#!/bin/sh # elvis: slack -- Search Slackware.com packages # Author: B. Watson (yalhcru at gmail) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # Unfortunately we can't use get with this form. Well, we can, # except the checkboxes for "search sets" don't work. So it has # to be a post request, which means this elvis depends on wget. I # suppose it could support curl instead (or in addition) but I don't # see the point. # The source search is pretty useless, but that's not this script's fault. . surfraw || exit 1 if [ "$( type -p wget )" = "" ]; then err "wget is required for this. please install it." fi get_slack_ver() { local ver sitevers i # initially set to the currently running version, if we can. # unfortunately, this can be wrong: if someone upgraded to -current # but didn't upgrade aaa_base, it'll still say 14.2 (or whatever they # upgraded from). if [ -e /etc/slackware-version ]; then ver="$( cut -d' ' -f2 < /etc/slackware-version )" else # we're not on slackware, assume current echo "current" return fi # now check the site, make sure it's a supported version # TODO: rewrite to use sed or awk? maybe not that big a deal. sitevers="$( wget -qO- "https://packages.slackware.com" | \ perl -ne 'print "$1 " while (/