add fuction
add repository search option
This commit is contained in:
parent
6f77f53988
commit
2de1d481f4
1 changed files with 15 additions and 0 deletions
15
u8-pacman
15
u8-pacman
|
|
@ -28,6 +28,7 @@ Options:
|
|||
-i PACKAGENAME install package
|
||||
-l list installed packages
|
||||
-r PACKAGENAME remove packagename
|
||||
-s PACKAGENAME search the archlinux repositories for given package
|
||||
-u update all installed packages
|
||||
|
||||
EOF
|
||||
|
|
@ -51,6 +52,10 @@ while [ "$1" ]; do
|
|||
shift
|
||||
source="list"
|
||||
;;
|
||||
-s)
|
||||
shift
|
||||
source="search"
|
||||
;;
|
||||
-h)
|
||||
usage
|
||||
exit 0
|
||||
|
|
@ -83,6 +88,10 @@ function list() {
|
|||
ls ~/.local/var/pkglist/*.lst | awk -F "/" '{print $NF}' | sed 's/\.lst//g'
|
||||
}
|
||||
|
||||
function search() {
|
||||
pacman -Ss $1
|
||||
}
|
||||
|
||||
if [[ "$source" == "install" ]]; then
|
||||
if [ -z "$PACKAGE" ]; then
|
||||
echo "see -h for usage"
|
||||
|
|
@ -100,6 +109,12 @@ elif [[ "$source" == "list" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
list
|
||||
elif [[ "$source" == "search" ]]; then
|
||||
if [ -z "$PACKAGE" ]; then
|
||||
echo "see -h for usage"
|
||||
exit 1
|
||||
fi
|
||||
search $PACKAGE
|
||||
elif [[ "$source" == "update" ]]; then
|
||||
update
|
||||
elif [[ -z "$source" ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue