Keywords
From Gentoo Linux Wiki
Contents |
[edit] Introduction
By default, portage will only install packages with a stable keyword. These would be x86, amd64, ppc, et cetera. So what do all the other keywords, such as ~x86, -x86 and -*, mean?
[edit] arch (x86, amd64, etc)
Both the package version and the ebuild are widely tested, known to work and not have any serious issues on the indicated platform.
[edit] ~arch (~x86, ~amd64, etc)
The package version and the ebuild are believed to work and do not have any known serious bugs, but more testing is required before the package version is considered suitable for arch.
[edit] No keyword
If a package has no keyword for a given architecture, it means it is not known whether the package will work, or that insufficient testing has occurred for ~arch.
[edit] -arch (-x86, -amd64, etc)
The package version will not work on the specified architecture. This could be caused by badly written code, relying upon particular hardware, or binary only packages. For example, non-64-bit or Endian clean code, or a BIOS querying tool would not work on platforms without a BIOS.
[edit] -*
The -* keyword is special. It is used to indicate package versions which are not worth trying to test on unlisted architectures. For example, a binary-only package which is only supported upstream on x86 and PPC might use:
KEYWORDS="-* x86 ppc"
This is different in implication from x86 ppc — the former implies that it will not work on other architectures, whereas the latter implies that it has not been tested.
[edit] Regenerating the Keywords File
If you have accidentally deleted or severely altered your /etc/portage/package.keywords file, either by incorrectly appending keywords from the shell or accidental deletion, you can use the following script to help regenerate and sort it:
| File: /usr/sbin/keywords-file-regen |
#!/bin/bash
function help {
echo "Syntax: keyword-file-regen [options]"
echo " --update-reg Update your keywords file"
echo " --update-local Update your portage overlay"
echo " --update-masked Update masked packages"
echo " --update-all Update all of the keywords file"
exit
}
function start {
k="/etc/portage/package.keywords"
if [ -f $k ]
then
rm $k
fi
}
function update_reg {
emerge -puON world |
grep UD |
sed -e "s/\[ebuild *UD\] //g" -e "s/-[0-9].*//" >> $k
}
function update_local {
emerge -puON world |
grep "[1]" |
sed -e "s/\[ebuild *UD\] //g" -e "s/-[0-9].*//" |
grep -v "ebuild" |
sed 's/ /\n/g' >> $k
}
function update_masked {
b=`emerge -pv world | grep -n exist | sed "s/:.*//"`
b=$(expr $b + 1)
emerge -pv world | sed -e "${b}!d" -e 's/ /\n/g' >> $k
while echo `emerge -pD world` | grep "masked"; do
emerge -pD world |
sed -e '/\!\!\!/!d' |
sed -n '1p' |
sed -e 's/" .*$//' -e 's/!.*"//' -e "s/-[0-9].*//" -e 's/[=,~,<,>]//' -e 's/[=]//' >> $k
done
}
function sort_file {
sort $k -o $k
}
#Options:
if [ ! "$1" ];
then
help
fi
while [ "$1" ]; do
case "$1" in
--update-reg)
start
update_reg
sort_file;;
--update-local)
start
update_local
update_reg
sort_file;;
--update-masked)
start
update_masked
update_reg
sort_file;;
--update-all)
start
update_reg
update_local
update_masked
sort_file;;
esac
shift
done
|
[edit] See Also
- Gentoo Development Guide The inspiration for this article.
- HOWTO Use Portage Correctly
- TIP Regenerate package keywords
