aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-02-09 21:59:18 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-02-09 21:59:18 +0000
commitef6d47d3e7367114ee89f1ee7931c8a2648f0bcc (patch)
tree91c18ad020a8e40d81f24bb808ea9648a67fbd74 /src
parent1a1bc856c153a24bd1fdd850a68f47376ea10004 (diff)
downloadsimplepkg-ef6d47d3e7367114ee89f1ee7931c8a2648f0bcc.tar.gz
simplepkg-ef6d47d3e7367114ee89f1ee7931c8a2648f0bcc.tar.bz2
templatepkg: added -d option
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@176 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src')
-rwxr-xr-xsrc/templatepkg24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/templatepkg b/src/templatepkg
index d2a23aa..1382759 100755
--- a/src/templatepkg
+++ b/src/templatepkg
@@ -47,7 +47,11 @@ function usage {
echo " file-name: the file or directory to be added"
echo " jail-root: the jail under file-name is located"
echo ""
- echo " in all cases, jail-root defaults to / if ommited"
+ echo " -d | --delete: delete files or folders from a template; arguments are:"
+ echo ""
+ echo " $BASENAME -d <template> <file-name>"
+ echo ""
+ echo " in all cases (-c, -u and -a), jail-root defaults to /, if ommited"
echo ""
exit 1
@@ -192,6 +196,24 @@ elif [ "$1" == "-a" ] || [ "$1" == "--add" ]; then
template_add $ROOT $3
+elif [ "$1" == "-d" ] || [ "$1" == "--delete" ]; then
+
+ if [ -z "$3" ]; then
+ usage
+ else
+
+ if [ -a "$TEMPLATE_BASE.d/$3" ]; then
+ if [ "$TEMPLATES_UNDER_SVN" == "1" ]; then
+ cd $TEMPLATE_BASE
+ svn del --force ./$3 || rm -rf ./$3
+ echo $BASENAME: please run jail-commit to del $3 in the svn repository
+ else
+ rm -rf $TEMPLATE_BASE.d/$3
+ fi
+ fi
+
+ fi
+
else
usage
fi