cookutils rev 909
cook: fix check_integrity()
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue May 30 05:33:45 2017 +0300 (2017-05-30) |
parents | f439bf689ac8 |
children | 39feb4e7243d |
files | cook lighttpd/index.cgi |
line diff
1.1 --- a/cook Mon May 29 04:48:50 2017 +0300 1.2 +++ b/cook Tue May 30 05:33:45 2017 +0300 1.3 @@ -541,15 +541,16 @@ 1.4 # Check source tarball integrity. 1.5 1.6 check_integrity() { 1.7 - if [ -n "$TARBALL_SHA1" ]; then 1.8 - echo "$TARBALL_SHA1 $SRC/$TARBALL" | sha1sum -c || exit 1 1.9 - fi 1.10 - if [ -n "$TARBALL_SHA256" ]; then 1.11 - echo "$TARBALL_SHA256 $SRC/$TARBALL" | sha256sum -c || exit 1 1.12 - fi 1.13 - if [ -n "$TARBALL_MD5" ]; then 1.14 - echo "$TARBALL_MD5 $SRC/$TARBALL" | md5sum -c || exit 1 1.15 - fi 1.16 + for i in sha1 sha3 sha256 sha512 md5; do 1.17 + I=$(echo $i | tr 'a-z' 'A-Z') 1.18 + eval sum=\$TARBALL_$I 1.19 + if [ -n "$sum" ]; then 1.20 + newline 1.21 + _ 'Checking %ssum of source tarball...' "$i" 1.22 + echo "$sum $SRC/$TARBALL" | ${i}sum -c || exit 1 1.23 + fi 1.24 + done 1.25 + newline 1.26 } 1.27 1.28 1.29 @@ -715,7 +716,7 @@ 1.30 # Get source tarball and make sure we have source dir named: 1.31 # $PACKAGE-$VERSION to be standard in receipts. Here we use tar.lzma 1.32 # tarball if it exists. 1.33 - if [ -n "$WGET_URL" ] && [ ! -f "$SRC/$TARBALL" ]; then 1.34 + if [ -n "$WGET_URL" -a ! -f "$SRC/$TARBALL" ]; then 1.35 if [ -f "$SRC/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ]; then 1.36 TARBALL="${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" 1.37 LZMA_SRC='' 1.38 @@ -723,7 +724,7 @@ 1.39 get_source || { broken; exit 1; } 1.40 fi 1.41 fi 1.42 - if [ -z "$WANTED" ] && [ -n "$TARBALL" ] && [ ! -d "$src" ]; then 1.43 + if [ -z "$WANTED" -a -n "$TARBALL" -a ! -d "$src" ]; then 1.44 mkdir -p $pkgdir/source/tmp; cd $pkgdir/source/tmp 1.45 if ! extract_source ; then 1.46 get_source 1.47 @@ -731,7 +732,7 @@ 1.48 fi 1.49 if [ -n "$LZMA_SRC" ]; then 1.50 cd $pkgdir/source 1.51 - if [ "$(ls -A tmp | wc -l)" -gl 1 ] || [ -f "$(echo tmp/*)" ]; then 1.52 + if [ "$(ls -A tmp | wc -l)" -gl 1 -o -f "$(echo tmp/*)" ]; then 1.53 mv tmp tmp-1; mkdir tmp 1.54 mv tmp-1 tmp/${SOURCE:-$PACKAGE}-$VERSION 1.55 fi 1.56 @@ -742,14 +743,16 @@ 1.57 cd $pkgdir/source/tmp 1.58 # Some archives are not well done and don't extract to one dir (ex lzma). 1.59 files=$(ls | wc -l) 1.60 - [ "$files" == 1 ] && [ -d "$(ls)" ] && mv * ../$PACKAGE-$VERSION 1.61 - [ "$files" == 1 ] && [ -f "$(ls)" ] && mkdir -p ../$PACKAGE-$VERSION && \ 1.62 + [ "$files" -eq 1 -a -d "$(ls)" ] && mv * ../$PACKAGE-$VERSION 1.63 + [ "$files" -eq 1 -a -f "$(ls)" ] && mkdir -p ../$PACKAGE-$VERSION && \ 1.64 mv * ../$PACKAGE-$VERSION/$TARBALL 1.65 [ "$files" -gt 1 ] && mkdir -p ../$PACKAGE-$VERSION && \ 1.66 mv * ../$PACKAGE-$VERSION 1.67 cd ..; rm -rf tmp 1.68 fi 1.69 1.70 + check_integrity 1.71 + 1.72 # Libtool shared libs path hack. 1.73 case "$ARCH" in 1.74 arm*) cross libhack ;; 1.75 @@ -1791,7 +1794,6 @@ 1.76 done 1.77 1.78 # Cook and pack or exit on error and log everything. 1.79 - check_integrity 1.80 cookit $@ 2>&1 | loglimit 50 > $LOGS/$pkg.log 1.81 remove_deps | tee -a $LOGS/$pkg.log 1.82 cookit_quality
2.1 --- a/lighttpd/index.cgi Mon May 29 04:48:50 2017 +0300 2.2 +++ b/lighttpd/index.cgi Tue May 30 05:33:45 2017 +0300 2.3 @@ -475,7 +475,7 @@ 2.4 -e 's#\([^a-zA-Z]\)\([Ee]rror\)$#\1<b>\2</b>#' \ 2.5 -e 's#ERROR:#<b>ERROR:</b>#g' \ 2.6 \ 2.7 - -e 's#^.*[Ff]ailed.*#<b>\0</b>#' \ 2.8 + -e 's#^.*[Ff][Aa][Ii][Ll][Ee][Dd].*#<b>\0</b>#' \ 2.9 -e 's#^.*[Ff]atal.*#<b>\0</b>#' \ 2.10 -e 's#^.*[Nn]ot found.*#<b>\0</b>#' \ 2.11 -e 's#^.*[Nn]o such file.*#<b>\0</b>#' \