Hello community,

here is the log from the commit of package rdiff-backup for openSUSE:Factory 
checked in at 2014-02-16 19:55:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rdiff-backup (Old)
 and      /work/SRC/openSUSE:Factory/.rdiff-backup.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rdiff-backup"

Changes:
--------
--- /work/SRC/openSUSE:Factory/rdiff-backup/rdiff-backup.changes        
2013-08-24 10:14:20.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.rdiff-backup.new/rdiff-backup.changes   
2014-02-16 19:55:12.000000000 +0100
@@ -1,0 +2,6 @@
+Fri Feb 14 13:56:13 UTC 2014 - [email protected]
+
+- add rdiff-backup-1.2.8-sparsefiles.diff to efficiently back up
+  sparse files (found on rdiff-backup mailing list)
+
+-------------------------------------------------------------------

New:
----
  rdiff-backup-1.2.8-sparsefiles.diff

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

Other differences:
------------------
++++++ rdiff-backup.spec ++++++
--- /var/tmp/diff_new_pack.mpLi62/_old  2014-02-16 19:55:13.000000000 +0100
+++ /var/tmp/diff_new_pack.mpLi62/_new  2014-02-16 19:55:13.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rdiff-backup
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,10 @@
 Url:            http://www.nongnu.org/rdiff-backup/
 Source0:        
http://savannah.nongnu.org/download/rdiff-backup/%{name}-%{version}.tar.bz2
 Patch0:         rdiff-backup-fix-deprecations.diff
+#
+# well, upstream is apparently dead, but I found this patch on the upstream 
mailing list.
+# PATCH-FEATURE-UPSTREAM rdiff-backup-1.2.8-sparsefiles.diff -- 
[email protected]
+Patch1:         rdiff-backup-1.2.8-sparsefiles.diff
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %if 0%{?suse_version} > 1210
 BuildRequires:  librsync-devel
@@ -59,6 +63,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 export CFLAGS="$RPM_OPT_FLAGS"

++++++ rdiff-backup-1.2.8-sparsefiles.diff ++++++
Author: Eric Wheeler
Found-Where: 
http://lists.gnu.org/archive/html/rdiff-backup-users/2011-01/msg00000.html
Found-By: Stefan Seyfried <[email protected]>

Efficiently back up sparse files

Index: b/rdiff_backup/rpath.py
===================================================================
--- a/rdiff_backup/rpath.py
+++ b/rdiff_backup/rpath.py
@@ -56,14 +56,48 @@ class SkipFileException(Exception):
 class RPathException(Exception): pass
 
 def copyfileobj(inputfp, outputfp):
        """Copies file inputfp to outputfp in blocksize intervals"""
        blocksize = Globals.blocksize
+
+       sparse = False
+       buf = None
        while 1:
                inbuf = inputfp.read(blocksize)
                if not inbuf: break
-               outputfp.write(inbuf)
+
+               if not buf: 
+                       buf = inbuf
+               else:
+                       buf += inbuf
+
+               # Combine "short" reads
+               if (len(buf) < blocksize):
+                       continue
+
+               buflen = len(buf)
+               if buf == "\x00" * buflen:
+                       outputfp.seek(buflen, os.SEEK_CUR)
+                       buf = None
+                       # flag sparse=True, that we seek()ed, but have not 
written yet
+                       # The filesize is wrong until we write
+                       sparse = True 
+               else:
+                       outputfp.write(buf)
+                       buf = None
+
+                       # We wrote, so clear sparse.
+                       sparse = False
+
+       
+       if buf:
+               outputfp.write(buf)
+               buf = None
+
+       elif sparse:
+               outputfp.seek(-1, os.SEEK_CUR)
+               outputfp.write("\x00")
 
 def cmpfileobj(fp1, fp2):
        """True if file objects fp1 and fp2 contain same data"""
        blocksize = Globals.blocksize
        while 1:
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to