1 diff -Nur coreutils-4.5.3.orig/doc/coreutils.texi coreutils-4.5.3/doc/coreutils.texi
2 --- coreutils-4.5.3.orig/doc/coreutils.texi Sun Oct 27 22:19:34 2002
3 +++ coreutils-4.5.3/doc/coreutils.texi Sun Oct 27 22:48:17 2002
6 Make a backup of each file that would otherwise be overwritten or removed.
10 +Install file, unless target already exists and is the same file, in which
11 +case the modification time is not changed.
15 Ignored; for compatibility with old Unix versions of @command{install}.
16 --- coreutils-6.3/src/install.c.orig 2006-09-16 23:47:24.000000000 +0200
17 +++ coreutils-6.3/src/install.c 2006-10-10 22:23:44.854022500 +0200
21 #include <sys/types.h>
22 +#include <sys/mman.h>
28 static mode_t dir_mode_bits = CHMOD_MODE_BITS;
30 +/* Compare files before installing (-C) */
31 +static int docompare=0;
33 /* If true, strip executable files after copying them. */
34 static bool strip_files;
40 +int compare (const char *file, const char *to)
46 + struct stat file_s, to_s;
49 + stat(file, &file_s);
52 + if (file_s.st_size != to_s.st_size)
55 + file_fd = open(file, O_RDONLY);
59 + to_fd = open(to, O_RDONLY);
66 + size = (size_t) file_s.st_size;
67 + if (size <= 4194309) /* Don't try to mmap() files > 4 MB */
69 + p = mmap(NULL, size, PROT_READ, MAP_SHARED, file_fd, (off_t) 0);
70 + if (p != MAP_FAILED)
72 + q = mmap(NULL, size, PROT_READ, MAP_SHARED, to_fd, (off_t) 0);
73 + if (q == MAP_FAILED)
79 + ret = (memcmp(p, q, size)==0) ? 0 : 1;
88 + char buf1[65536], buf2[65536];
91 + lseek(file_fd, 0, SEEK_SET);
92 + lseek(to_fd, 0, SEEK_SET);
95 + n1 = read(file_fd, buf1, sizeof(buf1));
100 + n2 = read(to_fd, buf2, n1);
102 + ret = memcmp(buf1, buf2, n1);
104 + ret = 1; /* ouf of sync */
107 + ret = 1; /* read failure */
117 cp_option_init (struct cp_options *x)
120 we'll actually use backup_suffix_string. */
121 backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
123 - while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pt:TvS:", long_options,
124 + while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pt:TvS:", long_options,
139 However, since !x->recursive, the call to "copy" will fail if FROM
144 + if(compare(from, to) == 0) /* Files are identical */
148 return copy (from, to, false, x, ©_into_self, NULL);
152 --backup[=CONTROL] make a backup of each existing destination file\n\
153 -b like --backup but does not accept an argument\n\
155 + -C install file, unless the target already exists and is the\n\
156 + same, in which case mtime will remain unchanged\n\
157 + (for compatibility with *BSD)\n\
158 -d, --directory treat all arguments as directory names; create all\n\
159 components of the specified directories\n\
161 --- coreutils-6.4/po/pl.po.orig 2006-10-24 22:32:17.793354500 +0200
162 +++ coreutils-6.4/po/pl.po 2006-10-24 22:34:53.511086250 +0200
163 @@ -3999,12 +3999,18 @@
164 " --backup[=CONTROL] make a backup of each existing destination file\n"
165 " -b like --backup but does not accept an argument\n"
167 +" -C install file, unless the target already exists and is the\n"
168 +" same, in which case mtime will remain unchanged\n"
169 +" (for compatibility with *BSD)\n"
170 " -d, --directory treat all arguments as directory names; create all\n"
171 " components of the specified directories\n"
173 " --backup[=TRYB] robienie kopii zapasowej przed zamazaniem pliku\n"
174 " -b jak --backup, ale bez podawania argumentu\n"
176 +" -C instalowanie pliku, chyba ¿e plik docelowy ju¿ istnieje\n"
177 +" i jest taki sam - wtedy mtime pozostanie nie zmieniony\n"
178 +" (dla kompatybilno¶ci z *BSD)\n"
179 " -d, --directory traktowanie wszystkich argumentów jako nazw "
181 " tworzenie katalogów sk³adowych podanych katalogów\n"