summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-09-28 21:07:23 +0000
committerMike Frysinger <vapier@gentoo.org>2012-09-28 21:07:23 +0000
commit60664f16ee8265d0b95c2d72358c65757e748415 (patch)
treef73478cb0eec9bd414907b8bc6877dc9ed448327 /scripts/update-gcc
parentdrop old snapshots that no longer exist (diff)
downloadtoolchain-60664f16ee8265d0b95c2d72358c65757e748415.tar.gz
toolchain-60664f16ee8265d0b95c2d72358c65757e748415.tar.bz2
toolchain-60664f16ee8265d0b95c2d72358c65757e748415.zip
auto delete old snapshots which are no longer on the servers
Diffstat (limited to 'scripts/update-gcc')
-rwxr-xr-xscripts/update-gcc11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/update-gcc b/scripts/update-gcc
index 51a4831..7d8b427 100755
--- a/scripts/update-gcc
+++ b/scripts/update-gcc
@@ -26,6 +26,17 @@ wget -nv --no-remove-listing -O /dev/null ftp://sources.redhat.com/pub/${PN}/sna
l=".listing"
sed -i 's/\r$//' ${l}
+# First unload ones that no longer exist.
+ebuilds=$(echo ${PN}-*_alpha*.ebuild)
+for e in ${ebuilds} ; do
+ v=$(echo "${e}" | sed -e 's:^gcc-::g' -e 's:.ebuild::g' -e 's:.._alpha:-:g')
+ if grep -q "\<${v}$" ${l} ; then
+ continue
+ fi
+ svn rm ${e}
+done
+
+# Then load new ones.
majors=$(awk '$(NF-2) ~ /^LATEST-/ { print gensub("LATEST-", "", "", $(NF-2)) }' ${l})
echo "${PN} majors:" ${majors}