Hello community,

here is the log from the commit of package rpmconf for openSUSE:Factory checked 
in at 2015-12-01 09:19:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-11-26 
17:04:36.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.rpmconf.new/rpmconf.changes     2015-12-01 
09:19:19.000000000 +0100
@@ -1,0 +2,6 @@
+Sat Nov 28 19:39:30 UTC 2015 - sor.ale...@meowr.ru
+
+- Update to 1.0.15:
+  * Handle broken symlinks.
+
+-------------------------------------------------------------------

Old:
----
  rpmconf-1.0.14.tar.gz

New:
----
  rpmconf-1.0.15.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rpmconf.spec ++++++
--- /var/tmp/diff_new_pack.jjqhCX/_old  2015-12-01 09:19:20.000000000 +0100
+++ /var/tmp/diff_new_pack.jjqhCX/_new  2015-12-01 09:19:20.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           rpmconf
-Version:        1.0.14
+Version:        1.0.15
 Release:        0
 Summary:        Tool to handle rpmnew and rpmsave files
 License:        GPL-3.0+

++++++ rpmconf-1.0.14.tar.gz -> rpmconf-1.0.15.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpmconf-rpmconf-1.0.14-1/rel-eng/packages/rpmconf 
new/rpmconf-rpmconf-1.0.15-1/rel-eng/packages/rpmconf
--- old/rpmconf-rpmconf-1.0.14-1/rel-eng/packages/rpmconf       2015-11-24 
11:01:18.000000000 +0100
+++ new/rpmconf-rpmconf-1.0.15-1/rel-eng/packages/rpmconf       2015-11-27 
09:11:57.000000000 +0100
@@ -1 +1 @@
-1.0.14-1 ./
+1.0.15-1 ./
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpmconf-rpmconf-1.0.14-1/rel-eng/releasers.conf 
new/rpmconf-rpmconf-1.0.15-1/rel-eng/releasers.conf
--- old/rpmconf-rpmconf-1.0.14-1/rel-eng/releasers.conf 2015-11-24 
11:01:18.000000000 +0100
+++ new/rpmconf-rpmconf-1.0.15-1/rel-eng/releasers.conf 2015-11-27 
09:11:57.000000000 +0100
@@ -10,6 +10,10 @@
 releaser = tito.release.FedoraGitReleaser
 branches = f22
 
+[fedora-f23]
+releaser = tito.release.FedoraGitReleaser
+branches = f23
+
 [epel]
 releaser = tito.release.FedoraGitReleaser
 branches = el6 epel7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpmconf-rpmconf-1.0.14-1/rpmconf/rpmconf.py 
new/rpmconf-rpmconf-1.0.15-1/rpmconf/rpmconf.py
--- old/rpmconf-rpmconf-1.0.14-1/rpmconf/rpmconf.py     2015-11-24 
11:01:18.000000000 +0100
+++ new/rpmconf-rpmconf-1.0.15-1/rpmconf/rpmconf.py     2015-11-27 
09:11:57.000000000 +0100
@@ -131,8 +131,7 @@
                 result.append(rpm_file[0])
         return result
 
-    @staticmethod
-    def show_diff(file1, file2):
+    def show_diff(self, file1, file2):
         """Show differences between two files.
 
         :param file1: Path to first file
@@ -141,8 +140,24 @@
         :type file2: str
 
         """
-        fromdate = time.ctime(os.stat(file1).st_mtime)
-        todate = time.ctime(os.stat(file2).st_mtime)
+        err_msg_template = "Warning: file {} is broken symlink. I'm using 
/dev/null instead.\n"
+        err_msg = ""
+        if os.path.islink(file1):
+            err_msg += "Info: '{0}' is symlink to '{1}'.\n".format(file1, 
os.readlink(file1))
+            if self.is_broken_symlink(file1):
+                fromdate = time.ctime(os.stat(file1).st_mtime)
+            else:
+                fromdate = None
+                err_msg += err_msg_template.format(file1)
+                file1 = "/dev/null"
+        if os.path.islink(file2):
+            err_msg += "Info: '{0}' is symlink to '{1}'.\n".format(file2, 
os.readlink(file2))
+            if self.is_broken_symlink(file2):
+                todate = time.ctime(os.stat(file2).st_mtime)
+            else:
+                todate = None
+                err_msg += err_msg_template.format(file2)
+                file2 = "/dev/null"
         try:
             fromlines = open(file1, "U").readlines()
             tolines = open(file2, "U").readlines()
