Add Arch package registry (#32692)

Close #25037
Close #31037

This PR adds a Arch package registry usable with pacman.

![grafik](https://github.com/user-attachments/assets/81cdb0c2-02f9-4733-bee2-e48af6b45224)

Rewrite of #25396 and #31037. You can follow [this
tutorial](https://wiki.archlinux.org/title/Creating_packages) to build a
package for testing.

Docs PR: https://gitea.com/gitea/docs/pulls/111

Co-authored-by: [d1nch8g@ion.lc](mailto:d1nch8g@ion.lc)
Co-authored-by: @ExplodingDragon

---------

Co-authored-by: dancheg97 <dancheg97@fmnx.su>
Co-authored-by: dragon <ExplodingFKL@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
KN4CK3R 2024-12-05 00:09:07 +01:00 committed by GitHub
parent 5ab7aa700f
commit 0c3c041c88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 1687 additions and 91 deletions

View file

@ -221,6 +221,11 @@ func SearchFiles(ctx context.Context, opts *PackageFileSearchOptions) ([]*Packag
return pfs, count, err
}
// HasFiles tests if there are files of packages matching the search options
func HasFiles(ctx context.Context, opts *PackageFileSearchOptions) (bool, error) {
return db.Exist[PackageFile](ctx, opts.toConds())
}
// CalculateFileSize sums up all blob sizes matching the search options.
// It does NOT respect the deduplication of blobs.
func CalculateFileSize(ctx context.Context, opts *PackageFileSearchOptions) (int64, error) {