blob: 332b6c161284d9a22681dce70f4e4ef6489fb25d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/bin/sh
x="$1"
cd ~
if [ "${x/\// }" == "${x}" ]; then
wget -q -O ~/rindex.cache http://tinderbox.x86.dev.gentoo.org/misc/rindex/.rindex
x=$(grep /${x}$ ~/rindex.cache)
x=$(echo -n ${x} |tr '\n' ' ')
if [ "${x/ /}" != "${x}" ]; then
echo "ambiguous short name $1. Please specify one of the following fully-qualified ebuild names instead: $(echo $x | tr '\n' ' ')"
exit 1
fi
[[ $x == "" ]] && exit 1
fi
foo=$(wget -q -O - http://tinderbox.x86.dev.gentoo.org/misc/rindex/$x)
if [[ $foo != "" ]]; then
for pkg in ${foo}; do
cpv=${pkg%:*}
use=${pkg/"${cpv}"}
result=${result:+${result}$'\n'}$(qatom -C ${cpv} | cut -f 1-2 -d " " --output-delimiter "/" | tr -d "\n")${use}
done
echo $x '<-' $(sort -u <<< "${result}" | tr "\n" " ")
exit $?
fi
exit 0
|