commit rdiff-backup for openSUSE:Factory
Hello community,
here is the log from the commit of package rdiff-backup for openSUSE:Factory checked in at 2014-05-24 07:41:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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 2014-02-16 19:55:12.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.rdiff-backup.new/rdiff-backup.changes 2014-05-24 07:41:17.000000000 +0200
@@ -1,0 +2,8 @@
+Wed Apr 23 15:17:29 UTC 2014 - hpj@urpla.net
+
+- apply rdiff-backup-dont-pick-empty-sessions.diff:
+ don't take empty sessions into account, which has the potential of
+ removing valid backups with --remove-older-than xB, while keeping
+ empty/useless sessions instead
+
+-------------------------------------------------------------------
@@ -5,0 +14,8 @@
+
+-------------------------------------------------------------------
+Thu Nov 14 14:25:53 UTC 2013 - hpj@urpla.net
+
+- fix hardlink issue: http://savannah.nongnu.org/bugs/?26848
+ - apply Joe Steeles patches to resolve it:
+ * Hardlink.py.revised-patch
+ * compare.py.patch
New:
----
Hardlink.py.revised-patch
compare.py.patch
rdiff-backup-dont-pick-empty-sessions.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rdiff-backup.spec ++++++
--- /var/tmp/diff_new_pack.Y7pEcY/_old 2014-05-24 07:41:18.000000000 +0200
+++ /var/tmp/diff_new_pack.Y7pEcY/_new 2014-05-24 07:41:18.000000000 +0200
@@ -25,10 +25,18 @@
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 -- seife+obs@b1-systems.com
Patch1: rdiff-backup-1.2.8-sparsefiles.diff
+# in order not stumble on handle hardlinks, these two patches are necessary
+# http://savannah.nongnu.org/bugs/?26848
+# PATCH-FEATURE-UPSTREAM Hardlink.py.revised-patch compare.py.patch -- hpj@urpla.net
+Patch2: Hardlink.py.revised-patch
+Patch3: compare.py.patch
+# don't take empty sessions into account, which has the potential of removing valid
+# backups with --remove-older-than xB, while keeping empty/useless sessions instead
+# patch is not upstream -- hpj@urpla.net
+Patch4: rdiff-backup-dont-pick-empty-sessions.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1210
BuildRequires: librsync-devel
@@ -64,6 +72,9 @@
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p0
+%patch3 -p0
+%patch4 -p1
%build
export CFLAGS="$RPM_OPT_FLAGS"
++++++ Hardlink.py.revised-patch ++++++
diff -u rdiff_backup/Hardlink.py rdiff_backup_rev/Hardlink.py
--- rdiff_backup/Hardlink.py 2009-03-16 10:36:21.000000000 -0400
+++ rdiff_backup_rev/Hardlink.py 2010-08-16 12:07:08.000000000 -0400
@@ -95,7 +95,13 @@
src_rorp.getnumlinks() == dest_rorp.getnumlinks() == 1):
return 1 # Hard links don't apply
- if src_rorp.getnumlinks() < dest_rorp.getnumlinks(): return 0
+ """The sha1 of linked files is only stored in the metadata of the first
+ linked file on the dest side. If the first linked file on the src side is
+ deleted, then the sha1 will also be deleted on the dest side, so we test for this
+ & report not equal so that another sha1 will be stored with the next linked
+ file on the dest side"""
+ if (not islinked(src_rorp) and not dest_rorp.has_sha1()): return 0
+ if src_rorp.getnumlinks() != dest_rorp.getnumlinks(): return 0
src_key = get_inode_key(src_rorp)
index, remaining, dest_key, digest = _inode_index[src_key]
if dest_key == "NA":
++++++ compare.py.patch ++++++
diff -u rdiff_backup/compare.py rdiff_backup_rev/compare.py
--- rdiff_backup/compare.py 2009-03-16 10:36:21.000000000 -0400
+++ rdiff_backup_rev/compare.py 2009-06-19 19:31:10.000000000 -0400
@@ -25,7 +25,7 @@
"""
from __future__ import generators
-import Globals, restore, rorpiter, log, backup, static, rpath, hash, robust
+import Globals, restore, rorpiter, log, backup, static, rpath, hash, robust, Hardlink
def Compare(src_rp, mirror_rp, inc_rp, compare_time):
"""Compares metadata in src_rp dir with metadata in mirror_rp at time"""
@@ -80,14 +80,15 @@
bad_files = 0
for repo_rorp in repo_iter:
if not repo_rorp.isreg(): continue
- if not repo_rorp.has_sha1():
+ verify_sha1 = get_hash(repo_rorp)
+ if not verify_sha1:
log.Log("Warning: Cannot find SHA1 digest for file %s,\n"
"perhaps because this feature was added in v1.1.1"
% (repo_rorp.get_indexpath(),), 2)
continue
fp = RepoSide.rf_cache.get_fp(base_index + repo_rorp.index, repo_rorp)
computed_hash = hash.compute_sha1_fp(fp)
- if computed_hash == repo_rorp.get_sha1():
+ if computed_hash == verify_sha1:
log.Log("Verified SHA1 digest of " + repo_rorp.get_indexpath(), 5)
else:
bad_files += 1
@@ -95,11 +96,24 @@
"doesn't match recorded digest of\n %s\n"
"Your backup repository may be corrupted!" %
(repo_rorp.get_indexpath(), computed_hash,
- repo_rorp.get_sha1()), 2)
+ verify_sha1), 2)
RepoSide.close_rf_cache()
if not bad_files: log.Log("Every file verified successfully.", 3)
return bad_files
+def get_hash (repo_rorp):
+ """ Try to get a sha1 digest from the repository. If hardlinks
+ are saved in the metadata, get the sha1 from the first hardlink """
+ Hardlink.add_rorp(repo_rorp)
+ if Hardlink.islinked(repo_rorp):
+ verify_sha1 = Hardlink.get_sha1(repo_rorp)
+ elif repo_rorp.has_sha1():
+ verify_sha1 = repo_rorp.get_sha1()
+ else:
+ verify_sha1 = None
+ Hardlink.del_rorp(repo_rorp)
+ return verify_sha1
+
def print_reports(report_iter):
"""Given an iter of CompareReport objects, print them to screen"""
assert not Globals.server
@@ -199,12 +213,13 @@
"""Like above, but also compare sha1 sums of any regular files"""
def hashes_changed(src_rp, mir_rorp):
"""Return 0 if their data hashes same, 1 otherwise"""
- if not mir_rorp.has_sha1():
+ verify_sha1 = get_hash(mir_rorp)
+ if not verify_sha1:
log.Log("Warning: Metadata file has no digest for %s, "
"unable to compare." % (mir_rorp.get_indexpath(),), 2)
return 0
elif (src_rp.getsize() == mir_rorp.getsize() and
- hash.compute_sha1(src_rp) == mir_rorp.get_sha1()):
+ hash.compute_sha1(src_rp) == verify_sha1):
return 0
return 1
++++++ rdiff-backup-dont-pick-empty-sessions.diff ++++++
Subject: Don't pick empty sessions
From: Hans-Peter Jansen
participants (1)
-
root@hilbert.suse.de