aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-10-29 14:30:25 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2019-10-29 14:32:09 +0100
commitf8f5754c6a9d932910bbf056ba0b829a2e88cb17 (patch)
treefb5488bdab5416146cbf6b71df2ea7a23268531d
parent51e31ddfdc27f198355e81eb2d821e0cc1c944f2 (diff)
downloadaports-f8f5754c6a9d932910bbf056ba0b829a2e88cb17.tar.gz
aports-f8f5754c6a9d932910bbf056ba0b829a2e88cb17.tar.bz2
aports-f8f5754c6a9d932910bbf056ba0b829a2e88cb17.tar.xz
main/abuild: backport chdir to "$builddir"
This makes it easier to backport security fixes which has the `cd "$builddir"` removed.
-rw-r--r--main/abuild/0001-abuild-chdir-to-builddir-if-it-exists.patch30
-rw-r--r--main/abuild/APKBUILD9
2 files changed, 36 insertions, 3 deletions
diff --git a/main/abuild/0001-abuild-chdir-to-builddir-if-it-exists.patch b/main/abuild/0001-abuild-chdir-to-builddir-if-it-exists.patch
new file mode 100644
index 0000000000..d07b5a464e
--- /dev/null
+++ b/main/abuild/0001-abuild-chdir-to-builddir-if-it-exists.patch
@@ -0,0 +1,30 @@
+From 2fe29d5829c0973ace1db350141b3c810ac888a7 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 3 Oct 2018 11:48:11 +0000
+Subject: [PATCH] abuild: chdir to $builddir if it exists
+
+chdir to $builddir before running prepare, build, package or check.
+---
+ abuild.in | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/abuild.in b/abuild.in
+index b1be8fc..8d69b4b 100644
+--- a/abuild.in
++++ b/abuild.in
+@@ -594,6 +594,12 @@ runpart() {
+ local part=$1
+ [ -n "$DEBUG" ] && msg "$part"
+ trap "die '$part failed'" EXIT
++ if [ -d "$builddir" ]; then
++ case "$part" in
++ prepare|build|package|check)
++ cd "$builddir";;
++ esac
++ fi
+ $part
+ trap - EXIT
+ }
+--
+2.18.1
+
diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD
index 95c216784a..04b78c3597 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -2,7 +2,7 @@
pkgname=abuild
pkgver=3.2.0
_ver=${pkgver%_git*}
-pkgrel=0
+pkgrel=1
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
@@ -20,7 +20,9 @@ subpackages="apkbuild-cpan:cpan:noarch apkbuild-gem-resolver:gems:noarch
abuild-rootbld:_rootbld:noarch"
options="suid !check"
pkggroups="abuild"
-source="http://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz"
+source="http://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
+ 0001-abuild-chdir-to-builddir-if-it-exists.patch
+ "
builddir="$srcdir/$pkgname-$_ver"
prepare() {
@@ -66,4 +68,5 @@ _rootbld() {
mkdir -p "$subpkgdir"
}
-sha512sums="ee9ca5542750c8f109337bd6f17757e914b9df4800d2f2bc279b1eb7a39f5ba55692e5006437c9c4d9e428272488245742aec1da9dd176b8359f215ca8990bb2 abuild-3.2.0.tar.xz"
+sha512sums="ee9ca5542750c8f109337bd6f17757e914b9df4800d2f2bc279b1eb7a39f5ba55692e5006437c9c4d9e428272488245742aec1da9dd176b8359f215ca8990bb2 abuild-3.2.0.tar.xz
+4cdcd6c3076c1415c9fc2dfdae6634ecac18e43e33cde4fa978137baaf8927369c80e5e630085c68c4c82165234ab5962cf4373c04566c60de92fd62725508a8 0001-abuild-chdir-to-builddir-if-it-exists.patch"