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:33:45 +0100
commit7ac611a2788443f67df1d963aa510d1dd42e1472 (patch)
treebdf030a03b07275be54232d55b017c635919c472
parent615b572ef6341859fe6be51d0809da4e783eb89e (diff)
downloadaports-7ac611a2788443f67df1d963aa510d1dd42e1472.tar.gz
aports-7ac611a2788443f67df1d963aa510d1dd42e1472.tar.bz2
aports-7ac611a2788443f67df1d963aa510d1dd42e1472.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/APKBUILD6
2 files changed, 34 insertions, 2 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 08d954c9a3..97a246438f 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -2,7 +2,7 @@
pkgname=abuild
pkgver=3.1.0
_ver=${pkgver%_git*}
-pkgrel=4
+pkgrel=5
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
@@ -24,6 +24,7 @@ source="http://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
0001-abuild-add-env-option-to-require-tests.patch
0001-abuild-rootbld-run-testsuites-if-requested-also-hand.patch
0001-abuild-fix-race-when-stripping.patch
+ 0001-abuild-chdir-to-builddir-if-it-exists.patch
"
builddir="$srcdir/$pkgname-$_ver"
@@ -73,4 +74,5 @@ _rootbld() {
sha512sums="bb9093d67942e3a63e4e053692c0bca30940cae05955518206cd9f7029211a188b7f442456ae126e61cbdca224eddb31e967d5cf0637e16893163cc963871a52 abuild-3.1.0.tar.xz
e02cc44c8ad9dd61c9b80684b8cf5b64477a6fd6221cde9efea2a7594c6e7ce01a51f8bd4b80d72f82f7caf93217979fb0b354c420983891fa93f34c4252a035 0001-abuild-add-env-option-to-require-tests.patch
5d196f302715f5f12ca13b70baea59f49bf3180e35e7a15849e9f9bc24b42a13666ee96666eae02bd31d54f227bb7c1fd5ae2e06dcfe1d7eb41ecfd6b9b3d28e 0001-abuild-rootbld-run-testsuites-if-requested-also-hand.patch
-4399485506ce566b158f53b1e4cabf99994d34fa31ddd0c0a6e11d089420f09cf4f72599ae4540d7ad1d11b31a54be05e416e6e58ed4a8acf27e3b91c9df5e2e 0001-abuild-fix-race-when-stripping.patch"
+4399485506ce566b158f53b1e4cabf99994d34fa31ddd0c0a6e11d089420f09cf4f72599ae4540d7ad1d11b31a54be05e416e6e58ed4a8acf27e3b91c9df5e2e 0001-abuild-fix-race-when-stripping.patch
+4cdcd6c3076c1415c9fc2dfdae6634ecac18e43e33cde4fa978137baaf8927369c80e5e630085c68c4c82165234ab5962cf4373c04566c60de92fd62725508a8 0001-abuild-chdir-to-builddir-if-it-exists.patch"