fix: allow double digit epoch for Debian packages (#8671)

Debian packages were capped for a single digit epoch, relax that requirement to a double digit epoch. This is allowed by Debian.

Resolves forgejo/forgejo#8649

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8671
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: pkpkpkpk <pkpkpkpk@noreply.codeberg.org>
Co-committed-by: pkpkpkpk <pkpkpkpk@noreply.codeberg.org>
This commit is contained in:
pkpkpkpk 2025-07-30 18:02:46 +02:00 committed by Gusted
parent 1761dae2db
commit 98e2a64e2d
2 changed files with 9 additions and 1 deletions

View file

@ -167,6 +167,14 @@ func TestParseControlFile(t *testing.T) {
require.ErrorIs(t, err, ErrInvalidArchitecture)
})
t.Run("ValidVersionEpoch", func(t *testing.T) {
for _, version := range []string{"0:1.2.3-test", "1:1.2.3-test", "9:1.2.3-test", "10:1.2.3-test", "37:1.2.3-test", "99:1.2.3-test"} {
p, err := ParseControlFile(buildContent(packageName, version, packageArchitecture))
require.NoError(t, err)
assert.NotNil(t, p)
}
})
t.Run("Valid", func(t *testing.T) {
content := buildContent(packageName, packageVersion, packageArchitecture)
full := content.String()