1 |
jlec 12/07/06 07:28:38 |
2 |
|
3 |
Added: fdupes-1.50_pre2-lfs.patch |
4 |
fdupes-1.50_pre2-typo.patch |
5 |
fdupes-1.50_pre2-compare-file.patch |
6 |
Removed: fdupes-1.40-memcpy.patch |
7 |
fdupes-1.40-external-md5sum-quotation.patch |
8 |
fdupes-1.40-external-md5sum-quotation-1.patch |
9 |
Log: |
10 |
app-misc/fdupes: Import some fixes from fedora |
11 |
|
12 |
(Portage version: 2.2.0_alpha116/cvs/Linux x86_64) |
13 |
|
14 |
Revision Changes Path |
15 |
1.1 app-misc/fdupes/files/fdupes-1.50_pre2-lfs.patch |
16 |
|
17 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/fdupes/files/fdupes-1.50_pre2-lfs.patch?rev=1.1&view=markup |
18 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/fdupes/files/fdupes-1.50_pre2-lfs.patch?rev=1.1&content-type=text/plain |
19 |
|
20 |
Index: fdupes-1.50_pre2-lfs.patch |
21 |
=================================================================== |
22 |
diff -urNp fdupes-1.50-PR2.orig/fdupes.c fdupes-1.50-PR2/fdupes.c |
23 |
--- fdupes-1.50-PR2.orig/fdupes.c 2009-01-31 20:11:49.577968848 +0530 |
24 |
+++ fdupes-1.50-PR2/fdupes.c 2009-01-31 20:29:17.103220311 +0530 |
25 |
@@ -643,7 +643,7 @@ void printmatches(file_t *files) |
26 |
while (files != NULL) { |
27 |
if (files->hasdupes) { |
28 |
if (!ISFLAG(flags, F_OMITFIRST)) { |
29 |
- if (ISFLAG(flags, F_SHOWSIZE)) printf("%ld byte%seach:\n", files->size, |
30 |
+ if (ISFLAG(flags, F_SHOWSIZE)) printf("%lld byte%seach:\n", files->size, |
31 |
(files->size != 1) ? "s " : " "); |
32 |
if (ISFLAG(flags, F_DSAMELINE)) escapefilename("\\ ", &files->d_name); |
33 |
printf("%s%c", files->d_name, ISFLAG(flags, F_DSAMELINE)?' ':'\n'); |
34 |
@@ -796,7 +796,7 @@ void deletefiles(file_t *files, int prom |
35 |
do { |
36 |
printf("Set %d of %d, preserve files [1 - %d, all]", |
37 |
curgroup, groups, counter); |
38 |
- if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%ld byte%seach)", files->size, |
39 |
+ if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%lld byte%seach)", files->size, |
40 |
(files->size != 1) ? "s " : " "); |
41 |
printf(": "); |
42 |
fflush(stdout); |
43 |
|
44 |
|
45 |
|
46 |
1.1 app-misc/fdupes/files/fdupes-1.50_pre2-typo.patch |
47 |
|
48 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/fdupes/files/fdupes-1.50_pre2-typo.patch?rev=1.1&view=markup |
49 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/fdupes/files/fdupes-1.50_pre2-typo.patch?rev=1.1&content-type=text/plain |
50 |
|
51 |
Index: fdupes-1.50_pre2-typo.patch |
52 |
=================================================================== |
53 |
diff -urNp fdupes-1.50-PR2.orig/fdupes.1 fdupes-1.50-PR2/fdupes.1 |
54 |
--- fdupes-1.50-PR2.orig/fdupes.1 2009-01-31 20:11:49.581967819 +0530 |
55 |
+++ fdupes-1.50-PR2/fdupes.1 2009-01-31 20:32:46.383969471 +0530 |
56 |
@@ -84,7 +84,7 @@ If fdupes returns with an error message |
57 |
.B fdupes: error invoking md5sum |
58 |
it means the program has been compiled to use an external |
59 |
program to calculate MD5 signatures (otherwise, fdupes uses |
60 |
-interal routines for this purpose), and an error has occurred |
61 |
+internal routines for this purpose), and an error has occurred |
62 |
while attempting to execute it. If this is the case, the |
63 |
specified program should be properly installed prior |
64 |
to running fdupes. |
65 |
|
66 |
|
67 |
|
68 |
1.1 app-misc/fdupes/files/fdupes-1.50_pre2-compare-file.patch |
69 |
|
70 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/fdupes/files/fdupes-1.50_pre2-compare-file.patch?rev=1.1&view=markup |
71 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/fdupes/files/fdupes-1.50_pre2-compare-file.patch?rev=1.1&content-type=text/plain |
72 |
|
73 |
Index: fdupes-1.50_pre2-compare-file.patch |
74 |
=================================================================== |
75 |
diff -urNp fdupes-1.50-PR2.orig/fdupes.c fdupes-1.50-PR2/fdupes.c |
76 |
--- fdupes-1.50-PR2.orig/fdupes.c 2009-01-31 20:11:49.577968848 +0530 |
77 |
+++ fdupes-1.50-PR2/fdupes.c 2009-01-31 22:01:11.872219443 +0530 |
78 |
@@ -492,7 +492,10 @@ file_t **checkmatch(filetree_t **root, f |
79 |
else { |
80 |
if (checktree->file->crcpartial == NULL) { |
81 |
crcsignature = getcrcpartialsignature(checktree->file->d_name); |
82 |
- if (crcsignature == NULL) return NULL; |
83 |
+ if (crcsignature == NULL) { |
84 |
+ errormsg ("cannot read file %s\n", checktree->file->d_name); |
85 |
+ return NULL; |
86 |
+ } |
87 |
|
88 |
checktree->file->crcpartial = (char*) malloc(strlen(crcsignature)+1); |
89 |
if (checktree->file->crcpartial == NULL) { |
90 |
@@ -504,7 +507,10 @@ file_t **checkmatch(filetree_t **root, f |
91 |
|
92 |
if (file->crcpartial == NULL) { |
93 |
crcsignature = getcrcpartialsignature(file->d_name); |
94 |
- if (crcsignature == NULL) return NULL; |
95 |
+ if (crcsignature == NULL) { |
96 |
+ errormsg ("cannot read file %s\n", file->d_name); |
97 |
+ return NULL; |
98 |
+ } |
99 |
|
100 |
file->crcpartial = (char*) malloc(strlen(crcsignature)+1); |
101 |
if (file->crcpartial == NULL) { |
102 |
@@ -577,8 +583,8 @@ file_t **checkmatch(filetree_t **root, f |
103 |
|
104 |
int confirmmatch(FILE *file1, FILE *file2) |
105 |
{ |
106 |
- unsigned char c1 = 0; |
107 |
- unsigned char c2 = 0; |
108 |
+ unsigned char c1[CHUNK_SIZE]; |
109 |
+ unsigned char c2[CHUNK_SIZE]; |
110 |
size_t r1; |
111 |
size_t r2; |
112 |
|
113 |
@@ -586,14 +592,13 @@ int confirmmatch(FILE *file1, FILE *file |
114 |
fseek(file2, 0, SEEK_SET); |
115 |
|
116 |
do { |
117 |
- r1 = fread(&c1, sizeof(c1), 1, file1); |
118 |
- r2 = fread(&c2, sizeof(c2), 1, file2); |
119 |
+ r1 = fread(c1, 1, sizeof(c1), file1); |
120 |
+ r2 = fread(c2, 1, sizeof(c2), file2); |
121 |
|
122 |
- if (c1 != c2) return 0; /* file contents are different */ |
123 |
- } while (r1 && r2); |
124 |
+ if (r1 != r2) return 0; /* file lengths are different */ |
125 |
+ if (memcmp (c1, c2, r1)) return 0; /* file contents are different */ |
126 |
+ } while (r2); |
127 |
|
128 |
- if (r1 != r2) return 0; /* file lengths are different */ |
129 |
- |
130 |
return 1; |
131 |
} |