Merge branch 'rawhide' into epel8

epel8 imports/e8/fdupes-2.2.1-1.el8
Richard Shaw 2 years ago
commit be64743c5f

4
.gitignore vendored

@ -1,3 +1 @@
fdupes-1.50-PR2.tar.gz
/fdupes-1.51.tar.gz
/fdupes-1.6.1.tar.gz
/fdupes-*.tar.gz

@ -1,24 +0,0 @@
From 88f3d2dd31fbef7e539b2523724221e8e8e5a9f0 Mon Sep 17 00:00:00 2001
From: Falk <falkartis@gmail.com>
Date: Thu, 27 Oct 2016 18:10:48 +0200
Subject: [PATCH] allow to type just a instead of all
Typing all many times can be boring/annoying, So I propose to allow people to type just a for all.
(sometimes there can be very large duplicate sets)
---
fdupes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fdupes.c b/fdupes.c
index 7eee165..7a8a6ed 100644
--- a/fdupes.c
+++ b/fdupes.c
@@ -886,7 +886,7 @@ void deletefiles(file_t *files, int prompt, FILE *tty)
token = strtok(preservestr, " ,\n");
while (token != NULL) {
- if (strcasecmp(token, "all") == 0)
+ if (strcasecmp(token, "all") == 0 || strcasecmp(token, "a") == 0)
for (x = 0; x <= counter; x++) preserve[x] = 1;
number = 0;

@ -1,88 +0,0 @@
From 315f6702f1cc37036d9f826314245b44a781c387 Mon Sep 17 00:00:00 2001
From: Adrian Lopez <adrianlopezroche@gmail.com>
Date: Sun, 21 Aug 2016 02:04:15 -0400
Subject: [PATCH] Delete old TODO file.
---
TODO | 72 --------------------------------------------------------------------
1 file changed, 72 deletions(-)
delete mode 100644 TODO
diff --git a/TODO b/TODO
deleted file mode 100644
index f7f77c4..0000000
--- a/TODO
+++ /dev/null
@@ -1,72 +0,0 @@
-- A bug with -S shows wrong results.
-
-- A bug causes the following behavior:
-
- $ fdupes --symlinks testdir
- testdir/with spaces b
- testdir/with spaces a
-
- testdir/zero_b
- testdir/zero_a
-
- testdir/symlink_two
- testdir/twice_one
-
- $ cp testdir/two testdir/two_again
- $ fdupes --symlinks testdir
- testdir/two_again
- testdir/two
- testdir/twice_one
- testdir/symlink_two
-
- testdir/with spaces b
- testdir/with spaces a
-
- testdir/zero_b
- testdir/zero_a
-
- ** This is not the desired behavior. Likewise:
-
- $ fdupes testdir
- testdir/with spaces b
- testdir/with spaces a
-
- testdir/zero_b
- testdir/zero_a
-
- testdir/twice_one
- testdir/two
-
- $ fdupes --symlinks testdir
- testdir/with spaces b
- testdir/with spaces a
-
- testdir/zero_b
- testdir/zero_a
-
- testdir/symlink_two
- testdir/twice_one
-
-- Don't assume that stat always works.
-
-- Add partial checksumming where instead of MD5ing whole
- files we MD5 and compare every so many bytes, caching
- these partial results for subsequent comparisons.
-
-- Option -R should not have to be separated from the rest,
- such that "fdupes -dR testdir", "fdupes -d -R testdir",
- "fdupes -Rd testdir", etc., all yield the same results.
-
-- Add option to highlight or identify symlinked files (suggest
- using --classify to identify symlinks with @ suffix... when
- specified, files containing @ are listed using \@).
-
-- Consider autodeletion option without user intervention.
-
-- Consider option to match only to files in specific directory.
-
-- Do a little commenting, to avoid rolling eyes and/or snickering.
-
-- Fix problem where MD5 collisions will result in one of the
- files not being registered (causing it to be ignored).
-

@ -1,167 +0,0 @@
From e95ec42dc178eff0410880c3dc4c0dac3df442df Mon Sep 17 00:00:00 2001
From: Adrian Lopez <adrianlopezroche@gmail.com>
Date: Tue, 23 Aug 2016 18:21:18 -0400
Subject: [PATCH] Add an option to sort duplicate files by ctime.
---
README | 5 +++--
fdupes.1 | 2 +-
fdupes.c | 49 +++++++++++++++++++++++++++++++++++++------------
3 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/README b/README
index c748d05..c27f043 100644
--- a/README
+++ b/README
@@ -37,8 +37,9 @@ Usage: fdupes [options] DIRECTORY...
grouping into sets; implies --noprompt
-p --permissions don't consider files with different owner/group or
permission bits as duplicates
- -o --order=BY select sort order for output, linking and deleting; by
- mtime (BY='time'; default) or filename (BY='name')
+ -o --order=BY select sort order for output and deleting; by file
+ modification time (BY='time'; default), status
+ change time (BY='ctime'), or filename (BY='name')
-i --reverse reverse order while sorting
-v --version display fdupes version
-h --help display this help message
diff --git a/fdupes.1 b/fdupes.1
index 5ddad87..969a5d8 100644
--- a/fdupes.1
+++ b/fdupes.1
@@ -72,7 +72,7 @@ don't consider files with different owner/group or permission bits as duplicates
.TP
.B -o --order\fR=\fIWORD\fR
order files according to WORD:
-time - sort by mtime, name - sort by filename
+time - sort by modification time, ctime - sort by status change time, name - sort by filename
.TP
.B -i --reverse
reverse order while sorting
diff --git a/fdupes.c b/fdupes.c
index ef64c45..7eee165 100644
--- a/fdupes.c
+++ b/fdupes.c
@@ -56,7 +56,8 @@
#define F_IMMEDIATE 0x8000
typedef enum {
- ORDER_TIME = 0,
+ ORDER_MTIME = 0,
+ ORDER_CTIME,
ORDER_NAME
} ordertype_t;
@@ -64,6 +65,8 @@ char *program_name;
unsigned long flags = 0;
+ordertype_t ordertype = ORDER_MTIME;
+
#define CHUNK_SIZE 8192
#define INPUT_SIZE 256
@@ -97,7 +100,7 @@ typedef struct _file {
md5_byte_t *crcsignature;
dev_t device;
ino_t inode;
- time_t mtime;
+ time_t sorttime;
int hasdupes; /* true only if file is first on duplicate chain */
struct _file *duplicates;
struct _file *next;
@@ -183,6 +186,14 @@ time_t getmtime(char *filename) {
return s.st_mtime;
}
+time_t getctime(char *filename) {
+ struct stat s;
+
+ if (stat(filename, &s) != 0) return 0;
+
+ return s.st_ctime;
+}
+
char **cloneargs(int argc, char **argv)
{
int x;
@@ -435,7 +446,17 @@ void getfilestats(file_t *file)
file->size = filesize(file->d_name);
file->inode = getinode(file->d_name);
file->device = getdevice(file->d_name);
- file->mtime = getmtime(file->d_name);
+
+ switch (ordertype)
+ {
+ case ORDER_CTIME:
+ file->sorttime = getctime(file->d_name);
+ break;
+ case ORDER_MTIME:
+ default:
+ file->sorttime = getmtime(file->d_name);
+ break;
+ }
}
int registerfile(filetree_t **branch, file_t *file)
@@ -911,11 +932,11 @@ int sort_pairs_by_arrival(file_t *f1, file_t *f2)
return !ISFLAG(flags, F_REVERSE) ? -1 : 1;
}
-int sort_pairs_by_mtime(file_t *f1, file_t *f2)
+int sort_pairs_by_time(file_t *f1, file_t *f2)
{
- if (f1->mtime < f2->mtime)
+ if (f1->sorttime < f2->sorttime)
return !ISFLAG(flags, F_REVERSE) ? -1 : 1;
- else if (f1->mtime > f2->mtime)
+ else if (f1->sorttime > f2->sorttime)
return !ISFLAG(flags, F_REVERSE) ? 1 : -1;
return 0;
@@ -1038,8 +1059,9 @@ void help_text()
printf(" \tgrouping into sets; implies --noprompt\n");
printf(" -p --permissions \tdon't consider files with different owner/group or\n");
printf(" \tpermission bits as duplicates\n");
- printf(" -o --order=BY \tselect sort order for output, linking and deleting; by\n");
- printf(" \tmtime (BY='time'; default) or filename (BY='name')\n");
+ printf(" -o --order=BY \tselect sort order for output and deleting; by file\n");
+ printf(" \tmodification time (BY='time'; default), status\n");
+ printf(" \tchange time (BY='ctime'), or filename (BY='name')\n");
printf(" -i --reverse \treverse order while sorting\n");
printf(" -v --version \tdisplay fdupes version\n");
printf(" -h --help \tdisplay this help message\n\n");
@@ -1061,7 +1083,6 @@ int main(int argc, char **argv) {
int progress = 0;
char **oldargv;
int firstrecurse;
- ordertype_t ordertype = ORDER_TIME;
#ifndef OMIT_GETOPT_LONG
static struct option long_options[] =
@@ -1161,7 +1182,9 @@ int main(int argc, char **argv) {
if (!strcasecmp("name", optarg)) {
ordertype = ORDER_NAME;
} else if (!strcasecmp("time", optarg)) {
- ordertype = ORDER_TIME;
+ ordertype = ORDER_MTIME;
+ } else if (!strcasecmp("ctime", optarg)) {
+ ordertype = ORDER_CTIME;
} else {
errormsg("invalid value for --order: '%s'\n", optarg);
exit(1);
@@ -1247,10 +1270,12 @@ int main(int argc, char **argv) {
if (confirmmatch(file1, file2)) {
if (ISFLAG(flags, F_DELETEFILES) && ISFLAG(flags, F_IMMEDIATE))
deletesuccessor(match, curfile,
- (ordertype == ORDER_TIME) ? sort_pairs_by_mtime : sort_pairs_by_filename );
+ (ordertype == ORDER_MTIME ||
+ ordertype == ORDER_CTIME) ? sort_pairs_by_time : sort_pairs_by_filename );
else
registerpair(match, curfile,
- (ordertype == ORDER_TIME) ? sort_pairs_by_mtime : sort_pairs_by_filename );
+ (ordertype == ORDER_MTIME ||
+ ordertype == ORDER_CTIME) ? sort_pairs_by_time : sort_pairs_by_filename );
}
fclose(file1);

@ -1,23 +1,24 @@
# Place rpm-macros into proper location.
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; /bin/echo $d)
Name: fdupes
Epoch: 1
Version: 1.6.1
Release: 6%{?dist}
Version: 2.2.1
Release: 1%{?dist}
Summary: Finds duplicate files in a given set of directories
License: MIT
URL: https://github.com/adrianlopezroche/%{name}
Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source0: https://github.com/adrianlopezroche/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source1: macros.%{name}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
# From upstream.
Patch0: %{url}/commit/315f6702f1cc37036d9f826314245b44a781c387.patch#/%{name}-1.6.1-delete_old_TODO.patch
Patch1: %{url}/commit/e95ec42dc178eff0410880c3dc4c0dac3df442df.patch#/%{name}-1.6.1-option_sort_by_ctime.patch
Patch2: %{url}/commit/88f3d2dd31fbef7e539b2523724221e8e8e5a9f0.patch#/%{name}-1.6.1-allow_a_instead_of_all.patch
BuildRequires: make
BuildRequires: ncurses-devel
BuildRequires: pcre2-devel
%description
FDUPES is a program for identifying duplicate files residing within specified
@ -29,7 +30,7 @@ directories.
# From README.
%{__cat} << EOF > LICENSE
FDUPES Copyright (c) 1999 Adrian Lopez
FDUPES Copyright (c) 1999-2022 Adrian Lopez
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
@ -51,21 +52,17 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
EOF
autoreconf -fiv
%build
%make_build \
COMPILER_OPTIONS="%{?optflags}" \
LDFLAGS="%{?__global_ldflags}"
%configure
%make_build
%install
%make_install \
INSTALL="%{__install} -p" \
BIN_DIR=%{_bindir} \
MAN_BASE_DIR=%{_mandir}
%{__install} -Dpm 0644 %{SOURCE1} \
%{buildroot}%{macrosdir}/macros.%{name}
%make_install
install -Dpm 0644 %{SOURCE1} %{buildroot}%{macrosdir}/macros.%{name}
%check
@ -78,12 +75,49 @@ EOF
%files
%license CONTRIBUTORS LICENSE
%doc CHANGES README
%doc %{_mandir}/man1/%{name}.1*
%{_mandir}/man1/%{name}.1*
%{_mandir}/man7/%{name}*.7*
%{_bindir}/%{name}
%{macrosdir}/macros.fdupes
%changelog
* Sat Sep 10 2022 Richard Shaw <hobbes1069@gmail.com> - 1:2.2.1-1
- Update to 2.2.1.
* Tue Aug 23 2022 Richard Shaw <hobbes1069@gmail.com> - 1:2.2.0-1
- Update to 2.2.0.
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Aug 13 2020 Richard Shaw <hobbes1069@gmail.com> - 1:2.1.1-1
- Update to 2.1.1.
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 02 2020 Richard Shaw <hobbes1069@gmail.com> - 1:2.1.0-1
- Update to 2.1.0.
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sun Jan 05 2020 Björn Esser <besser82@fedoraproject.org> - 1:2.0.0-1
- Update to 2.0.0 (#1787848)
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.6.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.6.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

@ -1 +1 @@
SHA512 (fdupes-1.6.1.tar.gz) = 6c6662b70068c2f48f4be64a6830c81a66852d650391d0756f20b9ac0df7d70c1a32918bd7cbd50e19de524d9ebc09ea338c19636e1807b071eb96b325e641db
SHA512 (fdupes-2.2.1.tar.gz) = 4911d2f776480691e7bd7045c181d49159add5b479188b05f0878a7af365cee0e430093e71ff172c04b876c58efc3be0f24c9d25f0cdebf1c869931175bc8608

Loading…
Cancel
Save