Control: tags -1 -moreinfo On Aug 29 2015, "Adam D. Barratt" <a...@adam-barratt.org.uk> wrote: > Control: tags -1 + moreinfo > > On Tue, 2015-08-25 at 19:29 -0700, Nikolaus Rath wrote: >> Would it be acceptible to upload a fix for #792685 to jessie? >> >> In short, the S3QL version currently in jessie is unable to read file >> system created with the S3QL version in wheezy. All stored data thus >> becomes inaccessible unless one installs an intermediate version (that >> is currently not available in Debian). >> >> The proposed patch forward-ports the necessary capability from an >> intermediate S3QL version. >> >> An update package can be downloaded from >> http://mentors.debian.net/debian/pool/main/s/s3ql/s3ql_2.11.1+dfsg-3.dsc > > Can we have a debdiff of the proposed package against the s3ql version > currently in Jessie, please?
Here it is. Best, -Nikolaus -- GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F »Time flies like an arrow, fruit flies like a Banana.«
diff -Nru s3ql-2.11.1+dfsg/debian/changelog s3ql-2.11.1+dfsg/debian/changelog --- s3ql-2.11.1+dfsg/debian/changelog 2014-12-02 21:59:11.000000000 -0800 +++ s3ql-2.11.1+dfsg/debian/changelog 2015-07-19 19:31:38.000000000 -0700 @@ -1,3 +1,10 @@ +s3ql (2.11.1+dfsg-3) jessie-updates; urgency=medium + + * Add support to upgrade from file systems created with the + S3QL version in Debian Wheezy. Closes: #792685. + + -- Nikolaus Rath <nikol...@rath.org> Sun, 19 Jul 2015 19:30:10 -0700 + s3ql (2.11.1+dfsg-2) unstable; urgency=medium * Fixed a problem with fsck.s3ql aborting with an diff -Nru s3ql-2.11.1+dfsg/debian/patches/series s3ql-2.11.1+dfsg/debian/patches/series --- s3ql-2.11.1+dfsg/debian/patches/series 2014-12-02 21:47:01.000000000 -0800 +++ s3ql-2.11.1+dfsg/debian/patches/series 2015-07-19 19:29:47.000000000 -0700 @@ -2,3 +2,4 @@ clock-granularity.diff check_dev_fuse_perms.diff bug_771452.diff +support_wheezy_upgrade.diff diff -Nru s3ql-2.11.1+dfsg/debian/patches/support_wheezy_upgrade.diff s3ql-2.11.1+dfsg/debian/patches/support_wheezy_upgrade.diff --- s3ql-2.11.1+dfsg/debian/patches/support_wheezy_upgrade.diff 1969-12-31 16:00:00.000000000 -0800 +++ s3ql-2.11.1+dfsg/debian/patches/support_wheezy_upgrade.diff 2015-08-01 21:10:41.000000000 -0700 @@ -0,0 +1,90 @@ +Description: Allow upgrading file systems created with wheezy +Origin: debian +Forwarded: not-needed +Last-Update: <2015-07-19> +Author: Nikolaus Rath <nikol...@rath.org> + +This patch forward-ports the upgrade mechanism from S3QL 2.9 and +thereby enables upgrading file systems that were created with +the S3QL version in Wheezy. + +--- a/src/s3ql/adm.py ++++ b/src/s3ql/adm.py +@@ -305,7 +305,10 @@ + raise QuietError() + + # Check revision +- if param['revision'] < CURRENT_FS_REV-1: ++ if param['revision'] >= CURRENT_FS_REV: ++ print('File system already at most-recent revision') ++ return ++ elif param['revision'] not in (16,20): + print(textwrap.dedent(''' + File system revision too old to upgrade! + +@@ -316,10 +319,6 @@ + print(get_old_rev_msg(param['revision'] + 1, 's3qladm')) + raise QuietError() + +- elif param['revision'] >= CURRENT_FS_REV: +- print('File system already at most-recent revision') +- return +- + print(textwrap.dedent(''' + I am about to update the file system to the newest revision. + You will not be able to access the file system with any older version +@@ -337,6 +336,22 @@ + if sys.stdin.readline().strip().lower() != 'yes': + raise QuietError() + ++ if param['revision'] == 16: ++ log.info('Upgrading from revision 16 to 20...') ++ # For this upgrade, we need to recreate the sqlite database from the ++ # metadata dump, because some SQLite types have changed ++ log.info('Discarding cached metadata to trigger database rebuild.') ++ db = None ++ ++ # Keep backup of local metadata (just in case...) ++ if os.path.exists(cachepath + '.params'): ++ assert os.path.exists(cachepath + '.db') ++ if (os.path.exists(cachepath + '.db.bak') or ++ os.path.exists(cachepath + '.params.bak')): ++ raise QuietError('Metadata backup already exists, did something go wrong?') ++ os.rename(cachepath + '.db', cachepath + '.db.bak') ++ os.rename(cachepath + '.params', cachepath + '.params.bak') ++ + if not db: + # Need to download metadata + with tempfile.TemporaryFile() as tmpfh: +@@ -352,7 +367,7 @@ + tmpfh.seek(0) + db = restore_metadata(tmpfh, cachepath + '.db') + +- log.info('Upgrading from revision %d to %d...', param['revision'], CURRENT_FS_REV) ++ log.info('Upgrading from revision 20 to %d...', CURRENT_FS_REV) + + param['revision'] = CURRENT_FS_REV + param['last-modified'] = time.time() +@@ -402,9 +417,8 @@ + print(textwrap.dedent('''\ + File system upgrade complete. + +- It is strongly recommended to run the s3ql_verify command with the +- --data option as soon as possible. This is necessary to ensure that the +- upgrade to the next (2.11) S3QL release will run smoothly.''')) ++ It is strongly recommended to run the new s3ql_verify command with the ++ --data option at least once and as soon as possible.''')) + + # This should be used on the *next* fs revision update to ensure that all + # objects conform to newest standards, so we can drop the legacy routines from +--- a/src/s3ql/backends/s3c.py ++++ b/src/s3ql/backends/s3c.py +@@ -697,7 +697,7 @@ + if hit.group(1) == 'format': + format_ = val + else: +- meta[hit.group(1)] = val ++ meta[hit.group(1)] = str(val) + + if format_ == 'pickle': + buf = ''.join(meta[x] for x in sorted(meta)