From patchwork Fri Oct 2 16:05:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 525623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 5FA16140761 for ; Sat, 3 Oct 2015 02:08:24 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id E2B8010E98; Fri, 2 Oct 2015 09:08:21 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 398FF10E96 for ; Fri, 2 Oct 2015 09:08:20 -0700 (PDT) Received: from bar2.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id ACE2D1E0156 for ; Fri, 2 Oct 2015 10:08:19 -0600 (MDT) X-ASG-Debug-ID: 1443802099-03dc537fe3a82680001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar2.cudamail.com with ESMTP id bvdFKAddULPENDjk (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 02 Oct 2015 10:08:19 -0600 (MDT) X-Barracuda-Envelope-From: shettyg@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mail-pa0-f48.google.com) (209.85.220.48) by mx1-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 2 Oct 2015 16:08:18 -0000 Received-SPF: unknown (mx1-pf2.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.48 Received: by pablk4 with SMTP id lk4so109501314pab.3 for ; Fri, 02 Oct 2015 09:08:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WLAt8hav66xuO1o7MlgR27Vtxo65U47dMx2CE50B2U4=; b=a/7/TtfKT6FWdagWp/PQwJESFoXGiI7Ky26wfT32WBv8ERASG8iNNYqE8QaavmGIeo +dE+YOsU/S3+ij0TF3FtB33Dd91xBeL3gi4dHZVUSHHpI0L3mnwyaMHnIGdjl0UnJz6N Ir5wjTQ3FCLDJ/ow1p7H0VHbzFwh89XXRvooXBCQa143ax/wZagXjIcwX9U+LSTU3pz7 9gZWlMnNDAZZfRtHRfqtqSw5TQEfpeu8W4aSGxY5//DR74UiyUBJ5IwyFuqQ0RGT6RkO me6Na/PJtq4ZMbMieeV2C1SuSR6CqXyGIL0NchL/yoKPY3GvxAQZfH3OV+gNXHnDLcqU PigQ== X-Gm-Message-State: ALoCoQlEbx0N53w9nmkQqeU7I4HblT18Mp7mFTKwEt+fv4kG90a1Tb9JZi7IZSV01+XmxVj6jIcz X-Received: by 10.66.233.97 with SMTP id tv1mr20872257pac.110.1443802098086; Fri, 02 Oct 2015 09:08:18 -0700 (PDT) Received: from ubuntu-test.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id dg2sm1550906pbb.9.2015.10.02.09.08.17 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 Oct 2015 09:08:17 -0700 (PDT) X-CudaMail-Envelope-Sender: shettyg@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.1.34 From: Gurucharan Shetty X-Google-Original-From: Gurucharan Shetty To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E2-1001045393 X-CudaMail-DTE: 100215 X-CudaMail-Originating-IP: 209.85.220.48 Date: Fri, 2 Oct 2015 09:05:10 -0700 X-ASG-Orig-Subj: [##CM-E2-1001045393##][PATCH] automake: Consolidate schema checksum check. Message-Id: <1443801910-16535-1-git-send-email-gshetty@nicira.com> X-Mailer: git-send-email 1.7.9.5 X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1443802099 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: Gurucharan Shetty Subject: [ovs-dev] [PATCH] automake: Consolidate schema checksum check. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- Makefile.am | 1 + build-aux/cksum-schema-check | 15 +++++++++++++++ ovn/automake.mk | 20 ++------------------ vswitchd/automake.mk | 10 +--------- vtep/automake.mk | 10 +--------- 5 files changed, 20 insertions(+), 36 deletions(-) create mode 100755 build-aux/cksum-schema-check diff --git a/Makefile.am b/Makefile.am index ab1a135..14da875 100644 --- a/Makefile.am +++ b/Makefile.am @@ -102,6 +102,7 @@ EXTRA_DIST = \ .travis/prepare.sh \ boot.sh \ build-aux/cccl \ + build-aux/cksum-schema-check \ build-aux/dist-docs \ build-aux/sodepends.pl \ build-aux/soexpand.pl \ diff --git a/build-aux/cksum-schema-check b/build-aux/cksum-schema-check new file mode 100755 index 0000000..75fcd6e --- /dev/null +++ b/build-aux/cksum-schema-check @@ -0,0 +1,15 @@ +#!/bin/sh + +schema=$1 +stamp=$2 + +sum=`sed '/cksum/d' $schema | cksum` +expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $schema` +if test "X$sum" = "X$expected"; then + touch $stamp +else + ln=`sed -n '/"cksum":/=' $schema` + echo >&2 "$schema:$ln: The checksum \"$sum\" was calculated from the schema file and does not match cksum field in the schema file - you should probably update the version number and the checksum in the schema file with the value listed here." + exit 1 +fi + diff --git a/ovn/automake.mk b/ovn/automake.mk index 4b6a836..f3f40e5 100644 --- a/ovn/automake.mk +++ b/ovn/automake.mk @@ -78,29 +78,13 @@ EXTRA_DIST += \ # Version checking for ovn-nb.ovsschema. ALL_LOCAL += ovn/ovn-nb.ovsschema.stamp ovn/ovn-nb.ovsschema.stamp: ovn/ovn-nb.ovsschema - @sum=`sed '/cksum/d' $? | cksum`; \ - expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \ - if test "X$$sum" = "X$$expected"; then \ - touch $@; \ - else \ - ln=`sed -n '/"cksum":/=' $?`; \ - echo >&2 "$?:$$ln: The checksum \"$$sum\" was calculated from the schema file and does not match cksum field in the schema file - you should probably update the version number and the checksum in the schema file with the value listed here."; \ - exit 1; \ - fi + $(srcdir)/build-aux/cksum-schema-check $? $@ CLEANFILES += ovn/ovn-nb.ovsschema.stamp # Version checking for ovn-sb.ovsschema. ALL_LOCAL += ovn/ovn-sb.ovsschema.stamp ovn/ovn-sb.ovsschema.stamp: ovn/ovn-sb.ovsschema - @sum=`sed '/cksum/d' $? | cksum`; \ - expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \ - if test "X$$sum" = "X$$expected"; then \ - touch $@; \ - else \ - ln=`sed -n '/"cksum":/=' $?`; \ - echo >&2 "$?:$$ln: The checksum \"$$sum\" was calculated from the schema file and does not match cksum field in the schema file - you should probably update the version number and the checksum in the schema file with the value listed here."; \ - exit 1; \ - fi + $(srcdir)/build-aux/cksum-schema-check $? $@ CLEANFILES += ovn/ovn-sb.ovsschema.stamp include ovn/controller/automake.mk diff --git a/vswitchd/automake.mk b/vswitchd/automake.mk index 81f201a..8d7f3ea 100644 --- a/vswitchd/automake.mk +++ b/vswitchd/automake.mk @@ -57,15 +57,7 @@ vswitchd/ovs-vswitchd.conf.db.5: \ # Version checking for vswitch.ovsschema. ALL_LOCAL += vswitchd/vswitch.ovsschema.stamp vswitchd/vswitch.ovsschema.stamp: vswitchd/vswitch.ovsschema - @sum=`sed '/cksum/d' $? | cksum`; \ - expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \ - if test "X$$sum" = "X$$expected"; then \ - touch $@; \ - else \ - ln=`sed -n '/"cksum":/=' $?`; \ - echo >&2 "$?:$$ln: The checksum \"$$sum\" was calculated from the schema file and does not match cksum field in the schema file - you should probably update the version number and the checksum in the schema file with the value listed here."; \ - exit 1; \ - fi + $(srcdir)/build-aux/cksum-schema-check $? $@ CLEANFILES += vswitchd/vswitch.ovsschema.stamp # Clean up generated files from older OVS versions. (This is important so that diff --git a/vtep/automake.mk b/vtep/automake.mk index 6027fd2..de028b6 100644 --- a/vtep/automake.mk +++ b/vtep/automake.mk @@ -80,13 +80,5 @@ vtep/vtep.5: \ # Version checking for vtep.ovsschema. ALL_LOCAL += vtep/vtep.ovsschema.stamp vtep/vtep.ovsschema.stamp: vtep/vtep.ovsschema - @sum=`sed '/cksum/d' $? | cksum`; \ - expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \ - if test "X$$sum" = "X$$expected"; then \ - touch $@; \ - else \ - ln=`sed -n '/"cksum":/=' $?`; \ - echo >&2 "$?:$$ln: The checksum \"$$sum\" was calculated from the schema file and does not match cksum field in the schema file - you should probably update the version number and the checksum in the schema file with the value listed here."; \ - exit 1; \ - fi + $(srcdir)/build-aux/cksum-schema-check $? $@ CLEANFILES += vtep/vtep.ovsschema.stamp