Hello community, here is the log from the commit of package dnf-plugins-core for openSUSE:Leap:15.2 checked in at 2020-01-22 08:19:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/dnf-plugins-core (Old) and /work/SRC/openSUSE:Leap:15.2/.dnf-plugins-core.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dnf-plugins-core" Wed Jan 22 08:19:24 2020 rev:26 rq:765599 version:4.0.13 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/dnf-plugins-core/dnf-plugins-core.changes 2020-01-15 14:52:35.181494663 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.dnf-plugins-core.new.26092/dnf-plugins-core.changes 2020-01-22 08:19:26.302181270 +0100 @@ -1,0 +2,12 @@ +Sun Jan 19 16:04:23 UTC 2020 - Neal Gompa <[email protected]> + +- Update to version 4.0.13 + + Fix: config_manager respect config file location during save + + Redesign reposync --latest for modular system (rh#1775434) + + [reposync] Fix --delete with multiple repos (rh#1774103) + + [doc] Skip creating and installing migrate documentation for Python 3+ + + [config-manager] Allow use of --set-enabled without arguments (rh#1679213) + + [versionlock] Prevent conflicting/duplicate entries (rh#1782052) +- Deconflict with zypper-needs-restarting on SLE to unblock PackageHub updates + +------------------------------------------------------------------- Old: ---- dnf-plugins-core-4.0.12.tar.gz New: ---- dnf-plugins-core-4.0.13.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dnf-plugins-core.spec ++++++ --- /var/tmp/diff_new_pack.vWh75y/_old 2020-01-22 08:19:26.914181600 +0100 +++ /var/tmp/diff_new_pack.vWh75y/_new 2020-01-22 08:19:26.918181602 +0100 @@ -2,7 +2,7 @@ # spec file for package dnf-plugins-core # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. -# Copyright (c) 2019 Neal Gompa <[email protected]>. +# Copyright (c) 2020 Neal Gompa <[email protected]>. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -42,6 +42,14 @@ %global yum_utils_subpackage_name dnf-utils %endif +# Deal with SLE Backports issues +%if 0%{?sle_version} && 0%{?is_backports} +%bcond_without deconflict +%global deconflict_prefix dnfutils- +%else +%bcond_with deconflict +%global deconflict_prefix %{nil} +%endif # Tests are broken on SUSE for now %bcond_with tests @@ -49,7 +57,7 @@ #global prerel rc1 Name: dnf-plugins-core -Version: 4.0.12 +Version: 4.0.13 Release: 0 Summary: Core Plugins for DNF License: GPL-2.0+ @@ -156,9 +164,11 @@ Conflicts: yum-changelog Conflicts: yum-utils %endif +%if ! %{with deconflict} # Cf. https://github.com/openSUSE/zypper/pull/254 Conflicts: zypper < 1.14.26 Conflicts: zypper-needs-restarting +%endif Requires: %{name} = %{version}-%{release} Requires: dnf >= %{dnf_lowest_compatible} Requires: python3-dnf >= %{dnf_lowest_compatible} @@ -310,8 +320,11 @@ ln -sf %{_libexecdir}/dnf-utils %{buildroot}%{_bindir}/yum-debug-restore ln -sf %{_libexecdir}/dnf-utils %{buildroot}%{_bindir}/yumdownloader -# We never shipped this plugin, and we never will, since we never used YUM... -rm %{buildroot}%{_mandir}/man8/dnf-migrate.8* +%if %{with deconflict} +# Deal with conflicts to unblock backports +mv %{buildroot}%{_bindir}/needs-restarting %{buildroot}%{_bindir}/dnfutils-needs-restarting +mv %{buildroot}%{_mandir}/man1/needs-restarting.1 %{buildroot}%{_mandir}/man1/dnfutils-needs-restarting.1 +%endif %if ! %{with copr_plugin} # Delete if we're not shipping COPR plugin @@ -384,8 +397,8 @@ %{_mandir}/man1/dnf-utils.1* %{_bindir}/debuginfo-install %{_mandir}/man1/debuginfo-install.1* -%{_bindir}/needs-restarting -%{_mandir}/man1/needs-restarting.1* +%{_bindir}/%{?deconflict_prefix}needs-restarting +%{_mandir}/man1/%{?deconflict_prefix}needs-restarting.1* %{_bindir}/find-repos-of-install %{_bindir}/package-cleanup %{_mandir}/man1/package-cleanup.1* ++++++ dnf-plugins-core-4.0.12.tar.gz -> dnf-plugins-core-4.0.13.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnf-plugins-core-4.0.12/dnf-plugins-core.spec new/dnf-plugins-core-4.0.13/dnf-plugins-core.spec --- old/dnf-plugins-core-4.0.12/dnf-plugins-core.spec 2019-11-25 12:04:52.000000000 +0100 +++ new/dnf-plugins-core-4.0.13/dnf-plugins-core.spec 2020-01-15 10:53:42.000000000 +0100 @@ -31,7 +31,7 @@ %endif Name: dnf-plugins-core -Version: 4.0.12 +Version: 4.0.13 Release: 1%{?dist} Summary: Core Plugins for DNF License: GPLv2+ @@ -740,6 +740,14 @@ %endif %changelog +* Wed Jan 15 2020 Aleš Matěj <[email protected]> - 4.0.13-1 +- Fix: config_manager respect config file location during save +- Redesign reposync --latest for modular system (RhBug:1775434) +- [reposync] Fix --delete with multiple repos (RhBug:1774103) +- [doc] Skip creating and installing migrate documentation for Python 3+ +- [config-manager] Allow use of --set-enabled without arguments (RhBug:1679213) +- [versionlock] Prevent conflicting/duplicate entries (RhBug:1782052) + * Mon Nov 25 2019 Aleš Matěj <[email protected]> - 4.0.12-1 - [reposync] Add --urls option (RhBug:1686602) - [versionlock] Add --raw option (RhBug:1645564) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnf-plugins-core-4.0.12/doc/CMakeLists.txt new/dnf-plugins-core-4.0.13/doc/CMakeLists.txt --- old/dnf-plugins-core-4.0.12/doc/CMakeLists.txt 2019-11-25 12:04:52.000000000 +0100 +++ new/dnf-plugins-core-4.0.13/doc/CMakeLists.txt 2020-01-15 10:53:42.000000000 +0100 @@ -27,7 +27,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/dnf-download.8 ${CMAKE_CURRENT_BINARY_DIR}/dnf-generate_completion_cache.8 ${CMAKE_CURRENT_BINARY_DIR}/dnf-leaves.8 - ${CMAKE_CURRENT_BINARY_DIR}/dnf-migrate.8 ${CMAKE_CURRENT_BINARY_DIR}/dnf-needs-restarting.8 ${CMAKE_CURRENT_BINARY_DIR}/dnf-repoclosure.8 ${CMAKE_CURRENT_BINARY_DIR}/dnf-repodiff.8 @@ -40,6 +39,10 @@ ${CMAKE_CURRENT_BINARY_DIR}/yum-copr.8 ${CMAKE_CURRENT_BINARY_DIR}/yum-versionlock.8 DESTINATION share/man/man8) +if (${PYTHON_VERSION_MAJOR} STREQUAL "2") +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dnf-migrate.8 + DESTINATION share/man/man8) +endif() if (${WITHOUT_LOCAL} STREQUAL "0") INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dnf-local.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnf-plugins-core-4.0.12/doc/conf.py new/dnf-plugins-core-4.0.13/doc/conf.py --- old/dnf-plugins-core-4.0.12/doc/conf.py 2019-11-25 12:04:52.000000000 +0100 +++ new/dnf-plugins-core-4.0.13/doc/conf.py 2020-01-15 10:53:42.000000000 +0100 @@ -80,6 +80,8 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] +if sys.version_info[0] > 2: + exclude_patterns.append('migrate.rst') # The reST default role (used for this markup: `text`) to use for all # documents. @@ -251,7 +253,6 @@ u'DNF generate_completion_cache Plugin', AUTHORS, 8), ('leaves', 'dnf-leaves', u'DNF leaves Plugin', AUTHORS, 8), ('local', 'dnf-local', u'DNF local Plugin', AUTHORS, 8), - ('migrate', 'dnf-migrate', u'DNF migrate Plugin', AUTHORS, 8), ('needs_restarting', 'dnf-needs-restarting', u'DNF needs_restarting Plugin', AUTHORS, 8), ('repoclosure', 'dnf-repoclosure', u'DNF repoclosure Plugin', AUTHORS, 8), ('repodiff', 'dnf-repodiff', u'DNF repodiff Plugin', AUTHORS, 8), @@ -292,6 +293,8 @@ ('dnf-utils', 'yum-utils', u'classic YUM utilities implemented as CLI shims on top of DNF', AUTHORS, 1), ] +if sys.version_info[0] < 3: + man_pages.append(('migrate', 'dnf-migrate', u'DNF migrate Plugin', AUTHORS, 8)) # If true, show URL addresses after external links. #man_show_urls = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnf-plugins-core-4.0.12/doc/release_notes.rst new/dnf-plugins-core-4.0.13/doc/release_notes.rst --- old/dnf-plugins-core-4.0.12/doc/release_notes.rst 2019-11-25 12:04:52.000000000 +0100 +++ new/dnf-plugins-core-4.0.13/doc/release_notes.rst 2020-01-15 10:53:42.000000000 +0100 @@ -22,6 +22,24 @@ .. contents:: ==================== +4.0.13 Release Notes +==================== + +- Fix: config_manager respect config file location during save +- [reposync] Fix --delete with multiple repos (RhBug:1774103) +- Redesign reposync --latest for modular system (RhBug:1775434) +- [doc] Skip creating and installing migrate documentation for Python 3+ +- [config-manager] Allow use of --set-enabled without arguments (RhBug:1679213) +- [versionlock] Prevent conflicting/duplicate entries (RhBug:1782052) + +Bugs fixed in 4.0.13: + +* :rhbug:`1679213` +* :rhbug:`1782052` +* :rhbug:`1775434` +* :rhbug:`1774103` + +==================== 4.0.12 Release Notes ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnf-plugins-core-4.0.12/doc/summaries_cache new/dnf-plugins-core-4.0.13/doc/summaries_cache --- old/dnf-plugins-core-4.0.12/doc/summaries_cache 2019-11-25 12:04:52.000000000 +0100 +++ new/dnf-plugins-core-4.0.13/doc/summaries_cache 2020-01-15 10:53:42.000000000 +0100 @@ -522,5 +522,21 @@ [ 1706386, "[RFE] Discoverable man page names for DNF plugins" + ], + [ + 1679213, + "yum-config-manager --enable/--disable without arguments is ambiguous" + ], + [ + 1782052, + "dnf versionlock will accept equivalent package names to add or exclude multiple times" + ], + [ + 1775434, + "reposync does not properly sync modules with --newest option" + ], + [ + 1774103, + "The '--delete' option when used with reposync command deletes the packages immediately after download." ] ] \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnf-plugins-core-4.0.12/plugins/config_manager.py new/dnf-plugins-core-4.0.13/plugins/config_manager.py --- old/dnf-plugins-core-4.0.12/plugins/config_manager.py 2019-11-25 12:04:52.000000000 +0100 +++ new/dnf-plugins-core-4.0.13/plugins/config_manager.py 2020-01-15 10:53:42.000000000 +0100 @@ -67,11 +67,6 @@ def run(self): """Execute the util action here.""" - - if self.opts.set_enabled and not self.opts.crepo: - logger.error(_("Error: Trying to enable already enabled repos.")) - self.opts.set_enabled = False - if self.opts.add_repo: self.add_repo() else: @@ -114,8 +109,9 @@ print("%s = %s" % (name, val)) if not self.opts.crepo or 'main' in self.opts.crepo: if self.opts.save and modify: - # modify [main] in dnf.conf - self.base.conf.write_raw_configfile(dnf.const.CONF_FILENAME, 'main', sbc.substitutions, modify) + # modify [main] in global configuration file + self.base.conf.write_raw_configfile(self.base.conf.config_file_path, 'main', + sbc.substitutions, modify) if self.opts.dump: print(self.base.output.fmtSection('main')) print(self.base.conf.dump()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnf-plugins-core-4.0.12/plugins/reposync.py new/dnf-plugins-core-4.0.13/plugins/reposync.py --- old/dnf-plugins-core-4.0.12/plugins/reposync.py 2019-11-25 12:04:52.000000000 +0100 +++ new/dnf-plugins-core-4.0.13/plugins/reposync.py 2020-01-15 10:53:42.000000000 +0100 @@ -145,7 +145,7 @@ else: self.download_packages(pkglist) if self.opts.delete: - self.delete_old_local_packages(pkglist) + self.delete_old_local_packages(repo, pkglist) def repo_target(self, repo): return _pkgdir(self.opts.destdir or self.opts.download_path, repo.id) @@ -169,25 +169,20 @@ pkg_download_path, repo_target)) return pkg_download_path - def delete_old_local_packages(self, packages_to_download): - download_map = dict() - for pkg in packages_to_download: - download_map[(pkg.repo.id, os.path.basename(pkg.location))] = pkg.location - # delete any *.rpm file, that is not going to be downloaded from repository - for repo in self.base.repos.iter_enabled(): - repo_target = self.repo_target(repo) - for dirpath, dirnames, filenames in os.walk(repo_target): - for filename in filenames: - path = os.path.join(dirpath, filename) - if filename.endswith('.rpm') and os.path.isfile(path): - location = download_map.get((repo.id, filename)) - if location is None or os.path.join(repo_target, location) != path: - # Delete disappeared or relocated file - try: - os.unlink(path) - logger.info(_("[DELETED] %s"), path) - except OSError: - logger.error(_("failed to delete file %s"), path) + def delete_old_local_packages(self, repo, pkglist): + # delete any *.rpm file under target path, that was not downloaded from repository + downloaded_files = set(self.pkg_download_path(pkg) for pkg in pkglist) + for dirpath, dirnames, filenames in os.walk(self.repo_target(repo)): + for filename in filenames: + path = os.path.join(dirpath, filename) + if filename.endswith('.rpm') and os.path.isfile(path): + if path not in downloaded_files: + # Delete disappeared or relocated file + try: + os.unlink(path) + logger.info(_("[DELETED] %s"), path) + except OSError: + logger.error(_("failed to delete file %s"), path) def getcomps(self, repo): comps_fn = repo._repo.getCompsFn() @@ -203,11 +198,35 @@ repo._repo.downloadMetadata(repo_target) return True + def _get_latest(self, query): + """ + return query with latest nonmodular package and all packages from latest version per stream + """ + if not dnf.base.WITH_MODULES: + return query.latest() + query.apply() + module_packages = self.base._moduleContainer.getModulePackages() + all_artifacts = set() + module_dict = {} # {NameStream: {Version: [modules]}} + for module_package in module_packages: + all_artifacts.update(module_package.getArtifacts()) + module_dict.setdefault(module_package.getNameStream(), {}).setdefault( + module_package.getVersionNum(), []).append(module_package) + non_modular_latest = query.filter( + pkg__neq=query.filter(nevra_strict=all_artifacts)).latest() + latest_artifacts = set() + for version_dict in module_dict.values(): + keys = sorted(version_dict.keys(), reverse=True) + for module in version_dict[keys[0]]: + latest_artifacts.update(module.getArtifacts()) + latest_modular_query = query.filter(nevra_strict=latest_artifacts) + return latest_modular_query.union(non_modular_latest) + def get_pkglist(self, repo): query = self.base.sack.query(flags=hawkey.IGNORE_MODULAR_EXCLUDES).available().filterm( reponame=repo.id) if self.opts.newest_only: - query = query.latest() + query = self._get_latest(query) if self.opts.source: query.filterm(arch='src') elif self.opts.arches: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnf-plugins-core-4.0.12/plugins/versionlock.py new/dnf-plugins-core-4.0.13/plugins/versionlock.py --- old/dnf-plugins-core-4.0.12/plugins/versionlock.py 2019-11-25 12:04:52.000000000 +0100 +++ new/dnf-plugins-core-4.0.13/plugins/versionlock.py 2020-01-15 10:53:42.000000000 +0100 @@ -33,6 +33,9 @@ NO_LOCKLIST = _('Locklist not set') ADDING_SPEC = _('Adding versionlock on:') EXCLUDING_SPEC = _('Adding exclude on:') +EXISTING_SPEC = _('Package already locked in equivalent form:') +ALREADY_LOCKED = _('Package {} is already locked') +ALREADY_EXCLUDED = _('Package {} is already excluded') DELETING_SPEC = _('Deleting versionlock for:') NOTFOUND_SPEC = _('No package found for:') NO_VERSIONLOCK = _('Excludes from versionlock plugin were not applied') @@ -155,13 +158,25 @@ cmd = self.opts.subcommand if cmd == 'add': - _write_locklist(self.base, self.opts.package, self.opts.raw, True, - "\n# Added locks on %s\n" % time.ctime(), - ADDING_SPEC, '') + (entry, entry_cmd) = _search_locklist(self.opts.package) + if entry == '': + _write_locklist(self.base, self.opts.package, self.opts.raw, True, + "\n# Added lock on %s\n" % time.ctime(), + ADDING_SPEC, '') + elif cmd != entry_cmd: + raise dnf.exceptions.Error(ALREADY_EXCLUDED.format(entry)) + else: + logger.info("%s %s", EXISTING_SPEC, entry) elif cmd == 'exclude': - _write_locklist(self.base, self.opts.package, self.opts.raw, False, - "\n# Added exclude on %s\n" % time.ctime(), - EXCLUDING_SPEC, '!') + (entry, entry_cmd) = _search_locklist(self.opts.package) + if entry == '': + _write_locklist(self.base, self.opts.package, self.opts.raw, False, + "\n# Added exclude on %s\n" % time.ctime(), + EXCLUDING_SPEC, '!') + elif cmd != entry_cmd: + raise dnf.exceptions.Error(ALREADY_LOCKED.format(entry)) + else: + logger.info("%s %s", EXISTING_SPEC, entry) elif cmd == 'list': for pat in _read_locklist(): logger.info(pat) @@ -202,6 +217,17 @@ return locklist +def _search_locklist(package): + found = action = '' + locked_specs = _read_locklist() + for ent in locked_specs: + if _match(ent, package): + found = ent + action = 'exclude' if ent.startswith('!') else 'add' + break + return (found, action) + + def _write_locklist(base, args, raw, try_installed, comment, info, prefix): specs = set() for pat in args: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dnf-plugins-core-4.0.12/rel-eng/packages/dnf-plugins-core new/dnf-plugins-core-4.0.13/rel-eng/packages/dnf-plugins-core --- old/dnf-plugins-core-4.0.12/rel-eng/packages/dnf-plugins-core 2019-11-25 12:04:52.000000000 +0100 +++ new/dnf-plugins-core-4.0.13/rel-eng/packages/dnf-plugins-core 2020-01-15 10:53:42.000000000 +0100 @@ -1 +1 @@ -4.0.12-1 ./ +4.0.13-1 ./
