-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arch packages implementation #31037
base: main
Are you sure you want to change the base?
Arch packages implementation #31037
Conversation
9a3f45a
to
1a49dd9
Compare
1a49dd9
to
1007ce7
Compare
TODO:
|
E2E Test: down: # size > 80G
rsync -avLP rsync://rsync.mirrors.ustc.edu.cn/archlinux/core core
rsync -avLP rsync://rsync.mirrors.ustc.edu.cn/archlinux/extra extra test: #!/usr/bin/env bash
set -e -o pipefail
len="$(find ./ -type f -name "*.pkg.tar.zst" | wc -l)"
index=0
rm -f test.txt
touch test.txt
while read -r file;do
name="$(basename "$file")"
echo "[$index/$len] upload $name ..."
delPath="$(sed -E 's/^([a-zA-Z0-9@._+-]+)-([a-zA-Z0-9@._+:]+-[a-zA-Z0-9@._+:]+)-([a-zA-Z0-9_]+).pkg.tar.zst$/\1\/\2\/\3/' <<< "$name")"
if curl --fail -XDELETE --user root:root "http://127.0.0.1:3000/api/packages/root/arch/test/$delPath" > /dev/null 2>&1;then
echo "删除 $name"
fi
if ! curl -XPUT --fail --user root:root http://127.0.0.1:3000/api/packages/root/arch/test --upload-file "$file" >/dev/null 2>&1;then
echo "$name upload fail."
echo "$name " >> test.txt
fi
curl --fail -XDELETE --user root:root "http://127.0.0.1:3000/api/packages/root/arch/test/$delPath" > /dev/null 2>&1 ||:
index="$((index +1 ))"
done < <(find ./ -type f -name "*.pkg.tar.zst") |
{{if .PackageDescriptor.Metadata.Groups}} | ||
<tr> | ||
<td class="collapsing"> | ||
<h5>{{ctx.Locale.Tr "packages.arch.version.groups"}}</h5> | ||
</td> | ||
<td>{{StringUtils.Join $.PackageDescriptor.Metadata.Groups ", "}}</td> | ||
</tr> | ||
{{end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this can be simplified?
$locale=""
$value=""
if xxx {
$locale=ctx.Locale.Tr xxx
$value=xxxx
}
if ....
<HTML code once>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yp05327 There is no need; using variables + if
doesn't seem as intuitive as the current code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I want to add xxx
class, then I need to add xxx
class 9 times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, should have a for loop, check all key/value in metadata, then use the code I mentioned above. 🤔
close #25037
This Commit was created by d1nch8g (#25396).
This PR adds a package registry for Arch Linux packages with support for package files, signatures, and automatic pacman-database management.
Features:
tar.zst
package and Gitea sign it.SigLevel = Required
.You can follow this tutorial to build a *.pkg.tar.zst package for testing
docs pr: gitea/docs#47
Co-authored-by: d1nch8g@ion.lc
Co-authored-by: @KN4CK3R
Co-authored-by: @silverwind
Co-authored-by: @mahlzahn