[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Don't try to by-hash installer checksum files



The installer files are never changed, nor are they read by apt.
---
 dak/generate_releases.py | 21 +++++++++++++--------
 daklib/regexes.py        |  3 ++-
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/dak/generate_releases.py b/dak/generate_releases.py
index 0c106b4..d1fc89f 100755
--- a/dak/generate_releases.py
+++ b/dak/generate_releases.py
@@ -45,7 +45,7 @@ import commands
 from sqlalchemy.orm import object_session
 
 from daklib import utils, daklog
-from daklib.regexes import re_gensubrelease, re_includeinrelease
+from daklib.regexes import re_gensubrelease, re_includeinrelease_byhash, re_includeinrelease_plain
 from daklib.dak_exceptions import *
 from daklib.dbconn import *
 from daklib.config import Config
@@ -367,20 +367,25 @@ class ReleaseWriter(object):
         hashes = [x for x in RELEASE_HASHES if x.db_name in suite.checksums]
 
         fileinfo = {}
+        fileinfo_byhash = {}
 
         uncompnotseen = {}
 
         for dirpath, dirnames, filenames in os.walk(".", followlinks=True, topdown=True):
             for entry in filenames:
-                # Skip things we don't want to include
-                if not re_includeinrelease.match(entry):
-                    continue
-
                 if dirpath == '.' and entry in ["Release", "Release.gpg", "InRelease"]:
                     continue
 
                 filename = os.path.join(dirpath.lstrip('./'), entry)
-                fileinfo[filename] = {}
+
+                if re_includeinrelease_byhash.match(entry):
+                    fileinfo[filename] = fileinfo_byhash[filename] = {}
+                elif re_includeinrelease_plain.match(entry):
+                    fileinfo[filename] = {}
+                # Skip things we don't want to include
+                else:
+                    continue
+
                 contents = open(filename, 'r').read()
 
                 # If we find a file for which we have a compressed version and
@@ -423,8 +428,8 @@ class ReleaseWriter(object):
         out.close()
         os.rename(outfile + '.new', outfile)
 
-        self._update_hashfile_table(session, fileinfo, hashes)
-        self._make_byhash_links(fileinfo, hashes)
+        self._update_hashfile_table(session, fileinfo_byhash, hashes)
+        self._make_byhash_links(fileinfo_byhash, hashes)
 
         sign_release_dir(suite, os.path.dirname(outfile))
 
diff --git a/daklib/regexes.py b/daklib/regexes.py
index 3dccbba..43e5684 100644
--- a/daklib/regexes.py
+++ b/daklib/regexes.py
@@ -103,7 +103,8 @@ re_parse_lintian = re.compile(r"^(?P<level>W|E|O): (?P<package>.*?): (?P<tag>[^
 
 # in generate-releases
 re_gensubrelease = re.compile (r".*/(binary-[0-9a-z-]+|source)$")
-re_includeinrelease = re.compile (r"(Translation-[a-zA-Z_]+\.(?:bz2|xz)|Contents-[0-9a-z-]+.gz|Index|Packages(.gz|.bz2|.xz)?|Sources(.gz|.bz2|.xz)?|Components-[0-9a-z-]+.yml(.gz|.xz)|icons-[0-9x-]+.tar(.gz|.xz)|MD5SUMS|SHA256SUMS|Release)$")
+re_includeinrelease_byhash = re.compile (r"(Translation-[a-zA-Z_]+\.(?:bz2|xz)|Contents-[0-9a-z-]+.gz|Index|Packages(.gz|.bz2|.xz)?|Sources(.gz|.bz2|.xz)?|Components-[0-9a-z-]+.yml(.gz|.xz)|icons-[0-9x-]+.tar(.gz|.xz)|Release)$")
+re_includeinrelease_plain = re.compile (r"(MD5SUMS|SHA256SUMS)$")
 
 # in generate_index_diffs
 re_includeinpdiff = re.compile(r"(Translation-[a-zA-Z_]+\.(?:bz2|xz))")
-- 
2.1.4



Reply to: