aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-06-18 17:22:31 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-06-18 17:22:31 +0000
commit4ec8eb7ccaa4b29e4f7b8820ba09265a1923a8ad (patch)
treed18e20f264f04d495c4c317245e5f89b2db4e717 /kiss
parent690375e24af4c8c4cd8fa578a68d4b519ac46e41 (diff)
downloadcpt-4ec8eb7ccaa4b29e4f7b8820ba09265a1923a8ad.tar.gz
kiss: Fix bug with removal of a non-repository package.
FossilOrigin-Name: f0cd6aeabfff5c7d74bc5019bb1a6c9d3a703c2fc6a2e54cf6fc8fcb12accdcc
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss10
1 files changed, 5 insertions, 5 deletions
diff --git a/kiss b/kiss
index ab86070..a38a7c8 100755
--- a/kiss
+++ b/kiss
@@ -171,7 +171,7 @@ pkg_install() {
cp "$(command -v tar)" "$cac_dir"
log "Removing previous version of package if it exists."
- pkg_remove "$name"
+ pkg_remove
"$cac_dir/tar" kpxf "$bin_dir/$pkg" -C "$sys_dir/" 2>/dev/null
"$sys_db/$name/post-install" 2>/dev/null
@@ -180,7 +180,7 @@ pkg_install() {
}
pkg_remove() {
- pkg_list "$name" || return 1
+ pkg_list "${1:-${name-null}}" || return 1
# Create a backup of 'rm' and 'rmdir' so they aren't
# removed during package removal.
@@ -195,7 +195,7 @@ pkg_remove() {
else
"$cac_dir/rm" -f -- "$sys_dir$file" || log "Failed to remove $file."
fi && log "Removed $file"
- done < "$sys_db/$name/manifest"
+ done < "$sys_db/${1:-$name}/manifest"
# Use the backup of 'rm' to remove 'rmdir' and itself.
"$cac_dir/rm" "$cac_dir/rmdir" "$cac_dir/rm"
@@ -223,7 +223,7 @@ pkg_list() {
}
args() {
- case $1 in b*|c*|i*|r*) pkg_setup "${2-null}"; esac
+ case $1 in b*|c*|i*) pkg_setup "${2-null}"; esac
case $1 in
b*) [ -f checksums ] ||
die "Checksums missing, run '$kiss checksum $name'"
@@ -250,7 +250,7 @@ args() {
pkg_install ;;
l*) pkg_list "$2" ;;
- r*) pkg_remove || die "Package '$name' not installed" ;;
+ r*) pkg_remove "${2-null}" || die "Package '${2-null}' not installed." ;;
u*) pkg_updates ;;
*) log "$kiss [b|c|i|l|r|u] [pkg]" \