Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/crossdev:master commit in: /
Date: Wed, 29 Jan 2020 23:21:03
Message-Id: 1580340030.7472a72787d046a4b47b752df64b4a8182fcf5ff.slyfox@gentoo
1 commit: 7472a72787d046a4b47b752df64b4a8182fcf5ff
2 Author: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 29 23:14:08 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 29 23:20:30 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=7472a727
7
8 crossdev: adjust repo-name in layout.conf based on repos.conf
9
10 When '--ov-output' is not provided, crossdev searches the list of
11 overlays for a repo matching the name "crossdev" or
12 "cross-${CTARGET}". When there is a match for "cross-${CTARGET}" but
13 the location does not exist, crossdev attempts to populate the overlay
14 structure. However, it incorrectly names the repo "crossdev" in
15 metadata/layout.conf under repo-name, as opposed to
16 "cross-${CTARGET}". This creates further problems when the list of
17 overlays is restricted using the '--overlays' option, given that the
18 name of the repo under repos.conf will not match what is in
19 layout.conf.
20
21 Use the correct repo-name when creating layout.conf. This preserves
22 the default behavior of using the repo-name "crossdev" when
23 '--ov-output' is provided.
24
25 Signed-off-by: Göktürk Yüksek <gokturk <AT> gentoo.org>
26 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
27
28 crossdev | 16 ++++++++++------
29 1 file changed, 10 insertions(+), 6 deletions(-)
30
31 diff --git a/crossdev b/crossdev
32 index 1722942..8783a9a 100755
33 --- a/crossdev
34 +++ b/crossdev
35 @@ -503,11 +503,14 @@ setup_portage_vars() {
36 # set up some repos.conf magic if possible. if not,
37 # install our stuff to the first overlay in the list.
38 if [[ -z ${CROSSDEV_OVERLAY} ]] ; then
39 - local repo
40 - for repo in "cross-${CTARGET}" crossdev ; do
41 - repo=$(echo "${REPO_CONFIG}" | sed -n "/^${repo}:/s,^[^:]*:,,p")
42 - if [[ -n ${repo} ]] ; then
43 - CROSSDEV_OVERLAY=${repo}
44 + local repo_path repo_name
45 + for repo_name in "cross-${CTARGET}" crossdev ; do
46 + repo_path=$(echo "${REPO_CONFIG}" | sed -n "/^${repo_name}:/s,^[^:]*:,,p")
47 + if [[ -n ${repo_path} ]] ; then
48 + CROSSDEV_OVERLAY=${repo_path}
49 + # if we end up installing our stuff, save the name of the repo
50 + # for further use in metadata/layout.conf
51 + CROSSDEV_OVERLAY_NAME=${repo_name}
52 break
53 fi
54 done
55 @@ -702,6 +705,7 @@ XPKGS=() XVERS=() XUSES=() XENVS=() XOVLS=()
56 DEFAULT_VER="[latest]"
57 SEARCH_OVERLAYS=""
58 CROSSDEV_OVERLAY=""
59 +CROSSDEV_OVERLAY_NAME="crossdev"
60 # These flags are always disabled for cross-gcc; either usually/always broken, or
61 # not tested, or doesn't make sense, or no one simply cares about them
62 GUSE_DISABLE="-boundschecking -d -gcj -gtk -libffi -mudflap -objc -objc++ -objc-gc"
63 @@ -1181,7 +1185,7 @@ set_metadata() {
64 # See if this repo is already named.
65 f="${CROSSDEV_OVERLAY}/profiles/repo_name"
66 repo_name=$(cat "${f}" 2>/dev/null)
67 - : ${repo_name:="crossdev"}
68 + : ${repo_name:="${CROSSDEV_OVERLAY_NAME}"}
69
70 xmkdir -p "${meta}"
71 if [[ -e ${layout} ]] ; then