Merge lp:~jamesodhunt/ubuntu/vivid/ubuntu-core-upgrader/allow-assets-unpack into lp:ubuntu/vivid/ubuntu-core-upgrader

Proposed by Steve Langasek
Status: Merged
Merged at revision: 65
Proposed branch: lp:~jamesodhunt/ubuntu/vivid/ubuntu-core-upgrader/allow-assets-unpack
Merge into: lp:ubuntu/vivid/ubuntu-core-upgrader
Diff against target: 80 lines (+35/-6) (has conflicts)
2 files modified
debian/changelog (+11/-0)
ubuntucoreupgrader/upgrader.py (+24/-6)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/vivid/ubuntu-core-upgrader/allow-assets-unpack
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+250493@code.launchpad.net

Description of the change

Permit snappy to install contents of the assets directory

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

Comments inline below.

This will break the ability to use --root-dir for testing, with any tarball that contains assets. I don't think we are blocked on this, but it bears mentioning.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-02-20 18:00:11 +0000
3+++ debian/changelog 2015-02-20 18:04:43 +0000
4@@ -1,3 +1,4 @@
5+<<<<<<< TREE
6 ubuntu-core-upgrader (0.7) UNRELEASED; urgency=medium
7
8 * Move this from the ppa to the main archive.
9@@ -5,6 +6,16 @@
10
11 -- Steve Langasek <steve.langasek@ubuntu.com> Fri, 20 Feb 2015 09:58:54 -0800
12
13+=======
14+ubuntu-core-upgrader (0.6~ppa25) UNRELEASED; urgency=medium
15+
16+ * ubuntucoreupgrader/upgrader.py:
17+ - tar_generator(): Permit unpack of assets/ directory to allow snappy to
18+ install them (and clean up).
19+
20+ -- James Hunt <james.hunt@ubuntu.com> Fri, 20 Feb 2015 14:55:46 +0000
21+
22+>>>>>>> MERGE-SOURCE
23 ubuntu-core-upgrader (0.6~ppa24) vivid; urgency=low
24
25 * support new "config.machine_readable" option
26
27=== modified file 'ubuntucoreupgrader/upgrader.py'
28--- ubuntucoreupgrader/upgrader.py 2015-01-30 11:51:24 +0000
29+++ ubuntucoreupgrader/upgrader.py 2015-02-20 18:04:43 +0000
30@@ -85,6 +85,11 @@
31 # - if the file '/etc/bar' should be modified, it
32 # would be specified in the tar file as member 'system/etc/bar'.
33 TAR_FILE_SYSTEM_PREFIX = 'system/'
34+
35+# boot assets (kernel, initrd, .dtb's)
36+# (XXX: note no trailing slash to ensure we unpack the directory itself).
37+TAR_FILE_ASSETS_PREFIX = 'assets'
38+
39 TAR_FILE_REMOVED_FILE = 'removed'
40
41 SYSTEM_IMAGE_CHANNEL_CONFIG = '/etc/system-image/channel.ini'
42@@ -1443,19 +1448,32 @@
43 # - Don't unpack the removed file.
44 # - Don't unpack device files *iff* they already exist.
45 # - Don't unpack files that are not below
46- # TAR_FILE_SYSTEM_PREFIX.
47+ # TAR_FILE_SYSTEM_PREFIX or TAR_FILE_ASSETS_PREFIX.
48 #
49 # - XXX: This is a temporary function to work-around for
50 # LP: #1381121: we shouldn't need to filter which files are
51 # extracted!
52- prefix = '{}dev/'.format(TAR_FILE_SYSTEM_PREFIX)
53+ device_prefix = '{}dev/'.format(TAR_FILE_SYSTEM_PREFIX)
54
55 mount_path = '{}/{}'.format(self.get_cache_dir(), member.name)
56
57- if (member.name == self.removed_file) or \
58- ((member.name.startswith(prefix) and
59- os.path.exists(mount_path)) or
60- not member.name.startswith(TAR_FILE_SYSTEM_PREFIX)):
61+ unpack = True
62+
63+ if member.name == self.removed_file:
64+ # already handled
65+ unpack = False
66+
67+ if member.name.startswith(device_prefix) and \
68+ os.path.exists(mount_path):
69+ # device already exists
70+ unpack = False
71+
72+ if not (member.name.startswith(TAR_FILE_SYSTEM_PREFIX) or
73+ member.name.startswith(TAR_FILE_ASSETS_PREFIX)):
74+ # unrecognised prefix directory
75+ unpack = False
76+
77+ if not unpack:
78 log.debug('not unpacking file {}'.format(member.name))
79 else:
80 # A modified root directory requires convering

Subscribers

People subscribed via source and target branches

to all changes: