Skip to content

Commit

Permalink
Trims leading ./ from filenames when repackaging reproducible packa…
Browse files Browse the repository at this point in the history
…ges (#37253)

When we repack tar.gz files, implicitly `./` is added in front of
the files being repacked. While this does not change anything when
you unpack the files, if you extract individual files by name, you
might expect to not have `./` there (this is what happens when
helm installs chart from .tgz file).

We are stripping the `./` during repackaging now.
  • Loading branch information
potiuk committed Feb 8, 2024
1 parent 1ab082b commit 8c83e91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev/breeze/src/airflow_breeze/utils/reproducible.py
Expand Up @@ -137,6 +137,8 @@ def reset(tarinfo):
arcname = entry
if prepend_path is not None:
arcname = os.path.normpath(os.path.join(prepend_path, arcname))
if arcname.startswith("./"):
arcname = arcname[2:]
tar_file.add(entry, filter=reset, recursive=False, arcname=arcname)
os.rename(temp_file, dest_archive)
return result
Expand Down

0 comments on commit 8c83e91

Please sign in to comment.