diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-01-30 18:18:31 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-01-30 18:18:31 +0000 |
commit | 9f2db07cb54fd3b0dbee1c35e7529a1cd66b40d7 (patch) | |
tree | 9e0270ff67293656de3af582bd71effb159d9dae /trunk/src/mkbuild | |
parent | 45b31bbc76745c51dd52b7722a7fa697157d3f2b (diff) | |
download | simplepkg-9f2db07cb54fd3b0dbee1c35e7529a1cd66b40d7.tar.gz simplepkg-9f2db07cb54fd3b0dbee1c35e7529a1cd66b40d7.tar.bz2 |
attempting to fix #47
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@786 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src/mkbuild')
-rwxr-xr-x | trunk/src/mkbuild | 35 |
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 |