aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/0001-abuild-chdir-to-builddir-if-it-exists.patch
blob: d07b5a464e866040fa33836208f4e9e2f122245a (plain) (blame)
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
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