aboutsummaryrefslogtreecommitdiffstats
path: root/services/packages/alpine
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2024-02-05 08:52:56 +0300
committerGitHub <noreply@github.com>2024-02-05 05:52:56 +0000
commit2da233ad8be107de29190720f1c30199410fe0cd (patch)
tree87965f42810c9286eec8c2ea463e83d26ed16b45 /services/packages/alpine
parent016c77a833d6843c2e18903d6c50a881018064f2 (diff)
downloadgitea-2da233ad8be107de29190720f1c30199410fe0cd.tar.gz
gitea-2da233ad8be107de29190720f1c30199410fe0cd.zip
Propagate install_if and provider_priority to APKINDEX (#28899)
Resolves https://github.com/go-gitea/gitea/issues/28704 Example of an entry in the generated `APKINDEX` file: ``` C:Q1xCO3H9LTTEbhKt9G1alSC87I56c= P:hello V:2.12-r1 A:x86_64 T:The GNU Hello program produces a familiar, friendly greeting U:https://www.gnu.org/software/hello/ L:GPL-3.0-or-later S:15403 I:36864 o:hello m: t:1705934118 D:so:libc.musl-x86_64.so.1 p:cmd:hello=2.12-r1 i:foobar=1.0 !baz k:42 ``` the `i:` and `k:` entries are new. --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'services/packages/alpine')
-rw-r--r--services/packages/alpine/repository.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/packages/alpine/repository.go b/services/packages/alpine/repository.go
index 30b7a06eb3..104548b421 100644
--- a/services/packages/alpine/repository.go
+++ b/services/packages/alpine/repository.go
@@ -230,6 +230,12 @@ func buildPackagesIndex(ctx context.Context, ownerID int64, repoVersion *package
if len(pd.FileMetadata.Provides) > 0 {
fmt.Fprintf(&buf, "p:%s\n", strings.Join(pd.FileMetadata.Provides, " "))
}
+ if pd.FileMetadata.InstallIf != "" {
+ fmt.Fprintf(&buf, "i:%s\n", pd.FileMetadata.InstallIf)
+ }
+ if pd.FileMetadata.ProviderPriority > 0 {
+ fmt.Fprintf(&buf, "k:%d\n", pd.FileMetadata.ProviderPriority)
+ }
fmt.Fprint(&buf, "\n")
}