wok view cookutils/stuff/check-wok @ rev 24055

Add current_version for most github hosted softwares
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jun 08 08:46:05 2021 +0000 (2021-06-08)
parents 324b3fa82b76
children 12b20ec07196
line source
1 #!/bin/sh
3 renice -n 1 -p $$
4 WOK=${1:-/home/slitaz/wok}
5 wget --help 2>&1 | grep -q tries && alias wget='wget -t 2'
6 . /etc/slitaz/cook.conf
8 for i in $WOK/*/receipt ; do
9 if [ ! -e $i ]; then
10 echo "$WOK is not a wok."
11 exit
12 fi
13 pkg=$(basename ${i%/receipt})
14 echo -en "\r$pkg \r" 1>&2
15 unset PACKAGE WANTED SHORT_DESC DEPENDS BUILD_DEPENDS SUGGESTED
16 unset CATEGORY VERSION WEB_SITE TARBALL WGET_URL
17 . $i
18 [ "$pkg" == "$PACKAGE" ] || echo "$pkg: PACKAGE=$PACKAGE "
19 [ -n "$SHORT_DESC" ] || echo "$pkg: no SHORT_DESC "
20 [ -n "$WEB_SITE" ] || echo "$pkg: no WEB_SITE "
21 [ -n "$CATEGORY" ] || echo "$pkg: no CATEGORY "
22 if grep -qs '^compile_rules()$' "$i" && [ -z "$WANTED" ] &&
23 [ "$CATEGORY" != "meta" ] && [ ! -d $(dirname "$i")/stuff ]; then
24 [ -z "$TARBALL" ] && echo "$pkg: no TARBALL "
25 [ -z "$WGET_URL" ] && echo "$pkg: no WGET_URL "
26 fi
27 [ -d $i/stuff ] && ! grep -q stuff $i/receipt && echo "$pkg: ? stuff "
28 . /etc/slitaz/slitaz.conf
29 case " $(echo $PKGS_CATEGORIES | xargs echo) " in
30 *\ $CATEGORY\ *) ;;
31 *) echo "$pkg: bad CATEGORY $CATEGORY " ;;
32 esac
33 false &&
34 case "$PACKAGE" in
35 *-dev) case " $DEPENDS " in
36 *\ ${PACKAGE%-dev}\ *) ;;
37 *) echo "$pkg: no dep ${PACKAGE%-dev}"
38 esac ;;
39 esac
40 [ -n "$VERSION" ] || echo "$pkg: no VERSION "
41 for j in $DEPENDS ; do
42 [ -s $WOK/$j/receipt ] && continue
43 [ -s /hg/wok/$j/receipt ] && continue
44 [ -s $WOK/get-$j/receipt ] && continue
45 grep -s "^PROVIDE=" $WOK/*/receipt | grep -q "[\" ]$j[\" ]" && continue
46 echo "$pkg: no dep $j "
47 done
48 for j in $BUILD_DEPENDS ; do
49 [ -s $WOK/$j/receipt ] && continue
50 [ -s /hg/wok/$j/receipt ] && continue
51 [ -s $WOK/get-$j/receipt ] && continue
52 grep -s "^PROVIDE=" $WOK/*/receipt | grep -q "[\" ]$j[\" ]" && continue
53 [ ! -s $WOK/$j/receipt ] &&
54 grep -qs -- '-dev)' $WOK/${j%-dev}/receipt && continue
55 echo "$pkg: no bdep $j "
56 done
57 for j in $SUGGESTED ; do
58 [ -s $WOK/$j/receipt ] && continue
59 [ -s /hg/wok/$j/receipt ] && continue
60 [ -s $WOK/get-$j/receipt ] && continue
61 grep -s "^PROVIDE=" $WOK/*/receipt | grep -q "[\" ]$j[\" ]" && continue
62 echo "$pkg: no sugg $j "
63 done
64 [ $(echo $WANTED | wc -w) -eq 1 ] &&
65 for j in $WANTED ; do
66 [ -s $WOK/$j/receipt ] || echo -e "\r$pkg: no wanted $j "
67 WANVER="$(unset VERSION; . $WOK/$j/receipt; echo $VERSION)"
68 [ "$VERSION" == "$WANVER" ] || echo "$pkg: wanted $j version $WANVER, not $VERSION "
69 done
70 done
71 echo " " 1>&2
72 for i in $(grep -l current_version $WOK/*/receipt); do
73 . $i
74 new="$(current_version)"
75 [ "$new" != "$VERSION" -a ${#new} -gt 0 -a ${#new} -lt 20 ] &&
76 echo "$PACKAGE: $VERSION -> $new"
77 done