diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 561: Fix V2 style hwpack layout with V3 config file

Message ID 20120912135713.26423.79899.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

James Tunnicliffe Sept. 12, 2012, 1:57 p.m. UTC
Merge authors:
  James Tunnicliffe (dooferlad)
Related merge proposals:
  https://code.launchpad.net/~dooferlad/linaro-image-tools/fix-bootloader-file-fallback/+merge/123927
  proposed by: James Tunnicliffe (dooferlad)
  review: Approve - Deepti B. Kalakeri (deeptik)
------------------------------------------------------------
revno: 561 [merge]
committer: James Tunnicliffe <james.tunnicliffe@linaro.org>
branch nick: linaro-image-tools
timestamp: Wed 2012-09-12 14:56:06 +0100
message:
  Fix V2 style hwpack layout with V3 config file
modified:
  linaro_image_tools/media_create/boards.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py	2012-09-10 17:50:26 +0000
+++ linaro_image_tools/media_create/boards.py	2012-09-12 10:51:00 +0000
@@ -245,7 +245,12 @@ 
                         keys = keys[1:]
 
         for f in file_names:
-            f = os.path.join(base_path, f)
+            # Check that the base path is needed. If the file doesn't exist,
+            # try without it (this provides fallback to V2 style directory
+            # layouts with a V3 config).
+            path_inc_board_and_bootloader = os.path.join(base_path, f)
+            if path_inc_board_and_bootloader in hwpack_tarfile.getnames():
+                f = path_inc_board_and_bootloader
             hwpack_tarfile.extract(f, self.tempdir)
             f = os.path.join(self.tempdir, f)
             out_files.append(f)