Commit 782f8a1f authored by Jérome Perrin's avatar Jérome Perrin

isconf: understand more URLs

We have so many variations of *.in that just allowing *.in is better
than listing them all.
parent 22950eb6
......@@ -466,21 +466,15 @@ def _namever(url, failonerr):
# isconf returns whether url points to data related to configuration file
# (contrary to binary executable), or a simple/small script.
def isconf(url):
if url.endswith('.conf.in') or \
if url.endswith('.in') or \
url.endswith('.cfg') or \
url.endswith('.cfg.in') or \
url.endswith('.cnf.in') or \
url.endswith('.cfg.jinja2') or \
url.endswith('.cfg.jinja2.in') or \
url.endswith('.jinja2.cfg') or \
url.endswith('.jinja2.library') or \
url.endswith('.asn') or \
url.endswith('/ltelogs.jinja2.sh') or \
'/promise/' in url or \
url.endswith('/templates/wrapper.in') or \
url.endswith('/logrotate_entry.in') or \
url.endswith('/matplotlibrc.in') or \
url.endswith('/goenv.sh.in') :
url.endswith('/template-fonts-conf') :
return True
return False
......
......@@ -75,8 +75,13 @@ def test_namever(url, nameok, verok):
'xxx.cfg',
'xxx.cfg.in',
'xxx.cnf.in',
'xxx.py.in',
'xxx.sh.in',
'xxx.yaml.in',
'xxx.xml.in',
'xxx.cfg.jinja2',
'xxx.cfg.jinja2.in',
'xxx/instance-theia.cfg.jinja.in',
'xxx.jinja2.cfg',
'xxx.jinja2.library',
'xxx.asn',
......@@ -86,6 +91,13 @@ def test_namever(url, nameok, verok):
'xxx/matplotlibrc.in',
'xxx/goenv.sh.in',
'xxx/promise/yyy',
'xxx/template-fonts-conf',
'xxx/template-tomcat-service.sh.in',
'xxx/server.xml.in',
'xxx/gitlab-export.in',
'xxx/watcher.in',
'xxx/runTestSuite.in',
'xxx/template-crontab-line.in',
])
def test_isconf(url):
assert nxdbom.isconf(url) == True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment