Skip to content

Commit

Permalink
Keep checksum of not compressed index file even if it's not uploaded
Browse files Browse the repository at this point in the history
Fixes: #756
  • Loading branch information
smira committed Jul 13, 2018
1 parent b0be6c8 commit 747b975
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deb/index_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ func (file *indexFile) Finalize(signer pgp.Signer) error {
file.tempFile.Close()

exts := []string{""}
cksumExts := exts
if file.compressable {
exts = append(exts, ".gz", ".bz2")
cksumExts = exts
if file.onlyGzip {
exts = []string{".gz"}
cksumExts = []string{"", ".gz"}
}
}

for _, ext := range exts {
for _, ext := range cksumExts {
var checksumInfo utils.ChecksumInfo

checksumInfo, err = utils.ChecksumsForFile(file.tempFilename + ext)
Expand Down
8 changes: 8 additions & 0 deletions system/t06_publish/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down Expand Up @@ -464,6 +468,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down
12 changes: 12 additions & 0 deletions system/t06_publish/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down Expand Up @@ -724,6 +728,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down Expand Up @@ -947,6 +955,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down
12 changes: 12 additions & 0 deletions system/t06_publish/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down Expand Up @@ -321,6 +325,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down Expand Up @@ -506,6 +514,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down
8 changes: 8 additions & 0 deletions system/t06_publish/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down Expand Up @@ -402,6 +406,10 @@ def check(self):
pathsSeen = set()
for l in release:
fileHash, fileSize, path = l.split()
if "Contents" in path and not path.endswith(".gz"):
# "Contents" are present in index, but not really written to disk
continue

pathsSeen.add(path)

fileSize = int(fileSize)
Expand Down

0 comments on commit 747b975

Please sign in to comment.