repochecker/epita: Check we have the original digest of compressed files

This commit is contained in:
nemunaire 2022-11-03 01:31:11 +01:00
parent 19daf69482
commit b334122707
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"fmt"
"path"
"strings"
"srs.epita.fr/fic-server/admin/sync"
"srs.epita.fr/fic-server/libfic"
@ -14,5 +15,10 @@ func EPITACheckFile(file *fic.EFile, exceptions *sync.CheckExceptions) (errs []e
errs = append(errs, fmt.Errorf("this file use a forbidden archive type."))
}
// Check .gz files have a dedicated hash
if path.Ext(file.Name) == ".gz" && !strings.HasSuffix(file.Name, ".tar.gz") && len(file.ChecksumShown) == 0 {
errs = append(errs, fmt.Errorf("digest of original, uncompressed, file missing in DIGESTS.txt"))
}
return
}