# HG changeset patch # User Christophe Lincoln # Date 1336748666 -7200 # Node ID 624b83cf0e4a5a21990540c5705a0f908794e2bb # Parent 69ed9cf3a2dc7bd06c5de532b9dfb53db99b6e11 Add spk-rm (make it standard and then use it as skeleton for other tools), main spk tool will folow diff -r 69ed9cf3a2dc -r 624b83cf0e4a spk-rm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spk-rm Fri May 11 17:04:26 2012 +0200 @@ -0,0 +1,62 @@ +#!/bin/sh +# +# Spk-rm - Remove SliTaz packages. Read the README before adding or +# modifing any code in spk! +# +# Copyright (C) SliTaz GNU/Linux - BSD License +# Author: See AUTHORS files +# +#. /usr/lib/slitaz/libspk.sh +. lib/libspk.sh + +# +# Functions +# + +# Help and usage +usage() { + name=$(basename $0) + cat << EOT + +$(boldify $(gettext "Usage:")) [package|--option] [pkg2 ... pkgN|--opt2] + +$(boldify $(gettext "Options:")) + +$(boldify $(gettext "Examples:")) + +EOT + exit 0 +} + +# +# Commands +# + +case "$1" in + "") usage ;; + *) + count=0 + for pkg in $@ + do + [ -d "$installed/$pkg" ] || continue + count=$(($count + 1)) + [ "$count" == 1 ] && echo "" + gettext "Removing"; echo " $pkg" + separator + # Handle --confirm + if [ "$confirm" ]; then + gettext "Confirm uninstalltion of:"; echo " $pkg" + gettext "Anser [y|Y|yes] or [n|N|no] : " + # A read_anser function ? + read anser + case "$anser" in + y|Y|yes) ;; + *) + gettext "Uninstallation canceled" + echo -e "\n" && exit 0 ;; + esac + fi + gettext "TODO"; echo + done ;; +esac +exit 0