aboutsummaryrefslogtreecommitdiff
path: root/trunk
diff options
context:
space:
mode:
Diffstat (limited to 'trunk')
-rwxr-xr-xtrunk/src/mkbuild35
1 files changed, 34 insertions, 1 deletions
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index f81526a..dd04dec 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -102,6 +102,8 @@ ${red}DESCRIPTION${normal}
print debug information
${red}-e${normal}, ${red}--edit${normal}
edit a mkbuild
+ ${red}-wc${normal}, ${red}--working-copy${normal}
+ create an unversioned mkbuild working copy
${red}EXAMPLES${normal}
${red}mkbuild -sa pyrex.mkbuild${normal}
@@ -206,7 +208,7 @@ function set_parameters {
break # we need to break otherwise specific arguments are evalued
;;
'-ls'|'--list')
- # Repository status
+ # List mkbuild folder contents
ACTION="list"
set_mkbuild_name $2
break # we need to break otherwise specific arguments are evalued
@@ -232,6 +234,13 @@ function set_parameters {
# Open mkbuild with $EDITOR
set_mkbuild_name $2
ACTION='edit'
+ break # we need to break otherwise specific arguments are evalued
+ ;;
+ '-wc'|'--working-copy')
+ # Create an unversioned mkbuild working copy
+ set_mkbuild_name $2
+ ACTION='working_copy'
+ break # we need to break otherwise specific arguments are evalued
;;
'-d'|'--debug')
# Debug mode
@@ -1672,10 +1681,31 @@ function list_mkbuild_contents {
ls `dirname $MKBUILD_NAME`
else
echo "Not found: $MKBUILD_NAME"
+ return 1
fi
}
+function working_copy {
+
+ local copy tmpfolder name
+
+ if [ -e "$MKBUILD_NAME" ]; then
+ name=$(basename $MKBUILD_NAME .mkbuild)
+ copy=$(basename $(basename $MKBUILD_NAME .mkbuild))
+ if [ -d "$copy" ]; then
+ tmpfolder="`mktemp $name.XXXXXX`"
+ mv $copy $tmpfolder/
+ fi
+ rsync -av --exclude=".svn" --exclude=".git" `dirname $MKBUILD_NAME`/ $copy/ &> /dev/null
+ echo "Working copy for $name set at $(pwd)/$name."
+ else
+ echo "Not found: $MKBUILD_NAME"
+ return 1
+ fi
+
+}
+
# ----------------------------------------------------------------
#=============================
@@ -1778,6 +1808,9 @@ case $ACTION in
'edit')
edit_mkbuild
;;
+ 'working_copy')
+ working_copy
+ ;;
esac
# Clear temporary files