You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2024/02/08 17:58:45 UTC

(airflow) branch main updated: Trims leading `./` from filenames when repackaging reproducible packages (#37253)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8c83e9156b Trims leading `./` from filenames when repackaging reproducible packages (#37253)
8c83e9156b is described below

commit 8c83e9156ba772f8577e1b32267b7e17adaccc1c
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Thu Feb 8 18:58:37 2024 +0100

    Trims leading `./` from filenames when repackaging reproducible packages (#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.
---
 dev/breeze/src/airflow_breeze/utils/reproducible.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dev/breeze/src/airflow_breeze/utils/reproducible.py b/dev/breeze/src/airflow_breeze/utils/reproducible.py
index 36a6eeea81..660e01b0a6 100644
--- a/dev/breeze/src/airflow_breeze/utils/reproducible.py
+++ b/dev/breeze/src/airflow_breeze/utils/reproducible.py
@@ -137,6 +137,8 @@ def repack_deterministically(
                         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