Create a package management script
git-svn-id: http://photonzero.com/dotfiles/trunk@96 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
parent
6dc5e5b89c
commit
a4786ca303
1 changed files with 39 additions and 0 deletions
39
bin/pk
Executable file
39
bin/pk
Executable file
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/sh
|
||||||
|
search () {
|
||||||
|
shift
|
||||||
|
if which pacman >/dev/null; then
|
||||||
|
pacman -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
|
||||||
|
}
|
||||||
|
|
||||||
|
install () {
|
||||||
|
shift
|
||||||
|
if which pacman >/dev/null; then
|
||||||
|
pacman -S $*
|
||||||
|
elif which port >/dev/null; then
|
||||||
|
port install $*
|
||||||
|
elif which portmaster >/dev/null; then
|
||||||
|
portmaster $*
|
||||||
|
elif which apt-get >/dev/null; then
|
||||||
|
apt-get install $*
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1
|
||||||
|
in
|
||||||
|
"i" | "install")
|
||||||
|
install $*;;
|
||||||
|
|
||||||
|
"s" | "search")
|
||||||
|
search $*;;
|
||||||
|
esac
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue