summaryrefslogtreecommitdiff
path: root/cleaner/lister
blob: 1a4f967ca22e0258096b0c6cc1916d84a643f61c (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh

# Before running this script you have to have full-list-distfiles file
# in current directory
#
# Format of full-list-distfiles file:
#
# cd <path-to-distfiles>
# find by-md5 -type f -printf '%p\n'
#
# DO NOT REMOVE FOLLOWING FILES:
#
# active-list-distfiles
# verified-specs-tags
#

# 
CVSROOT=":pserver:baggins@cvs.pld-linux.org:/cvsroot"
export CVSROOT

LISTFILES=""

touch_icons() {
	ICONS="`awk '/^Icon:/ {print $2}' ${1}`"
	for i in $ICONS ; do
		echo GIF87 >$i
	done
}

for TAG in $(cat .branches) ; do
	cvs checkout -r "$TAG" SPECS
	cvs up -A SPECS/builder

	cd SPECS
	for spec in $(find -name "*.spec") ; do
		grep -sq "$spec:$TAG" ../verified-specs-tags && continue
		touch_icons "$spec"
		DF=$(./builder --no-init -sdp -nc -ncs "$spec" || echo $spec >>../list-distfiles-$TAG-errors)
		for f in $DF ; do
			echo $f | grep -qsE "^by-md5" || continue
			echo $f >>../list-distfiles-auto-tags
			echo $f.desc >>../list-distfiles-auto-tags
		done
		echo $spec:$TAG >>../verified-specs-tags
	done
	LISTFILES="$LISTFILES list-distfiles-$TAG"
	cd -
	rm -rf SPECS
done

cvs checkout -r 1.1 SPECS
cvs up -A SPECS/builder
cd SPECS
for spec in $(find -name "*.spec") ; do
	TAGS="$(cvs status -v "${spec}" | awk '!/Sticky Tag:/ && /\(branch:/ || /\(revision/ { print $1 } ' | grep -s -f ../.auto-tags | xargs)"
	for rev in $TAGS ; do
		grep -sq "$spec:$rev" ../verified-specs-tags && continue
		cvs up -r $rev $spec
		touch_icons "$spec"
		DF=$(./builder --no-init -sdp -nc -ncs "$spec" || echo $spec >>../list-distfiles-auto-tags-errors)
		for f in $DF ; do
			echo $f | grep -qsE "^by-md5" || continue
			echo $f >>../list-distfiles-auto-tags
			echo $f.desc >>../list-distfiles-auto-tags
		done
		echo $spec:$rev >>../verified-specs-tags
	done
done
LISTFILES="$LISTFILES list-distfiles-auto-tags"
cd -
rm -rf SPECS

sort $LISTFILES | uniq >>active-list-distfiles
rm -f $LISTFILES

$D=$(date +%Y-%M-%d)
# List only files that are in full-list-distfiles but
# not in active-list-distfiles
# Just uniq -u is not enough because you can remove files added during
# run of the script
# B\(A * B)
sort active-list-distfiles full-list-distfiles | uniq -d | \
	sort - full-list-distfiles | uniq -u >distfiles-remove-$D

cvs commit -m"- $D update" active-list-distfiles verified-specs-tags