summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Witschel2019-10-15 16:00:36 +0000
committerJonas Witschel2019-10-15 16:00:36 +0000
commit436b7fde531772c42a458a4eef0ba4e94ef19083 (patch)
tree0cf9fa34a517b3132d8bce3f7ad3bcf5e93dab6e
parent8350ddac6e0b9492cd3af7595c030e777dc73309 (diff)
downloadaur-436b7fde531772c42a458a4eef0ba4e94ef19083.tar.gz
Use system Python binary (also fixes issues with the reproducible builds CI)
-rw-r--r--PKGBUILD11
-rw-r--r--deheader_use-system-python.patch42
2 files changed, 50 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 94b4cb8a7257..43ca820c53d4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,19 +1,24 @@
# Maintainer: Jonas Witschel <diabonas@archlinux.org>
pkgname=deheader
pkgver=1.6
-pkgrel=2
+pkgrel=3
pkgdesc='Find and optionally remove unneeded includes in C or C++ source files'
arch=('any')
url='http://www.catb.org/~esr/deheader/'
license=('BSD')
depends=('python')
-source=("$url/$pkgname-$pkgver.tar.gz")
+source=("$url/$pkgname-$pkgver.tar.gz" 'deheader_use-system-python.patch')
noextract=("$pkgname-$pkgver.tar.gz")
-sha512sums=('8278d845bf618aabe1fb1da77fb99f6de5efe76a8bd8ae12da0327c0e4df184b7c4d50b2ac2be4a3dd271b8b010818fef83cd80d81f2be2b04bd09e2fee1cea3')
+sha512sums=('8278d845bf618aabe1fb1da77fb99f6de5efe76a8bd8ae12da0327c0e4df184b7c4d50b2ac2be4a3dd271b8b010818fef83cd80d81f2be2b04bd09e2fee1cea3'
+ 'e864cd32dca820844c5d4a0ff4f15f18bf7be53231daba54111ea914cbd594f9d0244e4ec05cf806ef85a86662ce434acc41ace97106e846ddb7409be793a0d3')
prepare() {
# Invalid hardlink in release tarball leads to bsdtar errors during extraction
+ # (https://gitlab.com/esr/deheader/issues/7)
bsdtar --extract -s '|deheader-1.6/deheader.1||R' --file "$pkgname-$pkgver.tar.gz"
+
+ cd "$pkgname-$pkgver"
+ patch --strip=1 --input="$srcdir/deheader_use-system-python.patch"
}
check() {
diff --git a/deheader_use-system-python.patch b/deheader_use-system-python.patch
new file mode 100644
index 000000000000..03efaa54360c
--- /dev/null
+++ b/deheader_use-system-python.patch
@@ -0,0 +1,42 @@
+From df0b47a4543279191e1bfc88269438add4a8deb3 Mon Sep 17 00:00:00 2001
+From: Jonas Witschel <diabonas@gmx.de>
+Date: Tue, 15 Oct 2019 17:51:25 +0200
+Subject: [PATCH] Force use of the system Python 3 interpreter
+
+This avoids PATH manipulation attacks and is encouraged by PEP 394.
+---
+ deheader | 2 +-
+ test/Makefile | 5 -----
+ 2 files changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/deheader b/deheader
+index 5b7d06f..4ceb83b 100755
+--- a/deheader
++++ b/deheader
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ """\
+ deheader -- find (optionally remove) unneeded includes in C or C++ sourcefiles.
+
+diff --git a/test/Makefile b/test/Makefile
+index 6a70c0d..cf4dc8c 100644
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -4,13 +4,8 @@ SOURCES = $(shell ls *.c)
+
+ regress:
+ @echo "Testing deheader: no output is good news."
+- @setpython python2
+ @-deheader -v -v . >/tmp/regress
+ @diff -u regress.chk /tmp/regress
+- @setpython python3
+- @-deheader -v -v . >/tmp/regress
+- @diff -u regress.chk /tmp/regress
+- @setpython python
+ @rm /tmp/regress
+ makeregress:
+ @-deheader -v -v . >regress.chk
+--
+2.23.0
+