spk view spk-rm @ rev 11

Add: spk-add, spk-archive (both in working condition, but still need lots of cleaning and testing)
author Christian Mesh <meshca@clarkson.edu>
date Fri May 11 21:23:22 2012 -0500 (2012-05-11)
parents 7cd8650b22ae
children 8517989e8588
line source
1 #!/bin/sh
2 #
3 # Spk-rm - Remove SliTaz packages. Read the README before adding or
4 # modifing any code in spk!
5 #
6 # Copyright (C) SliTaz GNU/Linux - BSD License
7 # Author: See AUTHORS files
8 #
9 #. /usr/lib/slitaz/libspk.sh
10 . lib/libspk.sh
12 #
13 # Functions
14 #
16 # Help and usage
17 usage() {
18 name=$(basename $0)
19 cat << EOT
21 $(boldify $(gettext "Usage:")) $name [packages|--options]
23 $(boldify $(gettext "Options:"))
25 $(boldify $(gettext "Examples:"))
26 $name nano clex leafpad
27 $name nano clex --confirm
29 EOT
30 exit 0
31 }
33 #
34 # Commands and exit
35 #
37 case "$1" in
38 ""|usage|help) usage && exit 0 ;;
39 esac
41 #
42 # Handle packages
43 #
45 count=0
46 check_root
48 for pkg in $@
49 do
50 [ -d "$installed/$pkg" ] || continue
51 count=$(($count + 1))
52 [ "$count" == 1 ] && echo ""
53 gettext "Removing"; echo " $pkg"
54 separator
55 # Handle --confirm
56 if [ "$confirm" ]; then
57 gettext "Confirm uninstallation of"; echo -n " $pkg:"
58 if ! confirm; then
59 gettext "Uninstallation canceled"
60 echo -e "\n" && exit 0
61 fi
62 fi
63 gettext "TODO"; echo
64 done
66 exit 0