cookutils diff modules/precheck @ rev 1012
Separate modules/precheck from cook (next will be modules/getsrc); cook: fix bug preventing meta-packages to be included in receipt v2; lighttpd/index.cgi: show cooker state in the title (web browser show special icon if background page title has changed).
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Nov 24 14:39:52 2017 +0200 (2017-11-24) |
parents | |
children | 772ff37fe068 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/modules/precheck Fri Nov 24 14:39:52 2017 +0200 1.3 @@ -0,0 +1,38 @@ 1.4 +#!/bin/sh 1.5 +# 1.6 +# precheck - module of the SliTaz Cook 1.7 +# Preliminary checks of the receipt, made before the beginning of work. 1.8 +# Copyright (C) SliTaz GNU/Linux - GNU GPL v3 1.9 +# 1.10 + 1.11 +. /usr/lib/slitaz/libcook.sh 1.12 + 1.13 + 1.14 +receipt="$(realpath $1)" 1.15 + 1.16 +_ 'QA: checking package receipt...' 1.17 + 1.18 +for var in PACKAGE VERSION CATEGORY SHORT_DESC MAINTAINER WEB_SITE; do 1.19 + unset value 1.20 + value="$(. $receipt; eval echo \$$var)" 1.21 + # L10n: QA is quality assurance 1.22 + [ -n "$value" ] || die 'QA: empty variable: %s' "$var=\"\"" 1.23 + 1.24 + case "$var" in 1.25 + CATEGORY) 1.26 + valid="$(echo $PKGS_CATEGORIES)" # avoid newlines 1.27 + if ! echo " $valid " | grep -q " $value "; then 1.28 + _ 'QA: unknown category "%s"' "$value" 1.29 + die 'Please, use one of: %s' "$valid" 1.30 + fi 1.31 + ;; 1.32 + WEB_SITE) 1.33 + # We don't check WGET_URL since if dl is needed it will fail. 1.34 + # Break also if we're not online. Here error is not fatal. 1.35 + if ifconfig | grep -A1 '^[a-z]*[0-9]' | fgrep -q 'addr:' && 1.36 + ! busybox wget -T 12 --spider $value 2>/dev/null; then 1.37 + _ 'QA: unable to reach "%s"' "$value" 1.38 + fi 1.39 + ;; 1.40 + esac 1.41 +done