commit:     aaa0e489fcfa0f08f894342adc33bb9c93745e0a
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 17 19:17:06 2014 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Sep 17 19:17:06 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/crossdev.git;a=commit;h=aaa0e489

crossdev: set repo-name in generated layout.conf

URL: http://crbug.com/415246
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 crossdev | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/crossdev b/crossdev
index 56ddcda..29fe431 100755
--- a/crossdev
+++ b/crossdev
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 CROSSDEV_VER="@CDEVPV@"
@@ -931,8 +931,14 @@ set_metadata() {
        # we really can do about that.
        local autogen_tag="# Autogenerated and managed by crossdev"
        local meta=${CROSSDEV_OVERLAY}/metadata
+       local repo_name
        local layout=${meta}/layout.conf
-       local d name masters thin_manifests="false"
+       local f d name masters thin_manifests="false"
+
+       # See if this repo is already named.
+       f="${CROSSDEV_OVERLAY}/profiles/repo_name"
+       repo_name=$(cat "${f}" 2>/dev/null)
+       : ${repo_name:="crossdev"}
 
        mkdir -p "${meta}"
        if [[ -e ${layout} ]] ; then
@@ -954,6 +960,8 @@ set_metadata() {
                        name=$(<"${d}"/profiles/repo_name)
                fi
                [[ -z ${name} ]] && continue
+               # Don't list ourselves as a master.
+               [[ ${name} == "${repo_name}" ]] && continue
 
                # If this repo has an eclass dir, mark it as a master.
                # Note: portage reads the masters list in reverse order,
@@ -988,6 +996,7 @@ set_metadata() {
        ${autogen_tag}
        # Delete the above line if you want to manage this file yourself
        masters = ${masters% }
+       repo-name = ${repo_name}
        $(printf '%b' "${this_manifests}")
        EOF
 }

Reply via email to