X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 970C1DC7BDD for ; Fri, 5 Jul 2013 04:21:55 +0000 (UTC) Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id EC19320503 for ; Fri, 5 Jul 2013 00:21:50 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 05 Jul 2013 00:21:50 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :in-reply-to:references; s=smtpout; bh=/ElCFjx6yLn30fSW/8BaoY5Wq LM=; b=fW8YVvwnHJkESa0gDx8fl/dn0Uox8g+oBuIc+P/QRDzeWDij0q20orGHR eKTRD3bjA0wgR8aJvez9WA7/WN4wWJuTNNKjxaQkr35mhWlecC0nN+qGPXcXb4dj U1xyKf+SXtJoRTuoVqMq5En0gMyHX161On+C48YYKdRJchInOU= X-Sasl-enc: /Pt8wUsOPuHMpi1vm09Y9nqa5ZSU7GIqBq/BIz4TfFJi 1372998110 Received: from localhost (unknown [69.86.161.244]) by mail.messagingengine.com (Postfix) with ESMTPA id B9345680204 for ; Fri, 5 Jul 2013 00:21:50 -0400 (EDT) From: Dubiousjim To: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] [PATCH 21/31] abump: refactor verification of APKBUILD Date: Fri, 5 Jul 2013 00:21:30 -0400 Message-Id: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: * includes renaming pkgname, pkgver --- abump.in | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/abump.in b/abump.in index 7a0bd57..f25a4ea 100755 --- a/abump.in +++ b/abump.in @@ -18,19 +18,26 @@ fi # version bump packages do_bump() { - local p rc=0 pkgname pkgver section message + local p rc=0 name ver section message local upgrade="${cvelist:+security }upgrade" local a for p; do - pkgname=${p%-[0-9]*} - pkgver=${p#${pkgname}-} + name=${p%-[0-9]*} + ver=${p#${name}-} # calculate APKBUILD's path - if [ "${pkgname#*/}" != "$pkgname" ] && ! [ -d "$APORTSDIR/${pkgname%/*} ]; then + if [ "${name#*/}" != "$name" ] && ! [ -d "$APORTSDIR/${name%/*} ]; then error "'$p' should be of form 'foo-1.2.3' or 'main/foo-1.2.3'" rc=1; continue fi - a=$(aports_buildscript "$pkgname" || die "can't find APKBUILD for $pkgname") || { rc=1; continue; } + a=$(aports_buildscript "$name" || die "can't find APKBUILD for $name") || { rc=1; continue; } + + # verify APKBUILD + ( + . "$a" || exit 1 + [ "$pkgname" = "$name" ] || die "$name: APKBUILD has different \$pkgname" + type package | grep -q function || die "$name: missing package()" + ) || { rc=1; continue; } ( set -e @@ -39,7 +46,7 @@ do_bump() { section=${PWD%/*} section=${section##*/} - message="$section/$pkgname: $upgrade to ${pkgver}${cvelist}" + message="$section/$name: $upgrade to ${ver}${cvelist}" if [ -n "$fixes" ]; then message="$message @@ -48,9 +55,7 @@ fixes #${fixes#\#} fi echo "$message" - ( . ./APKBUILD; type package | grep -q function ) || die "package() missing" - - sed -i -e "s/^pkgver=.*/pkgver=$pkgver/" \ + sed -i -e "s/^pkgver=.*/pkgver=$ver/" \ -e "s/^pkgrel=.*/pkgrel=0/" \ APKBUILD -- 1.8.3.1 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---