]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@471 04377dda-e619-0410...
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Tue, 4 Dec 2007 14:29:17 +0000 (14:29 +0000)
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Tue, 4 Dec 2007 14:29:17 +0000 (14:29 +0000)
trunk/doc/CHANGELOG
trunk/mkbuild/model.mkbuild
trunk/src/mkbuild

index c067f6eb9e34d1da3d56fe91c5284b718f695ebd..eeffd064c729440f12c4a64a87e5fd51979ed2e9 100644 (file)
@@ -6,6 +6,12 @@ simplepkg changelog
 
   - common.sh: small change
   - generic.mkSlackBuild / perl.mkSlackBuild: minor fixe
+  - mkbuild:
+    - added inputs --path-files and --nps-strip
+    - remove old code 'let i++' in set_parameters function
+    - PATCH FILES parameter default set to ""
+    - NUMBER OF PREFIX SLASHES TO STRIP parameter default set to "1"
+    - change_others_parameters function minor fixe
 
 0.6pre11
 ========
index 453a84f288f1c69be3a3f9b734a85155b7516fe1..48325a41fcb9f9d89ce5996c5f0c50ccf6916a31 100644 (file)
 
 #
 # Number of jobs
-[[NUMBER OF JOBS]]="-j7"
+[[NUMBER OF JOBS]]="-j4"
 
 #---------------------
 # Others changes
 #---------------------
-#[[PATCH FILES]]=""
 #[[MD5SUM CODE]]=""
 #[[MD5SUM EXTENSION]]=""
 #[[SIGNING KEY]]=""
 #[[SIGNING KEY URL]]=""
-#[[PATCH FILES]]=""
+[[PATCH FILES]]=""
+[[NUMBER OF PREFIX SLASHES TO STRIP]]="1"
 
 # SlackBuild model
 [[SLACKBUILD MODEL]]="generic.mkSlackBuild"
index 45805f60f8d4766a376af0320608d7f73cc0a3c0..9cb9efecd1ad0752e806c75d22cfdb61a38d1191 100755 (executable)
@@ -19,7 +19,7 @@
 # Based in model generic.SlackBuild of Luiz
 #
 # Version:
-PROG_VERSION=1.1.9
+PROG_VERSION=1.1.10
 PROG_NAME=`basename $0`
 
 #--------------------------------------------------------------------
@@ -62,6 +62,10 @@ DESCRIPTION
                 Number of jobs to run simultaneously
             --prefix <install_dir>
                 Prefix install directory
+            -pf, --patch-files
+                List of patch files
+            -npss, --nps-strip
+                Number of prefix slashes to strip
 
         Program options:
         -h, --help
@@ -133,7 +137,6 @@ function set_parameters {
             ;;
             '-n'|'--new')
                 # New mkbuild configure file
