From: Luca Falavigna Date: Sun, 3 Oct 2010 13:07:45 +0000 (+0000) Subject: Don't hardcode paths X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a76a705c2236604e703884c6420b57efa60a9c9;p=dak Don't hardcode paths Signed-off-by: Luca Falavigna --- diff --git a/config/debian/dak.conf b/config/debian/dak.conf index 192a039b..fbf186f4 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 fcd4ca39..c1c29dc2 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 558dc44f..8086b515 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 5237d91e..c9dfa724 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')