[packages/rdiff-backup] - fix building with librsync 1.0+ - better handle hardlinks - rel 6

baggins baggins at pld-linux.org
Sat Apr 21 15:38:36 CEST 2018


commit 623b1ab3a1f38294d4a1f39d7277206e42d87b5c
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Apr 21 15:38:00 2018 +0200

    - fix building with librsync 1.0+
    - better handle hardlinks
    - rel 6

 hardlinks.patch   | 18 ++++++++++++++++++
 librsync.patch    | 20 ++++++++++++++++++++
 rdiff-backup.spec | 12 +++++++-----
 3 files changed, 45 insertions(+), 5 deletions(-)
---
diff --git a/rdiff-backup.spec b/rdiff-backup.spec
index 62d667e..d352701 100644
--- a/rdiff-backup.spec
+++ b/rdiff-backup.spec
@@ -3,11 +3,13 @@ Summary(hu.UTF-8):	Backup szoftver
 Summary(pl.UTF-8):	Oprogramowanie do robienia kopii zapasowych
 Name:		rdiff-backup
 Version:	1.2.8
-Release:	5
+Release:	6
 License:	GPL
 Group:		Networking/Utilities
 Source0:	http://download.savannah.gnu.org/releases-noredirect/rdiff-backup/%{name}-%{version}.tar.gz
 # Source0-md5:	1a94dc537fcf74d6a3a80bd27808e77b
+Patch0:		librsync.patch
+Patch1:		hardlinks.patch
 URL:		http://www.nongnu.org/rdiff-backup/
 BuildRequires:	librsync-devel >= 0.9.7-5
 BuildRequires:	popt-devel
@@ -56,16 +58,16 @@ różnice w stosunku do poprzedniej kopii zapasowej.
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
 
 %build
-python setup.py build
+%py_build
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-python setup.py install \
-	--optimize=2 \
-	--root=$RPM_BUILD_ROOT
+%py_install
 
 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
 
diff --git a/hardlinks.patch b/hardlinks.patch
new file mode 100644
index 0000000..40085c6
--- /dev/null
+++ b/hardlinks.patch
@@ -0,0 +1,18 @@
+diff -Nur rdiff-backup-1.2.8.orig/rdiff_backup/backup.py rdiff-backup-1.2.8/rdiff_backup/backup.py
+--- rdiff-backup-1.2.8.orig/rdiff_backup/backup.py	2009-03-16 08:36:21.000000000 -0600
++++ rdiff-backup-1.2.8/rdiff_backup/backup.py	2017-01-08 10:29:55.417206386 -0700
+@@ -555,8 +555,12 @@
+ 			elif result == 2: return 1 # SpecialFile
+ 		elif not self.patch_diff_to_temp(basis_rp, diff_rorp, new):
+ 			return 0
+-		if new.lstat() and not diff_rorp.isflaglinked():
+-			rpath.copy_attribs(diff_rorp, new)
++                if new.lstat():
++                        if diff_rorp.isflaglinked():
++                                if Globals.eas_write:
++                                        new.data['ea'] = diff_rorp.get_ea()
++                        else:
++                                rpath.copy_attribs(diff_rorp, new)
+ 		return self.matches_cached_rorp(diff_rorp, new)
+ 
+ 	def patch_hardlink_to_temp(self, diff_rorp, new):
diff --git a/librsync.patch b/librsync.patch
new file mode 100644
index 0000000..ce23c8a
--- /dev/null
+++ b/librsync.patch
@@ -0,0 +1,20 @@
+Patch by Roman Tereshonkov and Kari Hautio for rdiff-backup <= 1.2.8 to avoid a build failure with
+librsync >= 1.0.0 (which is a security bugfix release). The discussion and solution finding can be
+found at https://bugs.launchpad.net/duplicity/+bug/1416344 (for duplicity).
+
+--- rdiff-backup-1.2.8/_librsyncmodule.c			2009-03-16 15:36:21.000000000 +0100
++++ rdiff-backup-1.2.8/_librsyncmodule.c.librsync-1.0.0		2015-03-02 00:54:24.000000000 +0100
+@@ -59,8 +59,13 @@
+   if (sm == NULL) return NULL;
+   sm->x_attr = NULL;
+ 
++#ifdef RS_DEFAULT_STRONG_LEN
+   sm->sig_job = rs_sig_begin((size_t)blocklen,
+ 							 (size_t)RS_DEFAULT_STRONG_LEN);
++#else
++  sm->sig_job = rs_sig_begin((size_t)blocklen,
++							 (size_t)8, RS_MD4_SIG_MAGIC);
++#endif
+   return (PyObject*)sm;
+ }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rdiff-backup.git/commitdiff/623b1ab3a1f38294d4a1f39d7277206e42d87b5c



More information about the pld-cvs-commit mailing list