From f6affac471ca772f43441e25bc2420bb49293f81 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 2 Oct 2021 22:29:47 -0400 Subject: do not try to lint missing files This avoids spurious warnings of corruption when the files don't exist. Signed-off-by: Mike Frysinger --- build-docbook-catalog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-docbook-catalog b/build-docbook-catalog index b4d7223..0da432a 100755 --- a/build-docbook-catalog +++ b/build-docbook-catalog @@ -161,7 +161,7 @@ create_catalogs() { local adds # Initialize catalogs if they don't exist or are corrupt. - if ! xmllint "${ROOT}${ROOTCATALOG}" >&/dev/null ; then + if [[ -r ${ROOT}${ROOTCATALOG} ]] && ! xmllint "${ROOT}${ROOTCATALOG}" >&/dev/null ; then rm -f "${ROOTCATALOG}" echo "Deleting corrupt ${ROOT}${ROOTCATALOG} and starting over" fi @@ -179,7 +179,7 @@ create_catalogs() { fi # Initialize catalogs if they don't exist or are corrupt. - if ! xmllint "${ROOT}${CATALOG}" >&/dev/null ; then + if [[ -r ${ROOT}${CATALOG} ]] && ! xmllint "${ROOT}${CATALOG}" >&/dev/null ; then rm -f "${ROOT}${CATALOG}" echo "Deleting corrupt ${CATALOG} and starting over" fi -- cgit v1.2.3-65-gdbad