From patchwork Wed Dec 2 16:50:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Panu Matilainen X-Patchwork-Id: 9254 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 98202594B; Wed, 2 Dec 2015 17:51:03 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E1CF95913 for ; Wed, 2 Dec 2015 17:51:02 +0100 (CET) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 54D0AC0CC64F; Wed, 2 Dec 2015 16:51:02 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org.com (vpn1-6-161.ams2.redhat.com [10.36.6.161]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB2Gp0gC020942; Wed, 2 Dec 2015 11:51:01 -0500 From: Panu Matilainen To: dev@dpdk.org Date: Wed, 2 Dec 2015 18:50:47 +0200 Message-Id: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Subject: [dpdk-dev] [PATCH] scripts: support any legal git revisions as abi validation range X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In addition to git tags, support validating abi between any legal gitrevisions(7) syntaxes, such as "validate-abi.sh . -1 " "validate-abi.sh master mybrach " etc in addition to validating between tags. Makes it easier to run the validator for in-development work. Signed-off-by: Panu Matilainen Acked-by: Neil Horman --- scripts/validate-abi.sh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh index 4476433..0e3ccd7 100755 --- a/scripts/validate-abi.sh +++ b/scripts/validate-abi.sh @@ -43,16 +43,15 @@ log() { } validate_tags() { - git tag -l | grep -q "$TAG1" - if [ $? -ne 0 ] + + if [ -z "$HASH1" ] then - echo "$TAG1 is invalid" + echo "invalid revision: $TAG1" return fi - git tag -l | grep -q "$TAG2" - if [ $? -ne 0 ] + if [ -z "$HASH2" ] then - echo "$TAG2 is invalid" + echo "invalid revision: $TAG2" return fi } @@ -112,6 +111,9 @@ then cleanup_and_exit 1 fi +HASH1=$(git show -s --format=%H "$TAG1" -- 2> /dev/null) +HASH2=$(git show -s --format=%H "$TAG2" -- 2> /dev/null) + # Make sure our tags exist res=$(validate_tags) if [ -n "$res" ] @@ -120,6 +122,10 @@ then cleanup_and_exit 1 fi +# Make hashes available in output for non-local reference +TAG1="$TAG1 ($HASH1)" +TAG2="$TAG2 ($HASH2)" + ABICHECK=`which abi-compliance-checker 2>/dev/null` if [ $? -ne 0 ] then @@ -152,7 +158,7 @@ cd $(dirname $0)/.. log "INFO" "Checking out version $TAG1 of the dpdk" # Move to the old version of the tree -git checkout $TAG1 +git checkout $HASH1 # Make sure we configure SHARED libraries # Also turn off IGB and KNI as those require kernel headers to build @@ -185,7 +191,7 @@ cd $TARGET/lib log "INFO" "COLLECTING ABI INFORMATION FOR $TAG1" for i in `ls *.so` do - $ABIDUMP $i -o $ABI_DIR/$i-ABI-0.dump -lver $TAG1 + $ABIDUMP $i -o $ABI_DIR/$i-ABI-0.dump -lver $HASH1 done cd ../.. @@ -194,7 +200,7 @@ git clean -f -d git reset --hard # Move to the new version of the tree log "INFO" "Checking out version $TAG2 of the dpdk" -git checkout $TAG2 +git checkout $HASH2 # Make sure we configure SHARED libraries # Also turn off IGB and KNI as those require kernel headers to build @@ -220,7 +226,7 @@ cd $TARGET/lib log "INFO" "COLLECTING ABI INFORMATION FOR $TAG2" for i in `ls *.so` do - $ABIDUMP $i -o $ABI_DIR/$i-ABI-1.dump -lver $TAG2 + $ABIDUMP $i -o $ABI_DIR/$i-ABI-1.dump -lver $HASH2 done cd ../..