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.10/src/install.c.orig 2008-01-05 23:59:11.000000000 +0100
17 +++ coreutils-6.10/src/install.c 2008-03-02 02:21:08.251625392 +0100
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:Z:", long_options,
124 + while ((optc = getopt_long (argc, argv, "bCcsDdg:m:o:pt:TvS:Z:", 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 @@ -1854,6 +1854,9 @@
165 " --copy-contents copy contents of special files when "
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 same as --no-dereference --preserve=links\n"
172 " -a, --archive to samo co -dpR\n"
173 @@ -1863,6 +1866,10 @@
174 " -b jak --backup, ale bez podawania argumentu\n"
175 " --copy-contents kopiowanie zawartości pliku specjalnego w\n"
176 " przypadku rekursji\n"
177 + " -c (ignorowane)\n"
178 +" -C instalowanie pliku, chyba że plik docelowy już istnieje\n"
179 +" i jest taki sam - wtedy mtime pozostanie nie zmieniony\n"
180 +" (dla kompatybilności z *BSD)\n"
181 " -d to samo co --no-dereference --preserve=link\n"