repochecker/epita: Check we have the original digest of compressed files
This commit is contained in:
parent
19daf69482
commit
b334122707
1 changed files with 6 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"path"
|
"path"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"srs.epita.fr/fic-server/admin/sync"
|
"srs.epita.fr/fic-server/admin/sync"
|
||||||
"srs.epita.fr/fic-server/libfic"
|
"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."))
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue