Hello community, here is the log from the commit of package rpmconf for openSUSE:Factory checked in at 2015-06-05 08:46:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rpmconf (Old) and /work/SRC/openSUSE:Factory/.rpmconf.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rpmconf" Changes: -------- --- /work/SRC/openSUSE:Factory/rpmconf/rpmconf.changes 2015-01-15 15:59:22.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rpmconf.new/rpmconf.changes 2015-06-05 08:46:09.000000000 +0200 @@ -1,0 +2,11 @@ +Tue Jun 4 11:03:12 UTC 2015 - [email protected] + +- Update to 1.0.9 (changes since 1.0.7): + * pylint: let the logger expand params. + * 1226591 - do not flush stdin, when it is not TTY. + * Use RPM Python API to get package name of file. + * Minor fixes. +- Change group of python3-rpmconf-doc to Documentation/HTML. +- Suggest diffuse, kdiff3, meld, vim as mainstream does. + +------------------------------------------------------------------- Old: ---- rpmconf-1.0.7-1.tar.gz New: ---- rpmconf-1.0.9-1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rpmconf.spec ++++++ --- /var/tmp/diff_new_pack.TBNpIu/_old 2015-06-05 08:46:10.000000000 +0200 +++ /var/tmp/diff_new_pack.TBNpIu/_new 2015-06-05 08:46:10.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package rpmconf # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 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.7 +Version: 1.0.9 Release: 0 Summary: Tool to handle rpmnew and rpmsave files License: GPL-3.0+ @@ -31,6 +31,10 @@ BuildRequires: python3-rpm Requires: python3-%{name} Requires: python3-rpm +Suggests: diffuse +Suggests: kdiff3 +Suggests: meld +Suggests: vim BuildArch: noarch %description @@ -39,22 +43,21 @@ Keep current version, place back old version, watch the diff or merge. %package -n python3-%{name} -Summary: Python interface of rpmconf +Summary: Python interface for rpmconf Group: Development/Languages/Python %description -n python3-%{name} -Python interface of rpmconf. +Python interface for rpmconf and an essential part of rpmconf. %package -n python3-%{name}-doc Summary: Documentation of python interface for rpmconf -Group: Development/Languages/Python +Group: Documentation/HTML %description -n python3-%{name}-doc -Documentation generated from code of python3-rpmconf. +Documentation in HTML generated from code of python3-rpmconf. %prep %setup -q -n %{name}-%{name}-%{version}-1 -sed -i 's|%{_bindir}/rpm|/bin/rpm|g' %{name}/%{name}.py sed -i 's/\(SPHINXBUILD \+= \+\).*$/\1sphinx-build-%{py3_ver}/g' docs/Makefile %build @@ -70,21 +73,22 @@ install -Dm 0644 %{name}.8 %{buildroot}%{_mandir}/man8/%{name}.8 install -Dm 0644 docs/build/man/%{name}.3 %{buildroot}%{_mandir}/man3/%{name}.3 mkdir -p %{buildroot}%{_datadir}/%{name}/ -find %{buildroot}%{_datadir} -type f -name ".buildinfo" -delete -print +find docs +find docs/build/ -type f -name ".buildinfo" -delete -print %files %defattr(-,root,root) %doc LICENSE README TODO -%dir %{_datadir}/%{name}/ %{_sbindir}/%{name} -%{_mandir}/man8/%{name}.8* +%dir %{_datadir}/%{name}/ +%{_mandir}/man8/%{name}.8%{?ext_man} %files -n python3-%{name} %defattr(-,root,root) %doc LICENSE README TODO %{python3_sitelib}/%{name}/ %{python3_sitelib}/%{name}-*.egg-info -%{_mandir}/man3/%{name}.3* +%{_mandir}/man3/%{name}.3%{?ext_man} %files -n python3-%{name}-doc %defattr(-,root,root) ++++++ rpmconf-1.0.7-1.tar.gz -> rpmconf-1.0.9-1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.7-1/README new/rpmconf-rpmconf-1.0.9-1/README --- old/rpmconf-rpmconf-1.0.7-1/README 2015-01-12 11:55:27.000000000 +0100 +++ new/rpmconf-rpmconf-1.0.9-1/README 2015-06-01 11:44:06.000000000 +0200 @@ -3,7 +3,7 @@ What it does: - run "rpmconf --help" and you will see :) -- it search all config file of all installed packages and check if file with .rpmsave or .rpmnew exists. +- 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 @@ -11,7 +11,7 @@ - it can search for all orphaned rpmsave and rpmnew files. - it can dump diffs for unattended automation. -I provide only .zip and .tar.gz (automagicaly generated by GitHub) and .src.rpm. +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: @@ -75,7 +75,7 @@ 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 formating as I hope that sysadmins appreciate unified UI in Debian and Fedora. +strings and formatting as I hope that sysadmins appreciate unified UI in Debian and Fedora. License: GPLv3 Author: Miroslav Suchy <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.7-1/rel-eng/packages/rpmconf new/rpmconf-rpmconf-1.0.9-1/rel-eng/packages/rpmconf --- old/rpmconf-rpmconf-1.0.7-1/rel-eng/packages/rpmconf 2015-01-12 11:55:27.000000000 +0100 +++ new/rpmconf-rpmconf-1.0.9-1/rel-eng/packages/rpmconf 2015-06-01 11:44:06.000000000 +0200 @@ -1 +1 @@ -1.0.7-1 ./ +1.0.9-1 ./ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.7-1/rpmconf/rpmconf new/rpmconf-rpmconf-1.0.9-1/rpmconf/rpmconf --- old/rpmconf-rpmconf-1.0.7-1/rpmconf/rpmconf 2015-01-12 11:55:27.000000000 +0100 +++ new/rpmconf-rpmconf-1.0.9-1/rpmconf/rpmconf 1970-01-01 01:00:00.000000000 +0100 @@ -1,302 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2009 Red Hat, Inc. -# -# This software is licensed to you under the GNU General Public License, -# version 3 (GPLv3). There is NO WARRANTY for this software, express or -# implied, including the implied warranties of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv3 -# along with this software; if not, see -# http://www.gnu.org/licenses/gpl-3.0.txt. -# -# Red Hat trademarks are not licensed under GPLv3. No permission is -# granted to use or replicate Red Hat trademarks that are incorporated -# in this software or its documentation. -# - -DEBUG='' -#uncomment this line if you do not want really remove your files. -#DEBUG="echo DEBUG:" - -SELINUX='' - -MERGE_TYPE='None' - -print_help () { - cat <<HELP -usage: rpmconf [options] - -options: - -a, --all - Check configuration files of all packages. - -opackage, --owner=package - Check only configuration files of given package. - -ftype, --frontend=type - Define which frontend should be used for merging. - For list of valid types see man page. - -c, --clean - Find and delete orphaned .rpmnew and .rpmsave files. - -d, --debug - Dry run. Just show which file will be deleted. - -D, --diff - Non-interactive diff mode. Useful to audit configs. - Use with -a or -o options. - -V, --version - Display rpmconf version. - -Z - Display SELinux context of old and new file. -HELP - exit -} - -function toUpper { - echo $1 | tr "[:lower:]" "[:upper:]" -} - -function push_to_PACKAGE { - PACKAGE[${#PACKAGE[@]}]=$1 -} - -function show_diff { - old_file=$1 - new_file=$2 - if [ "$MODE" = "diff" ]; then - diff -u "$old_file" "$new_file" - else - diff -u "$old_file" "$new_file" | less - fi -} - -function validate_merge_type { - which $1 &>/dev/null || ( - echo "Error: $1 is not installed" - exit 1 - ) -} -function merge_conf_files { - CONF_FILE=$1 - OTHER_FILE=$2 - - case $MERGE_TYPE in - # vimdiff, gvimdiff, meld return 0 even if file was not saved - # we may handle it some way. check last modification? ask user? - vimdiff) vimdiff "$CONF_FILE" "$OTHER_FILE"; $DEBUG rm "$OTHER_FILE";; - gvimdiff) gvimdiff "$CONF_FILE" "$OTHER_FILE"; $DEBUG rm "$OTHER_FILE";; - diffuse) diffuse "$CONF_FILE" "$OTHER_FILE"; $DEBUG rm "$OTHER_FILE";; - kdiff3) kdiff3 "$CONF_FILE" "$OTHER_FILE" -o "$CONF_FILE" && $DEBUG rm "$OTHER_FILE" "${CONF_FILE}.orig";; - meld) meld "$CONF_FILE" "$OTHER_FILE"; $DEBUG rm "$OTHER_FILE";; - None) echo Error: you did not selected any frontend for merge.; exit 2;; - *) echo Error: Invalid option $1; exit 2;; - esac - -} - -function handle_rpmnew { - CONF_FILE=$1 - OTHER_FILE=$2 - if diff "$CONF_FILE" "$OTHER_FILE" &>/dev/null; then - $DEBUG rm "$OTHER_FILE" - return - fi - OPTION="" - while [ "$OPTION" != "Y" -a "$OPTION" != "I" -a "$OPTION" != "N" -a "$OPTION" != "O" -a "$OPTION" != "M" -a "$OPTION" != "S" ]; do - echo "Configuration file \`$CONF_FILE'" - ls -ltrd $SELINUX "$CONF_FILE" "$OTHER_FILE" - cat <<ASK - ==> 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 - N or O : keep your currently-installed version - D : show the differences between the versions - M : merge configuration files - Z : background this process to examine the situation - S : skip this file - The default action is to keep your current version. -*** aliases (Y/I/N/O/D/Z/S) [default=N] ? -ASK - read -u 1 -p "Your choice: " OPTION - RC=$? - if [ $RC -ne 0 ]; then - OPTION="S" - elif [ "$OPTION" = "" ]; then - OPTION="N" - fi - OPTION=`toUpper "$OPTION"` - if [ "$OPTION" = "D" ]; then - show_diff "$CONF_FILE" "$OTHER_FILE" - elif [ "$OPTION" = "Z" ]; then - kill -STOP $$ - fi - done - if [ "$OPTION" = "N" -o "$OPTION" = "O" ]; then - $DEBUG rm "$OTHER_FILE" - elif [ "$OPTION" = "Y" -o "$OPTION" = "I" ]; then - $DEBUG cp --no-dereference "$OTHER_FILE" "$CONF_FILE" \ - && $DEBUG rm "$OTHER_FILE" - elif [ "$OPTION" = "M" ]; then - merge_conf_files "$CONFFILE" "$OTHER_FILE" - fi -} - -function handle_rpmsave { - CONF_FILE=$1 - OTHER_FILE=$2 - if diff "$CONF_FILE" "$OTHER_FILE" &>/dev/null; then - $DEBUG rm "$OTHER_FILE" - return - fi - OPTION="" - while [ "$OPTION" != "Y" -a "$OPTION" != "I" -a "$OPTION" != "N" -a "$OPTION" != "O" -a "$OPTION" != "M" -a "$OPTION" != "S" ]; do - echo "Configuration file \`$CONF_FILE'" - ls -ltrd $SELINUX "$CONF_FILE" "$OTHER_FILE" - cat <<ASK - ==> 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: - Y or I : install (keep) the package maintainer's version - N or O : return back to your original file - D : show the differences between the versions - M : merge configuration files - Z : background this process to examine the situation - S : skip this file - The default action is to keep package maintainer's version. -*** aliases (Y/I/N/O/D/Z/S) [default=Y] ? -ASK - read -u 1 -p "Your choice: " OPTION - RC=$? - if [ $RC -ne 0 ]; then - OPTION="S" - elif [ "$OPTION" = "" ]; then - OPTION="Y" - fi - OPTION=`toUpper "$OPTION"` - if [ "$OPTION" = "D" ]; then - show_diff "$OTHER_FILE" "$CONF_FILE" - elif [ "$OPTION" = "Z" ]; then - kill -STOP $$ - elif [ "$OPTION" = "M" ]; then - merge_conf_files "$CONFFILE" "$OTHER_FILE" - fi - done - if [ "$OPTION" = "N" -o "$OPTION" = "O" ]; then - $DEBUG cp --no-dereference "$OTHER_FILE" "$CONF_FILE" \ - && $DEBUG rm "$OTHER_FILE" - elif [ "$OPTION" = "Y" -o "$OPTION" = "I" ]; then - $DEBUG rm "$OTHER_FILE" - elif [ "$OPTION" = "M" ]; then - merge_conf_files "$CONFFILE" "$OTHER_FILE" - fi -} - -function handle_packages { - PACKAGE=$1 - for CONFFILE in `LANG= rpm -qc $PACKAGE |grep -v '(contains no files)'`; do - if [ "$MODE" = "diff" ]; then - # Non-interactive diff mode. - [ -f "$CONFFILE.rpmnew" ] && show_diff "$CONFFILE" "$CONFFILE.rpmnew" - [ -f "$CONFFILE.rpmsave" ] && show_diff "$CONFFILE.rpmsave" "$CONFFILE" - [ -f "$CONFFILE.rpmorig" ] && show_diff "$CONFFILE.rpmorig" "$CONFFILE" - else - if [ -f "$CONFFILE.rpmnew" ]; then - handle_rpmnew "$CONFFILE" "$CONFFILE.rpmnew" - fi - if [ -f $CONFFILE.rpmsave ]; then - handle_rpmsave "$CONFFILE" "$CONFFILE.rpmsave" - fi - if [ -f $CONFFILE.rpmorig ]; then - handle_rpmsave "$CONFFILE" "$CONFFILE.rpmorig" - fi - fi - done -} - -function configure_packages { - PACKAGE=$1 - if [ "$PACKAGE" = "-a" ]; then - # this is faster then getting list of all packages and looping through - for FILE in /usr/share/rpmconf/*; do - rpm -qf $FILE >/dev/null 2>/dev/null && $FILE - done - elif [ -x /usr/share/rpmconf/$PACKAGE ]; then - /usr/share/rpmconf/$PACKAGE - fi -} - -function clean_orphan { - FILES_MERGE=$(mktemp --tmpdir --suffix=.merge rpmconf.XXXXXXXXXX) - FILES_DELETE=$(mktemp --tmpdir --suffix=.delete rpmconf.XXXXXXXXXX) - find /etc /var /usr -name '*.rpmnew' -o -name '*.rpmsave' | \ - while read rpmnew_rpmsave; do - rpmnew_rpmsave_orig=$(echo $rpmnew_rpmsave | sed 's/\(\.rpmnew\)\|\(\.rpmsave\)//g') - if rpm -qf $rpmnew_rpmsave_orig >/dev/null 2>&1; then - echo -e $(rpm -qf $rpmnew_rpmsave_orig --qf '%{name}') "\t\t$rpmnew_rpmsave" >> $FILES_MERGE - else - echo $rpmnew_rpmsave >> $FILES_DELETE - fi - done - if [ -s $FILES_MERGE ]; then - echo "These files need merging - you may want to run 'rpmconf -a':" - cat $FILES_MERGE - echo "Skipping files above." - echo - rm -f $FILES_MERGE - fi - if [ -s $FILES_DELETE ]; then - echo "Orphaned .rpmnew and .rpmsave files:" - cat $FILES_DELETE - read -u 1 -p "Delete these files (Y/n): " OPTION - RC=$? - if [ $RC -eq 0 ]; then - OPTION=$(toUpper "$OPTION") - if [ "$OPTION" = "Y" -o "$OPTION" = "" ]; then - cat $FILES_DELETE | cut -f2 -d' ' | xargs $DEBUG rm -f - fi - rm -f $FILES_DELETE - fi - fi -} - -if [ $# -eq 0 ]; then - print_help; -fi -unset PACKAGE -while [ $# -ge 1 ]; do - case $1 in - --help | -h) print_help;; - --diff | -D) MODE="diff";; - -o*) push_to_PACKAGE $(echo $1 | cut -c3-);; - --owner=*) push_to_PACKAGE $(echo $1 | cut -d= -f2-);; - --all | -a) push_to_PACKAGE '-a';; - --debug | -d) DEBUG="echo DEBUG:";; - --version | -V) rpm -q rpmconf; exit;; - -f*) MERGE_TYPE=$(echo $1 | cut -c3-);; - --frontend=*) MERGE_TYPE=$(echo $1 | cut -d= -f2-);; - --clean | -c) clean_orphan;; - -Z) SELINUX="--lcontext";; - *) echo Error: Invalid option $1; exit; - esac - shift -done - -case $MERGE_TYPE in - None) ;; - vimdiff) validate_merge_type vimdiff || exit;; - gvimdiff) validate_merge_type gvimdiff || exit;; - diffuse) validate_merge_type diffuse || exit;; - kdiff3) validate_merge_type kdiff3 || exit;; - meld) validate_merge_type meld || exit;; - *) cat <<ERROR; exit;; -Error: Invalid frontend for merge: $MERGE_TYPE -See man page for valid list of frontends -ERROR -esac - -for P in ${PACKAGE[@]}; do - handle_packages $P -done - -for P in ${PACKAGE[@]}; do - configure_packages $P -done - -exit 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.7-1/rpmconf/rpmconf.py new/rpmconf-rpmconf-1.0.9-1/rpmconf/rpmconf.py --- old/rpmconf-rpmconf-1.0.7-1/rpmconf/rpmconf.py 2015-01-12 11:55:27.000000000 +0100 +++ new/rpmconf-rpmconf-1.0.9-1/rpmconf/rpmconf.py 2015-06-01 11:44:06.000000000 +0200 @@ -99,7 +99,8 @@ :rtype: str """ - tcflush(sys.stdin, TCIOFLUSH) + if os.isatty(sys.stdin.fileno()): + tcflush(sys.stdin, TCIOFLUSH) return input(question) @staticmethod @@ -340,13 +341,13 @@ # rpmnew_rpmsave is lowercase name of rpmnew/rpmsave file (rpmnew_rpmsave_orig, _) = os.path.splitext(rpmnew_rpmsave) package_merge = file_delete = None - try: - package_merge = subprocess.check_output( - ["/usr/bin/rpm", '-qf', - rpmnew_rpmsave_orig, '--qf', '%{name}'], - universal_newlines=True, stderr=subprocess.DEVNULL) - except subprocess.CalledProcessError: + trans = rpm.TransactionSet() + # pylint: disable=no-member + tmp_db = trans.dbMatch("basenames", rpmnew_rpmsave_orig) + if tmp_db.count() == 0: file_delete = rpmnew_rpmsave + else: + package_merge = tmp_db.__next__().Name return ([package_merge, rpmnew_rpmsave_orig, rpmnew_rpmsave], file_delete) @@ -354,7 +355,7 @@ files_merge = [] files_delete = [] for topdir in ["/etc", "/var", "/usr"]: - self.logger.info("Seaching through: {}".format(topdir)) + 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.7-1/rpmconf.spec new/rpmconf-rpmconf-1.0.9-1/rpmconf.spec --- old/rpmconf-rpmconf-1.0.7-1/rpmconf.spec 2015-01-12 11:55:27.000000000 +0100 +++ new/rpmconf-rpmconf-1.0.9-1/rpmconf.spec 2015-06-01 11:44:06.000000000 +0200 @@ -1,7 +1,7 @@ Name: rpmconf Summary: Tool to handle rpmnew and rpmsave files License: GPLv3 -Version: 1.0.7 +Version: 1.0.9 Release: 1%{?dist} URL: http://wiki.github.com/xsuchy/rpmconf # source is created by: @@ -12,12 +12,20 @@ BuildRequires: docbook-utils BuildRequires: docbook-dtd31-sgml BuildRequires: python3-sphinx -BuildRequires: python3-pylint BuildRequires: python3-devel Requires: %{name}-base Requires: python3-rpmconf Requires: rpm-python3 BuildRequires: rpm-python3 +#check +BuildRequires: python3-pylint +BuildRequires: python3-six +# mergetools +Suggests: diffuse +Suggests: kdiff3 +Suggests: meld +Suggests: vim-X11 +Suggests: vim-enhanced %description This tool search for .rpmnew, .rpmsave and .rpmorig files and ask you what to do @@ -84,6 +92,16 @@ %dir %{_datadir}/rpmconf %changelog +* Mon Jun 01 2015 Miroslav Suchý <[email protected]> 1.0.9-1 +- pylint: let the logger expand params +- use soft deps + +* Mon Jun 01 2015 Miroslav Suchý <[email protected]> 1.0.8-1 +- 1226591 - do not flush stdin, when it is not TTY +- BR python3-six +- minor fixes +- use RPM Python API to get package name of file + * Mon Jan 12 2015 Miroslav Suchý <[email protected]> 1.0.7-1 - correctly reference tar.gz - add / before usr/bin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmconf-rpmconf-1.0.7-1/setup.py new/rpmconf-rpmconf-1.0.9-1/setup.py --- old/rpmconf-rpmconf-1.0.7-1/setup.py 2015-01-12 11:55:27.000000000 +0100 +++ new/rpmconf-rpmconf-1.0.9-1/setup.py 2015-06-01 11:44:06.000000000 +0200 @@ -4,7 +4,7 @@ setup(name = "rpmconf", packages = ["rpmconf"], - version = "1.0.7", + version = "1.0.9", description = "Handle rpmnew and rpmsave files", author = "Igor Gnatenko", author_email = "[email protected]",
