Skip to content

Commit

Permalink
create-relocatable-package.py: fix timestamp of executable files
Browse files Browse the repository at this point in the history
We mistakenly haven't added mtime while creating TarInfo object, we need
to add it.

Fixes scylladb/scylladb#13415

Closes: #37
(cherry picked from commit 30b8fc2)
  • Loading branch information
syuu1228 authored and avikivity committed Oct 31, 2023
1 parent cf7030a commit 6ad2e5a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/create-relocatable-package.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import magic
import re
import collections
import time


RELOC_PREFIX='scylla-python3'
Expand Down Expand Up @@ -147,11 +148,13 @@ def gen_python_thunk(ar, pybin):
ti = tarfile.TarInfo(name=os.path.join("bin", pybin))
ti.size = len(thunk)
ti.mode = 0o755
ti.mtime = time.time()
ar.reloc_addfile(ti, fileobj=io.BytesIO(thunk))

ti = tarfile.TarInfo(name=os.path.join("bin", "python3"))
ti.type = tarfile.SYMTYPE
ti.linkname = pybin
ti.mtime = time.time()
ar.reloc_addfile(ti)

def fixup_shebang(script):
Expand All @@ -174,6 +177,7 @@ def copy_file_to_python_env(ar, f, pip_binfile=False):
ti = tarfile.TarInfo(name=os.path.join("bin", os.path.basename(f)))
ti.size = obj.getbuffer().nbytes
ti.mode = 0o755
ti.mtime = time.time()
ar.reloc_addfile(ti, fileobj=obj)
else:
libfile = f
Expand Down

0 comments on commit 6ad2e5a

Please sign in to comment.