diff options
Diffstat (limited to 'lib/swupd')
-rw-r--r-- | lib/swupd/bundles.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/swupd/bundles.py b/lib/swupd/bundles.py index abfd08c..611f59d 100644 --- a/lib/swupd/bundles.py +++ b/lib/swupd/bundles.py @@ -1,3 +1,4 @@ +import glob import subprocess import shutil from oe.package_manager import RpmPM @@ -145,3 +146,16 @@ def copy_bundle_contents(d): bundles = (d.getVar('SWUPD_EMPTY_BUNDLES', True) or '').split() for bndl in bundles: stage_empty_bundle(d, bndl) + +def copy_old_versions(d): + for prevver in d.getVar('SWUPD_DELTAPACK_VERSIONS', True).split(): + if not os.path.exists(os.path.join(d.expand('${DEPLOY_DIR_SWUPD}/image'), prevver)): + pattern = d.expand('${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}*-%s-swupd.tar' % prevver) + prevver_tar = glob.glob(pattern) + if not prevver_tar or len(prevver_tar) > 1 or not os.path.exists(prevver_tar[0]): + bb.fatal("Creating swupd delta packs against %s is not possible because %s is not available." % + (prevver, pattern)) + cmd = ['tar', '-C', d.getVar('DEPLOY_DIR_SWUPD', True), '-xf', prevver_tar[0]] + output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) + if output: + bb.fatal('Unexpected output from the following command:\n%s\n%s' % (cmd, output)) |