slitaz-forge rev 364

Add chksrc & chkpkgs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed May 01 10:23:56 2013 +0200 (2013-05-01)
parents 5fa7c0df4e0d
children 28c1b40cf593
files mirror/info/bin/chksrc tank/web/lib/chkpkgs
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mirror/info/bin/chksrc	Wed May 01 10:23:56 2013 +0200
     1.3 @@ -0,0 +1,42 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +. /etc/tazwok.conf
     1.7 +WOK=/home/slitaz/${1:-cooking}/wok
     1.8 +WWW=/var/www/slitaz/mirror
     1.9 +SRC=$WWW/sources/packages-${1:-cooking}
    1.10 +SRC2=$WWW/sources/packages
    1.11 +
    1.12 +for i in $WOK/*/receipt ; do
    1.13 +	unset TARBALL EXTRA_SOURCE_FILES WGET_URL WANTED
    1.14 +	. $i
    1.15 +	[ -n "$WANTED" ] && continue
    1.16 +	[ -n "$TARBALL" ] && echo $TARBALL
    1.17 +	[ -n "$WGET_URL" ] && echo $WGET_URL >> /tmp/wget_url$$
    1.18 +	for j in $EXTRA_SOURCE_FILES ; do
    1.19 +		basename $j
    1.20 +	done
    1.21 +done | sort | uniq > /tmp/tarball$$
    1.22 +while read file; do
    1.23 +	[ -s $SRC/${file:0:1}/$file ] || [ -s $SRC/${file:0:1}/${file%.*}.lzma ] ||
    1.24 +	[ -s $SRC/${file:0:1}/${file%.*}.tar.lzma ] ||
    1.25 +	echo -e "Missing: $file\nURL: $(grep $file$ /tmp/wget_url$$ | sed q)"
    1.26 +done < /tmp/tarball$$
    1.27 +for i in $SRC/?/* ; do
    1.28 +	[ -f "$i" ] || continue
    1.29 +	j=$(basename $i)
    1.30 +	[ -f $SRC2/${j:0:1}/$j ] || ln $i $SRC2/${j:0:1}/$j
    1.31 +	case "$i" in
    1.32 +	*lzma)
    1.33 +		grep -q ^$(basename ${i%lzma}) /tmp/tarball$$ && continue
    1.34 +		[ $(ls ${i%lzma}* | wc -l) -ne 1 ] && ls ${i%lzma}* | cat
    1.35 +		;;
    1.36 +	*)
    1.37 +		grep -q ^$(basename $i)$ /tmp/tarball$$ && continue
    1.38 +		;;
    1.39 +	esac
    1.40 +	echo $i
    1.41 +done
    1.42 +rm -f /tmp/tarball$$ /tmp/wget_url$$
    1.43 +for i in $SRC2/?/* ; do
    1.44 +	[ $(stat -c "%h" $i) -eq 1 ] && echo $i
    1.45 +done
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tank/web/lib/chkpkgs	Wed May 01 10:23:56 2013 +0200
     2.3 @@ -0,0 +1,24 @@
     2.4 +#!/bin/sh
     2.5 +
     2.6 +PKG=/home/slitaz/${1:-cooking}/chroot/home/slitaz/packages
     2.7 +WOK=/home/slitaz/${1:-cooking}/chroot/home/slitaz/wok
     2.8 +
     2.9 +for i in $(cd $PKG ; ls *.tazpkg); do
    2.10 +	for j in $WOK/${i%%-*}*/taz/*/receipt ; do
    2.11 +		[ -s $j ] || break
    2.12 +		PACKAGE=
    2.13 +		VERSION=
    2.14 +		EXTRAVERSION=
    2.15 +		. $j
    2.16 +		[ "$i" == "$PACKAGE-$VERSION$EXTRAVERSION.tazpkg" ] && continue 2
    2.17 +	done
    2.18 +	echo "Rebuild $i"
    2.19 +done
    2.20 +[ -n "$2" ] && for i in $WOK/*/receipt; do
    2.21 +	PACKAGE=
    2.22 +	VERSION=
    2.23 +	EXTRAVERSION=
    2.24 +	. $i
    2.25 +	[ -s $PKG/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg ] ||
    2.26 +	echo "Not built : $(basename $(dirname $i))"
    2.27 +done