2 * Copyright (c) 1992, Brian Berliner and Jeff Polk
3 * Copyright (c) 1989-1992, Brian Berliner
5 * You may distribute under the terms of the GNU General Public License as
6 * specified in the README file that comes with the CVS source distribution.
10 * The user file looks modified judging from its time stamp; however it needn't
11 * be. No_Difference() finds out whether it is or not. If it is not, it
12 * updates the administration.
14 * returns 0 if no differences are found and non-zero otherwise
20 No_Difference (struct file_info *finfo, Vers_TS *vers)
28 /* If ts_user is "Is-modified", we can only conclude the files are
29 different (since we don't have the file's contents). */
30 if (vers->ts_user != NULL
31 && strcmp (vers->ts_user, "Is-modified") == 0)
34 if (!vers->srcfile || !vers->srcfile->path)
35 return (-1); /* different since we couldn't tell */
37 #ifdef PRESERVE_PERMISSIONS_SUPPORT
38 /* If special files are in use, then any mismatch of file metadata
39 information also means that the files should be considered different. */
40 if (preserve_perms && special_file_mismatch (finfo, vers->vn_user, NULL))
44 if (vers->entdata && vers->entdata->options)
45 options = xstrdup (vers->entdata->options);
47 options = xstrdup ("");
49 tocvsPath = wrap_tocvs_process_file (finfo->file);
50 retcode = RCS_cmp_file( vers->srcfile, vers->vn_user, (char **)NULL,
51 (char *)NULL, options,
52 tocvsPath == NULL ? finfo->file : tocvsPath );
55 /* no difference was found, so fix the entries file */
56 ts = time_stamp (finfo->file);
57 Register (finfo->entries, finfo->file,
58 vers->vn_user ? vers->vn_user : vers->vn_rcs, ts,
59 options, vers->tag, vers->date, (char *) 0);
63 /* We need to update the entries line on the client side. */
65 (finfo->file, finfo->update_dir, finfo->repository, SERVER_UPDATED);
70 /* update the entdata pointer in the vers_ts structure */
71 p = findnode (finfo->entries, finfo->file);
72 vers->entdata = p->data;
77 ret = 1; /* files were really different */
81 /* Need to call unlink myself because the noexec variable
82 * has been set to 1. */
83 TRACE ( 1, "unlink (%s)", tocvsPath);
84 if ( CVS_UNLINK (tocvsPath) < 0)
85 error (0, errno, "could not remove %s", tocvsPath);