Preparing scripts for the "clean" target
This commit is contained in:
parent
6b7e8dbdd8
commit
9aa3aabc4c
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#$Id$
|
||||
#Copyright (c) 2012 Pierre Pronchery <khorben@defora.org>
|
||||
#Copyright (c) 2012-2013 Pierre Pronchery <khorben@defora.org>
|
||||
#This program is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU General Public License as published by
|
||||
#the Free Software Foundation, version 3 of the License.
|
||||
@ -39,16 +39,20 @@ _debug()
|
||||
#usage
|
||||
_usage()
|
||||
{
|
||||
echo "Usage: subst.sh [-i|-u][-P prefix] target" 1>&2
|
||||
echo "Usage: subst.sh [-c|-i|-u][-P prefix] target..." 1>&2
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
#main
|
||||
clean=0
|
||||
install=0
|
||||
uninstall=0
|
||||
while getopts iuP: name; do
|
||||
while getopts "ciuP:" name; do
|
||||
case $name in
|
||||
c)
|
||||
clean=1
|
||||
;;
|
||||
i)
|
||||
uninstall=0
|
||||
install=1
|
||||
@ -76,6 +80,9 @@ while [ $# -gt 0 ]; do
|
||||
target="$1"
|
||||
shift
|
||||
|
||||
#clean
|
||||
[ "$clean" -ne 0 ] && continue
|
||||
|
||||
#uninstall
|
||||
if [ "$uninstall" -eq 1 ]; then
|
||||
$DEBUG $RM -- "$PREFIX/$target" || exit 2
|
||||
|
Loading…
Reference in New Issue
Block a user