diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-18 20:58:06 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-18 20:58:06 +0100 |
commit | 0b800e6c6e1890fa45de6e506aa7893de58ae73b (patch) | |
tree | 93581f0aa652ec9f960642a2bbd3453335c0baf0 | |
parent | e03fee6cf554c1408955baa8ebde8ebf1e13c53e (diff) |
pass package names as separate arguments
Since we've switched to an array-based approach, it makes more sense to
treat packages as separate arguments (that's how bash works anyway)
-rw-r--r-- | src/core/libs/lib-pacman.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index f087c83..2ce8706 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -138,22 +138,22 @@ list_packages () } # find out the group to which one or more packages belong -# $1 packages separated by spaces +# arguments: packages # output format: multiple lines, each line like: # <pkgname> <group> # order is the same as the input which_group () { - PACKAGE_GROUPS=`LANG=C $PACMAN_TARGET -Si $1 | awk '/^Name/{ printf("%s ",$3) } /^Group/{ print $3 }'` + PACKAGE_GROUPS=`LANG=C $PACMAN_TARGET -Si "$@" | awk '/^Name/{ printf("%s ",$3) } /^Group/{ print $3 }'` } # get group and packagedesc for packages -# $1 packages separated by spaces +# arguments: packages # output format: multiple lines, each line like: # <pkgname> <group> <desc> # order is the same as the input # note that space is used as separator, but desc is the only thing that will contain spaces. pkginfo () { - PACKAGE_INFO=`LANG=C $PACMAN_TARGET -Si $1 | awk '/^Name/{ printf("%s ",$3) } /^Group/{ printf("%s", $3) } /^Description/{ for(i=3;i<=NF;++i) printf(" %s",$i); printf ("\n")}'` + PACKAGE_INFO=`LANG=C $PACMAN_TARGET -Si "$@" | awk '/^Name/{ printf("%s ",$3) } /^Group/{ printf("%s", $3) } /^Description/{ for(i=3;i<=NF;++i) printf(" %s",$i); printf ("\n")}'` } |