From 39916858552d43ceedf9b1680fb79734b336a19e Mon Sep 17 00:00:00 2001 From: "Rodriguez Betancourt, Esteban" Date: Fri, 15 Apr 2016 23:08:47 +0000 Subject: cksum: Refine schema cksum validation Calculates the cksum removing the cksum line using a more strict regex than the used previously. It fixes a problem when calculating the cksum of a schema that has fields with the substring cksum (e.g.: a checksum column), lines that the previous cksum calculation incorrectly removes before running cksum. Also, the tool calculate-schema-cksum is introduced. This tool calculates the cksum of a schema file. It could be used in other programs, instead of calculating the cksum in an eventually different way than the expected by cksum-schema-check and other tools. Signed-off-by: Esteban Rodriguez Betancourt Signed-off-by: Ben Pfaff --- build-aux/cksum-schema-check | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'build-aux/cksum-schema-check') diff --git a/build-aux/cksum-schema-check b/build-aux/cksum-schema-check index 0fe37e4af..335e6456a 100755 --- a/build-aux/cksum-schema-check +++ b/build-aux/cksum-schema-check @@ -3,7 +3,8 @@ schema=$1 stamp=$2 -sum=`sed '/cksum/d' $schema | cksum` +cksumcheckpath=`dirname $0` +sum=`$cksumcheckpath/calculate-schema-cksum $schema` expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $schema` if test "X$sum" = "X$expected"; then touch $stamp -- cgit v1.2.1