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 1S2mIe-0005yK-Uw for garchives@archives.gentoo.org; Wed, 29 Feb 2012 16:22:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D86FE092E; Wed, 29 Feb 2012 16:22:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1044DE092E for ; Wed, 29 Feb 2012 16:22:36 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6883F1B4020 for ; Wed, 29 Feb 2012 16:22:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 2903AE5405 for ; Wed, 29 Feb 2012 16:22:35 +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: <1330449636.c0d8915eefa7f334f3912440016f50bd0b32995e.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: c0d8915eefa7f334f3912440016f50bd0b32995e X-VCS-Branch: master Date: Wed, 29 Feb 2012 16:22:35 +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: d7fc305e-cc7c-4221-ad31-d36e0a57abe0 X-Archives-Hash: 9d14773f66c4426149a750e2371b118b commit: c0d8915eefa7f334f3912440016f50bd0b32995e Author: Mike Frysinger gentoo org> AuthorDate: Tue Feb 28 17:20:36 2012 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Feb 28 17:20:36 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/crossdev.git;= a=3Dcommit;h=3Dc0d8915e crossdev: output config in a shell-evalable style Should simplify scripts trying to parse this as now they can do: eval $(crossdev --show-target-cfg ...); echo $foo Rather than manually parsing like: foo=3D$(crossdev --show-target-cfg ... | awk '$1 =3D=3D "foo" { print $N= F }') Signed-off-by: Mike Frysinger gentoo.org> --- crossdev | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/crossdev b/crossdev index 50a523e..68389d5 100755 --- a/crossdev +++ b/crossdev @@ -537,7 +537,7 @@ for with in HEADERS ; do done =20 show_target_cfg() { - local pkgs + local pkgs crosspkgs=3D() =20 pkgs=3D( binutils B @@ -547,18 +547,27 @@ show_target_cfg() { ) ex_gdb && pkgs+=3D( gdb D ) =20 - echo "arch ${TARCH}" - echo "target ${CTARGET}" - echo "category cross-${CTARGET}" + echo "arch=3D${TARCH}" + echo "target=3D${CTARGET}" + echo "category=3Dcross-${CTARGET}" while [[ ${#pkgs[@]} -gt 0 ]] ; do - local vcat=3D"${pkgs[1]}CAT" - local vpkg=3D"${pkgs[1]}PKG" + local pkg=3D${pkgs[0]} + local v=3D${pkgs[1]} + local vcat=3D"${v}CAT" + local vpkg=3D"${v}PKG" + local ocat=3D"${pkg}_category" + local opkg=3D"${pkg}_pn" =20 if [[ ${!vpkg} !=3D "[none]" ]] ; then - echo "${pkgs[0]} ${!vcat} ${!vpkg}" + echo "${ocat}=3D${!vcat}" + echo "${opkg}=3D${!vpkg}" + else + printf '%s=3D\n' "${ocat}" "${opkg}" fi + crosspkgs+=3D( ${pkg} ) pkgs=3D( ${pkgs[@]:2} ) done + echo "crosspkgs=3D'${crosspkgs[*]}'" =20 exit 0 }