repochecker: add new option -skipfiledigests to speed up the checks and avoid downloading lots of content

This commit is contained in:
nemunaire 2020-01-16 18:53:27 +01:00
parent aee3500fdf
commit 769158a9d7
3 changed files with 44 additions and 10 deletions

View file

@ -341,7 +341,7 @@ func buildExerciceFlags(i Importer, exercice fic.Exercice) (flags map[int64]impo
}
// CheckExerciceFlags checks if all flags for the given challenge are correct.
func CheckExerciceFlags(i Importer, exercice fic.Exercice, files []fic.EFile) (rf []fic.Flag, errs []string) {
func CheckExerciceFlags(i Importer, exercice fic.Exercice, files []string) (rf []fic.Flag, errs []string) {
flags, flagsids, berrs := buildExerciceFlags(i, exercice)
errs = append(errs, berrs...)
@ -358,7 +358,7 @@ func CheckExerciceFlags(i Importer, exercice fic.Exercice, files []fic.EFile) (r
for _, lf := range flag.FilesDeps {
found := false
for _, f := range files {
if f.Name == lf {
if f == lf {
found = true
break
}
@ -452,7 +452,7 @@ func ApiGetRemoteExerciceFlags(ps httprouter.Params, _ []byte) (interface{}, err
if theme != nil {
exercice, _, _, _, errs := BuildExercice(GlobalImporter, *theme, path.Join(theme.Path, ps.ByName("exid")), nil)
if exercice != nil {
flags, errs := CheckExerciceFlags(GlobalImporter, *exercice, []fic.EFile{})
flags, errs := CheckExerciceFlags(GlobalImporter, *exercice, []string{})
if flags != nil {
return flags, nil
} else {