提交 2a76a705 编写于 作者: L Luca Falavigna

Don't hardcode paths

Signed-off-by: NLuca Falavigna <dktrkranz@debian.org>
上级 69f09ae3
......@@ -364,6 +364,7 @@ Dir
Root "/srv/ftp-master.debian.org/ftp/";
Pool "/srv/ftp-master.debian.org/ftp/pool/";
Templates "/srv/ftp-master.debian.org/dak/templates/";
Export "/srv/ftp-master.debian.org/export/";
PoolRoot "pool/";
Lists "/srv/ftp-master.debian.org/database/dists/";
Cache "/srv/ftp-master.debian.org/database/";
......
......@@ -98,6 +98,7 @@ def britney_changelog(packages, suite, session):
old = {}
current = {}
Cnf = utils.get_conf()
try:
q = session.execute("SELECT changelog FROM suite WHERE id = :suiteid", \
......@@ -106,7 +107,9 @@ def britney_changelog(packages, suite, session):
except:
brit_file = None
if not brit_file:
if brit_file:
brit_file = os.path.join(Cnf['Dir::Root'], brit_file)
else:
return
q = session.execute("""SELECT s.source, s.version, sa.id
......
......@@ -36,9 +36,9 @@ def do_update(self):
print __doc__
try:
c = self.db.cursor()
c.execute("INSERT INTO config(name, value) VALUES ('exportpath', '/srv/ftp-master.debian.org/export/changelogs')")
c.execute("INSERT INTO config(name, value) VALUES ('exportpath', 'changelogs')")
c.execute("ALTER TABLE suite ADD COLUMN changelog text NULL")
c.execute("UPDATE suite SET changelog = '/srv/ftp-master.debian.org/ftp/dists/testing/ChangeLog' WHERE suite_name = 'testing'")
c.execute("UPDATE suite SET changelog = 'dists/testing/ChangeLog' WHERE suite_name = 'testing'")
c.execute("UPDATE config SET value = '39' WHERE name = 'db_revision'")
self.db.commit()
......
......@@ -267,6 +267,7 @@ def main():
if export:
if cnf.exportpath:
cnf.exportpath = os.path.join(Cnf['Dir::Export'], cnf.exportpath)
export_files(session, Cnf['Dir::Pool'], cnf.exportpath, Cnf['Dir::TempPath'])
else:
utils.fubar('No changelog export path defined')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册