forked from kiss-community/kiss
kiss: initial a arg
This commit is contained in:
parent
d25c4bd5e1
commit
596c64d447
18
kiss
18
kiss
@ -821,6 +821,17 @@ pkg_conflicts() {
|
|||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pkg_swap() {
|
||||||
|
# Check to see if the package is installed. This
|
||||||
|
# will exit with an error if it is not.
|
||||||
|
pkg_list "$1" >/dev/null
|
||||||
|
|
||||||
|
alt=$(printf %s "$1$2" | sed 's|/|>|g')
|
||||||
|
|
||||||
|
[ -f "$sys_db/../choices/$alt" ] ||
|
||||||
|
die "Alternative '$1 $2' doesn't exist"
|
||||||
|
}
|
||||||
|
|
||||||
pkg_remove() {
|
pkg_remove() {
|
||||||
# Remove a package and all of its files. The '/etc' directory
|
# Remove a package and all of its files. The '/etc' directory
|
||||||
# is handled differently and configuration files are *not*
|
# is handled differently and configuration files are *not*
|
||||||
@ -1170,11 +1181,8 @@ args() {
|
|||||||
case $action in
|
case $action in
|
||||||
a|alternatives)
|
a|alternatives)
|
||||||
if [ "$1" ]; then
|
if [ "$1" ]; then
|
||||||
# Check to see if the package is installed. This
|
pkg_swap "$@"
|
||||||
# will exit with an error if it is not.
|
|
||||||
pkg_list "$1" >/dev/null
|
|
||||||
|
|
||||||
[ "$2" ] || die "No alternative chosen"
|
|
||||||
else
|
else
|
||||||
log "Alternatives:"
|
log "Alternatives:"
|
||||||
|
|
||||||
@ -1188,7 +1196,7 @@ args() {
|
|||||||
# name for listing. (pkg_name>usr>bin>ls)
|
# name for listing. (pkg_name>usr>bin>ls)
|
||||||
for pkg in *; do
|
for pkg in *; do
|
||||||
[ -f "$pkg" ] &&
|
[ -f "$pkg" ] &&
|
||||||
printf '%s\n' "$pkg" | sed 's|>|: /|;s|>|/|g'
|
printf '%s\n' "$pkg" | sed 's|>| /|;s|>|/|g'
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user