From 161bf4ab797a481142315d1803170cf4be590036 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 5 Oct 2022 10:30:51 +0200 Subject: just-mr.py: for the fetch subcommand acutally fetch A checkout does not necessarily fetch an archive: if we already have the git tree for that archive, this is enough to create a build root. For the fetch command, however, we need to have the actual archive as we have to copy it to the distdir. Of course, we only create the git tree once we got hold of the archive. However, with the introduction of CAS purging, the invariant that we have the archive whenever we can create a build root will no longer be true. This is acutally a feature as the git trees can be stored more compactly if we accumulate different release archives of the same upstream project. However, it also means that we explicitly have to fetch the archive in the fetch subcommand. Do this. --- bin/just-mr.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'bin/just-mr.py') diff --git a/bin/just-mr.py b/bin/just-mr.py index 73b9b455..ccf1c5b6 100755 --- a/bin/just-mr.py +++ b/bin/just-mr.py @@ -341,7 +341,7 @@ def archive_fetch(desc, content): fail("Failed to fetch a file with id %s from %s" % (content, url)) -def archive_checkout(desc, repo_type="archive", *, fetch_only=False): +def archive_checkout(desc, repo_type="archive"): content_id = desc["content"] target = archive_checkout_dir(content_id, repo_type=repo_type) if ALWAYS_FILE and os.path.exists(target): @@ -360,8 +360,6 @@ def archive_checkout(desc, repo_type="archive", *, fetch_only=False): git_root(upstream=None), ] archive_fetch(desc, content=content_id) - if fetch_only: - return target_tmp = archive_tmp_checkout_dir(content_id, repo_type=repo_type) if os.path.exists(target_tmp): try_rmtree(target_tmp) @@ -698,7 +696,7 @@ def fetch(*, config, args): repo_desc["fetch"]) content = repo_desc["content"] print("%r --> %r (content: %s)" % (repo, distfile, content)) - archive_checkout(repo_desc, repo_desc["type"], fetch_only=True) + archive_fetch(repo_desc, content) shutil.copyfile(cas_path(content), os.path.join(fetch_dir, distfile)) -- cgit v1.2.3