Normalize paths when adding them to the tarball.
PiperOrigin-RevId: 162742684
diff --git a/tools/build_defs/pkg/build_tar.py b/tools/build_defs/pkg/build_tar.py
index 74edb58..a07fd43 100644
--- a/tools/build_defs/pkg/build_tar.py
+++ b/tools/build_defs/pkg/build_tar.py
@@ -111,6 +111,7 @@
ids = (0, 0)
if names is None:
names = ('', '')
+ dest = os.path.normpath(dest)
self.tarfile.add_file(
dest,
file_content=f,
@@ -142,6 +143,7 @@
symlink: the name of the symbolic link to add.
destination: where the symbolic link point to.
"""
+ symlink = os.path.normpath(symlink)
self.tarfile.add_file(symlink, tarfile.SYMTYPE, link=destination)
def add_deb(self, deb):