aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/0001-abuild-fix-provides-and-install_if-in-subpackages.patch
blob: 275e52393eb7b19b1f6eaa33eb425f33217d5270 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 0e58eeff8089c8c148c20a5e239d618095ec434f Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 11 Jun 2015 11:56:04 +0000
Subject: [PATCH] abuild: fix provides and install_if in subpackages

we need to clear provides set in global scope before splitting the
subpackages so the subpackage does not inherit main packages' provides.

But at the same time, we must not clear the provides/install_if set in
the splitfunction itself.
---
 abuild.in | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/abuild.in b/abuild.in
index cb069f2..dc72d79 100644
--- a/abuild.in
+++ b/abuild.in
@@ -683,6 +683,15 @@ postcheck() {
 	return 0
 }
 
+pre_split() {
+	if [ -z "$subpkgname" ]; then
+		return 0
+	fi
+	# the subpackages should not inherit those form main package
+	provides=""
+	install_if=""
+}
+
 prepare_subpackages() {
 	local i
 	cd "$startdir"
@@ -692,7 +701,7 @@ prepare_subpackages() {
 		msg "Running split function $func..."
 		local dir="$pkgbasedir/${i%:*}" name="${i%:*}"
 		( subpkgdir="$dir" subpkgname="$name" \
-			$0 $func prepare_package \
+			$0 pre_split $func prepare_package \
 			&& postcheck "$dir" "$name" ) || return 1
 	done
 	postcheck "$pkgdir" "$pkgname" || return 1
@@ -947,11 +956,6 @@ archcheck() {
 
 prepare_package() {
 	msg "Preparing ${subpkgname:+sub}package ${subpkgname:-$pkgname}..."
-	if [ -n "$subpkgname" ]; then
-		# the subpackages should not inherit those
-		provides=""
-		install_if=""
-	fi
 	stripbin
 	prepare_metafiles \
 		&& prepare_trace_rpaths \
-- 
2.4.2