summaryrefslogtreecommitdiff
blob: 762d1748b73f95341684918f5e0ac20c01589ee3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

EPREFIX=${EPREFIX:=${HOME}/Gentoo}

echo "See if we have emerge in PATH..."
type -p emerge || exit 1

ack="${EPREFIX}/etc/portage/package.accept_keywords"

sed "/### START keyword for $1/,/### END keyword for $1/d" -i ${ack}

echo "### START keyword for $1" >> ${ack}

while ! emerge -pv $1; do
	emerge -pv $1 |& sed -r -n '/masked by: missing keyword/{s,^- (.*/.*)-[[:digit:]].*,\1 **,p;q}' | tee -a ${ack}
done

echo "### END keyword for $1" >> ${ack}