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
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')
-rwxr-xr-xscripts/update-gcc11
-rwxr-xr-xscripts/update-gdb11
2 files changed, 22 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}
diff --git a/scripts/update-gdb b/scripts/update-gdb
index fbfaf34..0579d7e 100755
--- a/scripts/update-gdb
+++ b/scripts/update-gdb
@@ -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}-?.?.50.*.ebuild)
+for e in ${ebuilds} ; do
+ f=$(echo "${e}" | sed -e 's:^gdb-:gdb-weekly-:g' -e 's:.ebuild:.tar.bz2:g')
+ if grep -q "\<${f}$" ${l} ; then
+ continue
+ fi
+ svn rm ${e}
+done
+
+# Then load new ones.
snaps=$(grep -o ${PN}-weekly-'[[:digit:]]'.*.tar.* ${l} | \
sed -e 's:.*-::' -e 's:.tar.*::')