docbooksgml needs to know about --script mode

This commit is contained in:
Martin A. Brown 2016-03-08 09:16:12 -08:00
parent ca8b8e211f
commit 62c9cef32f
1 changed files with 8 additions and 5 deletions

View File

@ -117,11 +117,14 @@ class DocbookSGML(BaseDoctype, SignatureChecker):
def cleaned_indexsgml(self):
'''clean the junk from the output dir after building the index.sgml'''
# -- be super cautious before removing a bunch of files
cwd = os.getcwd()
if not os.path.samefile(cwd, self.output.dirname):
logger.error("%s (cowardly) refusing to clean directory %s", cwd)
logger.error("%s expected to find %s", self.output.dirname)
return False
if not self.config.script:
cwd = os.getcwd()
if not os.path.samefile(cwd, self.output.dirname):
logger.error("%s (cowardly) refusing to clean directory %s",
self.source.stem, cwd)
logger.error("%s expected to find %s",
self.source.stem, self.output.dirname)
return False
s = '''find . -mindepth 1 -maxdepth 1 -not -type d -delete -print'''
return self.shellscript(s)