]> git.decadent.org.uk Git - dak.git/commitdiff
clean_suites: fix clean_byhash when Dinstall::SuiteSuffix is set
authorJulien Cristau <jcristau@debian.org>
Wed, 18 May 2016 14:10:01 +0000 (16:10 +0200)
committerJulien Cristau <jcristau@debian.org>
Wed, 18 May 2016 14:10:01 +0000 (16:10 +0200)
Signed-off-by: Julien Cristau <jcristau@debian.org>
dak/clean_suites.py

index ac354371fee0a8fdd3b43ae437a96405dcae7b52..314c6121727a843427bde0c22cbcabe06df6e7e8 100755 (executable)
@@ -386,6 +386,9 @@ SELECT f.id, f.fingerprint FROM fingerprint f
 ################################################################################
 
 def clean_byhash(now_date, session):
+    cnf = Config()
+    suite_suffix = cnf.find("Dinstall::SuiteSuffix", "")
+
     Logger.log(["Cleaning out unused by-hash files..."])
 
     q = session.execute("""
@@ -399,7 +402,7 @@ def clean_byhash(now_date, session):
 
     if not Options["No-Action"]:
         for base, suite, path in q:
-            filename = os.path.join(base, 'dists', suite, path)
+            filename = os.path.join(base, 'dists', suite, suite_suffix, path)
             try:
                 os.unlink(filename)
             except OSError as exc: