diff --git a/dpkg-clamp-mtime.patch b/dpkg-clamp-mtime.patch new file mode 100644 index 0000000..c9c37b1 --- /dev/null +++ b/dpkg-clamp-mtime.patch @@ -0,0 +1,29 @@ +clamp-mtime only available in tar 1.28 but we may distar it in epel7 + + +man tar + --clamp-mtime + Only set time when the file is more recent than what was given with --mtime. + +--- ./scripts/Dpkg/Source/Archive.pm.orig 2018-09-23 14:50:58.650262327 +0100 ++++ ./scripts/Dpkg/Source/Archive.pm 2018-09-23 14:51:10.640395035 +0100 +@@ -52,7 +52,7 @@ sub create { + # Call tar creation process + $spawn_opts{delete_env} = [ 'TAR_OPTIONS' ]; + $spawn_opts{exec} = [ $Dpkg::PROGTAR, '-cf', '-', '--format=gnu', '--sort=name', +- '--mtime', "\@$mtime", '--clamp-mtime', '--null', ++ '--mtime', "\@$mtime", '--null', + '--numeric-owner', '--owner=0', '--group=0', + @{$opts{options}}, '-T', '-' ]; + *$self->{pid} = spawn(%spawn_opts); +--- ./dpkg-deb/build.c.orig 2018-09-23 14:50:06.952690066 +0100 ++++ ./dpkg-deb/build.c 2018-09-23 14:50:22.771865176 +0100 +@@ -450,7 +450,7 @@ tarball_pack(const char *dir, filenames_ + + command_init(&cmd, TAR, "tar -cf"); + command_add_args(&cmd, "tar", "-cf", "-", "--format=gnu", +- "--mtime", mtime, "--clamp-mtime", NULL); ++ "--mtime", mtime, NULL); + /* Mode might become a positional argument, pass it before -T. */ + if (mode) + command_add_args(&cmd, "--mode", mode, NULL); diff --git a/dpkg.spec b/dpkg.spec index 888749b..d45ca40 100644 --- a/dpkg.spec +++ b/dpkg.spec @@ -17,6 +17,7 @@ URL: https://tracker.debian.org/pkg/dpkg Source0: http://ftp.debian.org/debian/pool/main/d/dpkg/%{name}_%{version}.tar.xz Patch1: dpkg-fix-logrotate.patch Patch2: dpkg-perl-libexecdir.epel6.patch +Patch3: dpkg-clamp-mtime.patch BuildRequires: gcc-c++ BuildRequires: zlib-devel bzip2-devel libselinux-devel gettext ncurses-devel @@ -165,6 +166,10 @@ user interfaces. %if 0%{?rhel} && 0%{?rhel} < 7 %patch2 -p1 %endif +%if 0%{?rhel} && 0%{?rhel} < 8 +%patch3 -p1 +%endif + # Filter unwanted Requires: cat << \EOF > %{name}-req @@ -467,6 +472,7 @@ create_logfile * Sun Sep 23 2018 Sérgio Basto - 1.18.25-5 - Revert "Bundle a version of tar to make it compatible in EL7" - Keep BR: perl(Digest) +- Remove --clamp-mtime option on tar of el7. * Sun Sep 16 2018 Sérgio Basto - 1.18.25-4 - Fix conflicts with man pages on el