commit: 7472a72787d046a4b47b752df64b4a8182fcf5ff
Author: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 29 23:14:08 2020 +0000
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Jan 29 23:20:30 2020 +0000
URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=7472a727
crossdev: adjust repo-name in layout.conf based on repos.conf
When '--ov-output' is not provided, crossdev searches the list of
overlays for a repo matching the name "crossdev" or
"cross-${CTARGET}". When there is a match for "cross-${CTARGET}" but
the location does not exist, crossdev attempts to populate the overlay
structure. However, it incorrectly names the repo "crossdev" in
metadata/layout.conf under repo-name, as opposed to
"cross-${CTARGET}". This creates further problems when the list of
overlays is restricted using the '--overlays' option, given that the
name of the repo under repos.conf will not match what is in
layout.conf.
Use the correct repo-name when creating layout.conf. This preserves
the default behavior of using the repo-name "crossdev" when
'--ov-output' is provided.
Signed-off-by: Göktürk Yüksek <gokturk <AT> gentoo.org>
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
crossdev | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/crossdev b/crossdev
index 1722942..8783a9a 100755
--- a/crossdev
+++ b/crossdev
@@ -503,11 +503,14 @@ setup_portage_vars() {
# set up some repos.conf magic if possible. if not,
# install our stuff to the first overlay in the list.
if [[ -z ${CROSSDEV_OVERLAY} ]] ; then
- local repo
- for repo in "cross-${CTARGET}" crossdev ; do
- repo=$(echo "${REPO_CONFIG}" | sed -n
"/^${repo}:/s,^[^:]*:,,p")
- if [[ -n ${repo} ]] ; then
- CROSSDEV_OVERLAY=${repo}
+ local repo_path repo_name
+ for repo_name in "cross-${CTARGET}" crossdev ; do
+ repo_path=$(echo "${REPO_CONFIG}" | sed -n
"/^${repo_name}:/s,^[^:]*:,,p")
+ if [[ -n ${repo_path} ]] ; then
+ CROSSDEV_OVERLAY=${repo_path}
+ # if we end up installing our stuff, save the
name of the repo
+ # for further use in metadata/layout.conf
+ CROSSDEV_OVERLAY_NAME=${repo_name}
break
fi
done
@@ -702,6 +705,7 @@ XPKGS=() XVERS=() XUSES=() XENVS=() XOVLS=()
DEFAULT_VER="[latest]"
SEARCH_OVERLAYS=""
CROSSDEV_OVERLAY=""
+CROSSDEV_OVERLAY_NAME="crossdev"
# These flags are always disabled for cross-gcc; either usually/always broken,
or
# not tested, or doesn't make sense, or no one simply cares about them
GUSE_DISABLE="-boundschecking -d -gcj -gtk -libffi -mudflap -objc -objc++
-objc-gc"
@@ -1181,7 +1185,7 @@ set_metadata() {
# See if this repo is already named.
f="${CROSSDEV_OVERLAY}/profiles/repo_name"
repo_name=$(cat "${f}" 2>/dev/null)
- : ${repo_name:="crossdev"}
+ : ${repo_name:="${CROSSDEV_OVERLAY_NAME}"}
xmkdir -p "${meta}"
if [[ -e ${layout} ]] ; then