]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
adding mkbuild commit features
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Mon, 1 Dec 2008 16:00:17 +0000 (16:00 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Mon, 1 Dec 2008 16:00:17 +0000 (16:00 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@616 04377dda-e619-0410-9926-eae83683ac58

trunk/lib/common.sh
trunk/src/createpkg
trunk/src/mkbuild

index 15bad2f08d0f73b11e97c16ebe22319912966528..f1635e42cb5287570e2b9184890bc70577e1d087 100644 (file)
@@ -700,6 +700,33 @@ function svn_remove_empty_folders {
 
 }
 
+function commit_changes {
+
+  # usage: commit_changes <path>
+
+  local repos="$1" tmpfile
+  shift
+
+  if [ -d "$repos/.svn" ]; then
+    cwd="`pwd`"
+    chown_svn $repos && chgrp_svn $repos
+    cd $repos
+    if [ ! -z "$1" ]; then
+      if tmpfile=`mktemp -t simplepkg_commit.XXXXXX`; then
+        echo $* > $tmpfile
+        su_svn commit -F $tmpfile
+        rm -f $tmpfile
+      else
+        su_svn commit
+      fi
+    else
+      su_svn commit
+    fi
+    cd $cwd
+  fi
+
+}
+
 # -----------------------------------------------
 #           update jail functions
 # -----------------------------------------------
index 296a5fada8b8b1fdfbba362a17d189332798ae4c..41d860e820dbe4975616f68a5f1d5a98d5f3b85f 100644 (file)
@@ -298,33 +298,6 @@ function repository_status {
 
 }
 
-function commit_changes {
-
-  # usage: commit_changes <repository_path>
-
-  local repos="$1" tmpfile
-  shift
-
-  if [ -d "$repos/.svn" ]; then
-    cwd="`pwd`"
-    chown_svn $repos && chgrp_svn $repos
-    cd $repos
-    if [ ! -z "$1" ]; then
-      if tmpfile=`mktemp -t createpkg_commit.XXXXXX`; then
-        echo $* > $tmpfile
-        su_svn commit -F $tmpfile
-        rm -f $tmpfile
-      else
-        su_svn commit
-      fi
-    else
-      su_svn commit
-    fi
-    cd $cwd
-  fi
-
-}
-
 function create_repo_folder {
 
   # Create repository directory
index afb85711ac2d6ead106ff1b30ef889828e0edb60..d15af0fb5385fda5d63ea7eb3bdf4c5e1e57d1e4 100755 (executable)
@@ -15,9 +15,7 @@
 #  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 #  Place - Suite 330, Boston, MA 02111-1307, USA
 #
-#
 # Based in model generic.SlackBuild of Luiz
-#
 # Version $Rev$ - $Author$
 
 PROG_VERSION="1.2.8"
@@ -76,6 +74,12 @@ ${red}DESCRIPTION${normal}
             submit .mkbuild in local svn mkbuild tree
         ${red}-sa${normal}, ${red}--submit-all${normal}
             submit SlackBuild and .mkbuild files in local svn tree
+        ${red}-cs${normal}, ${red}--commit-slackbuild${normal}
+            commit SlackBuilds in svn SlackBuild tree
+        ${red}-cm${normal}, ${red}--commit-mkbuild${normal}
+            commit .mkbuild in svn mkbuild tree
+        ${red}-ca${normal}, ${red}--commit-all${normal}
+            commit SlackBuild and .mkbuild files in svn tree
         ${red}-h${normal}, ${red}--help${normal}
             this help mesage
         ${red}-n${normal}, ${red}--new${normal} ${green}<mkbuild_name>${normal}
@@ -136,18 +140,34 @@ function set_parameters {
         shift
       ;;
       '-ss'|'--submit-slackbuild')
-        # Commit SlackBuild file
+        # Submit SlackBuild file
         SUBMIT_SLACKBUILD=$on
       ;;
       '-sm'|'--submit-mkbuild')
-        # submit mkbuild file
+        # Submit mkbuild file
         SUBMIT_MKBUILD=$on
       ;;
       '-sa'|'--submit-all')
-        # Commit SlackBuild and mkbuild file
+        # Submit SlackBuild and mkbuild file
         SUBMIT_SLACKBUILD=$on
         SUBMIT_MKBUILD=$on
       ;;
+      '-cs'|'--commit-slackbuild')
+        # Commit SlackBuild file
+        commit_changes $SLACKBUILDS_DIR
+        exit 0
+      ;;
+      '-cm'|'--commit-mkbuild')
+        # commit mkbuild file
+        commit_changes $MKBUILDS_DIR
+        exit 0
+      ;;
+      '-ca'|'--commit-all')
+        # Commit SlackBuild and mkbuild file
+        commit_changes $SLACKBUILDS_DIR
+        commit_changes $MKBUILDS_DIR
+        exit 0
+      ;;
       '-n'|'--new')
         # New mkbuild configure file
         MKBUILD_NAME="${2//.mkbuild}.mkbuild"
@@ -651,10 +671,10 @@ function decompress_find {
 function load_parameters {
 
   # Load Createpkg parameters
-  SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/simplaret/slackbuilds`"
+  SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/simplepkg/slackbuilds`"
   [ ! -d $SLACKBUILDS_DIR ] && mkdir -p $SLACKBUILDS_DIR
 
-  MKBUILDS_DIR="`eval_parameter MKBUILDS_DIR /var/simplaret/mkbuilds`"
+  MKBUILDS_DIR="`eval_parameter MKBUILDS_DIR /var/simplepkg/mkbuilds`"
   [ ! -d $SLACKBUILDS_DIR ] && mkdir -p $SLACKBUILDS_DIR
 
   SLACKBUILDS_SVN="`eval_parameter SLACKBUILDS_DIR http://slack.sarava.org/slackbuilds`"