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 diff -Nur coreutils-4.5.3.orig/src/install.c coreutils-4.5.3/src/install.c
17 --- coreutils-4.5.3.orig/src/install.c Thu Sep 26 10:39:20 2002
18 +++ coreutils-4.5.3/src/install.c Sun Oct 27 22:48:17 2002
22 #include <sys/types.h>
23 +#include <sys/mman.h>
29 static mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
31 +/* Compare files before installing (-C) */
32 +static int docompare=0;
34 /* If nonzero, strip executable files after copying them. */
35 static int strip_files;
41 +int compare (const char *file, const char *to)
47 + struct stat file_s, to_s;
50 + stat(file, &file_s);
53 + if (file_s.st_size != to_s.st_size)
56 + file_fd = open(file, O_RDONLY);
60 + to_fd = open(to, O_RDONLY);
67 + size = (size_t) file_s.st_size;
68 + if (size <= 4194309) /* Don't try to mmap() files > 4 MB */
70 + p = mmap(NULL, size, PROT_READ, MAP_SHARED, file_fd, (off_t) 0);
71 + if (p != MAP_FAILED)
73 + q = mmap(NULL, size, PROT_READ, MAP_SHARED, to_fd, (off_t) 0);
74 + if (q == MAP_FAILED)
80 + ret = (memcmp(p, q, size)==0) ? 0 : 1;
89 + char buf1[65536], buf2[65536];
92 + lseek(file_fd, 0, SEEK_SET);
93 + lseek(to_fd, 0, SEEK_SET);
96 + n1 = read(file_fd, buf1, sizeof(buf1));
101 + n2 = read(to_fd, buf2, n1);
103 + ret = memcmp(buf1, buf2, n1);
105 + ret = 1; /* ouf of sync */
108 + ret = 1; /* read failure */
118 cp_option_init (struct cp_options *x)
121 we'll actually use backup_suffix_string. */
122 backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
124 - while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pvV:S:", long_options,
125 + while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pvV:S:", long_options,
145 + if(compare(from, to)==0) /* Files are identical */
149 fail = copy (from, to, nonexistent_dst, x, ©_into_self, NULL);
153 --backup[=CONTROL] make a backup of each existing destination file\n\
154 -b like --backup but does not accept an argument\n\
156 + -C install file, unless the target already exists and is the\n\
157 + same, in which case mtime will remain unchanged\n\
158 + (for compatibility with *BSD)\n\
159 -d, --directory treat all arguments as directory names; create all\n\
160 components of the specified directories\n\
162 --- coreutils-5.0/po/pl.po.orig Sat Mar 8 23:13:30 2003
163 +++ coreutils-5.0/po/pl.po Sat Mar 8 23:15:06 2003
164 @@ -2967,12 +2967,18 @@
165 " --backup[=CONTROL] make a backup of each existing destination file\n"
166 " -b like --backup but does not accept an argument\n"
168 +" -C install file, unless the target already exists and is the\n"
169 +" same, in which case mtime will remain unchanged\n"
170 +" (for compatibility with *BSD)\n"
171 " -d, --directory treat all arguments as directory names; create all\n"
172 " components of the specified directories\n"
174 " --backup[=TRYB] robienie kopii zapasowej przed zamazaniem pliku\n"
175 " -b jak --backup, ale bez podawania argumentu\n"
177 +" -C instalowanie pliku, chyba ¿e plik docelowy ju¿ istnieje\n"
178 +" i jest taki sam - wtedy mtime pozostanie nie zmieniony\n"
179 +" (dla kompatybilno¶ci z *BSD)\n"
180 " -d, --directory traktowanie wszystkich argumentów jako nazw "
182 " tworzenie katalogów sk³adowych podanych katalogów\n"