dotfiles/bin/pk
michener 02ad0c26b7 update pk
git-svn-id: http://photonzero.com/dotfiles/trunk@113 23f722f6-122a-0410-8cef-c75bd312dd78
2011-10-17 23:14:47 +00:00

55 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
search () {
shift
if which pacman >/dev/null; then
pacman -Ss $1 || aurget -Ss $1
elif which port >/dev/null; then
port search $1
elif which portmaster >/dev/null; then
cd /usr/ports
make search name=$1 | grep "^\(Port\|Path\|Info\|Moved\|$\)"
elif which aptitude >/dev/null; then
aptitude search $1
elif which apt-cache >/dev/null; then
apt-cache search $1
fi
}
update () {
shift
if which pacman >/dev/null; then
sudo pacman -Sy
elif which port >/dev/null; then
sudo port selfupdate
elif which portmaster >/dev/null; then
sudo portsnap fetch && sudo portsnap upgrade
elif which apt-get >/dev/null; then
sudo apt-get update
fi
}
install () {
shift
if which pacman >/dev/null; then
sudo pacman -S $* || sudo aurget -Ss --asroot $*
elif which port >/dev/null; then
sudo port install $*
elif which portmaster >/dev/null; then
sudo portmaster $*
elif which apt-get >/dev/null; then
sudo apt-get install $*
fi
}
case $1
in
"i" | "install")
install $*;;
"s" | "search")
search $*;;
"u" | "update")
update $*;;
esac