slitaz-forge view mirror/info/bin/chksrc @ rev 380

chksrc: handle TARBALL miss
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Dec 12 11:17:16 2013 +0000 (2013-12-12)
parents 60059c7485c2
children 388f54788371
line source
1 #!/bin/sh
3 . /etc/tazwok.conf
4 WOK=/home/slitaz/${1:-cooking}/wok
5 SRC=/var/www/slitaz/mirror/sources/packages-${1:-cooking}
6 SRC2=/var/www/slitaz/mirror/sources/packages
8 for i in $WOK/*/receipt ; do
9 unset TARBALL EXTRA_SOURCE_FILES WGET_URL WANTED PACKAGE VERSION
10 . $i
11 [ -n "$WANTED" ] && continue
12 if [ -z "$TARBALL" ]; then
13 [ -n "$WGET_URL" ] || continue
14 echo $(basename ${i%/receipt}) >> /tmp/notarball$$
15 TARBALL="$PACKAGE-$VERSION.tar.bz2"
16 fi
17 echo $TARBALL
18 [ -n "$WGET_URL" ] && echo $WGET_URL >> /tmp/wget_url$$
19 for j in $EXTRA_SOURCE_FILES ; do
20 basename $j
21 done
22 done | sort | uniq > /tmp/tarball$$
23 if [ -s /tmp/notarball$$ ]; then
24 echo $(cat /tmp/notarball$$ 2> /dev/null) | \
25 sed 's/ /, /g;s/^/No TARBALL for /'
26 rm -f /tmp/notarball$$
27 fi
28 while read file; do
29 [ -s $SRC/${file:0:1}/$file ] || [ -s $SRC/${file:0:1}/${file%.*}.lzma ] ||
30 [ -s $SRC/${file:0:1}/${file%.*}.tar.lzma ] ||
31 echo -e "Missing: $file\nURL: $(grep $file$ /tmp/wget_url$$ | sed q)"
32 done < /tmp/tarball$$
33 for i in $SRC/?/* ; do
34 [ -f "$i" ] || continue
35 j=$(basename $i)
36 [ -f $SRC2/${j:0:1}/$j ] || ln $i $SRC2/${j:0:1}/$j
37 case "$i" in
38 *lzma)
39 grep -q ^$(basename ${i%lzma}) /tmp/tarball$$ && continue
40 [ $(ls ${i%lzma}* | wc -l) -ne 1 ] && ls ${i%lzma}* | cat
41 ;;
42 *)
43 grep -q ^$(basename $i)$ /tmp/tarball$$ && continue
44 ;;
45 esac
46 echo $i
47 done
48 rm -f /tmp/tarball$$ /tmp/wget_url$$
49 for i in $SRC2/?/* ; do
50 [ $(stat -c "%h" $i) -eq 1 ] && echo $i
51 done