Add the option to build the bundle with no TUF.
authorIvan Alejandro <ivanalejandro0@gmail.com>
Thu, 22 Jan 2015 17:20:05 +0000 (14:20 -0300)
committerIvan Alejandro <ivanalejandro0@gmail.com>
Thu, 22 Jan 2015 17:20:05 +0000 (14:20 -0300)
Specifying in the spec file an option for 'tuf_repo' different than
'stable' or 'unstable' will build a TUF-less bundle.

bundler/actions.py

index cee1508..b36e280 100644 (file)
@@ -568,15 +568,21 @@ class CopyMisc(Action):
             tuf_config = self.TUF_CONFIG.format(self.TUF_STABLE)
         elif tuf_repo == 'unstable':
             tuf_config = self.TUF_CONFIG.format(self.TUF_UNSTABLE)
+        else:
+            # a different value than stable/unstable is interpreted as
+            # "don't use tuf", so we don't use a launcher file
+            tuf_config = None
 
-        with open(launcher_path, "w") as f:
-            f.write(tuf_config)
+        if tuf_config is not None:
+            with open(launcher_path, "w") as f:
+                f.write(tuf_config)
 
         metadata = os.path.join(self._basedir, "Bitmask", "repo", "metadata")
         mkdir("-p", os.path.join(metadata, "current"))
         mkdir("-p", os.path.join(metadata, "previous"))
         cp(os.path.join(binary_path, "root.json"),
            os.path.join(metadata, "current"))
+
         self.log("done")