main.cfg: use a REPOS configuration structure to provide different paths and dbnames
This commit is contained in:
parent
c9c45aa9ae
commit
52ffaab7e4
@ -31,9 +31,10 @@ def _cursorRowToDict(cursor, row):
|
||||
|
||||
def latest():
|
||||
response = {}
|
||||
for repo in app.config['SEARCH_REPOS']:
|
||||
for repo in app.config['REPOS']:
|
||||
response[repo] = []
|
||||
REPO_SOURCES_DB = "file:" + app.config['REPO_BASEDIR'] + f"{repo}-sources.db?mode=ro"
|
||||
REPO_SOURCES_DB = "file:" + app.config['REPOS'][repo]['path'] + f"{app.config['REPOS'][repo]['dbname']}-sources.db?mode=ro"
|
||||
logger.info(REPO_SOURCES_DB)
|
||||
conn = sqlite3.connect(REPO_SOURCES_DB, uri=True)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(
|
||||
@ -48,9 +49,9 @@ def query(qs):
|
||||
logger.info(f"Query of {qs}")
|
||||
|
||||
response = {}
|
||||
for repo in app.config['SEARCH_REPOS']:
|
||||
for repo in app.config['REPOS']:
|
||||
response[repo] = []
|
||||
REPO_SOURCES_DB = "file:" + app.config['REPO_BASEDIR'] + f"{repo}-sources.db?mode=ro"
|
||||
REPO_SOURCES_DB = "file:" + app.config['REPOS'][repo]['path'] + f"{app.config['REPOS'][repo]['dbname']}-sources.db?mode=ro"
|
||||
conn = sqlite3.connect(REPO_SOURCES_DB, uri=True)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(
|
||||
|
@ -1,5 +1,7 @@
|
||||
#
|
||||
# WebDist main configuration file
|
||||
#
|
||||
REPO_BASEDIR = "/var/webbuild/db/"
|
||||
SEARCH_REPOS = [ 'devel', 'devel-makedist', 'devel-autodist' ]
|
||||
REPOS = {
|
||||
'openmamba-rolling': { 'dbname': 'devel', 'path': '/var/autodist/db/' },
|
||||
'openmamba-testing': { 'dbname': 'devel-makedist', 'path': '/var/autodist/db/' },
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user