--- fdupes-1.50-PR2.orig/debian/watch +++ fdupes-1.50-PR2/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://netdial.caribe.net/~adrian2/programs/fdupes-(.*)\.tar\.gz --- fdupes-1.50-PR2.orig/debian/rules +++ fdupes-1.50-PR2/debian/rules @@ -0,0 +1,50 @@ +#!/usr/bin/make -f + +# This script uses debhelper by Joey Hess +# export DH_VERBOSE=1 + +include /usr/share/dpatch/dpatch.make + +build: build-stamp +build-stamp: patch-stamp + dh_testdir + # build package here + $(MAKE) LOCAL_LDFLAGS=-g + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp + + [ ! -f Makefile ] || $(MAKE) -i clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs usr/bin + + #cp fdupes $(CURDIR)/debian/fdupes/usr/bin + $(MAKE) install PREFIX=$(CURDIR)/debian/fdupes/usr MAN_BASE_DIR=$(CURDIR)/debian/fdupes/usr/share/man + +binary-indep: build install +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs CONTRIBUTORS TODO + dh_installman fdupes.1 + dh_installchangelogs CHANGES + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary --- fdupes-1.50-PR2.orig/debian/copyright +++ fdupes-1.50-PR2/debian/copyright @@ -0,0 +1,66 @@ +This package was debianized by Adrian Bridgett + +It was downloaded from http://code.google.com/p/fdupes/ + +Upstream Author: + + Adrian Lopez + +Copyright: + + Copyright (c) 1999 Adrian Lopez + +License: + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +The Debian packaging is Copyright (C) 2008-2009, Sandro Tosi +and is licensed under the same license as upstream code (see above). Previously +is Copyright (C) 2000-2003 Adrian Bridgett with unknown +license. + +Legal information for md5/md5.{c,h}: +Upstrem Author: + + L. Peter Deutsch + +Copyright: + + Copyright (C) 1999 Aladdin Enterprises. All rights reserved. + +License: + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any + damages arising from the use of this software. + + Permission is granted to anyone to use this software for any + purpose, including commercial applications, and to alter it and + redistribute it freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + 3. This notice may not be removed or altered from any source + distribution. --- fdupes-1.50-PR2.orig/debian/control +++ fdupes-1.50-PR2/debian/control @@ -0,0 +1,17 @@ +Source: fdupes +Section: utils +Priority: optional +Maintainer: Sandro Tosi +Build-Depends: debhelper (>= 5), dpatch +Standards-Version: 3.8.4 +Homepage: http://code.google.com/p/fdupes/ +Vcs-Git: git://git.debian.org/users/morph/fdupes.git +Vcs-Browser: http://git.debian.org/?p=users/morph/fdupes.git + +Package: fdupes +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: identifies duplicate files within given directories + FDupes uses md5sums and then a byte by byte comparison to find + duplicate files within a set of directories. It has several useful + options including recursion. --- fdupes-1.50-PR2.orig/debian/compat +++ fdupes-1.50-PR2/debian/compat @@ -0,0 +1 @@ +5 --- fdupes-1.50-PR2.orig/debian/changelog +++ fdupes-1.50-PR2/debian/changelog @@ -0,0 +1,175 @@ +fdupes (1.50-PR2-3) unstable; urgency=low + + * debian/control + - updated Homepage field + - updated upstream location + - added Vcs-* fields (now using Git on git.debian.org) + - bump Standards-Version to 3.8.4 (no changes needed) + - added ${misc:Depends} to Depends + * debian/patches/50_bts284274_hardlinkreplace.dpatch + - added -L / --linkhard to make fdupes replace files with hardlinks. Also + update the manual page; thanks to Rupert Levene for the report and to + Javier Fernández-Sanguino Peña for the patch; Closes: #284274 + * debian/patches/60_bts544568_fix_memleaks.dpatch + - fix memory leaks in main(); thanks to jbdenis for the report and patch; + Closes: #544568 + * debian/patches/70_bts537138_disambiguate_recurse.dpatch + - disambiguate the options '--recurse' and '--recurse:' ; thanks to Pietro + Battiston for the report; Closes: #537138 + * debian/source/format + - set explicitly version 1.0 source format + + -- Sandro Tosi Sat, 29 May 2010 10:08:59 +0200 + +fdupes (1.50-PR2-2) unstable; urgency=low + + * debian/control + - bump Standards-Version to 3.8.0 + + added debian/README.source + - updated my email address + * debian/patches/30_bts481809_manpage_summarize.dpatch + - added --summarize to manpage; thanks to Sam Morris for the report; + Closes: #481809 + * debian/patches/40_bts511702_nohidden_support.dpatch + - added support to exclude hidden files; thanks to Maximiliano Curia for the + report and the patch (edited to patch manpage too); Closes: #511702 + * debian/copyright + - added debian packaging legal stuff + + -- Sandro Tosi Thu, 05 Feb 2009 01:22:45 +0100 + +fdupes (1.50-PR2-1) unstable; urgency=low + + * Adopting package (Closes: #469883) + * New upstream release (Closes: #469812) + * debian/control + - set myself as maintainer + - bump Standards-Version to 3.7.3 + - set debhelper versioned build-dep >= 5 + - remove capitalization from short description + - reformat long description + - added dpatch build-dep + - added Homepage field + * debian/compat + - created with value 5 + * debian/copyright + - clearly separate (and indented with 4 spaces) upstream author, copyright + and license notices + - reformatted header: "debianized by" and upstream website + - reformatted legal info for md5 files + * debian/rules + - removed DH_COMPAT + - commented out DH_VERBOSE + - no longer ignore clean error (lintian warning) + - removed commented dh_* calls + - program installation now is done using Makefile + - removed unneeded dh_* call + - reformat input parameters for dh_* calls + - added dpatch stuff + - using dh_installman now + * debian/patches/01_restore_pristine_code.dpatch + - added to restore pristine upstream code + - edited to adapt to new upstrem release + * debian/watch + - added + * debian/patches/10_bts353789_manpage_typo.dpatch + - added to fix a typo in the manpage; thanks to A Costa; (Closes: #353789) + * debian/patches/20_bts447601_lfs_support.dpatch + - added to support LFS (files > 2GB); thanks to Andrew Vaughan; (Closes: + #447601) + * debian/patches/05_fix_makefile.dpatch + - added to fix upstream Makefile + * debian/patches/07_fix_manpage.dpatch + - added to escape minus signs in manpage (lintian warning) + + -- Sandro Tosi Tue, 18 Mar 2008 23:22:29 +0100 + +fdupes (1.40-4) unstable; urgency=low + + * applied Peter Harvey's speed up (sped that up too!) (closes: #213385) + in fact this fixes a bug - sometimes zero sized files would not be + shown as duplicates + + -- Adrian Bridgett Sat, 15 Nov 2003 18:33:46 +0000 + +fdupes (1.40-3) unstable; urgency=low + + * more lintian fixes + + -- Adrian Bridgett Sat, 31 May 2003 20:58:42 +0100 + +fdupes (1.40-2) unstable; urgency=low + + * lintian fixes + + -- Adrian Bridgett Tue, 19 Feb 2002 19:00:24 +0000 + +fdupes (1.40-1) unstable; urgency=low + + * new upstream + + -- Adrian Bridgett Sat, 24 Mar 2001 12:15:18 +0000 + +fdupes (1.31-2) unstable; urgency=low + + * add TODO and CHANGES files (closes: #75608) + + -- Adrian Bridgett Thu, 26 Oct 2000 18:02:48 +0100 + +fdupes (1.31-1) unstable; urgency=low + + * new upstream + + -- Adrian Bridgett Wed, 25 Oct 2000 10:34:44 +0100 + +fdupes (1.20-2) unstable; urgency=low + + * kill some ugly C and fixes segfault on unreadable files - you will + now get a warning and "file not matched" (closes: #68794, #74512) + + -- Adrian Bridgett Thu, 12 Oct 2000 19:51:49 +0100 + +fdupes (1.20-1) unstable; urgency=low + + * new upstream + + -- Adrian Bridgett Thu, 6 Apr 2000 18:13:06 +0100 + +fdupes (1.1.1-3) frozen unstable; urgency=low + + * wait for child md5sum processes and handle pipe() errors better + (closes #59405) + RM: doing lots of fork()s without waiting or sleeping is bad! + + -- Adrian Bridgett Tue, 7 Mar 2000 21:59:32 +0000 + +fdupes (1.1.1-2) frozen unstable; urgency=low + + * patch for insecure use of /tmp (thanks to Colin Phipps ) + + -- Adrian Bridgett Tue, 8 Feb 2000 18:53:12 +0000 + +fdupes (1.1.1-1) unstable; urgency=low + + * new upstream - now checks file length before checksumming + manpage included upstream + + -- Adrian Bridgett Tue, 11 Jan 2000 19:21:04 +0000 + +fdupes (1.1-2) unstable; urgency=low + + * man page added + + -- Adrian Bridgett Mon, 10 Jan 2000 13:57:16 +0000 + +fdupes (1.1-1) unstable; urgency=low + + * new upstream (-d delete option added) + + -- Adrian Bridgett Thu, 6 Jan 2000 22:32:44 +0000 + +fdupes (1.0-1) unstable; urgency=low + + * intial release. + + -- Adrian Bridgett Mon, 3 Jan 2000 15:59:17 +0000 --- fdupes-1.50-PR2.orig/debian/README.source +++ fdupes-1.50-PR2/debian/README.source @@ -0,0 +1,4 @@ +This package uses dpatch to handle patches against upstream source code; you +can find additional information about dpatch at + + /usr/share/doc/dpatch/ --- fdupes-1.50-PR2.orig/debian/patches/70_bts537138_disambiguate_recurse.dpatch +++ fdupes-1.50-PR2/debian/patches/70_bts537138_disambiguate_recurse.dpatch @@ -0,0 +1,49 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 70_bts537138_disambiguate_recurse.dpatch by Sandro Tosi +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Disambiguate the options '--recurse' and '--recurse:' + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' fdupes~/fdupes.1 fdupes/fdupes.1 +--- fdupes~/fdupes.1 2010-05-28 21:27:56.776898579 +0200 ++++ fdupes/fdupes.1 2010-05-28 21:35:33.492898800 +0200 +@@ -23,7 +23,8 @@ + .TP + .B -R --recurse: + for each directory given after this option follow subdirectories +-encountered within ++encountered within (note the ':' at the end of option; see the ++Examples section below for further explanation) + .TP + .B -s --symlinks + follow symlinked directories +@@ -92,6 +93,15 @@ + .B --sameline + is specified, spaces and backslash characters (\fB\e\fP) appearing + in a filename are preceded by a backslash character. ++ ++.SH EXAMPLES ++.TP ++.B fdupes a --recurse: b ++will follow subdirectories under b, but not those under a. ++.TP ++.B fdupes a --recurse b ++will follow subdirectories under both a and b. ++ + .SH CAVEATS + If fdupes returns with an error message such as + .B fdupes: error invoking md5sum +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' fdupes~/fdupes.c fdupes/fdupes.c +--- fdupes~/fdupes.c 2010-05-28 21:27:56.800905326 +0200 ++++ fdupes/fdupes.c 2010-05-28 21:37:27.243398155 +0200 +@@ -1037,7 +1037,8 @@ + printf(" -r --recurse \tfor every directory given follow subdirectories\n"); + printf(" \tencountered within\n"); + printf(" -R --recurse: \tfor each directory given after this option follow\n"); +- printf(" \tsubdirectories encountered within\n"); ++ printf(" \tsubdirectories encountered within (note the ':' at\n"); ++ printf(" \tthe end of the option, manpage for more details)\n"); + printf(" -s --symlinks \tfollow symlinks\n"); + printf(" -H --hardlinks \tnormally, when two or more files point to the same\n"); + printf(" \tdisk area they are treated as non-duplicates; this\n"); --- fdupes-1.50-PR2.orig/debian/patches/60_bts544568_fix_memleaks.dpatch +++ fdupes-1.50-PR2/debian/patches/60_bts544568_fix_memleaks.dpatch @@ -0,0 +1,29 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 60_bts544568_fix_memleaks.dpatch by jbdenis +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix memory leaks in main() + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' fdupes~/fdupes.c fdupes/fdupes.c +--- fdupes~/fdupes.c 2010-05-28 21:00:51.860398169 +0200 ++++ fdupes/fdupes.c 2010-05-28 21:00:51.964399081 +0200 +@@ -1314,10 +1314,17 @@ + while (files) { + curfile = files->next; + free(files->d_name); ++ free(files->crcsignature); ++ free(files->crcpartial); + free(files); + files = curfile; + } +- ++ ++ for (x = 0; x < argc; x++) ++ free(oldargv[x]); ++ ++ free(oldargv); ++ + purgetree(checktree); + + return 0; --- fdupes-1.50-PR2.orig/debian/patches/50_bts284274_hardlinkreplace.dpatch +++ fdupes-1.50-PR2/debian/patches/50_bts284274_hardlinkreplace.dpatch @@ -0,0 +1,228 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 50_bts284274_hardlinkreplace.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Replace duplicate files with hardlinks + +@DPATCH@ +diff -urNad fdupes-1.50-PR2~/fdupes.1 fdupes-1.50-PR2/fdupes.1 +--- fdupes-1.50-PR2~/fdupes.1 2009-07-31 00:38:28.000000000 +0200 ++++ fdupes-1.50-PR2/fdupes.1 2009-07-31 00:42:14.000000000 +0200 +@@ -58,10 +58,17 @@ + .B CAVEATS + below) + .TP ++.B -L --hardlink ++replace all duplicate files with hardlinks to the ++first file in each set of duplicates ++.TP + .B -N --noprompt + when used together with \-\-delete, preserve the first file in each + set of duplicates and delete the others without prompting the user + .TP ++.B -D --debug ++provide debugging information ++.TP + .B -v --version + display fdupes version + .TP +diff -urNad fdupes-1.50-PR2~/fdupes.c fdupes-1.50-PR2/fdupes.c +--- fdupes-1.50-PR2~/fdupes.c 2009-07-31 00:38:28.000000000 +0200 ++++ fdupes-1.50-PR2/fdupes.c 2009-07-31 00:41:08.000000000 +0200 +@@ -53,6 +53,8 @@ + #define F_NOPROMPT 0x0400 + #define F_SUMMARIZEMATCHES 0x0800 + #define F_EXCLUDEHIDDEN 0x1000 ++#define F_HARDLINKFILES 0x2000 ++#define F_DEBUGINFO 0x4000 + + char *program_name; + +@@ -881,6 +883,88 @@ + free(preservestr); + } + ++void hardlinkfiles(file_t *files, int debug) ++{ ++ int counter; ++ int groups = 0; ++ int curgroup = 0; ++ file_t *tmpfile; ++ file_t *curfile; ++ file_t **dupelist; ++ int max = 0; ++ int x = 0; ++ ++ curfile = files; ++ ++ while (curfile) { ++ if (curfile->hasdupes) { ++ counter = 1; ++ groups++; ++ ++ tmpfile = curfile->duplicates; ++ while (tmpfile) { ++ counter++; ++ tmpfile = tmpfile->duplicates; ++ } ++ ++ if (counter > max) max = counter; ++ } ++ ++ curfile = curfile->next; ++ } ++ ++ max++; ++ ++ dupelist = (file_t**) malloc(sizeof(file_t*) * max); ++ ++ if (!dupelist) { ++ errormsg("out of memory\n"); ++ exit(1); ++ } ++ ++ while (files) { ++ if (files->hasdupes) { ++ curgroup++; ++ counter = 1; ++ dupelist[counter] = files; ++ ++ if (debug) printf("[%d] %s\n", counter, files->d_name); ++ ++ tmpfile = files->duplicates; ++ ++ while (tmpfile) { ++ dupelist[++counter] = tmpfile; ++ if (debug) printf("[%d] %s\n", counter, tmpfile->d_name); ++ tmpfile = tmpfile->duplicates; ++ } ++ ++ if (debug) printf("\n"); ++ ++ /* preserve only the first file */ ++ ++ printf(" [+] %s\n", dupelist[1]->d_name); ++ for (x = 2; x <= counter; x++) { ++ if (unlink(dupelist[x]->d_name) == 0) { ++ if ( link(dupelist[1]->d_name, dupelist[x]->d_name) == 0 ) { ++ printf(" [h] %s\n", dupelist[x]->d_name); ++ } else { ++ printf("-- unable to create a hardlink for the file: %s\n", strerror(errno)); ++ printf(" [!] %s ", dupelist[x]->d_name); ++ } ++ } else { ++ printf(" [!] %s ", dupelist[x]->d_name); ++ printf("-- unable to delete the file!\n"); ++ } ++ } ++ printf("\n"); ++ } ++ ++ files = files->next; ++ } ++ ++ free(dupelist); ++} ++ + int sort_pairs_by_arrival(file_t *f1, file_t *f2) + { + if (f2->duplicates != 0) +@@ -971,10 +1055,14 @@ + printf(" \twith -s or --symlinks, or when specifying a\n"); + printf(" \tparticular directory more than once; refer to the\n"); + printf(" \tfdupes documentation for additional information\n"); +- //printf(" -l --relink \t(description)\n"); ++ /* printf(" -r --dlink \t(description)\n"); */ ++ printf(" -L --linkhard \thardlink duplicate files to the first file in\n"); ++ printf(" \teach set of duplicates without prompting the user\n"); + printf(" -N --noprompt \ttogether with --delete, preserve the first file in\n"); + printf(" \teach set of duplicates and delete the rest without\n"); + printf(" \twithout prompting the user\n"); ++ printf(" -D --debug \tenable debugging information\n"); ++ printf(" \teach set of duplicates without prompting the user\n"); + printf(" -v --version \tdisplay fdupes version\n"); + printf(" -h --help \tdisplay this help message\n\n"); + #ifdef OMIT_GETOPT_LONG +@@ -1010,12 +1098,14 @@ + { "symlinks", 0, 0, 's' }, + { "hardlinks", 0, 0, 'H' }, + { "relink", 0, 0, 'l' }, ++ { "linkhard", 0, 0, 'L' }, + { "noempty", 0, 0, 'n' }, + { "nohidden", 0, 0, 'A' }, + { "delete", 0, 0, 'd' }, + { "version", 0, 0, 'v' }, + { "help", 0, 0, 'h' }, + { "noprompt", 0, 0, 'N' }, ++ { "debug", 0, 0, 'D' }, + { "summarize", 0, 0, 'm'}, + { "summary", 0, 0, 'm' }, + { 0, 0, 0, 0 } +@@ -1029,7 +1119,7 @@ + + oldargv = cloneargs(argc, argv); + +- while ((opt = GETOPT(argc, argv, "frRq1Ss::HlnAdvhNm" ++ while ((opt = GETOPT(argc, argv, "frRq1Ss::HlLnAdDvhNm" + #ifndef OMIT_GETOPT_LONG + , long_options, NULL + #endif +@@ -1068,6 +1158,12 @@ + case 'd': + SETFLAG(flags, F_DELETEFILES); + break; ++ case 'L': ++ SETFLAG(flags, F_HARDLINKFILES); ++ break; ++ case 'D': ++ SETFLAG(flags, F_DEBUGINFO); ++ break; + case 'v': + printf("fdupes %s\n", VERSION); + exit(0); +@@ -1102,6 +1198,16 @@ + exit(1); + } + ++ if (ISFLAG(flags, F_HARDLINKFILES) && ISFLAG(flags, F_DELETEFILES)) { ++ errormsg("options --linkhard and --delete are not compatible\n"); ++ exit(1); ++ } ++ ++ if (ISFLAG(flags, F_HARDLINKFILES) && ISFLAG(flags, F_CONSIDERHARDLINKS)) { ++ errormsg("options --linkhard and --hardlinks are not compatible\n"); ++ exit(1); ++ } ++ + if (ISFLAG(flags, F_RECURSEAFTER)) { + firstrecurse = nonoptafter("--recurse:", argc, oldargv, argv, optind); + +@@ -1187,12 +1293,23 @@ + + else + +- if (ISFLAG(flags, F_SUMMARIZEMATCHES)) +- summarizematches(files); +- +- else ++ if (ISFLAG(flags, F_HARDLINKFILES)) + +- printmatches(files); ++ if (ISFLAG(flags, F_DEBUGINFO)) ++ hardlinkfiles(files, 1); ++ else ++ hardlinkfiles(files, 0); ++ ++ else { ++ ++ if (ISFLAG(flags, F_SUMMARIZEMATCHES)) ++ summarizematches(files); ++ ++ else ++ ++ printmatches(files); ++ ++ } + + while (files) { + curfile = files->next; --- fdupes-1.50-PR2.orig/debian/patches/40_bts511702_nohidden_support.dpatch +++ fdupes-1.50-PR2/debian/patches/40_bts511702_nohidden_support.dpatch @@ -0,0 +1,100 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 21_nohidden_support.dpatch by +## +## DP: Adds --nohidden support + +@DPATCH@ +diff -urNad fdupes-1.50-PR2~/fdupes.c fdupes-1.50-PR2/fdupes.c +--- fdupes-1.50-PR2~/fdupes.c 2009-01-13 14:13:33.000000000 -0200 ++++ fdupes-1.50-PR2/fdupes.c 2009-01-13 14:14:14.000000000 -0200 +@@ -31,6 +31,7 @@ + #endif + #include + #include ++#include + + #ifndef EXTERNAL_MD5 + #include "md5/md5.h" +@@ -51,6 +52,7 @@ + #define F_RECURSEAFTER 0x0200 + #define F_NOPROMPT 0x0400 + #define F_SUMMARIZEMATCHES 0x0800 ++#define F_EXCLUDEHIDDEN 0x1000 + + char *program_name; + +@@ -240,6 +242,7 @@ + struct stat linfo; + static int progress = 0; + static char indicator[] = "-\\|/"; ++ char *fullname, *name; + + cd = opendir(dir); + +@@ -285,6 +288,17 @@ + strcat(newfile->d_name, "/"); + strcat(newfile->d_name, dirinfo->d_name); + ++ if (ISFLAG(flags, F_EXCLUDEHIDDEN)) { ++ fullname = strdup(newfile->d_name); ++ name = basename(fullname); ++ if (name[0] == '.' && strcmp(name, ".") && strcmp(name, "..") ) { ++ free(newfile->d_name); ++ free(newfile); ++ continue; ++ } ++ free(fullname); ++ } ++ + if (filesize(newfile->d_name) == 0 && ISFLAG(flags, F_EXCLUDEEMPTY)) { + free(newfile->d_name); + free(newfile); +@@ -945,6 +959,7 @@ + printf(" \tdisk area they are treated as non-duplicates; this\n"); + printf(" \toption will change this behavior\n"); + printf(" -n --noempty \texclude zero-length files from consideration\n"); ++ printf(" -A --nohidden \texclude hidden files from consideration\n"); + printf(" -f --omitfirst \tomit the first file in each set of matches\n"); + printf(" -1 --sameline \tlist each set of matches on a single line\n"); + printf(" -S --size \tshow size of duplicate files\n"); +@@ -996,6 +1011,7 @@ + { "hardlinks", 0, 0, 'H' }, + { "relink", 0, 0, 'l' }, + { "noempty", 0, 0, 'n' }, ++ { "nohidden", 0, 0, 'A' }, + { "delete", 0, 0, 'd' }, + { "version", 0, 0, 'v' }, + { "help", 0, 0, 'h' }, +@@ -1013,7 +1029,7 @@ + + oldargv = cloneargs(argc, argv); + +- while ((opt = GETOPT(argc, argv, "frRq1Ss::HlndvhNm" ++ while ((opt = GETOPT(argc, argv, "frRq1Ss::HlnAdvhNm" + #ifndef OMIT_GETOPT_LONG + , long_options, NULL + #endif +@@ -1046,6 +1062,9 @@ + case 'n': + SETFLAG(flags, F_EXCLUDEEMPTY); + break; ++ case 'A': ++ SETFLAG(flags, F_EXCLUDEHIDDEN); ++ break; + case 'd': + SETFLAG(flags, F_DELETEFILES); + break; + +diff -urNad fdupes~/fdupes.1 fdupes/fdupes.1 +--- fdupes~/fdupes.1 2009-01-13 18:34:55.770835374 +0100 ++++ fdupes/fdupes.1 2009-01-13 18:36:08.510834538 +0100 +@@ -38,6 +38,9 @@ + .B -f --omitfirst + omit the first file in each set of matches + .TP ++.B -A --nohidden ++exclude hidden files from consideration ++.TP + .B -1 --sameline + list each set of matches on a single line + .TP --- fdupes-1.50-PR2.orig/debian/patches/30_bts481809_manpage_summarize.dpatch +++ fdupes-1.50-PR2/debian/patches/30_bts481809_manpage_summarize.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_bts481809_manpage_summarize.dpatch by Sandro Tosi +## +## DP: BTS #481809: add --summarize to manpage + +@DPATCH@ +diff -urNad fdupes~/fdupes.1 fdupes/fdupes.1 +--- fdupes~/fdupes.1 2008-07-03 08:54:35.238410127 +0200 ++++ fdupes/fdupes.1 2008-07-03 08:56:38.653443151 +0200 +@@ -44,6 +44,9 @@ + .B -S --size + show size of duplicate files + .TP ++.B -m --summarize ++summarize duplicate files information ++.TP + .B -q --quiet + hide progress indicator + .TP --- fdupes-1.50-PR2.orig/debian/patches/20_bts447601_lfs_support.dpatch +++ fdupes-1.50-PR2/debian/patches/20_bts447601_lfs_support.dpatch @@ -0,0 +1,40 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 20_bts447601_lfs_support.dpatch by Andrew Vaughan +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: LFS support for file with size > 2GB + +@DPATCH@ +diff -urNad fdupes~/Makefile fdupes/Makefile +--- fdupes~/Makefile 2008-03-17 20:12:35.000000000 +0100 ++++ fdupes/Makefile 2008-03-18 07:34:44.070304071 +0100 +@@ -74,7 +74,7 @@ + CC = gcc + COMPILER_OPTIONS = -Wall -O -g + +-CFLAGS= $(COMPILER_OPTIONS) -I. -DVERSION=\"$(VERSION)\" $(EXTERNAL_MD5) $(EXPERIMENTAL_RBTREE) $(OMIT_GETOPT_LONG) ++CFLAGS= $(COMPILER_OPTIONS) -I. -D_FILE_OFFSET_BITS=64 -DVERSION=\"$(VERSION)\" $(EXTERNAL_MD5) $(EXPERIMENTAL_RBTREE) $(OMIT_GETOPT_LONG) + + INSTALL_PROGRAM = $(INSTALL) -c -m 0755 + INSTALL_DATA = $(INSTALL) -c -m 0644 +diff -urNad fdupes~/fdupes.c fdupes/fdupes.c +--- fdupes~/fdupes.c 2008-03-18 07:33:54.975506314 +0100 ++++ fdupes/fdupes.c 2008-03-18 07:33:55.055510875 +0100 +@@ -648,7 +648,7 @@ + while (files != NULL) { + if (files->hasdupes) { + if (!ISFLAG(flags, F_OMITFIRST)) { +- if (ISFLAG(flags, F_SHOWSIZE)) printf("%ld byte%seach:\n", files->size, ++ if (ISFLAG(flags, F_SHOWSIZE)) printf("%lld byte%seach:\n", files->size, + (files->size != 1) ? "s " : " "); + if (ISFLAG(flags, F_DSAMELINE)) escapefilename("\\ ", &files->d_name); + printf("%s%c", files->d_name, ISFLAG(flags, F_DSAMELINE)?' ':'\n'); +@@ -801,7 +801,7 @@ + do { + printf("Set %d of %d, preserve files [1 - %d, all]", + curgroup, groups, counter); +- if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%ld byte%seach)", files->size, ++ if (ISFLAG(flags, F_SHOWSIZE)) printf(" (%lld byte%seach)", files->size, + (files->size != 1) ? "s " : " "); + printf(": "); + fflush(stdout); --- fdupes-1.50-PR2.orig/debian/patches/10_bts353789_manpage_typo.dpatch +++ fdupes-1.50-PR2/debian/patches/10_bts353789_manpage_typo.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_bts353789_manpage_typo.dpatch by A Costa +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix a typo in the manpage + +@DPATCH@ +diff -urNad fdupes~/fdupes.1 fdupes/fdupes.1 +--- fdupes~/fdupes.1 2008-03-17 20:12:35.000000000 +0100 ++++ fdupes/fdupes.1 2008-03-18 07:33:03.652581590 +0100 +@@ -84,7 +84,7 @@ + .B fdupes: error invoking md5sum + it means the program has been compiled to use an external + program to calculate MD5 signatures (otherwise, fdupes uses +-interal routines for this purpose), and an error has occurred ++internal routines for this purpose), and an error has occurred + while attempting to execute it. If this is the case, the + specified program should be properly installed prior + to running fdupes. --- fdupes-1.50-PR2.orig/debian/patches/07_fix_manpage.dpatch +++ fdupes-1.50-PR2/debian/patches/07_fix_manpage.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 07_fix_manpage.dpatch by Sandro Tosi +## +## DP: Added to escape minus signs in manpage (lintian warning) + +@DPATCH@ +diff -urNad fdupes~/fdupes.1 fdupes/fdupes.1 +--- fdupes~/fdupes.1 2008-03-17 20:12:35.000000000 +0100 ++++ fdupes/fdupes.1 2008-03-18 23:30:49.051348038 +0100 +@@ -53,7 +53,7 @@ + below) + .TP + .B -N --noprompt +-when used together with --delete, preserve the first file in each ++when used together with \-\-delete, preserve the first file in each + set of duplicates and delete the others without prompting the user + .TP + .B -v --version --- fdupes-1.50-PR2.orig/debian/patches/05_fix_makefile.dpatch +++ fdupes-1.50-PR2/debian/patches/05_fix_makefile.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 05_fix_makefile.dpatch by Sandro Tosi +## +## DP: Added to let this makefile work + +@DPATCH@ +diff -urNad fdupes~/Makefile fdupes/Makefile +--- fdupes~/Makefile 2008-03-17 20:12:35.000000000 +0100 ++++ fdupes/Makefile 2008-03-18 23:13:20.935619328 +0100 +@@ -97,8 +97,8 @@ + $(CC) $(CFLAGS) -o fdupes $(OBJECT_FILES) + + installdirs: +- test -d $(BIN_DIR) || -$(MKDIR) $(BIN_DIR) +- test -d $(MAN_DIR) || -$(MKDIR) $(MAN_DIR) ++ test -d $(BIN_DIR) || $(MKDIR) $(BIN_DIR) ++ test -d $(MAN_DIR) || $(MKDIR) $(MAN_DIR) + + install: fdupes installdirs + $(INSTALL_PROGRAM) fdupes $(BIN_DIR)/$(PROGRAM_NAME) --- fdupes-1.50-PR2.orig/debian/patches/01_restore_pristine_code.dpatch +++ fdupes-1.50-PR2/debian/patches/01_restore_pristine_code.dpatch @@ -0,0 +1,65 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_restore_pristine_code.dpatch by Sandro Tosi +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: New patch generated from fdupes 1.40-4 diff.gz + +@DPATCH@ +diff -urNad fdupes~/fdupes.c fdupes/fdupes.c +--- fdupes~/fdupes.c 2008-03-17 20:12:35.000000000 +0100 ++++ fdupes/fdupes.c 2008-03-18 00:03:06.798118530 +0100 +@@ -492,7 +492,10 @@ + else { + if (checktree->file->crcpartial == NULL) { + crcsignature = getcrcpartialsignature(checktree->file->d_name); +- if (crcsignature == NULL) return NULL; ++ if (crcsignature == NULL) { ++ errormsg ("cannot read file %s\n", checktree->file->d_name); ++ return NULL; ++ } + + checktree->file->crcpartial = (char*) malloc(strlen(crcsignature)+1); + if (checktree->file->crcpartial == NULL) { +@@ -504,7 +507,10 @@ + + if (file->crcpartial == NULL) { + crcsignature = getcrcpartialsignature(file->d_name); +- if (crcsignature == NULL) return NULL; ++ if (crcsignature == NULL) { ++ errormsg ("cannot read file %s\n", file->d_name); ++ return NULL; ++ } + + file->crcpartial = (char*) malloc(strlen(crcsignature)+1); + if (file->crcpartial == NULL) { +@@ -577,8 +583,8 @@ + + int confirmmatch(FILE *file1, FILE *file2) + { +- unsigned char c1 = 0; +- unsigned char c2 = 0; ++ unsigned char c1[CHUNK_SIZE]; ++ unsigned char c2[CHUNK_SIZE]; + size_t r1; + size_t r2; + +@@ -586,14 +592,13 @@ + fseek(file2, 0, SEEK_SET); + + do { +- r1 = fread(&c1, sizeof(c1), 1, file1); +- r2 = fread(&c2, sizeof(c2), 1, file2); ++ r1 = fread(c1, 1, sizeof(c1), file1); ++ r2 = fread(c2, 1, sizeof(c2), file2); + +- if (c1 != c2) return 0; /* file contents are different */ +- } while (r1 && r2); ++ if (r1 != r2) return 0; /* file lengths are different */ ++ if (memcmp (c1, c2, r1)) return 0; /* file contents are different */ ++ } while (r2); + +- if (r1 != r2) return 0; /* file lengths are different */ +- + return 1; + } + --- fdupes-1.50-PR2.orig/debian/patches/00list +++ fdupes-1.50-PR2/debian/patches/00list @@ -0,0 +1,10 @@ +01_restore_pristine_code +05_fix_makefile +07_fix_manpage +10_bts353789_manpage_typo +20_bts447601_lfs_support +30_bts481809_manpage_summarize +40_bts511702_nohidden_support +50_bts284274_hardlinkreplace +60_bts544568_fix_memleaks +70_bts537138_disambiguate_recurse --- fdupes-1.50-PR2.orig/debian/source/format +++ fdupes-1.50-PR2/debian/source/format @@ -0,0 +1 @@ +1.0