From: Mike Frysinger Date: Fri, 24 Jan 2014 06:51:46 +0000 (-0500) Subject: gentoo-sync: support portageq repositories_configuration X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=047f042ec713216cff4ed97845f7c3c1e0f89223;p=home.git gentoo-sync: support portageq repositories_configuration --- diff --git a/.bin/gentoo-sync b/.bin/gentoo-sync index e52bb76..c707e08 100755 --- a/.bin/gentoo-sync +++ b/.bin/gentoo-sync @@ -51,23 +51,34 @@ date if ${GS_UPWORLD} ; then ( - eval $(portageq envvar -v PORTDIR) - cd "${PORTDIR}" + repos=( + $(portageq repositories_configuration / | awk '$1 == "location" { $1 = $2 = ""; print }') + ) bad_pkgs=() good_pkgs=() for p in `qlist -ICS` ; do - if [[ -d ${p%:*} ]] ; then + good=false + for repo in ${repos[@]} ; do + if [[ -d ${repo}/${p%:*} ]] ; then + good=true + break + fi + done + + if ${good} ; then good_pkgs+=( ${p} ) else bad_pkgs+=( ${p} ) fi done + if [[ ${#bad_pkgs[@]} -gt 0 ]] ; then echo 'These packages no longer exist:' printf '\t%s\n' "${bad_pkgs[@]}" echo fi echo 'emerge -u1qv --keep-going $(awk '\''$2 ~ /\// {print $2}'\'' '${up_log}')' - emerge ${good_pkgs[*]} -upq --cols + emerge -upq --cols \ + $(printf '%s\n' ${good_pkgs[*]} | grep -v '^cross-') ) >& ${up_log} fi