Custom Search

Sunday, October 10, 2010

PKG_PATH Tweaking

Saw these on the mailing list a few weeks back.
First example is a bit long and drawn out but it works:

PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/`uname -a | \
cut -d” ” -f 3`/packages/`uname -a |cut -d” ” -f 5`/

Second method is a bit neater:
PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/

Create an alias in called pkg_find:

alias pkg_find=”echo ls | ftp -a $PKG_PATH |sed ‘s/.*\ //g’ |grep -i ”

Then, from the command prompt, do

$ pkg_find somepkg

and you’ll get the full package name.

Labels: