Hello community, here is the log from the commit of package rpmconf for openSUSE:Factory checked in at 2017-05-10 20:53:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rpmconf (Old) and /work/SRC/openSUSE:Factory/.rpmconf.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rpmconf" Wed May 10 20:53:31 2017 rev:12 rq:494043 version:1.0.19 Changes: -------- --- /work/SRC/openSUSE:Factory/rpmconf/rpmconf.changes 2016-07-27 16:12:53.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rpmconf.new/rpmconf.changes 2017-05-10 20:53:33.185146331 +0200 @@ -1,0 +2,7 @@ +Tue May 9 16:45:47 UTC 2017 - sor.ale...@meowr.ru + +- Update to version 1.0.19: + * Implement --test. + * Correctly pass /dev/null to difflib (rh#1350249). + +------------------------------------------------------------------- Old: ---- rpmconf-1.0.18.tar.gz New: ---- rpmconf-1.0.19.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rpmconf.spec ++++++ --- /var/tmp/diff_new_pack.TCQ4mC/_old 2017-05-10 20:53:33.973035149 +0200 +++ /var/tmp/diff_new_pack.TCQ4mC/_new 2017-05-10 20:53:33.981034021 +0200 @@ -1,7 +1,7 @@ # # spec file for package rpmconf # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: rpmconf -Version: 1.0.18 +Version: 1.0.19 Release: 0 Summary: Tool to handle rpmnew and rpmsave files License: GPL-3.0+ @@ -65,8 +65,8 @@ --install-scripts %{_sbindir} chmod a+x %{buildroot}%{python3_sitelib}/%{name}/%{name}.py -install -Dm 0644 %{name}.8 %{buildroot}%{_mandir}/man8/%{name}.8 -install -Dm 0644 docs/build/man/%{name}.3 %{buildroot}%{_mandir}/man3/%{name}.3 +install -Dpm 0644 %{name}.8 %{buildroot}%{_mandir}/man8/%{name}.8 +install -Dpm 0644 docs/build/man/%{name}.3 %{buildroot}%{_mandir}/man3/%{name}.3 mkdir -p %{buildroot}%{_datadir}/%{name}/ find docs/build/ -type f -name ".buildinfo" -delete -print ++++++ rpmconf-1.0.18.tar.gz -> rpmconf-1.0.19.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.18-1/.tito/packages/rpmconf new/rpmconf-rpmconf-1.0.19-1/.tito/packages/rpmconf --- old/rpmconf-rpmconf-1.0.18-1/.tito/packages/rpmconf 2016-06-24 09:41:27.000000000 +0200 +++ new/rpmconf-rpmconf-1.0.19-1/.tito/packages/rpmconf 2017-04-05 13:56:08.000000000 +0200 @@ -1 +1 @@ -1.0.18-1 ./ +1.0.19-1 ./ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.18-1/Makefile new/rpmconf-rpmconf-1.0.19-1/Makefile --- old/rpmconf-rpmconf-1.0.18-1/Makefile 2017-05-10 20:53:34.141011446 +0200 +++ new/rpmconf-rpmconf-1.0.19-1/Makefile 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -symbolic link to rel-eng/Makefile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.18-1/bin/rpmconf new/rpmconf-rpmconf-1.0.19-1/bin/rpmconf --- old/rpmconf-rpmconf-1.0.18-1/bin/rpmconf 2016-06-24 09:41:27.000000000 +0200 +++ new/rpmconf-rpmconf-1.0.19-1/bin/rpmconf 2017-04-05 13:56:08.000000000 +0200 @@ -42,6 +42,9 @@ metavar="EDITOR", help="Define which frontend should be used for merging." " For list of valid types see man page.") + 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.") parser.add_argument("-Z", dest="selinux", action="store_true", help="Display SELinux context of old and new file.") parser.add_argument("-o", "--owner", dest="owner", metavar="PACKAGE", @@ -59,7 +62,7 @@ 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) + selinux=args.selinux, test=args.test) if os.geteuid() != 0: sys.stderr.write("Most features are not useful without root privileges!!!\n") time.sleep(5) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.18-1/rpmconf/rpmconf.py new/rpmconf-rpmconf-1.0.19-1/rpmconf/rpmconf.py --- old/rpmconf-rpmconf-1.0.18-1/rpmconf/rpmconf.py 2016-06-24 09:41:27.000000000 +0200 +++ new/rpmconf-rpmconf-1.0.19-1/rpmconf/rpmconf.py 2017-04-05 13:56:08.000000000 +0200 @@ -27,16 +27,18 @@ import logging import os import pydoc -import rpm import shutil import signal import select import subprocess import sys -import termios import time import tty +#external +import rpm +import termios + __version__ = "1.0.90" #uncomment when rpm 4.13 is available #rpm.setInterruptSafety(False) @@ -56,6 +58,8 @@ :type diff: bool :param frontend: Define which frontend should be used for merging. :type frontend: str + :param test: Only test if there is some file to merge. + :type test: bool :ivar packages: :class:`list` of :class:`rpm.mi` :ivar clean: :class:`bool` :ivar diff: :class:`bool` @@ -66,7 +70,7 @@ """ def __init__(self, packages=None, clean=False, debug=False, selinux=False, - diff=False, frontend=None): + diff=False, frontend=None, test=None): trans = rpm.TransactionSet() if not packages: self.packages = [trans.dbMatch()] # pylint: disable=no-member @@ -80,16 +84,20 @@ self.frontend = frontend self.selinux = selinux self.debug = debug + self.test = test self.logger = logging.getLogger("rpmconf") self.logger.setLevel(logging.INFO) def run(self): """Main function to proceed""" + tested_files = 0 for pkg in self.packages: for pkg_hdr in pkg: - self._handle_package(pkg_hdr) + tested_files += self._handle_package(pkg_hdr) if self.clean: self._clean_orphan() + if tested_files > 0: + sys.exit(5) @staticmethod def flush_input(question): @@ -146,7 +154,7 @@ if self.is_broken_symlink(file1): fromdate = time.ctime(os.stat(file1).st_mtime) else: - fromdate = None + fromdate = "" err_msg += err_msg_template.format(file1) file1 = "/dev/null" else: @@ -156,14 +164,18 @@ if self.is_broken_symlink(file2): todate = time.ctime(os.stat(file2).st_mtime) else: - todate = None + todate = "" err_msg += err_msg_template.format(file2) file2 = "/dev/null" else: todate = time.ctime(os.stat(file2).st_mtime) try: fromlines = open(file1, "U").readlines() + if fromlines == []: + fromlines = [""] tolines = open(file2, "U").readlines() + if tolines == []: + tolines = [""] diff = difflib.unified_diff(fromlines, tolines, file1, file2, fromdate, todate) @@ -172,7 +184,11 @@ diff_out = subprocess.Popen(["/usr/bin/diff", "-u", file1, file2], stdout=subprocess.PIPE, universal_newlines=True) + # pylint: disable=redefined-variable-type diff = diff_out.communicate()[0] + if diff is None: + # read the error + diff = diff_out.communicate()[1] pydoc.pager(err_msg + "".join(diff)) @staticmethod @@ -274,6 +290,7 @@ sys.exit(4) def _handle_package(self, package): + result = 0 for conf_file in self.get_list_of_config(package): if self.diff: conf_rpmnew = "{0}.rpmnew".format(conf_file) @@ -285,14 +302,27 @@ else: tmp = "{}.{}" if os.access(tmp.format(conf_file, "rpmnew"), os.F_OK): - self._handle_rpmnew(conf_file, - tmp.format(conf_file, "rpmnew")) + if self.test: + print(tmp.format(conf_file, "rpmnew")) + result += 1 + else: + self._handle_rpmnew(conf_file, + tmp.format(conf_file, "rpmnew")) if os.access(tmp.format(conf_file, "rpmsave"), os.F_OK): - self._handle_rpmsave(conf_file, - tmp.format(conf_file, "rpmsave")) + if self.test: + print(tmp.format(conf_file, "rpmsave")) + result += 1 + else: + self._handle_rpmsave(conf_file, + tmp.format(conf_file, "rpmsave")) if os.access(tmp.format(conf_file, "rpmorig"), os.F_OK): - self._handle_rpmsave(conf_file, - tmp.format(conf_file, "rpmorig")) + if self.test: + print(tmp.format(conf_file, "rpmorig")) + result += 1 + else: + self._handle_rpmsave(conf_file, + tmp.format(conf_file, "rpmorig")) + return result def _handle_rpmnew(self, conf_file, other_file): if not (self.is_broken_symlink(conf_file) or self.is_broken_symlink(other_file)) \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.18-1/rpmconf.sgml new/rpmconf-rpmconf-1.0.19-1/rpmconf.sgml --- old/rpmconf-rpmconf-1.0.18-1/rpmconf.sgml 2016-06-24 09:41:27.000000000 +0200 +++ new/rpmconf-rpmconf-1.0.19-1/rpmconf.sgml 2017-04-05 13:56:08.000000000 +0200 @@ -41,6 +41,9 @@ <arg>-D, --diff</arg> </cmdsynopsis> <cmdsynopsis> + <arg>-t, --test</arg> + </cmdsynopsis> + <cmdsynopsis> <arg>-Z</arg> </cmdsynopsis> @@ -113,6 +116,16 @@ </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. + </para> + </listitem> + </varlistentry> <varlistentry> <term>-V, --version</term> <listitem> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.18-1/rpmconf.spec new/rpmconf-rpmconf-1.0.19-1/rpmconf.spec --- old/rpmconf-rpmconf-1.0.18-1/rpmconf.spec 2016-06-24 09:41:27.000000000 +0200 +++ new/rpmconf-rpmconf-1.0.19-1/rpmconf.spec 2017-04-05 13:56:08.000000000 +0200 @@ -1,7 +1,7 @@ Name: rpmconf Summary: Tool to handle rpmnew and rpmsave files License: GPLv3 -Version: 1.0.18 +Version: 1.0.19 Release: 1%{?dist} URL: http://wiki.github.com/xsuchy/rpmconf # source is created by: @@ -70,7 +70,7 @@ mkdir -p %{buildroot}%{_datadir}/rpmconf/ %check -python3-pylint rpmconf bin/rpmconf || : +pylint-3.6 rpmconf bin/rpmconf || : %files %license LICENSE @@ -91,6 +91,10 @@ %dir %{_datadir}/rpmconf %changelog +* Wed Apr 05 2017 Miroslav Suchý <msu...@redhat.com> 1.0.19-1 +- implement --test +- 1350249 - correctly pass /dev/null to difflib + * Fri Jun 24 2016 Miroslav Suchý <miros...@suchy.cz> 1.0.18-1 - add pylintrc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.18-1/setup.py new/rpmconf-rpmconf-1.0.19-1/setup.py --- old/rpmconf-rpmconf-1.0.18-1/setup.py 2016-06-24 09:41:27.000000000 +0200 +++ new/rpmconf-rpmconf-1.0.19-1/setup.py 2017-04-05 13:56:08.000000000 +0200 @@ -4,7 +4,7 @@ setup(name = "rpmconf", packages = ["rpmconf"], - version = "1.0.18", + version = "1.0.19", description = "Handle rpmnew and rpmsave files", author = "Igor Gnatenko", author_email = "i.gnatenko.br...@gmail.com",