diff --git a/bin/ecbundle-create b/bin/ecbundle-create index 91bf285..cc412a7 100755 --- a/bin/ecbundle-create +++ b/bin/ecbundle-create @@ -51,6 +51,9 @@ def main(): parser.add_argument('--src-dir', help='Directory containing repositories', default='source') + parser.add_argument('--arch-dir', + help='Directory containing supported architectures', default='arch') + parser.add_argument('--update', help='Update local checkout with remote changes', action='store_true') diff --git a/ecbundle/create.py b/ecbundle/create.py index ca2f11f..df6270c 100644 --- a/ecbundle/create.py +++ b/ecbundle/create.py @@ -33,6 +33,9 @@ def dryrun(self): def src_dir(self): return fullpath(self.get("src_dir", "source")) + def arch_dir(self): + return self.get("arch_dir", "arch") + def bundle(self): bundle_path = fullpath(self.get("bundle", None)) if bundle_path: @@ -66,9 +69,16 @@ def create(self): bundle_yml_file = src_dir + "/bundle.yml" + arch_dir = self.arch_dir() + if os.path.isabs(arch_dir): + symlink_force(arch_dir, src_dir + "/arch") + else: + symlink_force( + os.path.dirname(bundle.file()) + f"/{arch_dir}", src_dir + "/arch" + ) + if self.bundle_needs_updating(): symlink_force(bundle.file(), bundle_yml_file) - symlink_force(os.path.dirname(bundle.file()) + "/arch", src_dir + "/arch") self.create_cmakelists_from_bundle() diff --git a/tests/bundle_create/test_create.py b/tests/bundle_create/test_create.py index b35ba76..18d76a2 100644 --- a/tests/bundle_create/test_create.py +++ b/tests/bundle_create/test_create.py @@ -51,6 +51,7 @@ def test_create_simple(here, cleanup): "dry_run": True, "bundle": "%s" % here, "src_dir": "%s" % src_dir, + "arch_dir": "%s" % (here / "arch"), "update": False, "forced_update": False, "threads": 1, @@ -80,6 +81,7 @@ def test_create_optional_fail(here, cleanup): "dryrun": True, "dry_run": True, "src_dir": "%s" % src_dir, + "arch_dir": "%s" % (here / "arch"), "update": False, "forced_update": False, "threads": 1, @@ -117,6 +119,7 @@ def test_create_optional_success(here, cleanup): "dryrun": True, "dry_run": True, "src_dir": "%s" % src_dir, + "arch_dir": "%s" % (here / "arch"), "update": False, "forced_update": False, "threads": 1, @@ -158,6 +161,7 @@ def test_create_existing_symlink(here, cleanup, watcher): "dry_run": True, "bundle": "%s" % here, "src_dir": "%s" % src_dir, + "arch_dir": "%s" % (here / "arch"), "update": False, "forced_update": False, "threads": 1, diff --git a/tests/bundle_install/test_install.py b/tests/bundle_install/test_install.py index 45e0fc4..367bb21 100644 --- a/tests/bundle_install/test_install.py +++ b/tests/bundle_install/test_install.py @@ -70,6 +70,7 @@ def args(here): "cmake": None, "project1.cmake": None, "arch": None, + "arch_dir": "%s" % (here / "arch"), "build_type": "BIT", "bundle": "%s" % here, }