aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-02-26 00:08:44 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-02-26 00:08:44 +0000
commitf85d43884e072c71178d08b8aeef35d2bd70d931 (patch)
treec4815f1ae4ef74f1f2ae068cb6cd533ba0cc98b1
parent251dd8b869beab3d05cac1131a010989553cea05 (diff)
downloadsimplepkg-f85d43884e072c71178d08b8aeef35d2bd70d931.tar.gz
simplepkg-f85d43884e072c71178d08b8aeef35d2bd70d931.tar.bz2
attempting to fix #73
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@793 04377dda-e619-0410-9926-eae83683ac58
-rwxr-xr-xtrunk/src/mkbuild78
1 files changed, 62 insertions, 16 deletions
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index a016765..b490d6e 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -203,6 +203,24 @@ function set_parameters {
set_mkbuild_name $2
break # we need to break otherwise specific arguments are evalued
;;
+ '-ds'|'--delete-slackbuild')
+ # Delete SlackBuild
+ ACTION="delete_slackbuild"
+ set_mkbuild_name $2
+ break # we need to break otherwise specific arguments are evalued
+ ;;
+ '-dm'|'--delete-mkbuild')
+ # Delete mkbuild
+ ACTION="delete_mkbuild"
+ set_mkbuild_name $2
+ break # we need to break otherwise specific arguments are evalued
+ ;;
+ '-da'|'--delete-all')
+ # Delete mkbuild and SlackBuild
+ ACTION="delete_all"
+ set_mkbuild_name $2
+ break # we need to break otherwise specific arguments are evalued
+ ;;
'--status')
# Repository status
ACTION="status"
@@ -1669,29 +1687,47 @@ function check_manifest_signature {
}
-function delete_mkbuilds {
+function delete_mkbuild {
# delete content from a mkbuild folder
# usage: delete_mkbuilds [file]
- local file="$1"
- local folder="`basename $MKBUILD_NAME`"
-
- if [ -d "$folder" ]; then
- if [ -z "$1" ]; then
- # Delete the whole mkbuild folder
- svn_del $folder
- elif [ -e "$folder/$file" ]; then
- svn_del $folder/$file
+ local folder candidate file="$1"
+ local name="`basename $MKBUILD_NAME .mkbuild`.mkbuild"
+
+ for candidate in `find $MKBUILDS_DIR -name $name`; do
+ folder="`dirname $candidate`"
+ if [ -d "$folder" ]; then
+ if [ -z "$1" ]; then
+ # Delete the whole mkbuild folder
+ svn_del $folder
+ elif [ -e "$folder/$file" ]; then
+ svn_del $folder/$file
+ fi
fi
- fi
+ done
}
-function delete_slackbuilds {
+function delete_slackbuild {
+
+ # delete content from a SlackBuild folder
+ # usage: delete_slackbuilds [file]
- # TODO
- true
+ local folder candidate file="$1"
+ local name="`basename $MKBUILD_NAME .mkbuild`.SlackBuild"
+
+ for candidate in `find $SLACKBUILDS_DIR -name $name`; do
+ folder="`dirname $candidate`"
+ if [ -d "$folder" ]; then
+ if [ -z "$1" ]; then
+ # Delete the whole mkbuild folder
+ svn_del $folder
+ elif [ -e "$folder/$file" ]; then
+ svn_del $folder/$file
+ fi
+ fi
+ done
}
@@ -1711,8 +1747,8 @@ function working_copy {
local copy tmpfolder name
if [ -e "$MKBUILD_NAME" ]; then
- name=$(basename $MKBUILD_NAME .mkbuild)
- copy=$(basename $(basename $MKBUILD_NAME .mkbuild))
+ name="$(basename $MKBUILD_NAME .mkbuild)"
+ copy="$(basename $(basename $MKBUILD_NAME .mkbuild))"
if [ -d "$copy" ]; then
tmpfolder="`mktemp $name.XXXXXX`"
mv $copy $tmpfolder/
@@ -1823,6 +1859,16 @@ case $ACTION in
import_mkbuilds $*
import_slackbuilds $*
;;
+ 'delete_slackbuild')
+ delete_slackbuild
+ ;;
+ 'delete_mkbuild')
+ delete_mkbuild
+ ;;
+ 'delete_all')
+ delete_mkbuild
+ delete_slackbuild
+ ;;
'new')
create_mkbuild
;;