]> git.proxmox.com Git - swtpm.git/commitdiff
build-sys: Move regex to test PCR banks into configure script
authorStefan Berger <stefanb@linux.ibm.com>
Mon, 8 Nov 2021 12:24:06 +0000 (07:24 -0500)
committerStefan Berger <stefanb@us.ibm.com>
Mon, 8 Nov 2021 14:03:44 +0000 (09:03 -0500)
Move the regex test for the PCR banks into the configure script.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Makefile.am
configure.ac
scripts/Makefile.am [deleted file]
scripts/test_pcr_bank_list [deleted file]

index 062e0ec149850355b2c40c8891468a8d010aa06d..25c30683564a486e979bc7fe33272cba0fa71f6d 100644 (file)
@@ -9,7 +9,6 @@ SUBDIRS   = \
        man \
        samples \
        src \
-       scripts \
        tests
 
 ACLOCAL_AMFLAGS = -I m4
index 7a1a79e7eabad484ff0f2d3cc3c4613dd4074b40..33300d182f99adbf6f9460521aaba318e44198e0 100644 (file)
@@ -361,7 +361,8 @@ if test "x$enable_default_pcr_banks" != "x"; then
     DEFAULT_PCR_BANKS="$enable_default_pcr_banks"
 fi
 AC_MSG_CHECKING([which PCR banks to activate by default])
-if $srcdir/scripts/test_pcr_bank_list $DEFAULT_PCR_BANKS; then
+REGEX="^(sha1|sha256|sha384|sha512)(,(sha1|sha256|sha384|sha512)){0,3}\$"
+if bash -c "[[[ $DEFAULT_PCR_BANKS =~ $REGEX ]]] && exit 0 || exit 1"; then
        AC_MSG_RESULT([$DEFAULT_PCR_BANKS])
 else
        AC_MSG_ERROR([$DEFAULT_PCR_BANKS is an invalid list of PCR banks])
@@ -578,7 +579,6 @@ AC_CONFIG_FILES([Makefile                   \
                samples/swtpm-localca.conf  \
                samples/swtpm-create-user-config-files \
                samples/swtpm_setup.conf    \
-               scripts/Makefile            \
                include/Makefile            \
                include/swtpm/Makefile      \
                include/swtpm.h             \
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
deleted file mode 100644 (file)
index 364ed21..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# Makefile.am
-#
-# For the license, see the COPYING file in the root directory.
-#
-
-EXTRA_DIST = \
-       test_pcr_bank_list
diff --git a/scripts/test_pcr_bank_list b/scripts/test_pcr_bank_list
deleted file mode 100755 (executable)
index 1041e51..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-[[ $1 =~ ^(sha1|sha256|sha384|sha512)(,(sha1|sha256|sha384|sha512)){0,3}$ ]] \
- && exit 0
-exit 1