]> err.no Git - dak/commitdiff
Don't hardcode paths
authorLuca Falavigna <dktrkranz@debian.org>
Sun, 3 Oct 2010 13:07:45 +0000 (13:07 +0000)
committerLuca Falavigna <dktrkranz@debian.org>
Sun, 3 Oct 2010 13:07:45 +0000 (13:07 +0000)
Signed-off-by: Luca Falavigna <dktrkranz@debian.org>
config/debian/dak.conf
dak/control_suite.py
dak/dakdb/update39.py
dak/make_changelog.py

index 192a039b29f16bc6ed234aafbaad3e32f745ec6a..fbf186f4fb4e661e7c3e8ffa5eeb698ab4c660ab 100644 (file)
@@ -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/";
index fcd4ca39562cf0c96e61f2364dc3e412a1b01ed0..c1c29dc29e096663148aa6819c52ac7b1e6a5695 100755 (executable)
@@ -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
index 558dc44fe119a3365c6c636f94c99e89215f9546..8086b515f689c953344a055709762c2b306561c7 100644 (file)
@@ -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()
 
index 5237d91ee0c4578fade24e3222b482230d4ef7a6..c9dfa7249439edf042d856514dfb1d6efab3367d 100755 (executable)
@@ -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')