-                let i++
                 MKBUILD_NAME=$2
                 [ ${MKBUILD_NAME:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR "--new <mkbuild_name>"
                 shift
@@ -148,7 +151,7 @@ function set_parameters {
             ;;
             '-v'|'--version')
                 # Show program version
-                echo -e "\n$PROG_NAME version $PROG_VERSION\n" && exit 0
+                eecho $normal "\n$PROG_NAME version $PROG_VERSION\n" && exit 0
             ;;
             '-V' | '--verbose')
                 # Enable verbose mode
@@ -156,35 +159,30 @@ function set_parameters {
             ;;
             '-a'|'--author')
                 # Enter with author name
-                let i++
                 AUTHOR=$2
                 [ ${AUTHOR:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR AUTHOR
                 shift
             ;;
             '-ai'|'--author_initials')
                 # Enter with author name
-                let i++
                 AUTHOR_INITIALS=$2
                 [ ${AUTHOR_INITIALS:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR AUTHOR_INITIALS
                 shift
             ;;
             '-cs'|'--const_string')
                 # Enter with construction source name string
-                let i++
                 CONST_STRING=$2
                 [ ${CONST_STRING:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR CONST_STRING
                 shift
             ;;
             '-md'|'--model')
                 # Enter with SlackBuild model
-                let i++
                 MODEL=$2
                 [ ${MODEL:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR MODEL
                 shift
             ;;
             '-j'|'--jobs')
                 # Enter with SlackBuild model
-                let i++
                 NUMJOBS=$2
                 [ ${NUMJOBS:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR NUMJOBS
                 ! is_number $NUMJOBS &&  handle_error $ERROR_NOT_NUMBER NUMJOBS
@@ -193,39 +191,46 @@ function set_parameters {
             ;;
             '--prefix')
                 # Enter with SlackBuild model
-                let i++
                 PREFIX=$2
                 [ ${PREFIX:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR PREFIX
                 shift
             ;;
             '-pn'|'--pkg_name')
                 # Enter with package name
-                let i++
                 PKG_NAME=$2
                 [ ${PKG_NAME:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR PKG_NAME
                 shift
             ;;
             '-pv'|'pkg_version')
                 # Enter with package version
-                let i++
                 VERSION=$2
                 [ ${VERSION:0:1} = "-" ] && handle_error $ERROR_MKBUILD_INPUT_PAR VERSION
                 shift
             ;;
             '-sn'|'--src_name')
                 # Enter with source name
-                let i++
                 SRC_NAME=$2
                 [ ${SRC_NAME:0:1} = '-' ] && handle_error $ERROR_MKBUILD_INPUT_PAR SRC_NAME
                 shift
             ;;
             '-u'|'--url')
                 # Enter with url address
-                let i++
                 URL=$2
                 [ ${URL:0:1} = '-' ] && handle_error $ERROR_MKBUILD_INPUT_PAR URL
                 shift
             ;;
+            '-pf'|'--patch-files')
+                # Path files list
+                PATCH_FILES=$2
+                [ ${PATCH_FILES:0:1} = '-' ] && handle_error $ERROR_MKBUILD_INPUT_PAR PATCH_FILES
+                shift
+            ;;
+            '-npss'|'--nps-strip')
+                # Number of prefix slashes to strip
+                NPS_STRIP=$2
+                [ ${NPS_STRIP:0:1} = '-' ] && handle_error $ERROR_MKBUILD_INPUT_PAR NPS_STRIP
+                shift
+            ;;
             *)
                 # mkbuild input file
                 MK_INPUT_FILE="${1//.mkbuild}.mkbuild"
@@ -296,6 +301,8 @@ function start_build  {
     edit_file "UNPACKER" "$UNPACKER" $1
     edit_file "UNPACKER FLAGS" "$UNPACKER_FLAGS" $1
     edit_file "BUILD NUMBER" "$BUILD_NUMBER" $1
+    edit_file "PATCH FILES" "$PATCH_FILES" $1
+    edit_file "NUMBER OF PREFIX SLASHES TO STRIP" "$NPS_STRIP" $1
 
     edit_file_full "\$EXTENSION" "$EXTENSION" $1
 }
@@ -433,7 +440,7 @@ function make_slack_required {
 function change_others_parameters {
 
     # Change others parameters started by '[[' in .mkbuild file
-    grep '\[\[[A-Za-z]' $MK_INPUT_FILE | while read i; do
+    grep -v '^#' $MK_INPUT_FILE | grep '\[\[[A-Za-z]' | while read i; do
         CHANGE="`echo $i | sed 's/\[\[\(.*\)\]\]=\"\(.*\)\"/\1/'`"
         VALUE="`echo $i | sed 's/\[\[\(.*\)\]\]=\"\(.*\)\"/\2/'`"
         edit_file "$CHANGE" "$VALUE" $SLACKBUILD
@@ -782,6 +789,12 @@ else
     MODEL=`validate_parameter "$MODEL" "SLACKBUILD MODEL" "generic.mkSlackBuild"`
     [ $VERBOSE -eq $on ] && echo "[[SLACKBUILD MODEL]]=\"$MODEL\""
 
+    # PATCH FILES
+    PATCH_FILES=`validate_parameter "$PATCH_FILES" "PATCH FILES" ""`
+
+    # Strip  the smallest prefix containing num leading slashes from each file name found in the patch file.
+    NPS_STRIP=`validate_parameter "$NPS_STRIP" "NUMBER OF PREFIX SLASHES TO STRIP" "1"`
+
     # SlackBuild path
     SLACKBUILD_PATH=`validate_parameter "$SLACKBUILD_PATH" "SLACKBUILD PATH" ""`
     [ $VERBOSE -eq $on ] && echo "[[SLACKBUILD PATH]]=\"$SLACKBUILD_PATH\""