File: utilmeson_auxskeletonmm-tarball.py-use-c.patch

package info (click to toggle)
mm-common 1.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,212 kB
  • sloc: python: 843; perl: 296; makefile: 133; sh: 125; cpp: 48; xml: 2
file content (34 lines) | stat: -rw-r--r-- 1,054 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Simon McVittie <smcv@debian.org>
Date: Tue, 28 Nov 2023 16:57:13 -0800
X-Dgit-Generated: 1.0.5-1.1 77d8a907867d87eb56f57cfd5d3226aba19355d8
Subject: util/meson_aux/skeletonmm-tarball.py: Use consistent mode on files in

the generated tarball. (Closes: #977177)

Signed-off-by: Vagrant Cascadian <vagrant@reproducible-builds.org>

---

diff --git a/util/meson_aux/skeletonmm-tarball.py b/util/meson_aux/skeletonmm-tarball.py
index 138184c..a87590e 100755
--- a/util/meson_aux/skeletonmm-tarball.py
+++ b/util/meson_aux/skeletonmm-tarball.py
@@ -10,6 +10,7 @@ import os
 import sys
 import shutil
 import tarfile
+import stat
 
 if sys.argv[1] == 'check':
   # Called from run_command() during setup or configuration.
@@ -42,6 +43,10 @@ else:
 def reset(tarinfo):
     tarinfo.uid = tarinfo.gid = 0
     tarinfo.uname = tarinfo.gname = "root"
+    if tarinfo.isdir() or (tarinfo.mode & 0o111) != 0:
+        tarinfo.mode = stat.S_IFMT(tarinfo.mode) | 0o755
+    else:
+        tarinfo.mode = stat.S_IFMT(tarinfo.mode) | 0o644
     return tarinfo