commit:     273d518b5512ecdee5c7e5c215f9230de52c3879
Author:     Marvin Schmidt <marv <AT> exherbo <DOT> org>
AuthorDate: Thu Jan 20 09:06:13 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jan 27 20:28:27 2022 +0000
URL:        
https://gitweb.gentoo.org/proj/build-docbook-catalog.git/commit/?id=273d518b

Honour ROOT when deleting existing catalog

The condition checked for `${ROOT}${ROOTCATALOG}`, but then deleted
the catalog file outside of ROOT (`${ROOTCATALOG}`). Fix this by adding
the missing `${ROOT}`

Signed-off-by: Sam James <sam <AT> gentoo.org>

 build-docbook-catalog | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-docbook-catalog b/build-docbook-catalog
index 1b4ccf3..cee9af0 100755
--- a/build-docbook-catalog
+++ b/build-docbook-catalog
@@ -173,7 +173,7 @@ create_catalogs() {
 
        # Initialize catalogs if they don't exist or are corrupt.
        if [[ -r ${ROOT}${ROOTCATALOG} ]] && ! xmllint "${ROOT}${ROOTCATALOG}" 
>&/dev/null ; then
-               rm -f "${ROOTCATALOG}"
+               rm -f "${ROOT}${ROOTCATALOG}"
                echo "Deleting corrupt ${ROOT}${ROOTCATALOG} and starting over"
        fi
        if [[ ! -r ${ROOT}${ROOTCATALOG} ]] ; then

Reply via email to