'
;;
'python-pip-bootstrap')
url='https://bootstrap.pypa.io/get-pip.py'
regex=' entire copy of pip (version \([0-9.]\+\))\.'
;;
*'-dummy'|*'-bootstrap')
rem_pkgbase="${pkgbase%-*}"
rem_pkgbase="${rem_pkgbase//+/%2B}"
url='https://www.archlinux.org/packages/?q='"${rem_pkgbase}"
range='/^/'
regex='
\([^-<>]\+\)-[0-9]\+<\/td>'
regex_b=' | \([^-<>]\+\)-[0-9]\+<\/span><\/td>'
;;
*)
# It might be a (slightly modified) copy of an upstream package:
# Then we simply take the upstream pkgver.
if [ "${pkgbase}" = 'linux-olpc-xo1' ]; then
_pkgbase='linux'
else
_pkgbase="${pkgbase}"
fi
newver=$(
for repository in /var/lib/pacman/sync/*.db; do
bsdtar -tf "${repository}"
done \
| sed '
s@^'"${_pkgbase//./\.}"'-\([^-]\+\)-[0-9.]\+/desc$@\1@
t
d
' \
| sort -V \
| tail -n1
)
if [ -z "${newver}" ]; then
>&2 printf 'Checking the version of package "%s" is not yet implemented!\n' "${pkgbase}"
exit 1
fi
;;
esac
if [ -z "${newver}" ]; then
if [ -z "${regex_b}" ]; then
regex_b="${regex}"
fi
newver=$(
curl -LSs "${url}" | \
sed '
'"${range}"' s/^.*'"${regex}"'.*$/\1/
t
'"${range}"' s/^.*'"${regex_b}"'.*$/\1/
t
d
' | \
sort -V | \
tail -n1
)
fi
if [ "${newver}" != "${oldver}" ]; then
if ${machine_readable}; then
printf '%s="%s";\n' \
'pkgbase' "${pkgbase}" \
'newver' "${newver}" \
'oldver' "${oldver}"
else
printf '%s: %s vs. %s\n' \
"${pkgbase}" \
"${newver}" \
"${oldver}"
fi
fi
|