]> git.wh0rd.org Git - home.git/commitdiff
gentoo-sync: support portageq repositories_configuration
authorMike Frysinger <vapier@gentoo.org>
Fri, 24 Jan 2014 06:51:46 +0000 (01:51 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 24 Jan 2014 06:53:33 +0000 (01:53 -0500)
.bin/gentoo-sync

index e52bb76f3de9923390b45271a2c7433a2763a951..c707e08f3596db9f216f0b50447e9072180b1196 100755 (executable)
@@ -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