phase2: rely on rsync to merge updated SDK components
authorJo-Philipp Wich <jo@mein.io>
Mon, 6 Feb 2017 12:30:09 +0000 (13:30 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 6 Feb 2017 12:30:13 +0000 (13:30 +0100)
Relying on the file modtime is unreliable so we cannot trust tar's
--keep-newer-files to properly overwrite changed SDK components.

Extract into a different directory instead and use rsync with checksum
mode to replace updated SDK files.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
phase2/master.cfg

index c46de83fe0a27755a7819d73f28b31a9781e3955..b60417a9e1096b03d3f273c91fe2947dbc3a06d9 100644 (file)
@@ -278,7 +278,13 @@ for arch in arches:
        factory.addStep(ShellCommand(
                name = "unpacksdk",
                description = "Unpacking SDK archive",
-               command = ["tar", "--keep-newer-files", "--strip-components=1", "-C", "sdk/", "-vxf", "sdk.archive"],
+               command = "rm -rf sdk_update && mkdir sdk_update && tar --strip-components=1 -C sdk_update/ -vxf sdk.archive",
+               haltOnFailure = True))
+
+       factory.addStep(ShellCommand(
+               name = "updatesdk",
+               description = "Updating SDK",
+               command = "rsync --checksum -av sdk_update/ sdk/ && rm -rf sdk_update",
                haltOnFailure = True))
 
        factory.addStep(FileDownload(mastersrc=home_dir+'/key-build', slavedest="sdk/key-build", mode=0600))