summaryrefslogtreecommitdiff
blob: 7d8b42704fce44a8140ae3d0869e61ab062e84cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash -e

export LC_ALL=C
PN="gcc"

sudo=

[ -d sys-devel ] && cd sys-devel/${PN}
[ -d ../sys-devel ] && cd ../sys-devel/${PN}
if [ ! -e metadata.xml ] ; then
	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

wget -nv --no-remove-listing -O /dev/null ftp://sources.redhat.com/pub/${PN}/snapshots/
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}

lm=
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="${PN}-${m}.0_alpha${s}.ebuild"
		[[ -e ${s} ]] && continue
		echo " ${s}"
		cp ${curr} ${s}
		fetch ${s}
	done
	lm=${m}
done

rm -f ${l}

manifest ${s}