summaryrefslogtreecommitdiff
path: root/home/xyz/.local
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2023-12-19 00:59:19 -0800
committerXiao Pan <gky44px1999@gmail.com>2023-12-19 00:59:19 -0800
commit1c3bcaa9ccced66a159d03c48d2831ce22ca32bf (patch)
tree88c5065df9932cda3dd65e90d20f47b14958c3b5 /home/xyz/.local
parent94c70fbe93e2c6195dc24fe575d49fb4fbef1e88 (diff)
use studio as mirror website for fly-any repo
Diffstat (limited to 'home/xyz/.local')
-rwxr-xr-xhome/xyz/.local/bin/mpra21
1 files changed, 15 insertions, 6 deletions
diff --git a/home/xyz/.local/bin/mpra b/home/xyz/.local/bin/mpra
index 114c836b..2a1802a9 100755
--- a/home/xyz/.local/bin/mpra
+++ b/home/xyz/.local/bin/mpra
@@ -2,22 +2,29 @@
# MakePkg Repo-Add
fn () {
+ if ! { [ -f PKGBUILD ] || [ -h PKGBUILD ];}; then
+ exit
+ fi
find . -maxdepth 1 -type f -name "*.pkg.tar.$ext*" -delete
makepkg --sign -sf
newpkg="$(find . -maxdepth 1 -type f -name "*.pkg.tar.$ext")"
- mv "$newpkg" "$newpkg.sig" ..
+ [ -d ../repo ] || mkdir ../repo
+ mv "$newpkg" "$newpkg.sig" ../repo
# need manually repo-add new database for first time initialization
- repo-add -s -v -R "$(find .. -maxdepth 1 -type f -name '*.db.tar.gz')" "../$newpkg"
+ repo-add -s -v -R "$(find ../repo -maxdepth 1 -type f -name '*.db.tar.gz')" "../repo/$newpkg"
+ # seems no need to delete *.old and *.old.sig, see https://mirror.fcix.net/archlinux/core/os/x86_64/ it do include *.old
+ #find ../repo -maxdepth 1 -type f \( -name '*.old' -o -name '*.old.sig' \) -delete
}
-ext='zst'
+ext=zst
+copy_any=
-upd -p
-
-while getopts a opt; do
+while getopts ac opt; do
case $opt in
# arch linux arm still using .xz instead of .zst as package compression format
a) ext=xz;;
+ # copy arch linux fly-any repo
+ c) copy_any=1;;
\?) exit 1;;
esac
done
@@ -32,4 +39,6 @@ else
done
fi
+[ "$copy_any" ] && sudo rsync -vPrlt --delete ../repo/ /srv/http/mirrors/archlinux/any
+
upd -p