From 33e38a1385b14298fc926c2431288ec79caf1cb7 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 15 Mar 2024 22:19:06 -0400 Subject: repology: add -o (outdated) option. --- repology | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'repology') diff --git a/repology b/repology index 9d34172..c24f6da 100755 --- a/repology +++ b/repology @@ -5,6 +5,8 @@ # Author: B. Watson (yalhcru at gmail) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# https://repology.org//projects/?maintainer=urchlay@slackware.uk&inrepo=slackbuilds&outdated=1 + . surfraw || exit 1 w3_usage_hook() { @@ -15,6 +17,7 @@ Description: Local options: -p,-pkg,-package Search package names -m,-maint Search maintainers by email address + -o,-outdated Search for outdated packages, by email address By default, if there's an @ in the search term, a maintainer search is done, otherwise a package search. EOF @@ -25,8 +28,9 @@ w3_parse_option_hook() { opt="$1" optarg="$2" case "$opt" in - -p|-pkg|-pac*) repo_target="/projects/" ;; - -m|-main*) repo_target="/maintainers/" ;; + -p|-pkg|-pac*) repo_target="/projects/" ;; + -m|-main*) repo_target="/maintainers/" ;; + -o|-outdated*) repo_target="/projects/" ; O=1 ;; *) return 1 ;; esac return 0 @@ -40,5 +44,10 @@ w3_parse_args "$@" *) repo_target="/projects/" ;; esac -url="https://repology.org/${repo_target}?search=$( w3_url_of_arg $w3_args )"; +if [ "$O" = "1" ]; then + [ "$w3_args" = "" ] && w3_args="urchlay@slackware.uk" + url="https://repology.org/${repo_target}?maintainer=$( w3_url_of_arg $w3_args )&outdated=1"; +else + url="https://repology.org/${repo_target}?search=$( w3_url_of_arg $w3_args )"; +fi w3_browse_url "$url" -- cgit v1.2.3