SHA256
1
0
forked from pool/fdupes

- Update to upstream git repo on github

- Refresh patches:
  * fdupes-makefile.patch
  * 0008-speedup-the-file-compare.patch
  * 0010-add-permissions-mode.patch
  * 0011-add-an-option-to-sort-duplicate-files-by-name.patch
  * 50_bts284274_hardlinkreplace.dpatch
- Upstreamed patch:
  * 0004-Large-file-support-for-2GB-files-bts447601.patch
- Remove whitespace from fdupes.macros file
- Cleanup with spec-cleaner
  - Obey rpm-opt-flags
  - run test phase

OBS-URL: https://build.opensuse.org/package/show/utilities/fdupes?expand=0&rev=12
This commit is contained in:
Tomáš Chvátal 2015-08-03 19:29:01 +00:00 committed by Git OBS Bridge
parent a7f9689749
commit faab425747
11 changed files with 95 additions and 141 deletions

View File

@ -1,48 +0,0 @@
From 9024d0c1bbbb323ae30b3b025705b076094e2c6c Mon Sep 17 00:00:00 2001
From: Andrew Vaughan <ajv-lists@netspace.net.au>
Date: Fri, 12 Oct 2012 15:00:30 +0200
Subject: [PATCH 04/10] Large file support for >2GB files (bts447601)
---
Makefile | 2 +-
fdupes.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 0c968a8..4d50924 100644
--- a/Makefile
+++ b/Makefile
@@ -74,7 +74,7 @@ MKDIR = mkdir -p
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 --git a/fdupes.c b/fdupes.c
index f16e4e0..4ecf51b 100644
--- a/fdupes.c
+++ b/fdupes.c
@@ -648,7 +648,7 @@ void printmatches(file_t *files)
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 @@ void deletefiles(file_t *files, int prompt)
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);
--
1.7.11.5

View File

