From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 55928138350 for ; Thu, 30 Jan 2020 08:36:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6B1A8E0823; Thu, 30 Jan 2020 08:36:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3A6BFE0823 for ; Thu, 30 Jan 2020 08:36:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E768734E542 for ; Thu, 30 Jan 2020 08:36:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1CA3171 for ; Thu, 30 Jan 2020 08:36:53 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1580373395.71b2d76a8ae33cae46db8677f4d3cd52d3ec4b96.slyfox@gentoo> Subject: [gentoo-commits] proj/crossdev:master commit in: / X-VCS-Repository: proj/crossdev X-VCS-Files: crossdev X-VCS-Directories: / X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: 71b2d76a8ae33cae46db8677f4d3cd52d3ec4b96 X-VCS-Branch: master Date: Thu, 30 Jan 2020 08:36:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b152330b-c26e-49c6-b3a6-a5ab55820753 X-Archives-Hash: 463402e574ea671e9b155036e61bf4b0 commit: 71b2d76a8ae33cae46db8677f4d3cd52d3ec4b96 Author: Göktürk Yüksek gentoo org> AuthorDate: Thu Jan 30 02:58:56 2020 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Thu Jan 30 08:36:35 2020 +0000 URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=71b2d76a crossdev: create a repos.conf entry for the output overlay if necessary If --ov-output is specified on the command line but there is no corresponding repos.conf entry for the output overlay, it is of no use since the package manager will not take it into consideration. Determine and create a repos.conf entry when necessary for the output overlay. Derive it's name from the basename of the overlay path and also take into account possible file path collisions. Signed-off-by: Göktürk Yüksek gentoo.org> Signed-off-by: Sergei Trofimovich gentoo.org> crossdev | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/crossdev b/crossdev index 8783a9a..b460d53 100755 --- a/crossdev +++ b/crossdev @@ -516,6 +516,30 @@ setup_portage_vars() { done : ${CROSSDEV_OVERLAY:=$(echo "${SEARCH_OVERLAYS}" | head -1)} + else + # Check if there is a repos.conf entry whose + # location matches ${CROSSDEV_OVERLAY} + local repo_name conf_base i="" + + repo_name="$(echo "${REPO_CONFIG}" | sed -n "\|:${CROSSDEV_OVERLAY}$|s,:.*,,p")" + if [[ -n ${repo_name} ]]; then + # Match the name specified in the corresponding repos.conf entry + CROSSDEV_OVERLAY_NAME="${repo_name}" + else + # Derive the name + : ${CROSSDEV_OVERLAY_NAME:="$(basename "${CROSSDEV_OVERLAY}")"} + # Note that there is no repos.conf entry and set up the path for the conf file + # We'll create the conf file itself in set_metadata() + conf_base="${CONFIGROOT}/repos.conf/${CROSSDEV_OVERLAY_NAME}" + while [[ -e "${conf_base}${i}.conf" ]]; do + # If there is a file collision with the conf file we target, + # we'll first append '1' before '.conf' and try. + # If that doesn't work, we'll retry with an incremented number + # Incrementing an empty string returns '1' in the shell + i=$((i + 1)) + done + CROSSDEV_OVERLAY_CREATE_REPOS_CONF="${conf_base}${i}.conf" + fi fi # make sure we have a valid logdir @@ -705,7 +729,8 @@ XPKGS=() XVERS=() XUSES=() XENVS=() XOVLS=() DEFAULT_VER="[latest]" SEARCH_OVERLAYS="" CROSSDEV_OVERLAY="" -CROSSDEV_OVERLAY_NAME="crossdev" +CROSSDEV_OVERLAY_NAME="" +CROSSDEV_OVERLAY_CREATE_REPOS_CONF="" # 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" @@ -1249,6 +1274,17 @@ set_metadata() { repo-name = ${repo_name} $(printf '%b' "${this_manifests}") EOF + + # If there is no repos.conf entry for the output overlay, create one here + if [[ -n ${CROSSDEV_OVERLAY_CREATE_REPOS_CONF} ]]; then + cat <<-EOF > "${CROSSDEV_OVERLAY_CREATE_REPOS_CONF}" || die "could not create the repo conf" + ${autogen_tag} + [${repo_name}] + location = ${CROSSDEV_OVERLAY} + masters = ${masters% } + auto-sync = no + EOF + fi } xmkdir -p "${CONFIGROOT}" "${CROSSDEV_OVERLAY}"/{cross-${CTARGET},profiles}