From: rhatto Date: Sun, 11 Feb 2007 22:07:34 +0000 (+0000) Subject: templatepkg: now -c is different from -u X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=50570901c1743d507dd4ca347b161786cab608f0;p=simplepkg.git templatepkg: now -c is different from -u git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@186 04377dda-e619-0410-9926-eae83683ac58 --- diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 5785223..952f25d 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -447,3 +447,36 @@ function set_jail_perms { } +function use_svn { + + # check if svn usage is enabled + + if [ "$TEMPLATES_UNDER_SVN" == "1" ] && \ + [ "$TEMPLATE_STORAGE_STYLE" == "own-folder" ]; then + return 0 + else + return 1 + fi + +} + +function svn_check { + + # check if a file is under svn + # usage: svn_check + + local cwd + + cwd="`pwd`" + cd `dirname $1` + + if [ "`svn status $1 | awk '{ print $1 }'`" == "?" ]; then + return 1 + else + return 0 + fi + + cd $cwd + +} + diff --git a/trunk/src/jail-commit b/trunk/src/jail-commit index d6e18f3..656d568 100755 --- a/trunk/src/jail-commit +++ b/trunk/src/jail-commit @@ -36,8 +36,7 @@ function template_merge { return 1 fi - rm -f $TEMPLATE_BASE.perms - touch $TEMPLATE_BASE.perms + echo "" > $TEMPLATE_BASE.perms cd $TEMPLATE_BASE.d for file in `find`; do @@ -57,8 +56,7 @@ function template_merge { function template_svn_commit { - if [ "$TEMPLATES_UNDER_SVN" == "1" ] && \ - [ "$TEMPLATE_STORAGE_STYLE" == "own-folder" ]; then + if use_svn; then cd `basedir $TEMPLATE_BASE` svn commit -m "changes for `date`" fi diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg index 0a48406..914f1aa 100755 --- a/trunk/src/templatepkg +++ b/trunk/src/templatepkg @@ -33,10 +33,11 @@ function usage { echo "usage: $BASENAME