From: Mike Frysinger Date: Wed, 4 May 2022 13:14:11 +0000 (-0400) Subject: gentoo: update ebuild helpers X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=03038704215eec66fab2e9d9c458d9a2e1eac2b8;p=home.git gentoo: update ebuild helpers --- diff --git a/.profile.d/gentoo.sh b/.profile.d/gentoo.sh index 950260c..8aac8e8 100644 --- a/.profile.d/gentoo.sh +++ b/.profile.d/gentoo.sh @@ -1,9 +1,13 @@ -alias ebuild-sync='rsync -av ./ /usr/portage/${PWD#/usr/local/src/gentoo/repo/gentoo/} --exclude ChangeLog --exclude CVS --exclude metadata.xml --delete' -alias ebuild-emerge='sudo emerge -1av $(echo ${PWD} | awk -F/ "{printf \"%s/%s\", \$(NF-1), \$(NF)}")' +alias ebuild-sync='rsync -av ./ /usr/portage/${PWD#/usr/local/src/gentoo/repo/gentoo/} --exclude ChangeLog --exclude metadata.xml --delete' alias ekeyword='ekeyword -v -q' alias repoman='repoman -q -q' alias rf='/usr/local/src/gentoo/portage/repoman/bin/repoman.git -q full' +ebuild-emerge() { + sudo -E emerge -1av "$@" \ + $(echo "${PWD}" | awk -F/ "{printf \"%s/%s\", \$(NF-1), \$(NF)}") +} + _echangelog() { [[ ! -e ChangeLog ]] \ && echo "No ChangeLog" \ @@ -107,16 +111,16 @@ submit_bug_stable() { -d "${msg}" \ -a "${maintainer}" \ --cc="${cc// /,}" \ - -k STABLEREQ \ --product='Gentoo Linux' \ --component=Ebuilds \ --priority=Normal \ --severity=enhancement +# -k STABLEREQ } eskeys() { local k cat - if [[ ! -e ChangeLog ]] ; then + if [[ ! -e Manifest ]] ; then # running in a category rather than package cat="/" fi @@ -126,10 +130,22 @@ eskeys() { done } _erit() { - local msg=$1 ; shift - [[ $1 == [[:digit:]]* ]] && msg="$msg #$1" && shift - echo git commit -m "$(echo $@ | sed 's: :/:g') $msg" - git commit -m "$(echo $@ | sed 's: :/:g') $msg" + if [[ $# -eq 1 ]] ; then + echo "Args: " + return 1 + fi + + local cat=$(basename "$(dirname "${PWD}")") + local pkg=$(basename "${PWD}") + local mode=$1 ; shift + local ver=$1 ; shift + local arches=$(printf '%s/' $(printf '%s\n' "$@" | sort -u)) + arches=${arches%/} + local msg="${cat}/${pkg}: mark ${ver} ${arches} ${mode}" + + local cmd=( git commit -m "${msg}" . ) + echo "${cmd[@]}" + "${cmd[@]}" } erstable() { _erit stable "$@" ; } erlove() { _erit love "$@" ; }