aboutsummaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-12-04 14:29:17 +0000
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-12-04 14:29:17 +0000
commit81966dc0d9612b46c7879e993660200ac721e5f8 (patch)
tree45812f72a8d61da7ae0108f90723196595eb313a /trunk/src
parent03aef598007d6769583f0a8ac63066573ae84358 (diff)
downloadsimplepkg-81966dc0d9612b46c7879e993660200ac721e5f8.tar.gz
simplepkg-81966dc0d9612b46c7879e993660200ac721e5f8.tar.bz2
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@471 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src')
-rwxr-xr-xtrunk/src/mkbuild41
1 files changed, 27 insertions, 14 deletions
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index 45805f6..9cb9efe 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -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\""