[dak/master] Don't hardcode paths
Signed-off-by: Luca Falavigna <dktrkranz@debian.org>
---
config/debian/dak.conf | 1 +
dak/control_suite.py | 5 ++++-
dak/dakdb/update39.py | 4 ++--
dak/make_changelog.py | 1 +
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/config/debian/dak.conf b/config/debian/dak.conf
index 192a039..fbf186f 100644
--- a/config/debian/dak.conf
+++ b/config/debian/dak.conf
@@ -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/";
diff --git a/dak/control_suite.py b/dak/control_suite.py
index fcd4ca3..c1c29dc 100755
--- a/dak/control_suite.py
+++ b/dak/control_suite.py
@@ -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
diff --git a/dak/dakdb/update39.py b/dak/dakdb/update39.py
index 558dc44..8086b51 100644
--- a/dak/dakdb/update39.py
+++ b/dak/dakdb/update39.py
@@ -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()
diff --git a/dak/make_changelog.py b/dak/make_changelog.py
index 5237d91..c9dfa72 100755
--- a/dak/make_changelog.py
+++ b/dak/make_changelog.py
@@ -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')
--
1.5.6.5
Reply to: