1
0
Fork 0

feat: use numerical debian release string by default

master
dump_stack() 2023-05-24 07:15:34 +00:00
parent 77e118be64
commit 26a65924df
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
1 changed files with 6 additions and 2 deletions

View File

@ -119,10 +119,14 @@ var ReleaseStrings = [...]string{
"bookworm",
}
func (cn Release) String() string {
func (cn Release) Name() string {
return ReleaseStrings[cn]
}
func (cn Release) String() string {
return fmt.Sprintf("%d", cn)
}
func ReleaseFromString(s string) (r Release) {
switch strings.ToLower(s) {
case "7", "wheezy":
@ -220,7 +224,7 @@ func repositories(release Release) (repos []string) {
format := "deb [check-valid-until=no trusted=yes] " +
"http://snapshot.debian.org/archive/%s/%s " +
"%s%s main"
r := fmt.Sprintf(format, archive, snapshot, release, s)
r := fmt.Sprintf(format, archive, snapshot, release.Name(), s)
repos = append(repos, r)
}