Skip to content

Alpine Package Registry: Handling of 'noarch' packages #26691

Closed
@joniw

Description

@joniw

Description

Hello,

thank you for integrating the possibility to use gitea as an alpine package registry.

When adding a package with the architecture 'noarch' (like the salt package) it can not be installed via apk.

The reason is the architecture ist automatically detected from the package in the source-code and the uploaded package is then only available under the 'noarch' archtitecture and not under the other architectures like 'x86_64'.

A short test with the salt package from edge to my gitea instance:

root@alpine-dev ~/test # wget https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/salt-3006.2-r0.apk
Connecting to dl-cdn.alpinelinux.org ([2a04:4e42:6f::644]:443)
saving to 'salt-3006.2-r0.apk'
salt-3006.2-r0.apk   100% |**************************************************************************************************************************| 5625k  0:00:00 ETA
'salt-3006.2-r0.apk' saved
root@alpine-dev ~/test # curl --user testuser:password --upload-file salt-3006.2-r0.apk https://[***REDACTED***]/api/packages/alpine-packages/alpine/edge/
root@alpine-dev ~/test # apk update
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
fetch https://[***REDACTED***]/api/packages/alpine-packages/alpine/edge/salt/x86_64/APKINDEX.tar.gz
WARNING: updating and opening https://[***REDACTED***]/api/packages/alpine-packages/alpine/edge/salt: No such file or directory
v3.18.3-55-g2ee93b9273a [https://dl-cdn.alpinelinux.org/alpine/v3.18/main]
v3.18.3-63-g5d6ac0a2673 [https://dl-cdn.alpinelinux.org/alpine/v3.18/community]
2 unavailable, 0 stale; 20063 distinct packages available
root@alpine-dev ~/test # wget https://[***REDACTED***]/api/packages/alpine-packages/alpine/edge/salt/x86_64/APKINDEX.tar.gz
Connecting to [***REDACTED***] ([***REDACTED***]:443)
wget: server returned error: HTTP/1.1 404 Not Found
root@alpine-dev ~/test # wget https://[***REDACTED***]/api/packages/alpine-packages/alpine/edge/salt/noarch/APKINDEX.tar.gz
Connecting to [***REDACTED***] ([***REDACTED***]:443)
saving to 'APKINDEX.tar.gz'
APKINDEX.tar.gz      100% |**************************************************************************************************************************|  1170  0:00:00 ETA
'APKINDEX.tar.gz' saved

Possible solutions to this problem from my point of view are:

  • add 'noarch' packages to all architectures
  • allow to set the architecture on upload

With regards
Joniw

Gitea Version

1.20.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Test instance in Kubernetes

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions