From b613faf5cd4359db719e7349148a94af4c50e342 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 23 Sep 2017 05:35:08 -0400 Subject: image_signing: allow lsb-release to contain comments Nothing needs this, just something I noticed while debugging. BUG=None TEST=`ensure_sane_lsb-release.sh` no longer complains about comment lines BRANCH=None Change-Id: Ia39e6461db79a387cc59e5f88ec1216984bb4d28 Reviewed-on: https://chromium-review.googlesource.com/680058 Commit-Ready: Mike Frysinger Tested-by: Mike Frysinger Reviewed-by: Mike Frysinger --- scripts/image_signing/ensure_sane_lsb-release.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/image_signing/ensure_sane_lsb-release.sh b/scripts/image_signing/ensure_sane_lsb-release.sh index 9e5a179d..4d958b34 100755 --- a/scripts/image_signing/ensure_sane_lsb-release.sh +++ b/scripts/image_signing/ensure_sane_lsb-release.sh @@ -74,7 +74,10 @@ lsb_syntaxcheck() { # Also checks for = with no spaces on either side. # Checks that the value contains printables (and not starting with space). # Alternatively, the value is permitted to be empty (0 chars) too. - badlines=$(grep -Ev '^[A-Z][A-Z_]*=([[:graph:]][[:print:]]*)?$' "$lsbfile") + # Allow comments to start with #. + badlines=$(grep -Ev \ + -e '^[A-Z][A-Z_]*=([[:graph:]][[:print:]]*)?$' \ + -e '^[[:space:]]*#' "${lsbfile}") if [ -n "$badlines" ]; then syntaxbad=1 error "${lsbfile}: Some lines seem non-well-formed:" -- cgit v1.2.1