Add some support for tarballs using yelp-tools (GNOME bug 656738)

This commit is contained in:
Frédéric Péters 2011-09-30 19:57:03 +02:00
parent a9ae80181f
commit a9a220479b
3 changed files with 11 additions and 8 deletions

View File

@ -497,7 +497,10 @@ class Lgo(App):
makefile_am = fd.read()
# merge lines continued with \
makefile_am = re.sub(r'\\\s*\n', r' ', makefile_am)
if 'DOC_ID' in makefile_am and regex_gdu.findall(makefile_am):
if 'HELP_ID' in makefile_am and '@YELP_HELP_RULES@' in makefile_am:
logging.debug('found usage of mallard (via YELP_HELP_RULES) in %s' % tarinfo.name)
doc = MallardModule.create_from_tar(tar, tarinfo, makefile_am, nightly)
elif 'DOC_ID' in makefile_am and regex_gdu.findall(makefile_am):
logging.debug('found usage of mallard in %s' % tarinfo.name)
doc = MallardModule.create_from_tar(tar, tarinfo, makefile_am, nightly)
elif 'DOC_MODULE' in makefile_am and regex_gdu.findall(makefile_am):

View File

@ -47,10 +47,9 @@ class DocModule(object):
self.dirname = os.path.dirname(tarinfo.name)
if makefile_am:
self.makefile_am = makefile_am
try:
self.modulename = re.findall(r'DOC_ID\s?=\s?(.*)', makefile_am)[0].strip()
except IndexError:
self.modulename = re.findall(r'DOC_MODULE\s?=\s?(.*)', makefile_am)[0].strip()
self.modulename = re.findall(r'(?:DOC_ID|DOC_MODULE|HELP_ID)\s?=\s?(.*)',
makefile_am)[0].strip()
if '@' in self.modulename:
logging.warning('variadic module name: %s' % self.modulename)
# don't go interpreting autotools variables, as in this path

View File

@ -202,7 +202,7 @@ class MallardModule(DocModule):
ext_dirname = os.path.join(app.config.private_dir, 'extracts')
try:
doc_linguas = re.findall(r'DOC_LINGUAS\s+=[\t ](.*)',
doc_linguas = re.findall(r'(?:DOC_LINGUAS|HELP_LINGUAS)\s+=[\t ](.*)',
self.makefile_am)[0].split()
if not 'en' in doc_linguas:
doc_linguas.append('en')
@ -210,12 +210,13 @@ class MallardModule(DocModule):
doc_linguas = ['en']
try:
doc_pages = re.findall('DOC_PAGES\s+=\s+(.*)', self.makefile_am)[0].split()
doc_pages = re.findall(r'(?:DOC_PAGES|HELP_FILES)\s+=\s+(.*)',
self.makefile_am)[0].split()
except IndexError:
return
try:
doc_figures = re.findall('DOC_FIGURES\s+=\s+(.*)',
doc_figures = re.findall(r'(?:DOC_FIGURES|HELP_FIGURES)\s+=\s+(.*)',
self.makefile_am)[0].split()
figures_dirname = os.path.join(ext_dirname, self.dirname, 'C')
self.expand_doc_figures(doc_figures)