From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QwcCs-0005C1-8B for garchives@archives.gentoo.org; Thu, 25 Aug 2011 15:51:02 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3765D21C172; Thu, 25 Aug 2011 15:50:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0554B21C172 for ; Thu, 25 Aug 2011 15:50:53 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6680D1B400A for ; Thu, 25 Aug 2011 15:50:53 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B1F7980040 for ; Thu, 25 Aug 2011 15:50:52 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <72b8767e712ba8615331a035c8bcecaf5492347e.vapier@gentoo> Subject: [gentoo-commits] proj/crossdev:master commit in: / X-VCS-Repository: proj/crossdev X-VCS-Files: crossdev X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 72b8767e712ba8615331a035c8bcecaf5492347e Date: Thu, 25 Aug 2011 15:50:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 91c6cd88e3c16b6fa87543ee856f5737 commit: 72b8767e712ba8615331a035c8bcecaf5492347e Author: Mike Frysinger gentoo org> AuthorDate: Thu Aug 25 15:48:16 2011 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Aug 25 15:50:43 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/crossdev.git;= a=3Dcommit;h=3D72b8767e crossdev: auto-create metadata/layout.conf For people who are pulling packages from multiple overlays which may contain their own eclass dirs, auto create a layout.conf so that portage will search those automatically. Signed-off-by: Mike Frysinger gentoo.org> --- crossdev | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/crossdev b/crossdev index 5f60905..b470cd9 100755 --- a/crossdev +++ b/crossdev @@ -24,6 +24,7 @@ die() { eerror ${logfile} exit 1 } +has() { [[ " ${@:2} " =3D=3D *" $1 "* ]]; } =20 usage() { local exit_status=3D${1:-0} @@ -716,6 +717,49 @@ set_portage() { set_links ${cat} ${pkg} "${ovl}" set_env ${pkg} "${env}" } +set_metadata() { + # for people who have eclasses spread over their overlays, generate + # a layout.conf file so portage can find them. this is a crapshoot + # when diff overlay sources have conflicting eclasses, but nothing + # we really can do about that. + local autogen_tag=3D"# Autogenerated and managed by crossdev" + local meta=3D${CROSSDEV_OVERLAY}/metadata + local layout=3D${meta}/layout.conf + local d name masters + + mkdir -p "${meta}" + if [[ -e ${layout} ]] ; then + if ! grep -qs "^${autogen_tag}" "${layout}" ; then + einfo "leaving metadata/layout.conf alone in ${CROSSDEV_OVERLAY}" + return + fi + + # We are managing it, so blow it away + rm -f "${layout}" + fi + + # build up a list of possible repos where we can pull from + for d in "${BOVL}" "${GOVL}" "${KOVL}" "${LOVL}" ${SEARCH_OVERLAYS} "${= PORTDIR}" ; do + [[ -z ${d} ]] && continue + + name=3D + if [[ -e ${d}/profiles/repo_name ]] ; then + name=3D$(<"${d}"/profiles/repo_name) + fi + [[ -z ${name} ]] && continue + + if [[ -d ${d}/eclass ]] ; then + has ${name} ${masters} || masters+=3D" ${name}" + fi + done + + # write out that layout.conf! + cat <<-EOF > "${layout}" + ${autogen_tag} + # Delete the above line if you want to manage this file yourself + masters =3D${masters} + EOF +} =20 mkdir -p "${CONFIGROOT}" check_trailing_newline "${CONFIGROOT}"/categories @@ -735,6 +779,7 @@ set_portage ${KCAT} ${KPKG} ${KVER} "${KENV}" "${KOVL= }" set_portage ${LCAT} ${LPKG} ${LVER} "${LENV}" "${LOVL}" set_portage sys-devel gdb set_portage dev-util insight +set_metadata =20 # filter out revdep rebuild stuff #182601 mkdir -p /etc/revdep-rebuild