@ -10,11 +10,11 @@ https://bugzilla.novell.com/show_bug.cgi?id=406825
fdupes.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fdupes.c b/fdupes.c
index 1e9e620..678f31f 100644
--- a/fdupes.c
+++ b/fdupes.c
@@ -370,7 +370,7 @@ char *getcrcsignatureuntil(char *filename, off_t max_read)
Index: fdupes-fdupes-1.51/fdupes.c
===================================================================
--- fdupes-fdupes-1.51.orig/fdupes.c
+++ fdupes-fdupes-1.51/fdupes.c
@@ -370,7 +370,7 @@ char *getcrcsignatureuntil(char *filenam
}
while (fsize > 0) {
@ -22,8 +22,8 @@ index 1e9e620..678f31f 100644
+ toread = (fsize >= CHUNK_SIZE) ? CHUNK_SIZE : fsize;
if (fread(chunk, toread, 1, file) != 1) {
errormsg("error reading from file %s\n", filename);
fclose(file); // bugfix
@@ -606,8 +606,8 @@ int confirmmatch(FILE *file1, FILE *file2)
fclose(file);
@@ -606,8 +606,8 @@ int confirmmatch(FILE *file1, FILE *file
fseek(file2, 0, SEEK_SET);
do {
@ -34,6 +34,3 @@ index 1e9e620..678f31f 100644
if (r1 != r2) return 0; /* file lengths are different */
if (memcmp (c1, c2, r1)) return 0; /* file contents are different */
--
1.7.11.5

View File

@ -13,10 +13,10 @@ Requested-in: https://bugzilla.novell.com/show_bug.cgi?id=784670
fdupes.c | 25 ++++++++++++++++++++++++-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/fdupes.1 b/fdupes.1
index 9263adc..e0516f1 100644
--- a/fdupes.1
+++ b/fdupes.1
Index: fdupes-fdupes-1.51/fdupes.1
===================================================================
--- fdupes-fdupes-1.51.orig/fdupes.1
+++ fdupes-fdupes-1.51/fdupes.1
@@ -63,6 +63,9 @@ below)
when used together with \-\-delete, preserve the first file in each
set of duplicates and delete the others without prompting the user
@ -27,10 +27,10 @@ index 9263adc..e0516f1 100644
.B -v --version
display fdupes version
.TP
diff --git a/fdupes.c b/fdupes.c
index 678f31f..b3275a9 100644
--- a/fdupes.c
+++ b/fdupes.c
Index: fdupes-fdupes-1.51/fdupes.c
===================================================================
--- fdupes-fdupes-1.51.orig/fdupes.c
+++ fdupes-fdupes-1.51/fdupes.c
@@ -53,6 +53,7 @@
#define F_NOPROMPT 0x0400
#define F_SUMMARIZEMATCHES 0x0800
@ -39,7 +39,7 @@ index 678f31f..b3275a9 100644
char *program_name;
@@ -481,6 +482,19 @@ int registerfile(filetree_t **branch, file_t *file)
@@ -481,6 +482,19 @@ int registerfile(filetree_t **branch, fi
return 1;
}
@ -59,7 +59,7 @@ index 678f31f..b3275a9 100644
file_t **checkmatch(filetree_t **root, filetree_t *checktree, file_t *file)
{
int cmpresult;
@@ -503,6 +517,10 @@ file_t **checkmatch(filetree_t **root, filetree_t *checktree, file_t *file)
@@ -503,6 +517,10 @@ file_t **checkmatch(filetree_t **root, f
cmpresult = -1;
else
if (fsize > checktree->file->size) cmpresult = 1;
@ -70,15 +70,15 @@ index 678f31f..b3275a9 100644
else {
if (checktree->file->crcpartial == NULL) {
crcsignature = getcrcpartialsignature(checktree->file->d_name);
@@ -976,6 +994,7 @@ void help_text()
@@ -979,6 +997,7 @@ void help_text()
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(" \tprompting the user\n");
+ printf(" -p --permissions \tdon't consider files with different owner/group or permission bits as duplicates\n");
printf(" -v --version \tdisplay fdupes version\n");
printf(" -h --help \tdisplay this help message\n\n");
#ifdef OMIT_GETOPT_LONG
@@ -1019,6 +1038,7 @@ int main(int argc, char **argv) {
@@ -1022,6 +1041,7 @@ int main(int argc, char **argv) {
{ "noprompt", 0, 0, 'N' },
{ "summarize", 0, 0, 'm'},
{ "summary", 0, 0, 'm' },
@ -86,7 +86,7 @@ index 678f31f..b3275a9 100644
{ 0, 0, 0, 0 }
};
#define GETOPT getopt_long
@@ -1030,7 +1050,7 @@ int main(int argc, char **argv) {
@@ -1033,7 +1053,7 @@ int main(int argc, char **argv) {
oldargv = cloneargs(argc, argv);
@ -95,7 +95,7 @@ index 678f31f..b3275a9 100644
#ifndef OMIT_GETOPT_LONG
, long_options, NULL
#endif
@@ -1081,6 +1101,9 @@ int main(int argc, char **argv) {
@@ -1084,6 +1104,9 @@ int main(int argc, char **argv) {
case 'm':
SETFLAG(flags, F_SUMMARIZEMATCHES);
break;
@ -105,6 +105,3 @@ index 678f31f..b3275a9 100644
default:
fprintf(stderr, "Try `fdupes --help' for more information.\n");
--
1.7.11.5

View File

@ -12,11 +12,11 @@ Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
fdupes.c | 30 ++++++++++++++++++++++++++++--
2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/fdupes.1 b/fdupes.1
index e0516f1..b5fb0f6 100644
--- a/fdupes.1
+++ b/fdupes.1
@@ -66,6 +66,10 @@ set of duplicates and delete the others without prompting the user
Index: fdupes-fdupes-1.51/fdupes.1
===================================================================
--- fdupes-fdupes-1.51.orig/fdupes.1
+++ fdupes-fdupes-1.51/fdupes.1
@@ -66,6 +66,10 @@ set of duplicates and delete the others
.B -p --permissions
don't consider files with different owner/group or permission bits as duplicates
.TP
@ -27,10 +27,10 @@ index e0516f1..b5fb0f6 100644
.B -v --version
display fdupes version
.TP
diff --git a/fdupes.c b/fdupes.c
index b6aeaa7..08f9e2c 100644
--- a/fdupes.c
+++ b/fdupes.c
Index: fdupes-fdupes-1.51/fdupes.c
===================================================================
--- fdupes-fdupes-1.51.orig/fdupes.c
+++ fdupes-fdupes-1.51/fdupes.c
@@ -55,6 +55,11 @@
#define F_EXCLUDEHIDDEN 0x1000
#define F_PERMISSIONS 0x2000
@ -43,7 +43,7 @@ index b6aeaa7..08f9e2c 100644
char *program_name;
unsigned long flags = 0;
@@ -918,6 +923,11 @@ int sort_pairs_by_mtime(file_t *f1, file_t *f2)
@@ -921,6 +926,11 @@ int sort_pairs_by_mtime(file_t *f1, file
return 0;
}
@ -55,9 +55,9 @@ index b6aeaa7..08f9e2c 100644
void registerpair(file_t **matchlist, file_t *newmatch,
int (*comparef)(file_t *f1, file_t *f2))
{
@@ -995,6 +1005,9 @@ void help_text()
@@ -998,6 +1008,9 @@ void help_text()
printf(" \teach set of duplicates and delete the rest without\n");
printf(" \twithout prompting the user\n");
printf(" \tprompting the user\n");
printf(" -p --permissions \tdon't consider files with different owner/group or permission bits as duplicates\n");
+ printf(" -o --order \tselect sort order for output, linking and deleting. One of:\n");
+ printf(" time \torder by mtime (default)\n");
@ -65,7 +65,7 @@ index b6aeaa7..08f9e2c 100644
printf(" -v --version \tdisplay fdupes version\n");
printf(" -h --help \tdisplay this help message\n\n");
#ifdef OMIT_GETOPT_LONG
@@ -1015,6 +1028,7 @@ int main(int argc, char **argv) {
@@ -1018,6 +1031,7 @@ int main(int argc, char **argv) {
int progress = 0;
char **oldargv;
int firstrecurse;
@ -73,7 +73,7 @@ index b6aeaa7..08f9e2c 100644
#ifndef OMIT_GETOPT_LONG
static struct option long_options[] =
@@ -1039,6 +1053,7 @@ int main(int argc, char **argv) {
@@ -1042,6 +1056,7 @@ int main(int argc, char **argv) {
{ "summarize", 0, 0, 'm'},
{ "summary", 0, 0, 'm' },
{ "permissions", 0, 0, 'p' },
@ -81,7 +81,7 @@ index b6aeaa7..08f9e2c 100644
{ 0, 0, 0, 0 }
};
#define GETOPT getopt_long
@@ -1050,7 +1065,7 @@ int main(int argc, char **argv) {
@@ -1053,7 +1068,7 @@ int main(int argc, char **argv) {
oldargv = cloneargs(argc, argv);
@ -90,7 +90,7 @@ index b6aeaa7..08f9e2c 100644
#ifndef OMIT_GETOPT_LONG
, long_options, NULL
#endif
@@ -1104,6 +1119,16 @@ int main(int argc, char **argv) {
@@ -1107,6 +1122,16 @@ int main(int argc, char **argv) {
case 'p':
SETFLAG(flags, F_PERMISSIONS);
break;
@ -107,7 +107,7 @@ index b6aeaa7..08f9e2c 100644
default:
fprintf(stderr, "Try `fdupes --help' for more information.\n");
@@ -1179,7 +1204,8 @@ int main(int argc, char **argv) {
@@ -1182,7 +1207,8 @@ int main(int argc, char **argv) {
}
if (confirmmatch(file1, file2)) {
@ -115,8 +115,5 @@ index b6aeaa7..08f9e2c 100644
+ registerpair(match, curfile,
+ (ordertype == ORDER_TIME) ? sort_pairs_by_mtime : sort_pairs_by_filename );
//match->hasdupes = 1;
//curfile->duplicates = match->duplicates;
--
1.8.4.5
/*match->hasdupes = 1;
curfile->duplicates = match->duplicates;

View File

@ -5,10 +5,10 @@
## DP: Replace duplicate files with hardlinks
@DPATCH@
Index: fdupes-1.50-PR2/fdupes.c
Index: fdupes-fdupes-1.51/fdupes.c
===================================================================
--- fdupes-1.50-PR2.orig/fdupes.c
+++ fdupes-1.50-PR2/fdupes.c
--- fdupes-fdupes-1.51.orig/fdupes.c
+++ fdupes-fdupes-1.51/fdupes.c
@@ -54,6 +54,8 @@
#define F_SUMMARIZEMATCHES 0x0800
#define F_EXCLUDEHIDDEN 0x1000
@ -18,7 +18,7 @@ Index: fdupes-1.50-PR2/fdupes.c
typedef enum {
ORDER_TIME = 0,
@@ -904,6 +906,88 @@ void deletefiles(file_t *files, int prom
@@ -908,6 +910,88 @@ void deletefiles(file_t *files, int prom
free(preservestr);
}
@ -107,21 +107,21 @@ Index: fdupes-1.50-PR2/fdupes.c
int sort_pairs_by_arrival(file_t *f1, file_t *f2)
{
if (f2->duplicates != 0)
@@ -1000,10 +1084,12 @@ void help_text()
@@ -1003,10 +1087,12 @@ void help_text()
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(" -l --relink \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(" \tprompting the user\n");
+ printf(" -D --debug \tenable debugging information\n");
printf(" -p --permissions \tdon't consider files with different owner/group or permission bits as duplicates\n");
printf(" -o --order \tselect sort order for output, linking and deleting. One of:\n");
printf(" time \torder by mtime (default)\n");
@@ -1044,12 +1130,14 @@ int main(int argc, char **argv) {
@@ -1047,12 +1133,14 @@ int main(int argc, char **argv) {
{ "symlinks", 0, 0, 's' },
{ "hardlinks", 0, 0, 'H' },
{ "relink", 0, 0, 'l' },
@ -136,7 +136,7 @@ Index: fdupes-1.50-PR2/fdupes.c
{ "summarize", 0, 0, 'm'},
{ "summary", 0, 0, 'm' },
{ "permissions", 0, 0, 'p' },
@@ -1065,7 +1153,7 @@ int main(int argc, char **argv) {
@@ -1068,7 +1156,7 @@ int main(int argc, char **argv) {
oldargv = cloneargs(argc, argv);
@ -145,7 +145,7 @@ Index: fdupes-1.50-PR2/fdupes.c
#ifndef OMIT_GETOPT_LONG
, long_options, NULL
#endif
@@ -1104,6 +1192,12 @@ int main(int argc, char **argv) {
@@ -1107,6 +1195,12 @@ int main(int argc, char **argv) {
case 'd':
SETFLAG(flags, F_DELETEFILES);
break;
@ -158,7 +158,7 @@ Index: fdupes-1.50-PR2/fdupes.c
case 'v':
printf("fdupes %s\n", VERSION);
exit(0);
@@ -1151,6 +1245,16 @@ int main(int argc, char **argv) {
@@ -1154,6 +1248,16 @@ int main(int argc, char **argv) {
exit(1);
}
@ -175,7 +175,7 @@ Index: fdupes-1.50-PR2/fdupes.c
if (ISFLAG(flags, F_RECURSEAFTER)) {
firstrecurse = nonoptafter("--recurse:", argc, oldargv, argv, optind);
@@ -1237,12 +1341,23 @@ int main(int argc, char **argv) {
@@ -1245,12 +1349,23 @@ int main(int argc, char **argv) {
else
@ -204,10 +204,10 @@ Index: fdupes-1.50-PR2/fdupes.c
while (files) {
curfile = files->next;
Index: fdupes-1.50-PR2/fdupes.1
Index: fdupes-fdupes-1.51/fdupes.1
===================================================================
--- fdupes-1.50-PR2.orig/fdupes.1
+++ fdupes-1.50-PR2/fdupes.1
--- fdupes-fdupes-1.51.orig/fdupes.1
+++ fdupes-fdupes-1.51/fdupes.1
@@ -59,10 +59,17 @@ prompt user for files to preserve, delet
.B CAVEATS
below)

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5af2c71206fece42e0f9554427e323bef96653a4dceb5130bc8ac63e2ceb1619
size 19436

3
fdupes-1.51.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:761e16d4ecfef7302c62fe7ef1e181cd34f5c6ce5377dcad96e3ed44fb364986
size 18930

View File

@ -1,7 +1,7 @@
Index: Makefile
===================================================================
--- Makefile.orig 2002-05-31 09:31:45.000000000 +0200
+++ Makefile 2012-10-12 11:46:35.152408642 +0200
--- Makefile.orig
+++ Makefile
@@ -11,7 +11,7 @@
# determination of the actual installation directories.
# Suggested values are "/usr/local", "/usr", "/pkgs/fdupes-$(VERSION)"
@ -10,8 +10,8 @@ Index: Makefile
+PREFIX = /usr
#
# Certain platforms do not support long options (command line options).
@@ -50,7 +50,7 @@
# When compiling for 32-bit systems, FILEOFFSET_64BIT must be enabled
@@ -56,7 +56,7 @@ BIN_DIR = $(PREFIX)/bin
# MAN_DIR indicates directory where the fdupes man page is to be
# installed. Suggested value is "$(PREFIX)/man/man1"
#

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Mon Aug 3 19:26:55 UTC 2015 - tchvatal@suse.com
- Update to upstream git repo on github
- Refresh patches:
* fdupes-makefile.patch
* 0008-speedup-the-file-compare.patch
* 0010-add-permissions-mode.patch
* 0011-add-an-option-to-sort-duplicate-files-by-name.patch
* 50_bts284274_hardlinkreplace.dpatch
- Upstreamed patch:
* 0004-Large-file-support-for-2GB-files-bts447601.patch
- Remove whitespace from fdupes.macros file
- Cleanup with spec-cleaner
- Obey rpm-opt-flags
- run test phase
-------------------------------------------------------------------
Sun Dec 21 19:58:41 UTC 2014 - bwiedemann@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package fdupes (Version 1.40)
# spec file for package fdupes
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -15,14 +15,15 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: fdupes
Version: 1.50
Version: 1.51
Release: 0
Summary: Identifying or deleting duplicate files
Url: http://code.google.com/p/fdupes/
Group: Productivity/Archiving/Compression
License: MIT
Source0: http://fdupes.googlecode.com/files/fdupes-1.50-PR2.tar.gz
Group: Productivity/Archiving/Compression
Url: https://github.com/adrianlopezroche/fdupes
Source0: https://github.com/adrianlopezroche/%{name}/archive/%{name}-%{version}.tar.gz
Source1: macros.fdupes
#PATCH-FIX-SUSE: fix patch according distro's needs
Patch0: fdupes-makefile.patch
@ -35,8 +36,6 @@ Patch1: 0001-restore-pristine-code.patch
Patch2: 0002-Added-to-escape-minus-signs-in-manpage-lintian-warni.patch
#PATCH-FIX-DEBIAN: dtto
Patch3: 0003-Fix-a-typo-in-a-manpage-bts353789.patch
#PATCH-FIX-DEBIAN: support for large files
Patch4: 0004-Large-file-support-for-2GB-files-bts447601.patch
#PATCH-FIX-DEBIAN: manpage fix
Patch5: 0005-add-summarize-to-manpage-bts481809.patch
#PATCH-FIX-DEBIAN: dtto
@ -53,24 +52,18 @@ Patch10: 0010-add-permissions-mode.patch
Patch11: 0011-add-an-option-to-sort-duplicate-files-by-name.patch
#PATCH-FIX-DEBIAN: add -L/--linkhard
Patch20: 50_bts284274_hardlinkreplace.dpatch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora_version}
BuildRequires: which
%endif
%description
FDUPES is a program for identifying or deleting duplicate files
residing within specified directories
%prep
%setup -q -n %name-%{version}-PR2
%setup -q -n %{name}-%{name}-%{version}
%patch0
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
@ -81,16 +74,19 @@ residing within specified directories
%patch20 -p1
%build
echo -e "#!/bin/bash\n`which %__cc` \"\$@\"" >gcc
chmod 755 gcc
export PATH=`pwd`:$PATH
make %{?_smp_mflags}
make %{?_smp_mflags} COMPILER_OPTIONS="%{optflags}"
%install
install -D -m755 %{name} %{buildroot}%{_bindir}/%{name}
install -D -m644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
install -D -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.%{name}
%check
./%{name} testdir
./%{name} --omitfirst testdir
./%{name} --recurse testdir
./%{name} --size testdir
%files
%defattr(-, root, root)
%doc CHANGES

View File

@ -1,4 +1,3 @@
%fdupes(s) \
_target=""; \
_symlinks=0; \
@ -20,4 +19,3 @@
fi ; \
done \
%{nil}