Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/crossdev:master commit in: /
Date: Wed, 29 Feb 2012 16:22:47
Message-Id: 1330532522.072726d88e2c4b31f5249e45c5b3a33730eab3e0.vapier@gentoo
commit:     072726d88e2c4b31f5249e45c5b3a33730eab3e0
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 29 16:22:02 2012 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Feb 29 16:22:02 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/crossdev.git;a=commit;h=072726d8

crossdev: reverse masters list in layout.conf

Portage reads this in reverse order, so we have to populate it in
reverse order as well.

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 crossdev |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/crossdev b/crossdev
index 68389d5..14515ca 100755
--- a/crossdev
+++ b/crossdev
@@ -848,9 +848,11 @@ set_metadata() {
 		fi
 		[[ -z ${name} ]] && continue
 
-		# If this repo has an eclass dir, mark it as a master
+		# If this repo has an eclass dir, mark it as a master.
+		# Note: portage reads the masters list in reverse order,
+		#       so we have to prepare it the same way.
 		if [[ -d ${d}/eclass ]] ; then
-			has ${name} ${masters} || masters+=" ${name}"
+			has ${name} ${masters} || masters="${name} ${masters}"
 		fi
 
 		# If one of the overlays uses thin manifests, then turn it on
@@ -878,7 +880,7 @@ set_metadata() {
 	cat <<-EOF > "${layout}"
 	${autogen_tag}
 	# Delete the above line if you want to manage this file yourself
-	masters =${masters}
+	masters = ${masters% }
 	$(printf '%b' "${this_manifests}")
 	EOF
 }