aboutsummaryrefslogtreecommitdiff
path: root/repos
diff options
context:
space:
mode:
authoremmett1 <emmett1.2miligrams@protonmail.com>2025-01-29 01:09:38 +0800
committeremmett1 <emmett1.2miligrams@protonmail.com>2025-01-29 01:09:38 +0800
commitf69f99008217bb17338ee8a108391bef3d3b95d0 (patch)
treecc7edcefd0e9e2a0a45c30ea8066bc77afd80560 /repos
parent280e0a4c3824e219cbed9bfa93a9f5c832b76d4a (diff)
downloadalicelinux-f69f99008217bb17338ee8a108391bef3d3b95d0.tar.gz
alicelinux-f69f99008217bb17338ee8a108391bef3d3b95d0.zip
update scripts
Diffstat (limited to 'repos')
-rwxr-xr-xrepos/outdated.sh46
-rwxr-xr-xrepos/update.sh12
2 files changed, 43 insertions, 15 deletions
diff --git a/repos/outdated.sh b/repos/outdated.sh
index 5af614c8..af78350c 100755
--- a/repos/outdated.sh
+++ b/repos/outdated.sh
@@ -1,29 +1,45 @@
#!/bin/sh
+fetchversion() {
+ curl -SsZA tmp https://repology.org/badge/latest-versions/$1.svg \
+ | sed 's/, /,/g' \
+ | tr ' ' '\n' \
+ | grep -Eo 'central">.*<' \
+ | sed 's/<.*//;s/.*>//' \
+ | tr ',' '\n' \
+ | tail -n1
+}
+
while [ "$1" ]; do
unset curver port
[ -f $1/abuild ] && port=${1%/}
[ "$port" ] || { shift; continue; }
- pname=${1##*/}
+ name=${1#*/}; name=${name%/}
curver=$(grep ^version= $port/abuild | awk -F = '{print $2}')
[ "$curver" ] || { shift; continue; }
- case $pname in
- python-*) pname=python:${pname#python-};;
- perl-*) pname=perl:${pname#perl-};;
+ case $name in
+ python-*) name=python:${name#python-};;
+ perl-*) name=perl:${name#perl-};;
esac
- #clang) pname=llvm;;
- #dejavu-fonts-ttf) pame=fonts:dejavu;;
- #lcms2) pname=lcms;;
- #libconfig) pname=libconfig-hyperrealm;;
- #xf86-input-libinput) pname=xdrv:libinput;;
- #esac
+ # clear newver function
+ unset -f newver
if [ -s $port/outdated ]; then
- pname=$(cat $port/outdated | tail -n1)
+ . $port/outdated
+ fi
+ printf " checking $1\033[0K\r"
+ newver=$(fetchversion $name)
+ if [ "$(command -v newver)" ]; then
+ newver
fi
- v=$(curl -SsZA tmp https://repology.org/badge/latest-versions/$pname.svg | grep middle | sed 's/.*middle">//;s/<.*//;s/,//' | tr ' ' '\n' | tail -n1)
- [ "$v" ] || v=404
- if [ "$curver" != "$v" ]; then
- echo "$port $v ($curver)"
+ touch outdate.error outdate.list
+ sed "\|^$port .*|d" -i outdate.error
+ sed "\|^$port .*|d" -i outdate.list
+ if [ ! "$newver" ] || [ "$newver" = '-' ]; then
+ echo "$port $curver" >> outdate.error
+ elif [ "$curver" != "$newver" ]; then
+ echo "$port $newver ($curver)"
+ echo "$port $newver ($curver)" >> outdate.list
fi
shift
done
+printf "\033[0K"
diff --git a/repos/update.sh b/repos/update.sh
new file mode 100755
index 00000000..49c93acf
--- /dev/null
+++ b/repos/update.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+for i in $(awk '{print $1}' outdate.list); do
+ [ -d $i ] || continue
+ nv=$(grep ^"$i " outdate.list | awk '{print $2}')
+ ov=$(grep ^"$i " outdate.list | awk '{print $3}')
+ read -p "Update $i $ov to $nv " aaa
+ case $aaa in
+ n|N|no|NO|No|nO) continue;;
+ *) ./pkgup.sh $i $nv;;
+ esac
+done