Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 82288 Details for
Bug 126404
Provide tool for maintaining package.keywords
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
My script
keywords (text/plain), 3.32 KB, created by
Mathias Hasselmann
on 2006-03-16 03:51:55 UTC
(
hide
)
Description:
My script
Filename:
MIME Type:
Creator:
Mathias Hasselmann
Created:
2006-03-16 03:51:55 UTC
Size:
3.32 KB
patch
obsolete
>#!/bin/bash > >database=/etc/portage/package.keywords >tempfile=/tmp/keywords.$$ > >cleanup() { > rm -f ${tempfile} >} > >die() { > echo "${0//#*\//}: $*" >&2 > exit 1 >} > >append-package() { > local package=${1} > local keyword=${2:-~x86} > > test -z "${package}" && die "No package specified" > echo "${package} ${keyword}" >> ${database} >} > >remove-packages() { > if show-packages "$@" > then > echo "Press RETURN to remove those packages." > read > > GREPFLAGS=-v show-packages "$@" > ${tempfile} > diff -u "${database}" "${tempfile}" > > echo "Press RETURN to apply this changes." > read > > mv "${tempfile}" "${database}" > else > echo "No matches found." > fi >} > >show-packages() { > test $# = 0 && die "No packages specified" > > local pattern="$*" > > pattern="${pattern// /\\|}" > pattern="${pattern//./\\.}" > > grep ${GREPFLAGS} "^\(=\|>=\|<=\)\?\(${pattern}\)" < ${database} >} > >check-keyword() { > local keyword=$1; shift > grep -q "^KEYWORDS=.*[\"[:space:]]${keyword}\>" "$@" >} > >check-packages() { > sed -ne 's|^=\(\S\+\)/\(\S*\)-\([0-9.*]\+[a-z]\?\(_\w\+[0-9]\+\)\?\(-r[0-9]\+\)\?\)\s.*|\1 \2 \3|p' < ${database} | > while read category package version > do > test -d "/usr/portage/${category}" || echo "Bad category: ${category}" > > local cdirs=$(find /usr/{portage,local/overlay/*} -type d -name ${category} -maxdepth 1) > local pdirs=$(find ${cdirs} -type d -maxdepth 1 -name ${package}) > > if test -n "${pdirs}" > then > local efiles=$(find ${pdirs} -type f -maxdepth 1 -name "${package}-${version}.ebuild") > > if test -z "${efiles}" > then > local stable= unstable= > > for ebuild in $( > find ${pdirs} -type f -maxdepth 1 -name "*.ebuild") > do > ev=$(echo ${ebuild} | sed -e "s|.*/||" -e "s|^${package}-||" -e "s|\.ebuild$||g") > { check-keyword 'x86' ${ebuild} && stable="${stable} ${ev}"; } || > { check-keyword '~x86' ${ebuild} && unstable="${unstable} ${ev}"; } > done > > stable=${stable/# /} > unstable=${unstable/# /} > > echo "No ebuild found: ${category}/${package}-${version} [${stable:-none}][${unstable:-none}]" > elif echo "${version}" | fgrep -q -v '*' > then > check-keyword '~x86' ${efiles} || { > check-keyword 'x86' ${efiles} && > echo "Ebuild is stable: ${category}/${package}-${version}" || > echo "Platform not supported: ${category}/${package}-${version}" > } > fi > else > echo "Bad package: ${category}/${package}" > fi > > done >} > >show-usage() { > cat <<END >Usage: ${0//#*\//} COMMAND [ARGS...] >Utility for working with Gentoo package keywords. > >COMMANDS > > check Searches for obsolete keywords > add PACKAGE [KEYWORD] Adds a keyword for the given package > remove PACKAGE Removes package > show PACKAGE Lists packages > >END > >} > >trap cleanup EXIT > >case "$1" in > add) shift; append-package "$@";; > remove) shift; remove-packages "$@";; > show) shift; show-packages "$@";; > check) check-packages;; > *) show-usage;; >esac > ># vim: sw=4 sta et
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 126404
: 82288