From 292a00b1207c07a6795ec0121a7a65eb56e02d9c Mon Sep 17 00:00:00 2001 From: rhatto Date: Thu, 27 Nov 2008 23:51:27 +0000 Subject: minor cleanup git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@564 04377dda-e619-0410-9926-eae83683ac58 --- trunk/lib/common.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'trunk/lib') diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 4b54cc6..faeaeb4 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -572,13 +572,36 @@ function sync_repo { function svn_add { - # TODO: merge with svn_add function from mkbuild if [ -d "`dirname $1`/.svn" ] && ! svn_check $1; then su_svn add $1 fi } +function svn_copy { + + # usage: svn_copy + + # svn add file + [ $# -ne 1 ] && handle_error $ERROR_PAR_NUMBER + + orig="`dirname $1`" + file="`basename $1`" + dest="$2" + + if [ -d "$dest" ]; then + dest="$dest/$file" + fi + + # copy file + cp $orig/$file $dest + if [ -d "`dirname $dest`/.svn" ]; then + chown_svn $dest && chgrp_svn $dest + svn_add $dest + fi + +} + function svn_mkdir { # svn make directory -- cgit v1.2.3