Make sure to call normalizeDebianProgramName() on the whole name, not on parts
According to policy, the minimum length for a package is two, which is
something normalizeDebianProgramName() checks. However this function was
called on *parts* of the package name, and in case of a package such as
golang-golang-x-term, it fails, as the part "x" is only one character.
Note that we can safely drop strings.Trim(), as the string returned by
normalizeDebianProgramName() was already trimmed from '-'
Closes: #148
Arnaud Rebillout authored 3 years ago
zhsj committed 3 years ago
597 | 597 | } |
598 | 598 | parts[0] = host |
599 | 599 | |
600 | for i := range parts { | |
601 | if i == 0 { | |
602 | continue | |
603 | } | |
604 | ||
605 | parts[i] = normalizeDebianProgramName(parts[i]) | |
606 | } | |
607 | ||
608 | return strings.Trim("golang-"+strings.Join(parts, "-"), "-") | |
600 | return normalizeDebianProgramName("golang-" + strings.Join(parts, "-")) | |
609 | 601 | } |
610 | 602 | |
611 | 603 | func getDebianName() string { |