Last active
February 5, 2017 01:48
-
-
Save kentfredric/15fa5d73b8f1b50ac66c4726321cc18b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BADSLOTS=( | |
"dev-lang/perl:0/5.24" | |
"x11-libs/gtk+:3/3" | |
"net-libs/gnutls:0/0" | |
) | |
PHASES=( | |
"depend" | |
"rdepend" | |
"pdepend" | |
) | |
>/tmp/rebuild_me.1 | |
exec 3<>/tmp/rebuild_me.1 | |
>/tmp/rebuild_me | |
function get_ebuilds() { | |
local phase atom | |
phase=$1 | |
atom=$2 | |
echo -n "Querying for ${atom} in ${phase}: " >>/dev/stderr | |
qdepends --nocolor "--${phase}" --quiet --query "${atom}" | wc -l >&2 | |
qdepends --nocolor "--${phase}" --quiet --query "${atom}" | |
} | |
function get_ebuild_slots() { | |
xargs qdepends --nocolor --quiet -k SLOT | sed 's/: /:/' | |
} | |
function format_slots() { | |
xargs qatom --quiet --nocolor --format "%{CATEGORY}/%{PN}%[SLOT]" | sed -r 's|:([^/]*)/[^/]*|:\1|' | |
} | |
for SLOT in "${BADSLOTS[@]}"; do | |
for PHASE in "${PHASES[@]}"; do | |
get_ebuilds "${PHASE}" "${SLOT}=" | get_ebuild_slots | format_slots >&3 | |
sort -u /tmp/rebuild_me.1 > /tmp/rebuild_me | |
echo -n " ... total rebuilds so far: " >&2 | |
wc -l </tmp/rebuild_me >&2 | |
done | |
done | |
echo "Copy /tmp/rebuild_me to /etc/portage/sets/ and " | |
echo " try emerge -va1 -k n @rebuild_me" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment