aboutsummaryrefslogtreecommitdiff
path: root/trunk/lib
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2008-11-27 23:51:27 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2008-11-27 23:51:27 +0000
commit292a00b1207c07a6795ec0121a7a65eb56e02d9c (patch)
tree49766df6bdfcf20d3992f707ec17862f9e6a081c /trunk/lib
parent143a51b5d5689eb73cfb2a9080673646e04b9ee3 (diff)
downloadsimplepkg-292a00b1207c07a6795ec0121a7a65eb56e02d9c.tar.gz
simplepkg-292a00b1207c07a6795ec0121a7a65eb56e02d9c.tar.bz2
minor cleanup
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@564 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/lib')
-rw-r--r--trunk/lib/common.sh25
1 files changed, 24 insertions, 1 deletions
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 <orig> <dest>
+
+ # 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