xbps-src: update_check.sh: check distfile existence for kde
* KDE distfile storage is based on versionned "folder". An existing folder_version does not mean that the corresponding distifile exists, so let's check its existence. * wider scope for KDE urls that will use that rule. Fine for plenty other packages, except kdb that don't follow this hierarchy (yet)
This commit is contained in:
parent
23a615211a
commit
8944a9130e
@ -4,6 +4,7 @@ update_check() {
|
|||||||
local i p url sfname lpname bbname githubname rx found_version consider
|
local i p url sfname lpname bbname githubname rx found_version consider
|
||||||
local update_override=$XBPS_SRCPKGDIR/$XBPS_TARGET_PKG/update
|
local update_override=$XBPS_SRCPKGDIR/$XBPS_TARGET_PKG/update
|
||||||
local original_pkgname=$pkgname
|
local original_pkgname=$pkgname
|
||||||
|
local urlpfx urlsfx
|
||||||
|
|
||||||
if [ -r $update_override ]; then
|
if [ -r $update_override ]; then
|
||||||
. $update_override
|
. $update_override
|
||||||
@ -27,6 +28,35 @@ update_check() {
|
|||||||
else
|
else
|
||||||
printf '%s\n' "$site"
|
printf '%s\n' "$site"
|
||||||
fi |
|
fi |
|
||||||
|
# filter loop: if version are "folder" name based,
|
||||||
|
# substitute original url by every folder based ones (expand)
|
||||||
|
while IFS= read -r url; do
|
||||||
|
rx=
|
||||||
|
urlpfx="${url}"
|
||||||
|
urlsfx=
|
||||||
|
case "$url" in
|
||||||
|
*download.kde.org/stable/applications/*|*download.kde.org/stable/frameworks/*|*download.kde.org/stable/plasma/*|\
|
||||||
|
*download.kde.org/stable/kdevelop/*|*download.kde.org/stable/krita/*|*download.kde.org/stable/clazy/*|\
|
||||||
|
*download.kde.org/stable/digikam/*|*download.kde.org/stable/phonon/*)
|
||||||
|
urlpfx="${url%%${version%.*}*}"
|
||||||
|
urlsfx="${url##${urlpfx}${version%.*}}"
|
||||||
|
urlsfx="${urlsfx#.*/}"
|
||||||
|
urlsfx="/${urlsfx#/}"
|
||||||
|
rx='href="\K[\d\.]+(?=/")'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ -z "$rx" ]; then
|
||||||
|
# default case: don't rewrite url
|
||||||
|
printf '%s\n' "$url"
|
||||||
|
else
|
||||||
|
# substitute url if needed
|
||||||
|
if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
|
||||||
|
echo "(folder) fetching $urlpfx" 1>&2
|
||||||
|
fi
|
||||||
|
curl -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$urlpfx" |
|
||||||
|
grep -Po -i "$rx" | xargs -r -n 1 -I @@ printf '%s\n' "${urlpfx}@@${urlsfx}"
|
||||||
|
fi
|
||||||
|
done |
|
||||||
while IFS= read -r url; do
|
while IFS= read -r url; do
|
||||||
rx=
|
rx=
|
||||||
if [ -z "$site" ]; then
|
if [ -z "$site" ]; then
|
||||||
@ -64,9 +94,6 @@ update_check() {
|
|||||||
rx=linux-'\K'${version%.*}'[\d.]+(?=\.tar\.xz)';;
|
rx=linux-'\K'${version%.*}'[\d.]+(?=\.tar\.xz)';;
|
||||||
*cran.r-project.org/src/contrib*)
|
*cran.r-project.org/src/contrib*)
|
||||||
rx='\b\Q'"${pkgname#R-cran-}"'\E_\K\d+(\.\d+)*(-\d+)?(?=\.tar)';;
|
rx='\b\Q'"${pkgname#R-cran-}"'\E_\K\d+(\.\d+)*(-\d+)?(?=\.tar)';;
|
||||||
*download.kde.org/stable/applications*|*download.kde.org/stable/frameworks*|*download.kde.org/stable/plasma*)
|
|
||||||
url="${url%%${version%.*}*}"
|
|
||||||
rx='href="\K[\d\.]+(?=/")';;
|
|
||||||
*rubygems.org*)
|
*rubygems.org*)
|
||||||
url="https://rubygems.org/gems/${pkgname#ruby-}"
|
url="https://rubygems.org/gems/${pkgname#ruby-}"
|
||||||
rx='href="/gems/'${pkgname#ruby-}'/versions/\K[\d\.]*(?=")' ;;
|
rx='href="/gems/'${pkgname#ruby-}'/versions/\K[\d\.]*(?=")' ;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user