Skip to content
Snippets Groups Projects
Commit 5e86a207 authored by Boris Feld's avatar Boris Feld
Browse files

update-benchrepo: also respect the standard archive file naming

make-reference creates reference tar with a name containing the repo hash,
update the script to follow the same naming scheme.
parent a6c97f02
No related branches found
No related tags found
No related merge requests found
......@@ -76,9 +76,10 @@
# Write the new stats in the tar
print("Archiving the new benchrepo file.")
with tarfile.open(join(tmp_directory, "tmp.tar"), "w") as new_tar_file:
tmp_archive_path = join(tmp_directory, "tmp.tar")
with tarfile.open(tmp_archive_path, "w") as new_tar_file:
new_tar_file.add(benchrepo_path, arcname=repo_details)
new_tar_file.add(repository_path, arcname=repo_main_with_hash)
# And finally overwrite the original tar in place
print("Overwriting the original archive")
......@@ -80,9 +81,10 @@
new_tar_file.add(benchrepo_path, arcname=repo_details)
new_tar_file.add(repository_path, arcname=repo_main_with_hash)
# And finally overwrite the original tar in place
print("Overwriting the original archive")
shutil.move(join(tmp_directory, "tmp.tar"), reference_archive_path)
new_archive_path = join(dirname(reference_archive_path), repo_tarball)
shutil.move(tmp_archive_path, new_archive_path)
def main(args):
......
......@@ -54,7 +54,9 @@
$ cd ..
$ cat my-source-repo.benchrepo
cat: my-source-repo.benchrepo: No such file or directory
[1]
$ ls some-dir/
my-reference.tar
my-source-repo
my-source-repo-58d5d19d-reference.tar
my-source-repo.benchrepo
......@@ -60,5 +62,5 @@
$ tar tf some-dir/my-reference.tar | sort
$ tar tf some-dir/my-source-repo-*-reference.tar | sort
my-source-repo-58d5d19d-reference/
my-source-repo-58d5d19d-reference/.hg/
my-source-repo-58d5d19d-reference/.hg/00changelog.i
......@@ -139,7 +141,7 @@
my-source-repo-58d5d19d-reference/.hg/wcache/
my-source-repo-58d5d19d.benchrepo
$ tar -xf some-dir/my-reference.tar --wildcards "my-source-repo-*.benchrepo"
$ tar -xf some-dir/my-source-repo-*-reference.tar --wildcards "my-source-repo-*.benchrepo"
$ cat my-source-repo-*.benchrepo
reference-repo:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment