summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-05-22 16:38:12 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-05-22 17:14:14 +0200
commit206ebecb67c18cac157007941a63cb31a767f30b (patch)
treedb5164606046d6c6529abe29964b63cb90d2c0cc /bin
parent11f45137307b2e87d7baad8a954b80fafab2eb59 (diff)
downloadjustbuild-206ebecb67c18cac157007941a63cb31a767f30b.tar.gz
just-import-git: support assuming the canonical single-repo config
Add an option --plain pretending that the remote repository configuration is the canonical single-repository one. In this way, repositories not having a multi-repository configuration (e.g., code built with a foreign build system) can be imported in the same way to a template, thus providing a more uniform interface. This can also be useful, if a repository is to be imported completely without its transitive dependencis.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/just-import-git.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/bin/just-import-git.py b/bin/just-import-git.py
index 397c7a80..36b3d32b 100755
--- a/bin/just-import-git.py
+++ b/bin/just-import-git.py
@@ -230,8 +230,14 @@ def handle_import(args):
foreign_config_file = args.foreign_repository_config
else:
foreign_config_file = get_repository_config_file(srcdir)
- with open(foreign_config_file) as f:
- foreign_config = json.load(f)
+ if args.plain:
+ foreign_config = { "main": "",
+ "repositories": {"": {"repository":
+ {"type": "file",
+ "path": "." }}}}
+ else:
+ with open(foreign_config_file) as f:
+ foreign_config = json.load(f)
foreign_repos = foreign_config.get("repositories", {})
if args.foreign_repository_name:
foreign_name = args.foreign_repository_name
@@ -294,6 +300,13 @@ def main():
metavar="relative-path"
)
parser.add_argument(
+ "--plain",
+ action="store_true",
+ help=
+ "Pretend the remote repository description is the canonical"
+ + " single-repository one",
+ )
+ parser.add_argument(
"--as",
dest="import_as",
help="Name prefix to import the foreign repository as",