[v12.0/forgejo] fix: allow double digit epoch for Debian packages (#8733)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/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

Co-authored-by: pkpkpkpk <pkpkpkpk@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8733
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
forgejo-backport-action 2025-07-30 20:31:39 +02:00 committed by Gusted
commit 36f108041c
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()