Skip to content

Commit

Permalink
feat: changed name of inner folder of output tar to be name of tar in…
Browse files Browse the repository at this point in the history
…stead of temp folder name
  • Loading branch information
RonTamG committed Feb 12, 2024
1 parent 236e11c commit ba93cfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ def set_permissions(tarinfo):
tarinfo.mode = 0o755
return tarinfo

with tarfile.open(name, "w:gz") as tar:
tar.add(Path(path, "packages"))
tar.add(Path(path, "install.sh"), filter=set_permissions)
with tarfile.open(name + ".tar.gz", "w:gz") as tar:
tar.add(Path(path, "packages"), Path(name, "packages"))
tar.add(
Path(path, "install.sh"), Path(name, "install.sh"), filter=set_permissions
)


def apt_update(sources_list_path, enable_progress_bar=True):
Expand Down Expand Up @@ -187,7 +189,7 @@ def main():
generate_packages_index_file(packages, temp_folder)
write_install_script(name, temp_folder)
index_dump_path.unlink(missing_ok=True)
tar_dir(temp_folder, f"{name}.tar.gz")
tar_dir(temp_folder, name)

if not args.keep:
shutil.rmtree(temp_folder)
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance_tests/install_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ python main.py --sources-list /etc/apt/sources.list $remove_progress_bar git
tar -xvf git.tar.gz

# run the install script
cd temp_apt
cd git

./install.sh -y

Expand Down

0 comments on commit ba93cfa

Please sign in to comment.