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

chksrc: handle TARBALL miss (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Dec 12 11:30:29 2013 +0000 (2013-12-12)
parents d2d6aee377d5
children 40ad99b9e839
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$EXTRA_SOURCE_FILES" ]; then
13 [ -n "$WGET_URL" ] || continue
14 echo $(basename ${i%/receipt}) >> /tmp/notarball$$
15 TARBALL="$PACKAGE-$VERSION.tar.bz2"
16 fi
17 [ -n "$WGET_URL" ] && echo $WGET_URL >> /tmp/wget_url$$
18 for j in $TARBALL $EXTRA_SOURCE_FILES ; do
19 basename $j
20 done
21 done | sort | uniq > /tmp/tarball$$
22 if [ -s /tmp/notarball$$ ]; then
23 echo $(cat /tmp/notarball$$ 2> /dev/null) | \
24 sed 's/ /, /g;s/^/No TARBALL for /'
25 rm -f /tmp/notarball$$
26 fi
27 while read file; do
28 [ -s $SRC/${file:0:1}/$file ] || [ -s $SRC/${file:0:1}/${file%.*}.lzma ] ||
29 [ -s $SRC/${file:0:1}/${file%.*}.tar.lzma ] ||
30 echo -e "Missing: $file\nURL: $(grep $file$ /tmp/wget_url$$ | sed q)"
31 done < /tmp/tarball$$
32 for i in $SRC/?/* ; do
33 [ -f "$i" ] || continue
34 j=$(basename $i)
35 [ -f $SRC2/${j:0:1}/$j ] || ln $i $SRC2/${j:0:1}/$j
36 case "$i" in
37 *lzma)
38 grep -q ^$(basename ${i%lzma}) /tmp/tarball$$ && continue
39 [ $(ls ${i%lzma}* | wc -l) -ne 1 ] && ls ${i%lzma}* | cat
40 ;;
41 *)
42 grep -q ^$(basename $i)$ /tmp/tarball$$ && continue
43 ;;
44 esac
45 echo $i
46 done
47 rm -f /tmp/tarball$$ /tmp/wget_url$$
48 for i in $SRC2/?/* ; do
49 [ $(stat -c "%h" $i) -eq 1 ] && echo $i
50 done