summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-09-28 18:15:38 +0000
committerMike Frysinger <vapier@gentoo.org>2012-09-28 18:15:38 +0000
commit3bc139d298378af1807d6e43e7ec36257a840048 (patch)
treea3bae2dbca5840ee42e7526a6178c7b0fa5fe85f /scripts
parentupdate gcc snapshots (diff)
downloadtoolchain-3bc139d298378af1807d6e43e7ec36257a840048.tar.gz
toolchain-3bc139d298378af1807d6e43e7ec36257a840048.tar.bz2
toolchain-3bc139d298378af1807d6e43e7ec36257a840048.zip
convert scripts to use wget as that is less likely to be removed (like lynx), and it produces a much nicer output to parse as we are working with ftp listings
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-gcc45
-rwxr-xr-xscripts/update-gdb36
2 files changed, 51 insertions, 30 deletions
diff --git a/scripts/update-gcc b/scripts/update-gcc
index db01020..51a4831 100755
--- a/scripts/update-gcc
+++ b/scripts/update-gcc
@@ -1,45 +1,56 @@
#!/bin/bash -e
+export LC_ALL=C
+PN="gcc"
+
sudo=
-[ -d sys-devel ] && cd sys-devel/gcc
-[ -d ../sys-devel ] && cd ../sys-devel/gcc
+[ -d sys-devel ] && cd sys-devel/${PN}
+[ -d ../sys-devel ] && cd ../sys-devel/${PN}
if [ ! -e metadata.xml ] ; then
- echo "Run this in the gcc dir"
+ echo "Run this in the ${PN} dir"
exit 1
fi
export FEATURES="assume-digests -strict digest"
+fetch() {
+ ${sudo} env GENTOO_MIRRORS=" " FEATURES="${FEATURES}" ebuild $1 fetch
+}
+manifest() {
+ ${sudo} ebuild $1 manifest
+}
date
-lynx -dump ftp://sources.redhat.com/pub/gcc/snapshots > list
+wget -nv --no-remove-listing -O /dev/null ftp://sources.redhat.com/pub/${PN}/snapshots/
+l=".listing"
+sed -i 's/\r$//' ${l}
-major=$(grep /LATEST list | cut -d- -f2)
-echo "GCC majors:" ${major}
+majors=$(awk '$(NF-2) ~ /^LATEST-/ { print gensub("LATEST-", "", "", $(NF-2)) }' ${l})
+echo "${PN} majors:" ${majors}
lm=
-for m in ${major} ; do
- snaps=$(grep /${m}- list | cut -d- -f2)
- curr=$(ls gcc-${m}.0_alpha* | LC_ALL=C sort | tail -n 1)
- if [ -z "${curr}" ] ; then
- curr=$(ls gcc-${lm}.0_alpha* | LC_ALL=C sort | tail -n 1)
- if [ -z "${curr}" ] ; then
+for m in ${majors} ; do
+ snaps=$(awk '$NF ~ /^'${m}'-/ { print gensub("'${m}'-", "", "", $NF) }' ${l})
+ curr=$(ls ${PN}-${m}.0_alpha* | sort | tail -n 1)
+ if [[ -z ${curr} ]] ; then
+ curr=$(ls ${PN}-${lm}.0_alpha* | sort | tail -n 1)
+ if [[ -z ${curr} ]] ; then
echo "no current ebuild for major ${m}"
exit 1
fi
fi
echo "### ${m}: ${curr}"
for s in ${snaps} ; do
- s="gcc-${m}.0_alpha${s}.ebuild"
- [ -e ${s} ] && continue
+ s="${PN}-${m}.0_alpha${s}.ebuild"
+ [[ -e ${s} ]] && continue
echo " ${s}"
cp ${curr} ${s}
- $sudo env GENTOO_MIRRORS=" " FEATURES="${FEATURES}" ebuild ${s} fetch
+ fetch ${s}
done
lm=${m}
done
-rm -f list
+rm -f ${l}
-$sudo ebuild ${s} manifest
+manifest ${s}
diff --git a/scripts/update-gdb b/scripts/update-gdb
index a2b75db..fbfaf34 100755
--- a/scripts/update-gdb
+++ b/scripts/update-gdb
@@ -1,35 +1,45 @@
#!/bin/bash -e
export LC_ALL=C
+PN="gdb"
sudo=
-[ -d sys-devel ] && cd sys-devel/gdb
-[ -d ../sys-devel ] && cd ../sys-devel/gdb
+[ -d sys-devel ] && cd sys-devel/${PN}
+[ -d ../sys-devel ] && cd ../sys-devel/${PN}
if [ ! -e metadata.xml ] ; then
- echo "Run this in the gdb dir"
+ echo "Run this in the ${PN} dir"
exit 1
fi
export FEATURES="assume-digests -strict digest"
+fetch() {
+ ${sudo} env GENTOO_MIRRORS=" " FEATURES="${FEATURES}" ebuild $1 fetch
+}
+manifest() {
+ ${sudo} ebuild $1 manifest
+}
date
-lynx -dump -nolist ftp://sources.redhat.com/pub/gdb/snapshots/current > list
+wget -nv --no-remove-listing -O /dev/null ftp://sources.redhat.com/pub/${PN}/snapshots/current/
+l=".listing"
+sed -i 's/\r$//' ${l}
-snaps=$(grep gdb-weekly-'[[:digit:]]'.*.tar list | cut -d- -f3)
+snaps=$(grep -o ${PN}-weekly-'[[:digit:]]'.*.tar.* ${l} | \
+ sed -e 's:.*-::' -e 's:.tar.*::')
-src=$(ls gdb-*.ebuild | sort | tail -n 1)
-for s in ${snaps} "" ; do
- [[ ${s} == *.tar.* ]] || continue
- s=${s%.tar.*}
- dst="gdb-${s}.ebuild"
+src=$(ls ${PN}-*.ebuild | sort | tail -n 1)
+for s in ${snaps} ; do
+ dst="${PN}-${s}.ebuild"
[[ ! -e ${dst} ]] || continue
echo "### found ${s}"
cp ${src} ${dst}
- $sudo env GENTOO_MIRRORS=" " FEATURES="${FEATURES}" ebuild ${dst} fetch
+ fetch ${dst}
done
-rm -f list
+rm -f ${l}
-$sudo ebuild ${src} manifest
+if [[ -n ${src} ]] ; then
+ manifest ${src}
+fi