Hello community,

here is the log from the commit of package obs-service-recompress for 
openSUSE:Factory checked in at 2013-11-04 15:40:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/obs-service-recompress (Old)
 and      /work/SRC/openSUSE:Factory/.obs-service-recompress.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "obs-service-recompress"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/obs-service-recompress/obs-service-recompress.changes
    2013-10-30 15:47:39.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.obs-service-recompress.new/obs-service-recompress.changes
       2013-11-04 15:40:04.000000000 +0100
@@ -1,0 +2,6 @@
+Mon Nov  4 09:13:15 UTC 2013 - speili...@suse.com
+
+- Update to version 0.3:
+  + Don't overwrite identical files
+
+-------------------------------------------------------------------

Old:
----
  obs-service-recompress-0.2.tar.gz

New:
----
  obs-service-recompress-0.3.tar.gz

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

Other differences:
------------------
++++++ obs-service-recompress.spec ++++++
--- /var/tmp/diff_new_pack.914EEm/_old  2013-11-04 15:40:06.000000000 +0100
+++ /var/tmp/diff_new_pack.914EEm/_new  2013-11-04 15:40:06.000000000 +0100
@@ -19,7 +19,7 @@
 %define service recompress
 
 Name:           obs-service-%{service}
-Version:        0.2
+Version:        0.3
 Release:        0
 Summary:        An OBS source service: Recompress files
 License:        GPL-2.0+

++++++ obs-service-recompress-0.2.tar.gz -> obs-service-recompress-0.3.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-service-recompress-0.2/recompress 
new/obs-service-recompress-0.3/recompress
--- old/obs-service-recompress-0.2/recompress   2013-10-29 14:50:47.000000000 
+0100
+++ new/obs-service-recompress-0.3/recompress   2013-11-04 10:12:59.000000000 
+0100
@@ -90,7 +90,29 @@
 
   # do the real work
   $UNCOMPRESS "$FILE" | $COMPRESS > "$MYOUTDIR/$NEWFILE" || exit 1
-  echo "Compressed $FILE to $NEWFILE"
+
+  # Check if the (compressed) target file already exists in the directory where
+  # the service is invoked and drop the newly generated one. Avoids overwriting
+  # otherwise identical files which only have different timestamps. Note that
+  # zdiff and co all fail to do that properly...
+  if [ -f $NEWFILE ] ; then
+    DIFF_TMPDIR=$(mktemp -d)
+    SRC_DIR="$PWD"
+    cd $DIFF_TMPDIR
+    mkdir new old
+    $(cd new ; tar -xxf "$MYOUTDIR/$NEWFILE")
+    $(cd old ; tar -xxf "$SRC_DIR/$NEWFILE")
+    if diff -r new old > /dev/null ; then
+      echo "Identical target file $NEWFILE already exists, skipping.."
+      rm -r "$MYOUTDIR/$NEWFILE"
+    else
+      echo "Compressed $FILE to $NEWFILE"
+    fi
+    cd $SRC_DIR
+    rm -r $DIFF_TMPDIR
+  else
+    echo "Compressed $FILE to $NEWFILE"
+  fi
 
   # we can remove service files, no need to store them twice
   rm -f "$FILE"

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to