From dac7c03dc137e45977e44d172e6a9f18099671db Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 06 2019 11:01:24 +0000 Subject: import rpm-4.11.3-40.el7 --- diff --git a/SOURCES/rpm-4.11.3-brp-python-bytecompile-Fix-when-default-python-is-no.patch b/SOURCES/rpm-4.11.3-brp-python-bytecompile-Fix-when-default-python-is-no.patch new file mode 100644 index 0000000..b5d214d --- /dev/null +++ b/SOURCES/rpm-4.11.3-brp-python-bytecompile-Fix-when-default-python-is-no.patch @@ -0,0 +1,27 @@ +--- rpm-4.11.3/scripts/brp-python-bytecompile.old 2014-02-05 14:04:02.000000000 +0100 ++++ rpm-4.11.3/scripts/brp-python-bytecompile 2019-03-25 09:43:06.272804044 +0100 +@@ -6,12 +6,6 @@ + exit 0 + fi + +-# If we don't have a python interpreter, avoid changing anything. +-default_python=${1:-/usr/bin/python} +-if [ ! -x "$default_python" ]; then +- exit 0 +-fi +- + # Figure out how deep we need to descend. We could pick an insanely high + # number and hope it's enough, but somewhere, somebody's sure to run into it. + depth=`(find "$RPM_BUILD_ROOT" -type f -name "*.py" -print0 ; echo /) | \ +@@ -55,6 +49,11 @@ + fi + done + ++# If we don't have a python interpreter, avoid changing anything. ++default_python=${1:-/usr/bin/python} ++if [ ! -x "$default_python" ]; then ++ exit 0 ++fi + + # Handle other locations in the filesystem using the default python + # implementation: diff --git a/SOURCES/rpm-4.11.x-add-g-libs.patch b/SOURCES/rpm-4.11.x-add-g-libs.patch new file mode 100644 index 0000000..9ffa73d --- /dev/null +++ b/SOURCES/rpm-4.11.x-add-g-libs.patch @@ -0,0 +1,86 @@ +--- rpm-4.11.3/scripts/find-debuginfo.sh.old 2019-01-02 13:14:10.283068553 +0100 ++++ rpm-4.11.3/scripts/find-debuginfo.sh 2019-03-21 09:36:06.196400883 +0100 +@@ -3,6 +3,7 @@ + #for inclusion in an rpm spec file. + # + # Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r] [-m] ++# [--g-libs] + # [-o debugfiles.list] + # [--run-dwz] [--dwz-low-mem-die-limit N] + # [--dwz-max-die-limit N] +@@ -10,6 +11,8 @@ + # [builddir] + # + # The -g flag says to use strip -g instead of full strip on DSOs or EXEs. ++# The --g-libs flag says to use strip -g instead of full strip ONLY on DSOs. ++# Options -g and --g-libs are mutually exclusive. + # The --strict-build-id flag says to exit with failure status if + # any ELF binary processed fails to contain a build-id note. + # The -r flag says to use eu-strip --reloc-debug-sections. +@@ -32,6 +35,9 @@ + # With -g arg, pass it to strip on libraries or executables. + strip_g=false + ++# With --g-libs arg, pass it to strip on libraries. ++strip_glibs=false ++ + # with -r arg, pass --reloc-debug-sections to eu-strip. + strip_r=false + +@@ -65,6 +71,9 @@ + dwz_max_die_limit=$2 + shift + ;; ++ --g-libs) ++ strip_glibs=true ++ ;; + -g) + strip_g=true + ;; +@@ -100,6 +109,11 @@ + shift + done + ++if ("$strip_g" = "true") && ("$strip_glibs" = "true"); then ++ echo >&2 "*** ERROR: -g and --g-libs cannot be used together" ++ exit 2 ++fi ++ + i=0 + while ((i < nout)); do + outs[$i]="$BUILDDIR/${outs[$i]}" +@@ -132,6 +146,9 @@ + application/x-sharedlib*) g=-g ;; + application/x-executable*) g=-g ;; + esac ++ $strip_glibs && case "$(file -bi "$2")" in ++ application/x-sharedlib*) g=-g ;; ++ esac + eu-strip --remove-comment $r $g -f "$1" "$2" || exit + chmod 444 "$1" || exit + } +@@ -317,7 +334,23 @@ + chmod u-w "$f" + fi + +- $include_minidebug && add_minidebug "${debugfn}" "$f" ++ # strip -g implies we have full symtab, don't add mini symtab in that case. ++ # It only makes sense to add a minisymtab for executables and shared ++ # libraries. Other executable ELF files (like kernel modules) don't need it. ++ if [ "$include_minidebug" = "true" -a "$strip_g" = "false" ]; then ++ skip_mini=true ++ if [ "$strip_glibs" = "false" ]; then ++ case "$(file -bi "$f")" in ++ application/x-sharedlib*) skip_mini=false ;; ++ esac ++ fi ++ case "$(file -bi "$f")" in ++ application/x-sharedlib*) skip_mini=false ;; ++ application/x-executable*) skip_mini=false ;; ++ application/x-pie-executable*) skip_mini=false ;; ++ esac ++ $skip_mini || add_minidebug "${debugfn}" "$f" ++ fi + + echo "./${f#$RPM_BUILD_ROOT}" >> "$ELFBINSFILE" + diff --git a/SOURCES/rpm-4.11.x-disk-space-calculation.patch b/SOURCES/rpm-4.11.x-disk-space-calculation.patch new file mode 100644 index 0000000..6e8c4ee --- /dev/null +++ b/SOURCES/rpm-4.11.x-disk-space-calculation.patch @@ -0,0 +1,77 @@ +--- rpm-4.11.3/lib/transaction.c.old 2019-01-02 13:14:10.304068576 +0100 ++++ rpm-4.11.3/lib/transaction.c 2019-02-28 11:03:32.164403544 +0100 +@@ -368,6 +368,11 @@ + return rConflicts; + } + ++static rpm_loff_t DivideHardlinkSize(int nlink, rpm_loff_t originalSize) ++{ ++ return (originalSize / nlink) + 1; ++} ++ + /** + * handleInstInstalledFiles. + * @param ts transaction set +@@ -384,6 +389,8 @@ + { + rpmfs fs = rpmteGetFileStates(p); + int isCfgFile = ((rpmfiFFlagsIndex(otherFi, ofx) | rpmfiFFlagsIndex(fi, fx)) & RPMFILE_CONFIG); ++ rpm_loff_t otherFileSize; ++ int nlink; + + if (XFA_SKIPPING(rpmfsGetAction(fs, fx))) + return; +@@ -445,7 +452,15 @@ + action = rpmfiDecideFateIndex(otherFi, ofx, fi, fx, skipMissing); + rpmfsSetAction(fs, fx, action); + } +- rpmfiSetFReplacedSizeIndex(fi, fx, rpmfiFSizeIndex(otherFi, ofx)); ++ ++ otherFileSize = rpmfiFSizeIndex(otherFi, ofx); ++ ++ /* Only an appropriate fraction of the file size of a hardlink */ ++ nlink = rpmfiFNlinkIndex(otherFi, ofx); ++ if (nlink > 1) ++ otherFileSize = DivideHardlinkSize(nlink, otherFileSize); ++ ++ rpmfiSetFReplacedSizeIndex(fi, fx, otherFileSize); + } + + /** +@@ -470,6 +485,8 @@ + rpmfileAttrs FFlags; + struct rpmffi_s * recs; + int numRecs; ++ rpm_loff_t fileSize; ++ int nlink; + + if (XFA_SKIPPING(rpmfsGetAction(fs, i))) + continue; +@@ -633,9 +650,15 @@ + break; + } + ++ fileSize = rpmfiFSizeIndex(fi, i); ++ nlink = rpmfiFNlinkIndex(fi, i); ++ /* Only an appropriate fraction of the file sizeof a hardlink */ ++ if (nlink > 1) ++ fileSize = DivideHardlinkSize(nlink, fileSize); ++ + /* Update disk space info for a file. */ + rpmtsUpdateDSI(ts, fpEntryDev(fpc, fiFps), fpEntryDir(fpc, fiFps), +- rpmfiFSizeIndex(fi, i), rpmfiFReplacedSizeIndex(fi, i), ++ fileSize, rpmfiFReplacedSizeIndex(fi, i), + fixupSize, rpmfsGetAction(fs, i)); + + } +--- rpm-4.11.3/lib/rpmfi.h.old 2014-02-05 14:04:02.000000000 +0100 ++++ rpm-4.11.3/lib/rpmfi.h 2019-01-07 09:57:40.407787724 +0100 +@@ -396,7 +396,7 @@ + + #define RPMFI_FLAGS_ERASE \ + (RPMFI_NOFILECLASS | RPMFI_NOFILELANGS | \ +- RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | RPMFI_NOFILEINODES | \ ++ RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | \ + RPMFI_NOFILEVERIFYFLAGS) + + #define RPMFI_FLAGS_INSTALL \ diff --git a/SOURCES/rpm-4.11.x-perl.req-6.patch b/SOURCES/rpm-4.11.x-perl.req-6.patch new file mode 100644 index 0000000..8a86532 --- /dev/null +++ b/SOURCES/rpm-4.11.x-perl.req-6.patch @@ -0,0 +1,81 @@ +--- rpm-4.11.3/scripts/perl.req.old 2019-05-26 15:41:33.316395021 +0200 ++++ rpm-4.11.3/scripts/perl.req 2019-05-26 14:08:38.248028422 +0200 +@@ -90,10 +90,10 @@ + + sub compute_global_requires { + +-# restrict require to all non provided by the file +- foreach my $moduler (sort keys %require) { +- if (exists $provide{$moduler} && length($require{$moduler}) == 0) { +- $require = delete $require{$moduler}; ++# restrict require_removable to all non provided by the file ++ foreach my $moduler (sort keys %require_removable) { ++ if (exists $provide{$moduler} && length($require_removable{$moduler}) == 0) { ++ $require_removable = delete $require_removable{$moduler}; + } + } + # store requires to global_requires +@@ -107,8 +107,21 @@ + $global_require{$module} = $newver; + } + } ++ ++# store requires_removable to global_requires ++ foreach my $module (sort keys %require_removable) { ++ my $oldver = $global_require{$module}; ++ my $newver = $require_removable{$module}; ++ if ($oldver) { ++ $global_require{$module} = $newver ++ if ($HAVE_VERSION && $newver && version->new($oldver) < $newver); ++ } else { ++ $global_require{$module} = $newver; ++ } ++ } + # remove all local requires and provides + undef %require; ++ undef %require_removable; + undef %provide; + } + +@@ -124,6 +137,18 @@ + } + } + ++sub add_require_removable { ++ my ($module, $newver) = @_; ++ my $oldver = $require_removable{$module}; ++ if ($oldver) { ++ $require_removable{$module} = $newver ++ if ($HAVE_VERSION && $newver && version->new($oldver) < $newver); ++ } ++ else { ++ $require_removable{$module} = $newver; ++ } ++} ++ + sub process_file { + + my ($file) = @_; +@@ -286,7 +311,6 @@ + + # if the module starts with /, it is an absolute path to a file + if ($module =~ m(^/)) { +- print "$module\n"; + next; + } + +@@ -346,7 +370,13 @@ + add_require($_, undef) for split(' ', $1); + } + elsif ($version =~ /(["'])([^"']+)\1/) { +- add_require($2, undef); ++ # requires like "use base name" can be removed if they are ++ # provided in the same file ++ if (($whitespace eq "") && ($statement eq "use") && ($module eq "base")) { ++ add_require_removable($2, undef); ++ } else { ++ add_require($2, undef); ++ } + } + next; + } diff --git a/SOURCES/rpm-4.11.x-remove-perl-provides-from-requires.patch b/SOURCES/rpm-4.11.x-remove-perl-provides-from-requires.patch new file mode 100644 index 0000000..e785591 --- /dev/null +++ b/SOURCES/rpm-4.11.x-remove-perl-provides-from-requires.patch @@ -0,0 +1,104 @@ +--- rpm-4.11.3/scripts/perl.req.old 2019-01-02 13:14:10.258068525 +0100 ++++ rpm-4.11.3/scripts/perl.req 2019-02-28 11:00:57.200220227 +0100 +@@ -42,18 +42,29 @@ + $HAVE_VERSION = 0; + eval { require version; $HAVE_VERSION = 1; }; + ++use File::Basename; ++my $dir = dirname($0); ++$HAVE_PROV = 0; ++if ( -e "$dir/perl.prov" ) { ++ $HAVE_PROV = 1; ++ $prov_script = "$dir/perl.prov"; ++} + + if ("@ARGV") { +- foreach (@ARGV) { +- process_file($_); ++ foreach my $file (@ARGV) { ++ process_file($file); ++ process_file_provides($file); ++ compute_global_requires(); + } + } else { + + # notice we are passed a list of filenames NOT as common in unix the + # contents of the file. + +- foreach (<>) { +- process_file($_); ++ foreach my $file (<>) { ++ process_file($file); ++ process_file_provides($file); ++ compute_global_requires(); + } + } + +@@ -61,8 +72,9 @@ + foreach $perlver (sort keys %perlreq) { + print "perl >= $perlver\n"; + } +-foreach $module (sort keys %require) { +- if (length($require{$module}) == 0) { ++ ++foreach my $module (sort keys %global_require) { ++ if (length($global_require{$module}) == 0) { + print "perl($module)\n"; + } else { + +@@ -70,13 +82,35 @@ + # operators. Also I will need to change the processing of the + # $RPM_* variable when I upgrade. + +- print "perl($module) >= $require{$module}\n"; ++ print "perl($module) >= $global_require{$module}\n"; + } + } + + exit 0; + +- ++sub compute_global_requires { ++ ++# restrict require to all non provided by the file ++ foreach my $moduler (sort keys %require) { ++ if (exists $provide{$moduler} && length($require{$moduler}) == 0) { ++ $require = delete $require{$moduler}; ++ } ++ } ++# store requires to global_requires ++ foreach my $module (sort keys %require) { ++ my $oldver = $global_require{$module}; ++ my $newver = $require{$module}; ++ if ($oldver) { ++ $global_require{$module} = $newver ++ if ($HAVE_VERSION && $newver && version->new($oldver) < $newver); ++ } else { ++ $global_require{$module} = $newver; ++ } ++ } ++# remove all local requires and provides ++ undef %require; ++ undef %provide; ++} + + sub add_require { + my ($module, $newver) = @_; +@@ -328,3 +362,17 @@ + + return; + } ++ ++sub process_file_provides { ++ ++ my ($file) = @_; ++ chomp $file; ++ ++ return if (! $HAVE_PROV); ++ ++ my @result = readpipe( "$prov_script $file" ); ++ foreach my $prov (@result) { ++ $provide{$1} = undef if $prov =~ /perl\(([_:a-zA-Z0-9]+)\)/; ++ } ++ ++} diff --git a/SOURCES/rpm-4.11.x-setcaps.patch b/SOURCES/rpm-4.11.x-setcaps.patch new file mode 100644 index 0000000..097c5e8 --- /dev/null +++ b/SOURCES/rpm-4.11.x-setcaps.patch @@ -0,0 +1,28 @@ +--- rpm-4.11.3/rpmpopt.in.old 2019-01-02 13:14:10.222068485 +0100 ++++ rpm-4.11.3/rpmpopt.in 2019-01-02 13:36:46.212326391 +0100 +@@ -52,6 +52,25 @@ + --pipe "(echo 'ch() { chown -h -- \"$1\" \"$3\";chgrp -h -- \"$2\" \"$3\"; }';grep '^ch '|grep -v \(none\))|sh" \ + --POPTdesc=$"set user/group ownership of files in a package" + ++ ++rpm alias --setcaps -q --qf \ ++ "[if \[ -f %{FILENAMES:shescape} -a ! -L %{FILENAMES:shescape} \]; then\n\ ++%|FILECAPS?{ if \[ -n %{FILECAPS:shescape} \]; then\n\ ++ setcap %{FILECAPS:shescape} %{FILENAMES:shescape}\n\ ++ el}:{ }|if \[ -n \"\$(getcap %{FILENAMES:shescape})\" \]; then\n\ ++ setcap -r %{FILENAMES:shescape}\n\ ++ fi\n\ ++fi\n]" \ ++ --pipe "sh" \ ++ --POPTdesc=$"set capabilities of files in a package" ++ ++rpm alias --restore -q --qf \ ++ '[ rpm --setugids %{NAME:shescape}; \ ++ rpm --setperms %{NAME:shescape}; \ ++ rpm --setcaps %{NAME:shescape}; \n]' --pipe "sh" \ ++ --POPTdesc=$"restore file/directory permissions" ++ ++ + rpm alias --conflicts --qf \ + "[%|VERBOSE?{%{CONFLICTFLAGS:deptype}: }:{}|%{CONFLICTNEVRS}\n]" \ + --POPTdesc=$"list capabilities this package conflicts with" diff --git a/SOURCES/rpm-4.13.x-bad-owner-group.patch b/SOURCES/rpm-4.13.x-bad-owner-group.patch new file mode 100644 index 0000000..0a6785e --- /dev/null +++ b/SOURCES/rpm-4.13.x-bad-owner-group.patch @@ -0,0 +1,53 @@ +--- rpm-4.11.3/build/files.c.old 2019-01-02 13:14:10.217068479 +0100 ++++ rpm-4.11.3/build/files.c 2019-03-20 13:18:38.290142740 +0100 +@@ -2015,23 +2015,32 @@ + flp->fl_mode &= S_IFMT; + flp->fl_mode |= fl.def.ar.ar_fmode; + } ++ + if (fl.def.ar.ar_user) { + flp->uname = fl.def.ar.ar_user; + } else { + flp->uname = rpmstrPoolId(fl.pool, rpmugUname(flp->fl_uid), 1); + } ++ if (! flp->uname) { ++ flp->uname = rpmstrPoolId(fl.pool, rpmugUname(getuid()), 1); ++ } ++ if (! flp->uname) { ++ flp->uname = rpmstrPoolId(fl.pool, "root", 1); ++ } ++ + if (fl.def.ar.ar_group) { + flp->gname = fl.def.ar.ar_group; + } else { + flp->gname = rpmstrPoolId(fl.pool, rpmugGname(flp->fl_gid), 1); + } +- flp->langs = xstrdup(""); +- +- if (! (flp->uname && flp->gname)) { +- rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), diskPath); +- fl.processingFailed = 1; ++ if (! flp->gname) { ++ flp->gname = rpmstrPoolId(fl.pool, rpmugGname(getgid()), 1); ++ } ++ if (! flp->gname) { ++ flp->gname = rpmstrPoolId(fl.pool, "root", 1); + } + ++ flp->langs = xstrdup(""); + fl.files.used++; + } + argvFree(files); +--- rpm-4.11.3/build/parsePrep.c.old 2013-11-22 11:31:31.000000000 +0100 ++++ rpm-4.11.3/build/parsePrep.c 2019-03-20 13:19:33.705172465 +0100 +@@ -29,10 +29,6 @@ + urlfn, strerror(errno)); + return RPMRC_FAIL; + } +- if (!rpmugUname(sb.st_uid) || !rpmugGname(sb.st_gid)) { +- rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), urlfn); +- return RPMRC_FAIL; +- } + + return RPMRC_OK; + } diff --git a/SPECS/rpm.spec b/SPECS/rpm.spec index 19bad96..1d14d23 100644 --- a/SPECS/rpm.spec +++ b/SPECS/rpm.spec @@ -21,7 +21,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: %{?snapver:0.%{snapver}.}35%{?dist} +Release: %{?snapver:0.%{snapver}.}40%{?dist} Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://rpm.org/releases/rpm-4.11.x/%{name}-%{srcver}.tar.bz2 @@ -92,6 +92,11 @@ Patch189: rpm-4.12.x-rpmSign-return-value-correction.patch Patch190: rpm-4.13.x-fix_find_debuginfo_opts_g.patch Patch191: rpm-4.13.x-enable_noghost_option.patch Patch192: rpm-4.11.x-provide-audit-events.patch +Patch193: rpm-4.11.x-setcaps.patch +Patch194: rpm-4.11.x-disk-space-calculation.patch +Patch195: rpm-4.11.x-remove-perl-provides-from-requires.patch +Patch196: rpm-4.13.x-bad-owner-group.patch +Patch197: rpm-4.11.x-perl.req-6.patch # Filter soname dependencies by name Patch200: rpm-4.11.x-filter-soname-deps.patch @@ -118,6 +123,7 @@ Patch312: rpm-4.11.x-man-systemd-inhibit.patch Patch313: rpm-4.11.x-quiet-signing.patch Patch314: rpm-4.11.x-export-verifysigs-to-python.patch + # Temporary Patch to provide support for updates Patch400: rpm-4.10.90-rpmlib-filesystem-check.patch # Disable plugins @@ -133,6 +139,13 @@ Patch502: rpm-4.13.x-RPMCALLBACK_ELEM_PROGRESS-available-header.patch # Backport of reinstall functionality from 4.12 # https://bugzilla.redhat.com/show_bug.cgi?id=1466650 Patch503: rpm-4.11.x-reinstall.patch +Patch504: rpm-4.11.x-add-g-libs.patch + +# Fix brp-python-bytecompile script to work with Python 3 packages +# https://bugzilla.redhat.com/show_bug.cgi?id=1691402 +# Fixed upstream: +# https://github.com/rpm-software-management/rpm/commit/a8e51b3bb05c6acb1d9b2e3d34f859ddda1677be +Patch505: rpm-4.11.3-brp-python-bytecompile-Fix-when-default-python-is-no.patch # Partially GPL/LGPL dual-licensed and some bits with BSD # SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD @@ -365,6 +378,11 @@ Requires: rpm-libs%{_isa} = %{version}-%{release} %patch190 -p1 -b .find_debuginfo_opts %patch191 -p1 -b .noghost %patch192 -p1 -b .audit-events +%patch193 -p1 -b .setcaps +%patch194 -p1 -b .diskspace +%patch195 -p1 -b .perl.req5 +%patch196 -p1 -b .badowner +%patch197 -p1 -b .perl.req6 %patch200 -p1 -b .filter-soname-deps %patch201 -p1 -b .dont-filter-ld64 @@ -396,6 +414,8 @@ Requires: rpm-libs%{_isa} = %{version}-%{release} %patch501 -p1 -b .elem-progress %patch502 -p1 -b .elem-progress-header %patch503 -p1 -b .reinstall +%patch504 -p1 -b .g-libs +%patch505 -p1 -b .brp-python-bytecompile %if %{with int_bdb} ln -s db-%{bdbver} db @@ -627,6 +647,23 @@ exit 0 %doc COPYING doc/librpm/html/* %changelog +* Sun May 26 2019 Pavlina Moravcova Varekova - 4.11.3-40 +- Remove only special perl dependencies provided in the same file (#1570181) + +* Thu Mar 21 2019 Tomas Orsava - 4.11.3-39 +- Fix brp-python-bytecompile script to work with Python 3 packages (#1691402) + +* Thu Mar 21 2019 Pavlina Moravcova Varekova - 4.11.3-38 +- Add flag to use strip -g instead of full strip on DSOs (#1663264) + +* Wed Mar 20 2019 Pavlina Moravcova Varekova - 4.11.3-37 +- Use user and group of the rpmbuild process or root for sources (#1572772) + +* Thu Feb 28 2019 Pavlina Moravcova Varekova - 4.11.3-36 +- Add popt-based options --setcaps and --restore (#1550745) +- Improve hardlink handling in disk space calculation (#1491786) +- Remove perl dependencies that are provided in the same file (#1570181) + * Tue Jun 19 2018 Pavlina Moravcova Varekova - 4.11.3-35 - Correct "root_dir" output in audit event (#1555326)