2007-04-19 23:38:29 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
BDIR=$1
|
|
|
|
ADIR=$2
|
|
|
|
IN="$3"
|
|
|
|
OUT="$4"
|
|
|
|
|
|
|
|
echo "DONEDONE" > $BDIR/DONE
|
2009-12-29 00:27:25 -01:00
|
|
|
awk -v max_size=$MAX_PKG_SIZE '
|
2007-04-19 23:38:29 +00:00
|
|
|
/^Package:/ {
|
|
|
|
srcname=$2
|
|
|
|
srcs_done++
|
|
|
|
}
|
|
|
|
|
|
|
|
/^Section: non-free/ {
|
|
|
|
component[srcname]="non-free"
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
|
|
|
/^Section: contrib/ {
|
|
|
|
component[srcname]="contrib"
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
|
|
|
/^Section:/ {
|
|
|
|
component[srcname]="main"
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
|
|
|
/^DONEDONE/ {
|
|
|
|
parsed=1
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
2009-12-29 00:27:25 -01:00
|
|
|
/^Files:/ {
|
|
|
|
in_files = 1
|
|
|
|
next
|
|
|
|
}
|
|
|
|
/^ / {
|
|
|
|
if (in_files) {
|
|
|
|
size[srcname]+=$2
|
|
|
|
next
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-04-19 23:38:29 +00:00
|
|
|
/.*/ {
|
2009-12-29 00:27:25 -01:00
|
|
|
in_files = 0
|
2007-04-19 23:38:29 +00:00
|
|
|
if (parsed) {
|
2009-12-29 00:27:25 -01:00
|
|
|
if (size[$0] > max_size) {
|
|
|
|
printf("source:%s:%s-SRCTOOBIG\n", component[$0], $0)
|
|
|
|
} else {
|
|
|
|
printf("source:%s:%s\n", component[$0], $0)
|
|
|
|
}
|
2007-04-19 23:38:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
' $ADIR/$CODENAME-source/apt-state/lists/*Sources $BDIR/DONE $IN > $BDIR/list.mid
|
|
|
|
|
|
|
|
if [ "$NONFREE"x = "1"x ] ; then
|
2009-12-29 00:27:25 -01:00
|
|
|
grep -v SRCTOOBIG $BDIR/list.mid > $OUT
|
2007-04-19 23:38:29 +00:00
|
|
|
else
|
2009-12-29 00:27:25 -01:00
|
|
|
grep -v -e :non-free: -e SRCTOOBIG $BDIR/list.mid > $OUT
|
2007-04-19 23:38:29 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$EXTRANONFREE"x = "1"x ] ; then
|
2009-12-29 00:27:25 -01:00
|
|
|
grep :non-free: $BDIR/list.mid | grep -v SRCTOOBIG >> $OUT
|
2007-04-19 23:38:29 +00:00
|
|
|
fi
|
2009-12-29 00:27:25 -01:00
|
|
|
|
|
|
|
awk -F : '
|
|
|
|
/SRCTOOBIG/ { print $3 }
|
|
|
|
' $BDIR/list.mid > $BDIR/sourcetoobig
|