diff --git a/Manual.md b/Manual.md
index 0bcf0ccef91..b08c06d9fdb 100644
--- a/Manual.md
+++ b/Manual.md
@@ -451,7 +451,9 @@ matches a version number enclosed in `...` tags.
- `update_ignore` is a space-separated list of shell globs that match
version numbers which are not taken into account for checking newer
-versions. Example: `update_ignore="*b*"`
+versions. Example: `update_ignore="*b*"`
+
+You can run such a check using `./xbps-src update-check `.
### build style scripts
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
new file mode 100644
index 00000000000..cb6ef2d7cb5
--- /dev/null
+++ b/common/xbps-src/shutils/update_check.sh
@@ -0,0 +1,73 @@
+# vim: set ts=4 sw=4 et:
+
+update_check() {
+ local i p url rx found_version consider
+ export LC_ALL=C
+ : ${update_pkgname:=$pkgname}
+
+ if [ -z "$update_site" ]; then
+ printf '%s\n' "$homepage"
+ for i in $distfiles; do
+ printf '%s\n' "${i%/*}/"
+ done
+ else
+ printf '%s\n' "$update_site"
+ fi |
+ while IFS= read -r url; do
+ if [ -z "$update_site" ]; then
+ case "$url" in
+ *sourceforge.net/sourceforge*)
+ url="http://sourceforge.net/projects/$update_pkgname/rss?limit=200";;
+ *code.google.com*|*googlecode*)
+ url="http://code.google.com/p/$update_pkgname/downloads/list";;
+ *launchpad.net*)
+ url="https://launchpad.net/$update_pkgname/+download";;
+ *cpan.*)
+ update_pkgname=${update_pkgname#perl-};;
+ *pypi.python.org*)
+ update_pkgname=${update_pkgname#python-};;
+ *github.com*)
+ githubname="$(printf %s "$url" | cut -d/ -f4,5)"
+ url="https://api.github.com/repos/$githubname/tags"
+ rx='"name":\s*"(v|'"$update_pkgname"'-)?\K[^\d]*([\d\.]+)(?=")';;
+ esac
+ fi
+
+ rx=${update_pattern:-$rx}
+ rx=${rx:-'(?&2
+ fi
+ curl -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Ls "$url" |
+ grep -Po -i "$rx"
+ done |
+ sort -Vu |
+ {
+ grep . || echo "NO VERSION found for $pkgname" 1>&2
+ } |
+ while IFS= read -r found_version; do
+ if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
+ echo "found version $found_version"
+ fi
+ consider=true
+ p="$update_ignore "
+ while [ -n "$p" ]; do
+ i=${p%% *}
+ p=${p#* }
+ case "$found_version" in
+ $i)
+ consider=false
+ if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
+ echo "ignored $found_version due to $i"
+ fi
+ esac
+ done
+ if $consider; then
+ xbps-uhelper cmpver "$pkgname-${version}_1" "$pkgname-${found_version}_1"
+ if [ $? = 255 ]; then
+ echo "NEWER VERSION $pkgname-$found_version (have $pkgname-${version})"
+ fi
+ fi
+ done
+}
diff --git a/xbps-src b/xbps-src
index 29abd3d14d2..b2561b439fa 100755
--- a/xbps-src
+++ b/xbps-src
@@ -95,6 +95,9 @@ update-bulk
update-sys
Rebuilds all packages in your system that are outdated and updates them.
+update-check
+ Check upstream site of for new releases.
+
zap
Removes a masterdir but preserving ccache, distcc and host directories.
@@ -638,6 +641,10 @@ case "$XBPS_TARGET" in
update-sys)
bulk_update -i
;;
+ update-check)
+ read_pkg
+ update_check
+ ;;
zap)
masterdir_zap
;;