@@ -155,12 +170,17 @@
                                         stdout=subprocess.PIPE,
                                         universal_newlines=True)
             diff = diff_out.communicate()[0]
-        pydoc.pager("".join(diff))
+        pydoc.pager(err_msg + "".join(diff))
+
+    @staticmethod
+    def is_broken_symlink(file1):
+        """ Returns true if file is broken symlink. False otherwise. """
+        #pylint: disable=no-member
+        return os.path.islink(file1) and os.path.exists(file1)
 
-    @classmethod
-    def _show_cond_diff(cls, file_ex, file1, file2):
+    def _show_cond_diff(self, file_ex, file1, file2):
         if os.path.lexists(file_ex):
-            cls.show_diff(file1, file2)
+            self.show_diff(file1, file2)
 
     @staticmethod
     def _copy(src, dst):
@@ -272,7 +292,8 @@
                                          tmp.format(conf_file, "rpmorig"))
 
     def _handle_rpmnew(self, conf_file, other_file):
-        if filecmp.cmp(conf_file, other_file):
+        if not (self.is_broken_symlink(conf_file) or 
self.is_broken_symlink(other_file)) \
+            and filecmp.cmp(conf_file, other_file):
             self._remove(other_file)
             return
 
@@ -318,7 +339,8 @@
             self._overwrite(other_file, conf_file)
 
     def _handle_rpmsave(self, conf_file, other_file):
-        if filecmp.cmp(conf_file, other_file):
+        if not (self.is_broken_symlink(conf_file) or 
self.is_broken_symlink(other_file)) \
+            and filecmp.cmp(conf_file, other_file):
             self._remove(other_file)
             return
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpmconf-rpmconf-1.0.14-1/rpmconf.spec 
new/rpmconf-rpmconf-1.0.15-1/rpmconf.spec
--- old/rpmconf-rpmconf-1.0.14-1/rpmconf.spec   2015-11-24 11:01:18.000000000 
+0100
+++ new/rpmconf-rpmconf-1.0.15-1/rpmconf.spec   2015-11-27 09:11:57.000000000 
+0100
@@ -1,7 +1,7 @@
 Name:           rpmconf
 Summary:        Tool to handle rpmnew and rpmsave files
 License:        GPLv3
-Version:        1.0.14
+Version:        1.0.15
 Release:        1%{?dist}
 URL:            http://wiki.github.com/xsuchy/rpmconf
 # source is created by:
@@ -92,6 +92,9 @@
 %dir %{_datadir}/rpmconf
 
 %changelog
+* Fri Nov 27 2015 Miroslav Suchý <msu...@redhat.com> 1.0.15-1
+- 1277025 - handle broken symlinks
+
 * Tue Nov 24 2015 Miroslav Suchý <miros...@suchy.cz> 1.0.14-1
 - we use utf8
 - call python3 directly
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rpmconf-rpmconf-1.0.14-1/setup.py 
new/rpmconf-rpmconf-1.0.15-1/setup.py
--- old/rpmconf-rpmconf-1.0.14-1/setup.py       2015-11-24 11:01:18.000000000 
+0100
+++ new/rpmconf-rpmconf-1.0.15-1/setup.py       2015-11-27 09:11:57.000000000 
+0100
@@ -4,7 +4,7 @@
 
 setup(name = "rpmconf",
       packages = ["rpmconf"],
-      version = "1.0.14",
+      version = "1.0.15",
       description = "Handle rpmnew and rpmsave files",
       author = "Igor Gnatenko",
       author_email = "i.gnatenko.br...@gmail.com",


Reply via email to