Fix metadata creation and simplify deduplication

This commit is contained in:
Mustafa Gezen 2021-02-14 18:14:21 +01:00
parent 0db0040f1d
commit b699ae6dac
1 changed files with 5 additions and 3 deletions

View File

@ -220,11 +220,13 @@ func ProcessRPM(pd *ProcessData) {
log.Fatalf("could not create metadata file: %v", err)
}
for _, source := range md.sourcesToIgnore {
if source.expired {
sourcePath := source.name
_, err := w.Filesystem.Stat(sourcePath)
if source.expired || err != nil {
continue
}
sourcePath := source.name
sourceFile, err := w.Filesystem.Open(sourcePath)
if err != nil {
log.Fatalf("could not open ignored source file %s: %v", sourcePath, err)
@ -246,7 +248,7 @@ func ProcessRPM(pd *ProcessData) {
log.Fatalf("could not write to metadata file: %v", err)
}
path := fmt.Sprintf("%s", checksum)
path := checksum
if strContains(alreadyUploadedBlobs, path) {
continue
}