2008-06-23 21:55:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
MIRROR=$1
|
|
|
|
SUITE=$2
|
|
|
|
TMPDIR=$3
|
2008-06-25 00:24:09 +00:00
|
|
|
BASEDIR=$4
|
2008-06-23 21:55:36 +00:00
|
|
|
export LC_ALL=C
|
|
|
|
|
2008-06-25 00:24:09 +00:00
|
|
|
if [ "$MIRROR"x = ""x ] || \
|
|
|
|
[ "$SUITE"x = ""x ] || \
|
|
|
|
[ "$TMPDIR"x = ""x ] || \
|
|
|
|
[ "$BASEDIR"x = ""x ] ; then
|
2008-06-23 21:55:36 +00:00
|
|
|
echo "$0: Need parameters"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2008-06-25 00:24:09 +00:00
|
|
|
TASKFILE=$BASEDIR/tasks/firmware
|
|
|
|
|
2008-06-23 21:55:36 +00:00
|
|
|
rm -rf $TMPDIR/firmware
|
|
|
|
mkdir -p $TMPDIR/firmware
|
|
|
|
|
2009-08-18 22:52:02 +00:00
|
|
|
FILES=`( cpp -undef $TASKFILE | grep -v -e "^#" -e "^$" ; \
|
2008-06-25 00:24:09 +00:00
|
|
|
echo DONE ;
|
|
|
|
zcat $MIRROR/dists/$SUITE/non-free/binary-*/Packages.gz ) | \
|
2008-06-23 21:55:36 +00:00
|
|
|
awk '
|
2008-06-25 00:24:09 +00:00
|
|
|
/DONE/ {
|
|
|
|
in_packages = 1
|
|
|
|
matched = 0
|
|
|
|
next
|
|
|
|
}
|
|
|
|
/.*/ {
|
|
|
|
if (!in_packages) {
|
|
|
|
firmware[$1] = num_fw
|
|
|
|
num_fw++
|
|
|
|
next
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/^Package: / {
|
|
|
|
matched = 0
|
|
|
|
if (in_packages) {
|
|
|
|
for (fw in firmware) {
|
|
|
|
if (fw == $2) {
|
|
|
|
matched = 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
next
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/^Filename: / {
|
|
|
|
if (matched) {
|
|
|
|
print $2
|
|
|
|
}
|
|
|
|
}' | sort -u`
|
2008-06-23 21:55:36 +00:00
|
|
|
|
|
|
|
for file in $FILES; do
|
|
|
|
cp $MIRROR/$file $TMPDIR/firmware/
|
|
|
|
done
|
|
|
|
|
|
|
|
cd $TMPDIR/firmware
|
|
|
|
tar czf ../firmware.tar.gz .
|
2008-06-23 21:57:37 +00:00
|
|
|
zip -9rq ../firmware.zip .
|
|
|
|
cd ..
|
|
|
|
ls -l $PWD/firmware.tar.gz $PWD/firmware.zip
|