]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
mkbuild-1.1.3: correção a UNPACKER e UNPACKER_FLAGS
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Sun, 18 Nov 2007 23:04:16 +0000 (23:04 +0000)
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Sun, 18 Nov 2007 23:04:16 +0000 (23:04 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@453 04377dda-e619-0410-9926-eae83683ac58

trunk/conf/simplepkg.conf.new
trunk/src/mkbuild

index 0ec81e7c9ca5a986131a67a593dc4aa8c39f543b..b5eb5e77acb96242d537962ec40cd7c4d4aa1e79 100644 (file)
@@ -132,6 +132,9 @@ SLACKBUILDS_DIR="/var/simplepkg/slackbuilds"
 # Set binaries default repository directory
 MAKEPKG_REPOS="/var/simplepkg/repos"
 
+# Set mkbuild default repository directory
+MKBUILD_REPOS="/var/simplepkg/mkbuild"
+
 # Set sources default directory
 SOURCE_DIR="/var/simplepkg/sources"
 
index 99f631e3175d9b7c66c98e3dbddd0fd280db7ee2..e0e6d7b6e706841cdb62d4efc727aa20fe18322b 100755 (executable)
@@ -18,8 +18,8 @@
 #
 # Based in model generic.SlackBuild of Luiz
 #
-# Version 1.1.2
-PROG_VERSION=1.1.2
+# Version 1.1.3
+PROG_VERSION=1.1.3
 PROG_NAME=`basename $0`
 
 #--------------------------------------------------------------------
@@ -65,7 +65,7 @@ DESCRIPTION
         -h, --help
             this help mesage
         -c, --commit
-            commit SlackBuilds in local svn tree
+            commit SlackBuilds in local svn SlackBuild tree
         -n, --new <mkbuild_name>
             start a new mkbuild configure file
         -v, --version
@@ -310,6 +310,8 @@ function start_build  {
     edit_file "OTHER CONFIGURE ARGS" "$OPTIONS" $1
     edit_file "DOCUMENTATION FILES" "$DOCFILES" $1
     edit_file "PREFIX" "$PREFIX" $1
+    edit_file "UNPACKER" "$UNPACKER" $1
+    edit_file "UNPACKER FLAGS" "$UNPACKER_FLAGS" $1
 
     edit_file_full "\$EXTENSION" "$EXTENSION" $1
 }
@@ -461,6 +463,8 @@ function get_slackbuild_path {
 
 }
 
+# ----------------------------------------------------------------
+# ------------------- svn functions ------------------------------
 function commit_slackbuild {
 
     # Commit SlackBuild in local Slack.Sarava tree
@@ -506,6 +510,46 @@ function commit_slackbuild {
     cd $WORK
 }
 
+function commit_mkbuild {
+
+    # Commit mkbuild in local mkbuild Slack.Sarava tree
+    if [ $UID -ne 0 ]; then
+        echo "Only root can commit mkbuild..."
+        return 1
+    fi
+
+    # check mkbuild directory
+    [ ! -e $MKBUILD_REPOS ] && createpkg --sync
+
+    # Get mkbuild path in parameter file
+    MKBUILD_PATH=`validate_parameter "$SLACKBUILD_PATH" "SLACKBUILD PATH" ""`
+    [ $VERBOSE -eq $on ] && echo "[[SLACKBUILD PATH]]=\"$SLACKBUILD_PATH\""
+
+    # Get mkbuild path in slackbuild local tree
+    if [ -z $MKBUILD_PATH ]; then
+        MKBUILD_PATH=`find $MKBUILD_REPOS -name $MKBUILD_NAME | xargs dirname` 2>/dev/null
+    fi
+
+    # Get SlackBuild path in gentoo-portage tree
+    if [ -z $MKBUILD_PATH ]; then
+        # Mount mkbuild path
+        [ $VERBOSE -eq $on ] && echo -e "\nFind mkbuild PATH in Slack.Sarava tree..."
+        AUX=`get_slackbuild_path`
+        [ ! -z $AUX ] && MKBUILD_PATH="`dirname $AUX | tr - /`/`basename $AUX`" || MKBUILD_PATH="others/unclassified/$PKG_NAME"
+    fi
+
+    # change to mkbuilds directory
+    cd $MKBUILDS_DIR/
+
+    # Add mkbuild scripts
+    # check path
+    [ ! -e $MKBUILD_PATH ] && svn_mkdir $MKBUILD_PATH
+    # add SlackBuild
+    svn_add $MKBUILD_NAME $MKBUILD_PATH
+
+    cd $WORK
+}
+
 function svn_mkdir {
 
     # svn make directory
@@ -537,6 +581,9 @@ function svn_add {
     fi
 }
 
+# ----------------------------------------------------------------
+# ------------------- general functions --------------------------
+
 function is_number {
 
     # Check if $1 is a number
@@ -586,20 +633,30 @@ function decompress_find {
     esac
 }
 
+function load_parameters {
+
+    # Load Createpkg parameters
+    MKBUILD_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplaret/repos`"
+    SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/simplaret/slackbuilds`"
+
+    COLOR_MODE="`eval_parameter COLOR_MODE none`"
+}
+# ----------------------------------------------------------------
+
 #=============================
 #        Main Program
 #=============================
 #-----------------------------
 # Common functions
-COMMON="/usr/libexec/simplepkg/common.sh"
+COMMON_SH="/usr/libexec/simplepkg/common.sh"
 SIMPLEPKG_CONF="/etc/simplepkg/simplepkg.conf"
 WORK=`pwd`
 LANG=en_US
 
-if [ -f "$COMMON" ]; then
-  source $COMMON
+if [ -f "$COMMON_SH" ]; then
+  source $COMMON_SH
 else
-  echo "error: file $COMMON found, check your $BASENAME installation"
+  echo "error: file $COMMON_SH not found. Check your $BASENAME installation"
   mkbuild_error 0
 fi
 
@@ -610,8 +667,10 @@ set_constants
 COMMIT=$off
 # Set verbose off
 VERBOSE=$off
-# Createpkg and mkbuild section
-SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/slackbuilds`"
+
+# Load /etc/simplepkg/simplepkg.conf parameters
+load_parameters
+
 # Auxiliar file
 AUX_TMP=/tmp/mkbuild_tmp.$RANDOM
 # Derectory to SlackBuild models