From 82bba06da26a63558ed722ba73a7e549a05cf4a8 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 31 2020 09:41:30 +0000 Subject: import yum-utils-1.1.31-53.el7 --- diff --git a/SOURCES/BZ-1463723-repotrack-copy-local-packages.patch b/SOURCES/BZ-1463723-repotrack-copy-local-packages.patch new file mode 100644 index 0000000..e999a49 --- /dev/null +++ b/SOURCES/BZ-1463723-repotrack-copy-local-packages.patch @@ -0,0 +1,26 @@ +commit 18acdb310b0d55467cbf403c91cceb35a44ef125 +Author: Michal Domonkos +Date: Tue Sep 10 18:48:19 2019 +0200 + + repotrack: copy local packages. BZ 1463723 + + While we correctly set the target localpath on the package object, we + don't actually fetch (copy) the package itself if it's local. This + fixes it. + + Note that, for remote packages (without file://), this change has no + effect (see UrlGrabber.urlgrab() for the context). + +diff --git a/repotrack.py b/repotrack.py +index 79b761f..66e5b89 100755 +--- a/repotrack.py ++++ b/repotrack.py +@@ -266,7 +266,7 @@ def main(): + if not opts.quiet: + my.logger.info('Downloading %s' % os.path.basename(remote)) + pkg.localpath = local # Hack: to set the localpath to what we want. +- path = repo.getPackage(pkg) ++ path = repo.getPackage(pkg, copy_local=1) + + if not os.path.exists(local) or not os.path.samefile(path, local): + shutil.copy2(path, local) diff --git a/SOURCES/BZ-1630197-needs-restarting-clarify-exit-code.patch b/SOURCES/BZ-1630197-needs-restarting-clarify-exit-code.patch new file mode 100644 index 0000000..2060425 --- /dev/null +++ b/SOURCES/BZ-1630197-needs-restarting-clarify-exit-code.patch @@ -0,0 +1,28 @@ +diff --git a/docs/needs-restarting.1 b/docs/needs-restarting.1 +index 7910e25..0e7a591 100644 +--- a/docs/needs-restarting.1 ++++ b/docs/needs-restarting.1 +@@ -15,7 +15,7 @@ Display a help message, and then quit. + .IP "\fB\-u, \-\-useronly\fP" + Show processes for my userid only. + .IP "\fB\-r, \-\-reboothint\fP" +-Only report whether a full reboot is required (returns 1) or not (returns 0). ++Only report whether a full reboot is required (exit code 1) or not (exit code 0). + .IP "\fB\-s, \-\-services\fP" + List the affected systemd services only. + +diff --git a/needs-restarting.py b/needs-restarting.py +index c2d5ad9..eaafd9d 100755 +--- a/needs-restarting.py ++++ b/needs-restarting.py +@@ -63,8 +63,8 @@ def parseargs(args): + parser.add_option("-u", "--useronly", default=False, action="store_true", + help='show processes for my userid only') + parser.add_option("-r", "--reboothint", default=False, action="store_true", +- help=('only report whether a full reboot is required (returns 1) or not ' +- '(returns 0)')) ++ help=('only report whether a full reboot is required (exit code 1) or ' ++ 'not (exit code 0)')) + parser.add_option("-s", "--services", default=False, action="store_true", + help='list the affected systemd services only') + diff --git a/SOURCES/BZ-1659588-repotrack-fix-repofrompath-opt.patch b/SOURCES/BZ-1659588-repotrack-fix-repofrompath-opt.patch new file mode 100644 index 0000000..89bf56a --- /dev/null +++ b/SOURCES/BZ-1659588-repotrack-fix-repofrompath-opt.patch @@ -0,0 +1,59 @@ +diff -up yum-utils-1.1.31/repotrack.py.orig yum-utils-1.1.31/repotrack.py +--- yum-utils-1.1.31/repotrack.py.orig 2019-09-10 19:51:11.702158451 +0200 ++++ yum-utils-1.1.31/repotrack.py 2019-09-10 19:51:48.542659295 +0200 +@@ -145,6 +145,27 @@ def main(): + archlist.extend(rpmUtils.arch.getArchList(opts.arch)) + else: + archlist = rpmUtils.arch.getArchList() ++ ++ if opts.repofrompath: ++ for repo in opts.repofrompath: ++ tmp = tuple(repo.split(',')) ++ if len(tmp) != 2: ++ my.logger.error("Error: Bad repofrompath argument: %s" %repo) ++ continue ++ repoid, repopath = tmp ++ if repopath and repopath[0] == '/': ++ baseurl = 'file://' + repopath ++ else: ++ baseurl = repopath ++ try: ++ my.add_enable_repo(repoid, baseurls=[baseurl], ++ basecachedir=my.conf.cachedir, ++ timestamp_check=False) ++ except yum.Errors.DuplicateRepoError, e: ++ my.logger.error(e) ++ sys.exit(1) ++ if not opts.quiet: ++ my.logger.info("Added %s repo from %s" % (repoid, repopath)) + + # do the happy tmpdir thing if we're not root + if os.geteuid() != 0 or opts.tempcache: +@@ -175,27 +196,6 @@ def main(): + my.logger.error(e) + sys.exit(1) + +- if opts.repofrompath: +- for repo in opts.repofrompath: +- tmp = tuple(repo.split(',')) +- if len(tmp) != 2: +- my.logger.error("Error: Bad repofrompath argument: %s" %repo) +- continue +- repoid, repopath = tmp +- if repopath and repopath[0] == '/': +- baseurl = 'file://' + repopath +- else: +- baseurl = repopath +- try: +- my.add_enable_repo(repoid, baseurls=[baseurl], +- basecachedir=my.conf.cachedir, +- timestamp_check=False) +- except yum.Errors.DuplicateRepoError, e: +- my.logger.error(e) +- sys.exit(1) +- if not opts.quiet: +- my.logger.info("Added %s repo from %s" % (repoid, repopath)) +- + try: + my.doRepoSetup() + my._getSacks(archlist=archlist) diff --git a/SPECS/yum-utils.spec b/SPECS/yum-utils.spec index 7e8dba5..d908d95 100644 --- a/SPECS/yum-utils.spec +++ b/SPECS/yum-utils.spec @@ -12,7 +12,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 52%{?dist} +Release: 53%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -82,6 +82,11 @@ Patch183: BZ-1493489-yum-config-manager-fix-add-repo-2.patch #rhel-7.7 Patch200: BZ-1476701-handle-md-fetch-errors.patch +#rhel-7.8 +Patch220: BZ-1659588-repotrack-fix-repofrompath-opt.patch +Patch221: BZ-1463723-repotrack-copy-local-packages.patch +Patch222: BZ-1630197-needs-restarting-clarify-exit-code.patch + URL: http://yum.baseurl.org/download/yum-utils/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -530,6 +535,11 @@ This plugin touches rpmdb files to work around overlayfs issues. #rhel-7.7 %patch200 -p1 +#rhel-7.8 +%patch220 -p1 +%patch221 -p1 +%patch222 -p1 + %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install @@ -860,6 +870,14 @@ fi %{_mandir}/man1/yum-ovl.1.* %changelog +* Tue Sep 10 2019 Michal Domonkos - 1.1.31-53 +- repotrack: fix --repofrompath for non-root users +- Related: bug#1659588 +- repotrack: copy local packages +- Related: bug#1463723 +- needs-restarting: clarify exit code in help and man page +- Related: bug#1630197 + * Fri Apr 26 2019 Michal Domonkos - 1.1.31-52 - reposync: fix up the previous patch - Related: bug#1476701