1 alias ebuild-sync='rsync -av ./ /usr/portage/${PWD#/usr/local/src/gentoo-x86/} --exclude ChangeLog --exclude CVS --exclude metadata.xml --delete'
2 alias ebuild-emerge='sudo emerge -1av $(echo ${PWD} | awk -F/ "{printf \"%s/%s\", \$(NF-1), \$(NF)}")'
3 alias ekeyword='ekeyword -v -q'
8 echo "Usage: cvs_gentoo_url <file>[:rev1[:rev2]]"
12 # spec has the form file:rev1[:rev2]
13 # rev2 defaults to rev1-1
19 if [[ ! -e ${file} ]] ; then
20 echo "file '${file}' does not exist"
24 [[ ${file} == */* ]] && dir=${file%/*}
28 if [[ -z ${rev2} ]] ; then
32 set -- $(grep /${file}/ CVS/Entries)
36 if [[ ${rev2} == "0" ]] ; then
40 # existing file, bump rev automatically
41 rev2="1.$((${rev2#1.}+1))"
44 local rev2r=${rev2#1.}
45 local rev1=${3:-1.$((rev2r - 1))}
47 local cvsroot=$(<${dir}/CVS/Repository)
48 if [[ ${cvsroot} == gentoo-x86* ]] ; then
49 cvsroot=${cvsroot#gentoo-x86}
54 [[ ${rev2} == "1.1" || ${rev1} == "${rev2}" ]] \
55 && urirev="?rev=${rev2}" \
56 || urirev="?r1=${rev1}&r2=${rev2}"
57 echo "http://sources.gentoo.org/${cvsroot}/${file}${urirev}"
61 _cvs_gentoo_url "${f}"
66 local repo=$(git config remote.origin.url | sed 's:.*git.overlays.gentoo.org/::')
67 git log -n3 ${1:-HEAD} | \
68 sed "s,^commit ,http://git.overlays.gentoo.org/gitweb/?p=${repo};a=commitdiff;h=,"
75 URL = "http://sources.gentoo.org/" gensub(/.*svnroot\/([^/]*).*/,"\\1","");
76 } else if ($1 == "Revision:") {
78 URL = URL "?rev=" (rev + 1) "&view=rev"
91 URL = "http://sources.gentoo.org" $1 "?"
92 } else if ($1 == "Revision:") {
94 URL = URL "r1=" rev "&r2=" (rev + 1)
102 [[ ! -e ChangeLog ]] \
103 && echo "No ChangeLog" \
105 echangelog "$@" || return 1
108 repoman commit --echangelog=y "${@:1:$#-1}" -m "${@:$#}" || return 1
112 _echangelog "$@" || exit 1
113 cvs commit -m "$@" || exit 1
118 while [[ $# -gt 0 ]] ; do
119 declare url=$1 tmp=$(mktemp) filename || return 1
120 [[ ${url} == */* ]] || url="http://bugs.gentoo.org/attachment.cgi?id=${url}"
121 printf '%s -> ' "${url}"
122 if eval $(wget -S -O"${tmp}" "${url}" 2>&1 |
123 grep 'Content-disposition:' | sed 's/.* //') && \
124 mv "${tmp}" "${filename}" && \
125 chmod $(printf "%03o" "$((0666 & ~$(umask)))") "${filename}" ; then
136 if [[ $@ == *.ebuild* ]] ; then
139 keys=$(sed -n '/^[[:space:]]*KEYWORD/{s:.*=::;s:"::g;p}' ${e})
140 for a in ${keys} ; do
141 [[ ${a} != ~* ]] && continue
148 printf '%s@gentoo.org ' ${ret//\~}
151 stable_arch_emails() {
152 arch_emails "$@" | sed -r -e 's:([^ ]*-[^ ]*|mips)@[^ ]*::g'
155 local f=${1:-metadata.xml}
156 local maintainer=$(xml sel -t -v pkgmetadata/herd $f)
157 if [[ ${maintainer:-no-herd} == "no-herd" ]] ; then
158 maintainer=$(xml sel -t -v pkgmetadata/maintainer/email $f)
159 elif [[ -n ${maintainer} ]] ; then
160 maintainer="${maintainer}@gentoo.org"
162 if [[ -z ${maintainer} ]] ; then
163 echo "No maintainer found in $f"
169 submit_bug_stable() {
171 if [[ $1 == "-m" ]] ; then
175 if [[ -z $1 ]] || [[ -n $2 ]] ; then
176 echo "Usage: submit_bug_stable <ebuilds>"
180 maintainer=$(eget_maintainer) || return 1
181 local cat=$(basename $(dirname $(pwd)))
182 local pkg=${1%.ebuild}
183 local ebuild=${pkg}.ebuild
184 local cc=$(stable_arch_emails ${ebuild})
185 if [[ -z ${cc} ]] ; then
186 echo "Unable to read ebuild '${ebuild}'"
189 if [[ ${maintainer} == *" "* ]] ; then
190 cc+=",${maintainer#* }"
191 maintainer=${maintainer%% *}
196 -t "${cat}/${pkg}: stabilize" \
201 --product='Gentoo Linux' \
202 --component=Ebuilds \
204 --severity=enhancement
209 if [[ ! -e ChangeLog ]] ; then
210 # running in a category rather than package
213 [[ -z $* ]] && set -- arm64 m68k s390 sh
215 ekeyword "${k}=x86" $(grep -l "KEYWORDS.*${k}" *${cat}*.ebuild)
220 [[ $1 == [[:digit:]]* ]] && msg="$msg #$1" && shift
221 echo repoman commit -m "$(echo $@ | sed 's: :/:g') $msg"
222 repoman commit -m "$(echo $@ | sed 's: :/:g') $msg"
224 erstable() { _erit stable "$@" ; }
225 erlove() { _erit love "$@" ; }
227 export PORTAGE_INST_UID=${UID}
228 export PORTAGE_INST_GID=`id -g`