Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rpmconf for openSUSE:Factory checked in at 2021-11-23 22:10:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rpmconf (Old) and /work/SRC/openSUSE:Factory/.rpmconf.new.1895 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rpmconf" Tue Nov 23 22:10:50 2021 rev:13 rq:933313 version:1.1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/rpmconf/rpmconf.changes 2017-05-10 20:53:33.185146331 +0200 +++ /work/SRC/openSUSE:Factory/.rpmconf.new.1895/rpmconf.changes 2021-11-23 22:13:26.578307904 +0100 @@ -1,0 +2,19 @@ +Sat Nov 20 19:39:20 UTC 2021 - Alexei Sorokin <sor.ale...@meowr.ru> + +- Update to version 1.1.4 (changes since 1.0.19): + * Better handle message after merging. + * Add sdiff support (gh#xsuchy/rpmconf#51). + * rpmconf.sgml: Improve readability. + * Drop the deprecated no-op "U" mode for open() for Python 3.9+. + * Fix short version of --version. + * Implement --root option. + * initialise rpm transaction faster. + * Do not traceback when Ctrl+C. + * Do not go over all packages if neither -a or -o is set. + * Implement --exclude. + * Implement unattended mode. + * Move init section after sleep() so it can be interrupted by ^C. +- Fix version in the released RPM. +- BuildRequire make. + +------------------------------------------------------------------- Old: ---- rpmconf-1.0.19.tar.gz New: ---- rpmconf-1.1.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rpmconf.spec ++++++ --- /var/tmp/diff_new_pack.GYBJm4/_old 2021-11-23 22:13:27.046306356 +0100 +++ /var/tmp/diff_new_pack.GYBJm4/_new 2021-11-23 22:13:27.050306343 +0100 @@ -1,7 +1,7 @@ # # spec file for package rpmconf # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,20 +12,21 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: rpmconf -Version: 1.0.19 +Version: 1.1.4 Release: 0 Summary: Tool to handle rpmnew and rpmsave files -License: GPL-3.0+ +License: GPL-3.0-or-later Group: System/Base -Url: https://github.com/xsuchy/rpmconf +URL: https://github.com/xsuchy/rpmconf Source: https://github.com/xsuchy/%{name}/archive/%{name}-%{version}-1.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: docbook-utils-minimal BuildRequires: docbook_3 +BuildRequires: make BuildRequires: python3-Sphinx BuildRequires: python3-devel BuildRequires: python3-rpm @@ -35,6 +36,7 @@ Suggests: kdiff3 Suggests: meld Suggests: vim +Suggests: diffutils BuildArch: noarch %description @@ -52,10 +54,13 @@ %prep %setup -q -n %{name}-%{name}-%{version}-1 +sed -i 's/__version__ = .*/__version__ = "%{version}"/' rpmconf/rpmconf.py +sed -i 's/version = .*,/version = "%{version}",/' setup.py + %build python3 setup.py build docbook2man %{name}.sgml -make %{?_smp_mflags} -C docs man \ +%make_build -C docs man \ SPHINXBUILD=sphinx-build-%{py3_ver} %install @@ -71,15 +76,15 @@ find docs/build/ -type f -name ".buildinfo" -delete -print %files -%defattr(-,root,root) -%doc LICENSE README TODO +%license LICENSE +%doc README.md TODO %{_sbindir}/%{name} %dir %{_datadir}/%{name}/ %{_mandir}/man8/%{name}.8%{?ext_man} %files -n python3-%{name} -%defattr(-,root,root) -%doc LICENSE README TODO +%license LICENSE +%doc README.md TODO %{python3_sitelib}/%{name}/ %{python3_sitelib}/%{name}-* %{_mandir}/man3/%{name}.3%{?ext_man} ++++++ rpmconf-1.0.19.tar.gz -> rpmconf-1.1.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.19-1/.tito/packages/rpmconf new/rpmconf-rpmconf-1.1.4-1/.tito/packages/rpmconf --- old/rpmconf-rpmconf-1.0.19-1/.tito/packages/rpmconf 2017-04-05 13:56:08.000000000 +0200 +++ new/rpmconf-rpmconf-1.1.4-1/.tito/packages/rpmconf 2021-03-04 12:36:07.000000000 +0100 @@ -1 +1 @@ -1.0.19-1 ./ +1.1.4-1 ./ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.19-1/.tito/releasers.conf new/rpmconf-rpmconf-1.1.4-1/.tito/releasers.conf --- old/rpmconf-rpmconf-1.0.19-1/.tito/releasers.conf 2017-04-05 13:56:08.000000000 +0200 +++ new/rpmconf-rpmconf-1.1.4-1/.tito/releasers.conf 2021-03-04 12:36:07.000000000 +0100 @@ -1,10 +1,14 @@ -[fedora-git] +[release] releaser = tito.release.FedoraGitReleaser -branches = master +branches = master epel8 epel7 + +[all] +releaser = tito.release.FedoraGitReleaser +branches = master f32 f31 epel8 epel7 -[fedora-f24] +[fedora-master] releaser = tito.release.FedoraGitReleaser -branches = f24 +branches = master [fedora-f22] releaser = tito.release.FedoraGitReleaser @@ -16,4 +20,4 @@ [epel] releaser = tito.release.FedoraGitReleaser -branches = el6 epel7 +branches = epel8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.19-1/README new/rpmconf-rpmconf-1.1.4-1/README --- old/rpmconf-rpmconf-1.0.19-1/README 2017-04-05 13:56:08.000000000 +0200 +++ new/rpmconf-rpmconf-1.1.4-1/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,82 +0,0 @@ -rpmconf -tool to handle rpmnew and rpmsave files - -What it does: -- run "rpmconf --help" and you will see :) -- it searches all config file of all installed packages and check if file with .rpmsave or .rpmnew exists. -- It allows you to see diff of this file against current file and can do merge. -- It allows you to keep current version or the other one (rpmsave or rpmnew one). -- it deletes .rpmsave and .rpmnew files which are identical to current file -- after your choice it deletes the unwanted file. -- it can search for all orphaned rpmsave and rpmnew files. -- it can dump diffs for unattended automation. - -I provide only .zip and .tar.gz (automagically generated by GitHub) and .src.rpm. -If you are looking for .rpm files run either: - yum install rpmconf -- at least in Fedora and EPEL - or check: -http://koji.fedoraproject.org/koji/packageinfo?packageID=8847 - - -If you just want to see the difference between old and new files, -run rpmconf non-interactively like this (for one package): - - [user@host ~]$ rpmconf -oglibc -D - --- /etc/nsswitch.conf 2013-07-02 13:55:25.000000000 +0000 - +++ /etc/nsswitch.conf.rpmnew 2012-10-22 15:46:43.000000000 +0000 - @@ -36,7 +36,7 @@ - initgroups: files - - #hosts: db files nisplus nis dns - -hosts: files dns myhostname - +hosts: files dns - - # Example - obey only what nisplus tells us... - #services: nisplus [NOTFOUND=return] files - -or like this for all packages: - - [user@host ~]$ rpmconf -D -a | head -20 - --- /etc/nsswitch.conf 2013-07-02 13:55:25.000000000 +0000 - +++ /etc/nsswitch.conf.rpmnew 2012-10-22 15:46:43.000000000 +0000 - @@ -36,7 +36,7 @@ - initgroups: files - - #hosts: db files nisplus nis dns - -hosts: files dns myhostname - +hosts: files dns - - # Example - obey only what nisplus tells us... - #services: nisplus [NOTFOUND=return] files - --- /usr/share/info/dir 2013-12-29 02:37:24.067000000 +0000 - +++ /usr/share/info/dir.rpmnew 2013-03-21 13:20:38.000000000 +0000 - @@ -15,1978 +15,8 @@ - - * Menu: - - -Archiving - -* Cpio: (cpio). Copy-in-copy-out archiver to tape or disk. - -* Tar: (tar). Making tape (or disk) archives. - - -How to build package: - - yum install tito - cd source - tito build --rpm - -Hacking: - commit your code (localy is fine) - cd source - tito build --test --rpm - -History: -Originally there was no such tool for RPM world. I came from Debian world where handling -of configuration files is directly in apt. Since rpm is non-interactive, such handling -must be in separate tool. Therefore I started creating rpmconf, which is very similar -to Debian configuration handling. I even try to copy as much as possible the frontend -strings and formatting as I hope that sysadmins appreciate unified UI in Debian and Fedora. - -License: GPLv3 -Author: Miroslav Suchy <msu...@redhat.com> - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.19-1/README.md new/rpmconf-rpmconf-1.1.4-1/README.md --- old/rpmconf-rpmconf-1.0.19-1/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/rpmconf-rpmconf-1.1.4-1/README.md 2021-03-04 12:36:07.000000000 +0100 @@ -0,0 +1,95 @@ +# rpmconf + +tool to handle rpmnew and rpmsave files + +What it does: +- run "rpmconf --help" and you will see :) +- it searches all config file of all installed packages and check if file with .rpmsave or .rpmnew exists. +- It allows you to see diff of this file against current file and can do merge. +- It allows you to keep current version or the other one (rpmsave or rpmnew one). +- it deletes .rpmsave and .rpmnew files which are identical to current file +- after your choice it deletes the unwanted file. +- it can search for all orphaned rpmsave and rpmnew files. +- it can dump diffs for unattended automation. + +I provide only .zip and .tar.gz (automagically generated by GitHub) and .src.rpm. +If you are looking for .rpm files run either: + dnf install rpmconf +- at least in Fedora and EPEL - or check: +http://koji.fedoraproject.org/koji/packageinfo?packageID=8847 + + +If you just want to see the difference between old and new files, +run rpmconf non-interactively like this (for one package): + + [user@host ~]$ rpmconf -oglibc -D + --- /etc/nsswitch.conf 2013-07-02 13:55:25.000000000 +0000 + +++ /etc/nsswitch.conf.rpmnew 2012-10-22 15:46:43.000000000 +0000 + @@ -36,7 +36,7 @@ + initgroups: files + + #hosts: db files nisplus nis dns + -hosts: files dns myhostname + +hosts: files dns + + # Example - obey only what nisplus tells us... + #services: nisplus [NOTFOUND=return] files + +or like this for all packages: + + [user@host ~]$ rpmconf -D -a | head -20 + --- /etc/nsswitch.conf 2013-07-02 13:55:25.000000000 +0000 + +++ /etc/nsswitch.conf.rpmnew 2012-10-22 15:46:43.000000000 +0000 + @@ -36,7 +36,7 @@ + initgroups: files + + #hosts: db files nisplus nis dns + -hosts: files dns myhostname + +hosts: files dns + + # Example - obey only what nisplus tells us... + #services: nisplus [NOTFOUND=return] files + --- /usr/share/info/dir 2013-12-29 02:37:24.067000000 +0000 + +++ /usr/share/info/dir.rpmnew 2013-03-21 13:20:38.000000000 +0000 + @@ -15,1978 +15,8 @@ + + * Menu: + + -Archiving + -* Cpio: (cpio). Copy-in-copy-out archiver to tape or disk. + -* Tar: (tar). Making tape (or disk) archives. + + +## How to build package + + yum install tito + cd source + tito build --rpm + +## Hacking + + commit your code (localy is fine) + cd source + tito build --test --rpm + +## History + +Originally there was no such tool for RPM world. I came from Debian world where handling +of configuration files is directly in apt. Since rpm is non-interactive, such handling +must be in separate tool. Therefore I started creating rpmconf, which is very similar +to Debian configuration handling. I even try to copy as much as possible the frontend +strings and formatting as I hope that sysadmins appreciate unified UI in Debian and Fedora. + +## Sponsor + +This project is sponsored by [Red Hat](https://www.redhat.com/). You can [buy](https://www.redhat.com/en/store) Red Hat subscription to sponsor this project. + + +## License + +GPLv3 + +## Author + +Miroslav Such?? <msu...@redhat.com> + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.19-1/bin/rpmconf new/rpmconf-rpmconf-1.1.4-1/bin/rpmconf --- old/rpmconf-rpmconf-1.0.19-1/bin/rpmconf 2017-04-05 13:56:08.000000000 +0200 +++ new/rpmconf-rpmconf-1.1.4-1/bin/rpmconf 2021-03-04 12:36:07.000000000 +0100 @@ -42,6 +42,10 @@ metavar="EDITOR", help="Define which frontend should be used for merging." " For list of valid types see man page.") + parser.add_argument("--root", dest="root", action="store", + metavar="ROOT", + help="Specifies an alternative installroot, relative to" + " where all packages are installed.") parser.add_argument("-t", "--test", dest="test", action="store_true", help="Only test if there are some files for merge. Return " "0 exit code if there is none such file.") @@ -50,8 +54,23 @@ parser.add_argument("-o", "--owner", dest="owner", metavar="PACKAGE", nargs="*", help="Check only configuration files of given package.") - parser.add_argument("-v", "--version", dest="version", action="store_true", + parser.add_argument("-u", "--unattended", dest="unattended", + choices=["use_maintainer", "use_your", "default"], + nargs="?", const="default", metavar="MODE", + help="Unattended mode: do not prompt user, perform actions " + "based on MODE. use_maintainer replaces existing " + "configuration files with .rpmnew and deletes all " + ".rpmsave files. use_your deletes .rpmnew files and " + "replaces existing configuration files with .rpmsave " + "files. default does use_your for .rpmnew files and " + " use_maintainer for .rpmsave (same as prompts). " + "(default: %(default)s)") + parser.add_argument("-V", "--version", dest="version", action="store_true", help="Display rpmconf version.") + parser.add_argument("-x", "--exclude", dest="exclude", metavar="DIRECTORY", + nargs="*", + help="Exclude path from checking. Applies only for -c.") + args = parser.parse_args() if args.version: print(rpmconf.__version__) @@ -59,14 +78,19 @@ if not (args.owner or args.all or args.clean): parser.print_help() sys.exit(1) - rconf = rpmconf.RpmConf(packages=None if args.all else args.owner, - clean=args.clean, debug=args.debug, - diff=args.diff, frontend=args.frontend, - selinux=args.selinux, test=args.test) + owner = args.owner if args.owner else [] + if os.geteuid() != 0: sys.stderr.write("Most features are not useful without root privileges!!!\n") time.sleep(5) + rconf = rpmconf.RpmConf(packages=None if args.all else owner, + clean=args.clean, debug=args.debug, + diff=args.diff, frontend=args.frontend, + selinux=args.selinux, test=args.test, + exclude=args.exclude, root=args.root, + unattended=args.unattended) + try: rconf.run() except IOError as err: @@ -77,4 +101,7 @@ raise if __name__ == "__main__": - main() + try: + main() + except KeyboardInterrupt: + sys.exit(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.19-1/rpmconf/rpmconf.py new/rpmconf-rpmconf-1.1.4-1/rpmconf/rpmconf.py --- old/rpmconf-rpmconf-1.0.19-1/rpmconf/rpmconf.py 2017-04-05 13:56:08.000000000 +0200 +++ new/rpmconf-rpmconf-1.1.4-1/rpmconf/rpmconf.py 2021-03-04 12:36:07.000000000 +0100 @@ -32,14 +32,16 @@ import select import subprocess import sys +import tempfile import time import tty +from pathlib import Path #external import rpm import termios -__version__ = "1.0.90" +__version__ = "1.0.60" #uncomment when rpm 4.13 is available #rpm.setInterruptSafety(False) @@ -67,24 +69,43 @@ :ivar selinux: :class:`bool` :ivar debug: :class:`bool` :ivar logger: :class:`logging.Logger` - + :param exclude: List of directories which should be skipped. + :type exclude: listi + :param root: Defines alternative installroot. + :type root: str + :ivar root: :class:`str` + :param unattended: Defines unattended mode. + :type unattended: str + :ivar unattended: :class:`str` """ def __init__(self, packages=None, clean=False, debug=False, selinux=False, - diff=False, frontend=None, test=None): - trans = rpm.TransactionSet() - if not packages: - self.packages = [trans.dbMatch()] # pylint: disable=no-member + diff=False, frontend=None, test=None, exclude=None, root=None, + unattended=None): + if root: + self.trans = rpm.TransactionSet(rootdir=root) + else: + self.trans = rpm.TransactionSet() + self.trans.setVSFlags((rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS)) + if exclude is None: + exclude = [] + self.packages = [] + if packages is None: #this can be [] if neither -a nor -o is set + self.packages = [self.trans.dbMatch()] # pylint: disable=no-member else: - self.packages = [] - for pkg in packages: - tmp = trans.dbMatch("name", pkg) # pylint: disable=no-member - self.packages.append(tmp) + if packages: + for pkg in packages: + tmp = self.trans.dbMatch("name", pkg) # pylint: disable=no-member + self.packages.append(tmp) + self.clean = clean self.diff = diff self.frontend = frontend self.selinux = selinux self.debug = debug self.test = test + self.exclude = [Path(os.path.realpath(x)) for x in exclude] + self.root = root + self.unattended = unattended self.logger = logging.getLogger("rpmconf") self.logger.setLevel(logging.INFO) @@ -121,8 +142,7 @@ signal.signal(signal.SIGINT, signal.default_int_handler) return input(question) - @staticmethod - def get_list_of_config(package): + def get_list_of_config(self, package): """Get all files marked as config in package :param package: RPM Header of package @@ -135,7 +155,10 @@ result = [] for rpm_file in files: if rpm_file[4] & rpm.RPMFILE_CONFIG: # pylint: disable=no-member - result.append(rpm_file[0]) + file_name = rpm_file[0] + if self.root: + file_name = os.path.normpath(self.root + file_name) + result.append(file_name) return result def show_diff(self, file1, file2): @@ -170,10 +193,10 @@ else: todate = time.ctime(os.stat(file2).st_mtime) try: - fromlines = open(file1, "U").readlines() + fromlines = open(file1).readlines() if fromlines == []: fromlines = [""] - tolines = open(file2, "U").readlines() + tolines = open(file2).readlines() if tolines == []: tolines = [""] diff = difflib.unified_diff(fromlines, tolines, @@ -276,13 +299,29 @@ self._remove("{}.orig".format(conf_file)) except subprocess.CalledProcessError: print("Files not merged.") + elif self.frontend == "sdiff": + try: + tmp_file_name = (tempfile.mkstemp(prefix='rpmconf_'))[1] + subprocess.check_call( + ["/usr/bin/sdiff", "-o", tmp_file_name, + conf_file, other_file]) + self._remove(other_file) + self._copy(tmp_file_name, conf_file) + self._remove(tmp_file_name) + except subprocess.CalledProcessError as e: + if e.returncode == 1: + self._remove(other_file) + self._copy(tmp_file_name, conf_file) + self._remove(tmp_file_name) + else: # returncode == 2 + print("Files not merged.") elif (self.frontend == "env" or self.frontend is None) and \ os.environ.get('MERGE') is not None: merge_tool = os.environ.get('MERGE') print(repr(merge_tool)) subprocess.check_call([merge_tool, conf_file, other_file]) else: - self.logger.error("You did not selected any frontend for merge.\n" + + self.logger.error("You did not select any frontend for merge.\n" + " Define it with environment variable 'MERGE' or flag -f.") sys.exit(2) except FileNotFoundError as err: @@ -330,6 +369,13 @@ self._remove(other_file) return + if self.unattended == "use_maintainer": + self._overwrite(other_file, conf_file) + return + if self.unattended in ["use_your", "default"]: + self._remove(other_file) + return + prompt = """ ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version @@ -366,6 +412,9 @@ os.kill(os.getpid(), signal.SIGSTOP) if option == "M": self._merge_conf_files(conf_file, other_file) + if not os.access(other_file, os.F_OK): + print("File {} has been merged.".format(other_file)) + return if option in ["N", "O"]: self._remove(other_file) if option in ["Y", "I"]: @@ -377,6 +426,13 @@ self._remove(other_file) return + if self.unattended in ["use_maintainer", "default"]: + self._remove(other_file) + return + if self.unattended == "use_your": + self._overwrite(other_file, conf_file) + return + prompt = """ ==> Package distributor has shipped an updated version. ==> Maintainer forced upgrade. Your old version has been backed up. What would you like to do about it? Your options are: @@ -414,19 +470,20 @@ os.kill(os.getpid(), signal.SIGSTOP) if option == "M": self._merge_conf_files(conf_file, other_file) + if not os.access(other_file, os.F_OK): + print("File {} has been merged.".format(other_file)) + return if option in ["Y", "I"]: self._remove(other_file) if option in ["N", "O"]: self._overwrite(other_file, conf_file) - @staticmethod - def _clean_orphan_file(rpmnew_rpmsave): + def _clean_orphan_file(self, rpmnew_rpmsave): # rpmnew_rpmsave is lowercase name of rpmnew/rpmsave file (rpmnew_rpmsave_orig, _) = os.path.splitext(rpmnew_rpmsave) package_merge = file_delete = None - trans = rpm.TransactionSet() # pylint: disable=no-member - tmp_db = trans.dbMatch("basenames", rpmnew_rpmsave_orig) + tmp_db = self.trans.dbMatch("basenames", rpmnew_rpmsave_orig) if tmp_db.count() == 0: file_delete = rpmnew_rpmsave else: @@ -437,12 +494,15 @@ def _clean_orphan(self): files_merge = [] files_delete = [] + excludes = self.exclude + [Path('/var/lib/mock')] for topdir in ["/etc", "/var", "/usr"]: - self.logger.info("Seaching through: %s", topdir) - for root, dirs, files in os.walk(topdir, followlinks=True): - if root == "/var/lib": - # skip /var/lib/mock - dirs[:] = [d for d in dirs if d != "mock"] + self.logger.info("Searching through: %s", topdir) + if Path(topdir) in excludes: + continue + if self.root: + topdir = os.path.normpath(self.root + topdir) + for root, dirs, files in os.walk(topdir, followlinks=True, topdown=True): + dirs[:] = [d for d in dirs if Path(os.path.join(root, d)) not in excludes] for name in files: l_name = os.path.join(root, name) if os.path.splitext(l_name)[1] in [".rpmnew", ".rpmsave"]: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.19-1/rpmconf.sgml new/rpmconf-rpmconf-1.1.4-1/rpmconf.sgml --- old/rpmconf-rpmconf-1.0.19-1/rpmconf.sgml 2017-04-05 13:56:08.000000000 +0200 +++ new/rpmconf-rpmconf-1.1.4-1/rpmconf.sgml 2021-03-04 12:36:07.000000000 +0100 @@ -13,7 +13,7 @@ <RefNameDiv> <RefName><command>&SCRIPTCOMMAND;</command></RefName> <RefPurpose> - This tool search for .rpmnew, .rpmsave and .rpmorigfiles and ask you what to do with them: Keep current version, place back old version or watch the diff. + This tool searches for .rpmnew, .rpmsave and .rpmorig files and asks you what to do with them: keep the current version, replace with the previous version, or review the diff. </RefPurpose> </RefNameDiv> <RefSynopsisDiv> @@ -32,6 +32,9 @@ <arg>-f<replaceable><type></replaceable> --frontend=<replaceable><type></replaceable></arg> </cmdsynopsis> <cmdsynopsis> + <arg>--root <replaceable><ROOT></replaceable></arg> + </cmdsynopsis> + <cmdsynopsis> <arg>-c, --clean</arg> </cmdsynopsis> <cmdsynopsis> @@ -44,6 +47,12 @@ <arg>-t, --test</arg> </cmdsynopsis> <cmdsynopsis> + <arg>-u, --unattended <replaceable><optional><MODE></optional></replaceable></arg> + </cmdsynopsis> + <cmdsynopsis> + <arg>-x, --exclude <replaceable><DIRECTORY></replaceable></arg> + </cmdsynopsis> + <cmdsynopsis> <arg>-Z</arg> </cmdsynopsis> @@ -54,19 +63,17 @@ <para> Rpmconf will search for all config file of given package (or all installed packages) and will check if coresponding .rpmsave, .rpmnew or - .rpmorig file exist. In such case you will be asked if you want to - keep current version, put back old version or see diff of those two - files. Then it delete that unwanted file. + .rpmorig files exist. If so, you will be asked if you want to keep the + current version, revert to the previous version, or diff the two files. + The unwanted file is then deleted. </para> <para> - Additionally rpmconf can also handle application configuration, if - application support rpmconf. - Application must have executable file present in /usr/share/rpmconf/. - The file must have the same name as package itself and the package - must own that file. - The executable must be idempotent. I.e. you can execute it multiple times - and additional run, must not change something. Ideally it will be - Puppet/Chef/Ansible/CFengine manifest. + Additionally, rpmconf can also handle application configuration, if + the application supports rpmconf. The application must have an + executable file present in /usr/share/rpmconf/. The file must have the + same name as package itself and the package must own that file. The + executable must be idempotent, i.e. subsequent executions should have + no effect. Ideally it should be a Puppet/Chef/Ansible/CFengine manifest. </para> </RefSect1> @@ -87,22 +94,21 @@ <varlistentry> <term>-f<type>, --frontend=<type></term> <listitem> - <para>Define which frontend should be used for merging. Valid options are: vimdiff, gvimdiff, diffuse, kdiff3, meld and env. When set to env, the command to use is taken from the environment variable $MERGE. The default is env.</para> + <para>Define which frontend should be used for merging. Valid options are: vimdiff, gvimdiff, diffuse, kdiff3, meld, sdiff and env. When set to env, the command to use is taken from the environment variable $MERGE. The default is env.</para> </listitem> </varlistentry> <varlistentry> <term>-c, --clean</term> <listitem> - <para>Find all .rpmnew and .rpmsave files in /etc and /var directories. List all files, which belongs to installed packages. Then it write all files which are orphaned and ask you if it is safe to delete them.</para> + <para>Find all .rpmnew and .rpmsave files in /etc and /var directories. List all files belonging to installed packages, then write all files which are orphaned and ask if it is safe to delete them.</para> </listitem> </varlistentry> <varlistentry> <term>-d, --debug</term> <listitem> - <para>Dry run. Instead of executing an action (move/remove of file) it will - be echoed to standard output. However executable for merging of configuration files - is executed. Beware that this option is position sensitive. And only action specified after --debug are dry run. - E.g. --all --debug --clean, will run in dry run mode only for --clean, but not for --all. + <para>Dry run. Instead of executing an action (move or delete a file) the filename will + be echoed to standard output. However, the executable for merging of configuration files + will still be executed. Beware that this option is position-sensitive: only actions specified after --debug are dry-run, e.g. --all --debug --clean will run --clean in dry run mode but not --all. </para> </listitem> </varlistentry> @@ -117,12 +123,34 @@ </listitem> </varlistentry> <varlistentry> + <term>--root ROOT</term> + <listitem> + <para> + Specifies an alternative installroot, relative to where all packages are installed. + </para> + </listitem> + </varlistentry> + <varlistentry> <term>-t, --test</term> <listitem> <para> Just test existence of files to merge. If there is some file to merge then rpmconf - will print it and exit with status code 5. If there is none to merge, then return - with exit code 0. + will print it and exit with status code 5. If there are none to merge, then exit + with status code 0. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>-u [<MODE>], --unattended [<MODE>]</term> + <listitem> + <para> + Unattended mode. + Do not prompt user, but perform actions based on MODE. Valid options are: use_maintainer, use_your, default. + use_maintainer replaces existing configuration files with .rpmnew files and deletes leftover .rpmsave and + .rpmorig files. use_your deletes .rpmnew files and replaces existing configuration files with .rpmsave files. + default does use_your for .rpmnew files and use_maintainer for .rpmsave files, as are the default prompts + in interactive mode. + Specifying MODE is optional, default is used by default. </para> </listitem> </varlistentry> @@ -130,16 +158,24 @@ <term>-V, --version</term> <listitem> <para> - Display &SCRIPTCOMMAND; version. This option expect that this script + Display &SCRIPTCOMMAND; version. This option expects that this script is installed as rpm package. </para> </listitem> </varlistentry> <varlistentry> + <term>-x, --exclude [DIRECTORY [DIRECTORY ...]]</term> + <listitem> + <para> + Exclude DIRECTORY from checking. Applies only for -c. + </para> + </listitem> + </varlistentry> + <varlistentry> <term>-Z</term> <listitem> <para> - Display SELinux context of old and new file. Note: if you choose to install .rpmsave version. It is copied to original filename, therefore SELinux context is reset to default value specified by SELinux policy. + Display the SELinux contexts of the old and new files. Note: if you choose to install .rpmsave version. It is copied to the original filename, therefore its SELinux context is reset to the default value specified by SELinux policy. </para> </listitem> </varlistentry> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.19-1/rpmconf.spec new/rpmconf-rpmconf-1.1.4-1/rpmconf.spec --- old/rpmconf-rpmconf-1.0.19-1/rpmconf.spec 2017-04-05 13:56:08.000000000 +0200 +++ new/rpmconf-rpmconf-1.1.4-1/rpmconf.spec 2021-03-04 12:36:07.000000000 +0100 @@ -1,49 +1,68 @@ +%bcond_with tests +%if 0%{?rhel} == 7 +%global python3_pkgversion 36 +%endif + Name: rpmconf Summary: Tool to handle rpmnew and rpmsave files License: GPLv3 -Version: 1.0.19 +Version: 1.1.4 Release: 1%{?dist} -URL: http://wiki.github.com/xsuchy/rpmconf +URL: https://github.com/xsuchy/rpmconf # source is created by: # git clone https://github.com/xsuchy/rpmconf.git # cd rpmconf; tito build --tgz Source0: %{name}-%{version}.tar.gz BuildArch: noarch +BuildRequires: make BuildRequires: docbook-utils BuildRequires: docbook-dtd31-sgml -BuildRequires: python3-sphinx -BuildRequires: python3-devel +BuildRequires: python%{python3_pkgversion}-sphinx +BuildRequires: python%{python3_pkgversion}-devel Requires: %{name}-base -Requires: python3-rpmconf +Requires: python%{python3_pkgversion}-rpmconf +%if 0%{?rhel} == 7 +Requires: python36-rpm +BuildRequires: python36-rpm +%else Requires: rpm-python3 BuildRequires: rpm-python3 -#check -BuildRequires: python3-pylint -BuildRequires: python3-six +%if %{with tests} +BuildRequires: python%{python3_pkgversion}-pylint +BuildRequires: python%{python3_pkgversion}-six +%endif +%endif # mergetools -Suggests: diffuse +%if 0%{?rhel} == 7 + # nothing +%else +Suggests: diffuse +Suggests: diffutils Suggests: kdiff3 Suggests: meld Suggests: vim-X11 Suggests: vim-enhanced +# sdiff +Suggests: diffutils +%endif %description This tool search for .rpmnew, .rpmsave and .rpmorig files and ask you what to do with them: Keep current version, place back old version, watch the diff or merge. -%package -n python3-rpmconf +%package -n python%{python3_pkgversion}-rpmconf Summary: Python interface for %{name} BuildArch: noarch -%description -n python3-rpmconf +%description -n python%{python3_pkgversion}-rpmconf Python interface for %{name}. Mostly useful for developers only. -%package -n python3-rpmconf-doc +%package -n python%{python3_pkgversion}-rpmconf-doc Summary: Documentation of python interface for %{name} BuildArch: noarch -%description -n python3-rpmconf-doc +%description -n python%{python3_pkgversion}-rpmconf-doc Documentation generated from code of python3-rpmconf. %package base @@ -57,9 +76,15 @@ %setup -q %build +sed -i 's/__version__ = .*/__version__ = "%{version}"/' rpmconf/rpmconf.py +sed -i 's/version = .*,/version = "%{version}",/' setup.py %{__python3} setup.py build docbook2man rpmconf.sgml +%if 0%{?rhel} == 7 +make -C docs html man SPHINXBUILD=sphinx-build-3.6 +%else make -C docs html man +%endif %install %{__python3} setup.py install --skip-build \ @@ -70,20 +95,23 @@ mkdir -p %{buildroot}%{_datadir}/rpmconf/ %check -pylint-3.6 rpmconf bin/rpmconf || : +%if %{with tests} +pylint-3 rpmconf bin/rpmconf || : +%endif %files %license LICENSE %{_sbindir}/rpmconf %{_mandir}/man8/rpmconf.8* +%doc README.md -%files -n python3-rpmconf +%files -n python%{python3_pkgversion}-rpmconf %license LICENSE %{python3_sitelib}/rpmconf/ %{python3_sitelib}/rpmconf-*.egg-info %{_mandir}/man3/rpmconf.3* -%files -n python3-rpmconf-doc +%files -n python%{python3_pkgversion}-rpmconf-doc %license LICENSE %doc docs/build/html/ @@ -91,6 +119,40 @@ %dir %{_datadir}/rpmconf %changelog +* Thu Mar 04 2021 Miroslav Such?? <msu...@redhat.com> 1.1.4-1 +- 1934986 - update link + +* Tue Dec 22 2020 Miroslav Such?? <miros...@suchy.cz> 1.1.3-1 +- Implement unattended mode. +- move init section after sleep() so it can be interrupted by Ctrl+C + +* Mon Nov 30 2020 Miroslav Such?? <msu...@redhat.com> 1.1.2-1 +- BR make +- Fix typo in error message + +* Mon May 04 2020 Miroslav Such?? <msu...@redhat.com> 1.1.1-1 +- fix version in released rpm +- fix short version of --version +- implement --root option +- initialize rpm transaction faster +- do not traceback when Ctrl+C +- do not go over all packages if neither -a or -o is set +- implement --exclude + +* Tue Apr 21 2020 Miroslav Such?? <miros...@suchy.cz> 1.0.22-1 +- build for el7 + +* Thu Jan 16 2020 Miroslav Such?? <msu...@redhat.com> 1.0.21-1 +- Drop the deprecated no-op "U" mode for open() to support Python 3.9 + +* Sun Sep 22 2019 Miroslav Such?? <msu...@redhat.com> 1.0.20-1 +- remove old changelog entries +- better handle message after merging +- do not run pylint by default +- add sdiff support [GH#51] +- rpmconf.sgml: Improve readability +- include README in package + * Wed Apr 05 2017 Miroslav Such?? <msu...@redhat.com> 1.0.19-1 - implement --test - 1350249 - correctly pass /dev/null to difflib @@ -173,71 +235,3 @@ * Wed Oct 29 2014 Miroslav Such?? <msu...@redhat.com> 1.0.1-1 - migrate to python3 - handle symlinks correctly - -* Thu Oct 02 2014 Miroslav Such?? 0.3.7-1 -- when there is no error return 0 - -* Sun Jan 12 2014 Miroslav Such?? <miros...@suchy.cz> 0.3.6-1 -- add non-interactive --diff mode -- remove some white space in NAME section -- remove garbage from man page -- rpmconf-base should not require rpmconf - -* Thu Jul 25 2013 Miroslav Such?? <msu...@redhat.com> 0.3.5-1 -- add ability to configure packages -- replace old macro RPM_BUILD_ROOT -- create subpackage -base which will own /usr/share/rpmconf -- document ability to handle app configuration - -* Mon Jul 15 2013 Miroslav Such?? <miros...@suchy.cz> -- When overwriting the current file with an .rpmnew/.rpmsave file, check that - the copy worked before removing the source file. -- Skip deleting files if user input could not be read. -- fix few spelling typos - -* Fri Jul 08 2011 Miroslav Such?? 0.3.3-1 -- Revert "change download location to github magic url" - -* Fri Jul 08 2011 Miroslav Such?? 0.3.2-1 -- change download location to github magic url - -* Fri Jul 08 2011 Miroslav Such?? 0.3.1-1 -- bump up version -- add warning about --debug position sensitivity -- scan /usr during --clean -- introduce new option -Z to print SELinux context of old and new file -- do not dereference links -- allow another option : skip the current config file and go to the next one -- show config file dates -- we do not need perl -- --clean - Find and delete orphaned .rpmnew and .rpmsave files. -- fix spelling error - -* Mon Feb 22 2010 Miroslav Suchy <msu...@redhat.com> 0.2.2-1 -- 567318 - fix syntax error -- add diffuse as merge frontend - -* Thu Jan 7 2010 Miroslav Suchy <msu...@redhat.com> 0.2.1-1 -- implement merging of files using vimdiff, gvimdiff, meld, - and kdiff3 -- added command line option --version -- added command line option --debug -- fix build requires on Mandriva - -* Mon Aug 31 2009 Miroslav Suchy <msu...@redhat.com> 0.1.8-1 -- fix copy and past typo - -* Fri Aug 28 2009 Miroslav Suchy <msu...@redhat.com> 0.1.7-1 -- add support for handling .rpmorig -- 513794 - localisation problem -- add support for suspending script - -* Fri Jul 17 2009 Miroslav Suchy <msu...@redhat.com> 0.1.6-1 -- addressed fedora package review notes (#7) - -* Thu Jul 16 2009 Miroslav Suchy <msu...@redhat.com> 0.1.5-1 -- addressed fedora package review notes - -* Thu Jul 16 2009 Miroslav Suchy <msu...@redhat.com> 0.1.3-1 -- initial version - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.19-1/setup.py new/rpmconf-rpmconf-1.1.4-1/setup.py --- old/rpmconf-rpmconf-1.0.19-1/setup.py 2017-04-05 13:56:08.000000000 +0200 +++ new/rpmconf-rpmconf-1.1.4-1/setup.py 2021-03-04 12:36:07.000000000 +0100 @@ -4,7 +4,7 @@ setup(name = "rpmconf", packages = ["rpmconf"], - version = "1.0.19", + version = "1.1.4", description = "Handle rpmnew and rpmsave files", author = "Igor Gnatenko", author_email = "i.gnatenko.br...@gmail.com",