cookutils view modules/precheck @ rev 1019

cook: add fix() to use '--as-needed' linker flag in compile_rules(); cookit(): make QA fail on empty vars / bad values; remove_already_packed(): fix bug when $PACKAGE not listed in $SPLIT and we use this function for the default set. lighttpd/index.cgi: sort orphans. modules/precheck: separate error message by empty lines.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Dec 07 14:31:28 2017 +0200 (2017-12-07)
parents 772ff37fe068
children f77e48e58ac0
line source
1 #!/bin/sh
2 #
3 # precheck - module of the SliTaz Cook
4 # Preliminary checks of the receipt made before the beginning of work.
5 # Copyright (C) SliTaz GNU/Linux - GNU GPL v3
6 #
8 . /usr/lib/slitaz/libcook.sh
10 # Return immediately if QA is not used
11 [ -n "$QA" ] || return 0
13 receipt="$(realpath $1)"
15 _ 'QA: checking package receipt...'
17 for var in PACKAGE VERSION CATEGORY SHORT_DESC MAINTAINER WEB_SITE; do
18 unset value
19 value="$(. $receipt; eval echo \$$var)"
20 # L10n: QA is quality assurance
21 [ -n "$value" ] || die 'QA: empty variable: %s' "$var=\"\""
23 case "$var" in
24 CATEGORY)
25 valid="$(echo $PKGS_CATEGORIES)" # avoid newlines
26 if ! echo " $valid " | grep -q " $value "; then
27 newline
28 _ 'QA: unknown category "%s"' "$value"
29 longline "Please, use one of: $valid"
30 die
31 fi
32 ;;
33 WEB_SITE)
34 # We don't check WGET_URL since if dl is needed it will fail.
35 # Break also if we're not online. Here error is not fatal.
36 if ifconfig | grep -A1 '^[a-z]*[0-9]' | fgrep -q 'addr:' &&
37 ! busybox wget -T 12 --spider $value 2>/dev/null; then
38 _ 'QA: unable to reach "%s"' "$value"
39 fi
40 ;;
41 esac
42 done