Commit 759d5fe5 authored by PoroCYon's avatar PoroCYon
Browse files

orphanize

parent 3a194444
#!/usr/bin/env bash
print_help() {
(>&2 cat <<EOF
Purge a package without deleting the installed binaries.
Usage: $0 [-h|-?|--help]
Print this help text and exit.
- $0 <package-name>
Orphanize the package.
EOF
)
}
main() {
local ESCAPED_PKG=`escape_string $2`
if [ -z "$2" ]; then
print_help
exit
fi
case $1 in
-h|-?|--help)
print_help
;;
*)
exec_subcommand src-db exists "$1"
if [ $? -ne 0 ]; then
(>&2 echo "This package doesn't exist.")
exit 1
fi
# 1. unreg in the bin db
exec_subcommand bin-db exists "$1"
if [ $? -eq 0 ]; then
exec_subcommand bin-db unreg "$1"
else
(>&2 echo "This package isn't installed.")
exit 1
fi
# 2. unregister
exec_subcommand src-db unreg "$1"
# 3. nuke
rm -rf "$SSPT_DL_DIR/$ESCAPED_PKG"
;;
esac
}
if [ $# -eq 0 ]; then
print_help
exit
fi
main $@
......@@ -8,7 +8,7 @@ function edit_the_conf() {
cfgfile="$cfgfile/sspt.conf"
local edit_conf=
read -e -p "Edit the sspt.conf file? (Y/n)" $edit_conf
read -e -p "Edit the sspt.conf file? (Y/n) " $edit_conf
if [ "$edit_conf" != "n" ] && [ "$edit_conf" != "N" ]; then
command -v "$EDITOR" >/dev/null 2>&1 && "$EDITOR" "$cfgfile" && return
command -v "nano" >/dev/null 2>&1 && "nano" "$cfgfile" && return
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment