From 047f042ec713216cff4ed97845f7c3c1e0f89223 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 24 Jan 2014 01:51:46 -0500 Subject: [PATCH] gentoo-sync: support portageq repositories_configuration --- .bin/gentoo-sync | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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 -- 2.39.5