diff options
Diffstat (limited to 'trunk/utils/mkbuild')
-rwxr-xr-x | trunk/utils/mkbuild | 211 |
1 files changed, 130 insertions, 81 deletions
diff --git a/trunk/utils/mkbuild b/trunk/utils/mkbuild index b9cda66..b0544c1 100755 --- a/trunk/utils/mkbuild +++ b/trunk/utils/mkbuild @@ -9,8 +9,12 @@ # Slackbuilds são scripts utilizados no Slackware para gerar # pacotes tgz. # -# Version 0.9.10 +# Turn off debug +set +x # +# Version 0.9.12 +PROG_VERSION=0.9.12 + #-------------------------------------------------------------------- # Functions #-------------------------------------------------------------------- @@ -26,16 +30,14 @@ function config_help() function view_file() { [ $# -ne 2 ] && return 1 - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --title " $1 " --textbox $2 20 75 + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --title " $1 " --textbox $2 20 75 } # Exit function function mk_exit() { - #[ ! -z $SLACKBUILD ] && [ -e $SLACKBUILD ] && echo "SlackBuild save in $SLACKBUILD" - #[ ! -z $MKSLACKBUILD ] && [ -e $MKSLACKBUILD ] && echo "mkSlackBuild save in $SLACKBUILD" - clean_all + clear exit $1 } @@ -73,7 +75,7 @@ function print_lines_to() function mk_slackdesc() { print_lines_to "slackdesc" "|-----" $SB_MODEL - echo -n $MK_PKGNAME | tr [a-z\-] " " + echo -n $MK_PKGNAME | tr [a-z+\-] " " echo -n "|-----handy-ruler" let N=18+${#MK_PKGNAME} for i in `seq $N $SLACKDESC_LEN`; do @@ -126,7 +128,7 @@ function unpkg_source() { # FIXME: if MK_DECOMPRESSOR -ne bunzip2 or gunzip... if [ $MK_DECOMPRESSOR = "bunzip2" -o $MK_DECOMPRESSOR = "gunzip" ]; then - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --cancel-label "Main Menu" --infobox "Uncompress source in /tmp/$MK_PKGNAME. Wait" 3 45 [ $? -ne 0 ] && return 100 mkdir /tmp/$MK_PKGNAME/ 2>/dev/null @@ -136,7 +138,7 @@ function unpkg_source() DOC_FILES=`find $MK_TMPSRC -type f -maxdepth 1 -name "[A-Z]*" | sed 's/.*\/\(.*\)$/\1/'` else - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --msgbox "$MK_DECOMPRESSOR not configurated..." 5 45 fi } @@ -159,7 +161,7 @@ function select_source() { MK_SOURCE=$BASEDIR while [ ! -f $MK_SOURCE ]; do - MK_SOURCE=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + MK_SOURCE=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --cancel-label "Main Menu" --title " Select source file name (use spaces to select): " --fselect "$MK_SOURCE" 10 70` [ $? -ne 0 ] && return 100 if [ ! -f $MK_SOURCE ]; then @@ -177,19 +179,19 @@ function select_source() # Edit authot, Initials and editor function edit_author() { - MK_AUTHOR=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with author complite name:" 8 60 "$MK_AUTHOR"` + MK_AUTHOR=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with author complite name:" 8 60 "$MK_AUTHOR"` edit_file "AUTHOR NAME" "$MK_AUTHOR" ~/.mkslackbuild MK_AUTHOR_INITIALS=`echo $MK_AUTHOR | sed 's/ /\n/g' | sed 's/^\([A-Z]\).*/\1/' | sed ':i; $!N; s/\n//; ti' | tr [A-Z] [a-z]` - MK_AUTHOR_INITIALS=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with author assignature:" 8 60 "$MK_AUTHOR_INITIALS"` + MK_AUTHOR_INITIALS=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with author assignature:" 8 60 "$MK_AUTHOR_INITIALS"` edit_file "AUTHOR INITIALS" "$MK_AUTHOR_INITIALS" ~/.mkslackbuild - MK_EDITOR=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with editor command:" 8 60 "pico"` + MK_EDITOR=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with editor command:" 8 60 "pico"` edit_file "EDITOR" "$MK_EDITOR" ~/.mkslackbuild } # Edit source URL function edit_url() { - MK_URL=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --cancel-label "Main Menu" --inputbox "Enter with complite URL from source:" 8 60 "$MK_URL"` + MK_URL=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --cancel-label "Main Menu" --inputbox "Enter with complite URL from source:" 8 60 "$MK_URL"` [ $? -ne 0 ] && return 100 } @@ -198,7 +200,7 @@ function edit_source_name() { # Carrega nome do arquivo MK_SRCNAME=`basename $MK_URL` - MK_SRCNAME=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --cancel-label "Main Menu" --inputbox "Enter with complite source file name:" 8 60 "$MK_SRCNAME"` + MK_SRCNAME=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --cancel-label "Main Menu" --inputbox "Enter with complite source file name:" 8 60 "$MK_SRCNAME"` [ $? -ne 0 ] && return 100 } @@ -212,7 +214,7 @@ function edit_pkgname() MK_EXTENSION=`echo $MK_SRCNAME | sed -r 's/(.*)-(.*)\.(.*\..*)$/\3/'` # Configura nome, versão e extensão do pacote - ANS=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + ANS=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --cancel-label "Main Menu" --form "Check information below:" 14 52 7 \ "Source name:" 1 1 "$MK_SRC_NAME" 1 15 30 60 \ "Package name:" 3 1 "$MK_PKGNAME" 3 15 30 60 \ @@ -234,7 +236,7 @@ function edit_decompress_arg() MK_DECOMPRESSOR_TEST_FLAG="" # Configura nome, versão e extensão do pacote - ANS3=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + ANS3=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --cancel-label "Main Menu" --form "Check information below:" 10 55 3 \ "Uncompress program:" 1 1 "$MK_DECOMPRESSOR" 1 23 25 60 \ "Uncompress test flag:" 3 1 "$MK_DECOMPRESSOR_TEST_FLAG" 3 23 25 100` @@ -258,7 +260,7 @@ function edit_configure() while [ $ANS0 -eq 1 ]; do local ANS1="7" while [ $ANS1 -ne 0 ]; do - ANS1=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + ANS1=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --cancel-label "Continue" --menu "Select one option" 0 0 0 \ 1 "View ./configure help" \ 2 "View documentations" \ @@ -274,10 +276,10 @@ function edit_configure() view_docs ;; '3') - MK_PREFIX=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with prefix for install $MK_PKGNAME" 8 60 "$MK_PREFIX"` + MK_PREFIX=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with prefix for install $MK_PKGNAME" 8 60 "$MK_PREFIX"` ;; '4') - MK_OPTIONS=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with configure options for compile $MK_PKGNAME" 8 60 "$MK_OPTIONS"` + MK_OPTIONS=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with configure options for compile $MK_PKGNAME" 8 60 "$MK_OPTIONS"` ;; *) ANS1=0 @@ -286,7 +288,7 @@ function edit_configure() done # Configure - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --title " Execute ./configure below? " --yesno "./configure --prefix=$MK_PREFIX $MK_OPTIONS" 6 70 + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --title " Execute ./configure below? " --yesno "./configure --prefix=$MK_PREFIX $MK_OPTIONS" 6 70 if [ $? -eq 0 ]; then ( cd $MK_TMPSRC @@ -297,7 +299,7 @@ function edit_configure() read ANS0 fi - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --title " Configure line is ok? " --yesno "./configure --prefix=$MK_PREFIX $MK_OPTIONS" 6 70 + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --title " Configure line is ok? " --yesno "./configure --prefix=$MK_PREFIX $MK_OPTIONS" 6 70 ANS0=$? done @@ -315,7 +317,7 @@ function view_docs() done while [ $ANS2 -eq 0 ]; do - SELECT=`eval "dialog --stdout --backtitle \"mkSlackBuild $PROG_VERSION [$MK_PKGNAME]\" --cancel-label \"Continue\" --title \" Documentations files \" --menu \"Select doc-file below:\" 20 45 13 $MENU"` + SELECT=`eval "dialog --stdout --backtitle \"Make SlackBuild $PROG_VERSION [$MK_PKGNAME]\" --cancel-label \"Continue\" --title \" Documentations files \" --menu \"Select doc-file below:\" 20 45 13 $MENU"` ANS2=$? [ $ANS2 -eq 0 ] && view_file "File: $SELECT" $MK_TMPSRC/$SELECT done @@ -336,7 +338,7 @@ function edit_docfiles() DOCMENU="$DOCMENU $i \"\" off" fi done - SELECTDOCS=`eval "dialog --stdout --separate-output --backtitle \"mkSlackBuild $PROG_VERSION [$MK_PKGNAME]\" --title \" Documentations files \" --cancel-label \"Continue\" --checklist \"Select documentation files below:\" 20 45 13 $DOCMENU"` + SELECTDOCS=`eval "dialog --stdout --separate-output --backtitle \"Make SlackBuild $PROG_VERSION [$MK_PKGNAME]\" --title \" Documentations files \" --cancel-label \"Continue\" --checklist \"Select documentation files below:\" 20 45 13 $DOCMENU"` fi MK_DOCFILES="`echo $SELECTDOCS | sed ':i; N; s/\n/ /; bi'`" @@ -345,7 +347,7 @@ function edit_docfiles() # Edit compiler architecture function edit_arch() { - MK_ARCH=`dialog --stdout --backtitle "mkSlackBuild documentation files below:" --cancel-label "Main Menu" --inputbox "Set an architecture to compiler:" 8 45 $MK_ARCH` + MK_ARCH=`dialog --stdout --backtitle "Make SlackBuild documentation files below:" --cancel-label "Main Menu" --inputbox "Set an architecture to compiler:" 8 45 $MK_ARCH` [ $? -ne 0 ] && return 100 } @@ -357,6 +359,7 @@ function change_strings() { # echo "$1 -> $2" [ $# -ne 2 ] && mk_exit 1 + [ -z $2 ] && return 0 eval "grep -l \"\[\[$1\]\]\" *" | while read FILE; do edit_file "$1" "$2" $FILE done @@ -380,12 +383,13 @@ function start_build() change_strings "OTHER CONFIGURE ARGS" "$MK_OPTIONS" change_strings "DOCUMENTATION FILES" "$MK_DOCFILES" change_strings "PREFIX" "$MK_PREFIX" + #change_strings "MD5SUM EXTENSION" "$MK_MD5SUM_EXT" } # Mount final SlackBuild function mount_slackbuild() { - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "SlackBuild save in $SLACKBUILD" 5 30 + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "SlackBuild save in $SLACKBUILD" 5 45 rm $SLACKBUILD 2>/dev/null # [ ! -e `dirname $SLACKBUILD` ] && mkdir `dirname $SLACKBUILD` @@ -402,7 +406,7 @@ function mount_slackbuild_to() { if [ $# -eq 1 ]; then END_SECTION=$1 - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "SlackBuild save in $SLACKBUILD.test" 5 30 + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "SlackBuild save in $SLACKBUILD.test" 5 45 rm $SLACKBUILD.test 2>/dev/null # [ ! -e `dirname $SLACKBUILD` ] && mkdir `dirname $SLACKBUILD` @@ -451,7 +455,7 @@ function make_file_sections() function get_source_dialog() { if [ ! -e $MK_SOURCE ]; then - dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --yesno " Download $MK_SRCNAME? " 5 50 if [ $? -eq 0 ]; then download_url @@ -469,10 +473,11 @@ function test_source() local ANS=0 while [ $TEST -ne 0 ]; do + dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "Test source with $MK_DECOMPRESSOR $MK_DECOMPRESSOR_TEST_FLAG $MK_SOURCE" 5 50 $MK_DECOMPRESSOR $MK_DECOMPRESSOR_TEST_FLAG $MK_SOURCE TEST=$? if [ $TEST -ne 0 ]; then - dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --yesno "Source uncompress error. Download source again?" 6 50 + dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --yesno "Source uncompress error. Download source again?" 6 50 if [ $? -eq 0 ]; then rm $MK_SOURCE get_source_dialog @@ -505,7 +510,7 @@ function edit_signature() # GPG and MD5 test local ANS=0 - ANS=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + ANS=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --menu "Select code validate type:" 0 0 0 \ "1" "gpg signature" \ "2" "md5sum" \ @@ -524,7 +529,7 @@ function edit_signature() # Enable GPG signature check function edit_gpg() { - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --msgbox "Enter with gpg minimized signing key." 5 50 $EDITOR $MK_GPGFILEKEY } @@ -606,7 +611,7 @@ function create_slackbuild() # Open mkslackbuild dialog input function open_mkslackbuild_dialog() { - MKSLACKBUILD=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + MKSLACKBUILD=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --title " Select source file name (use spaces to select): " \ --fselect "$BASEDIR/" 10 70` [ $? -ne 0 ] && return 100 @@ -631,7 +636,7 @@ function open_mkslackbuild() [ -e $BASEDIR/slack-required ] && ( cp $BASEDIR/slack-required $DEPENDENCY_LIST ) else - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --msgbox "$MKSLACKBUILD most be a mkslackbuild file" 6 45 return 100 fi @@ -655,7 +660,7 @@ function open_mkslackbuild() # Save mkSlackbuild function save_mkslackbuild() { - dialog --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "mkSlackBuild save in $MKSLACKBUILD" 5 30 + dialog --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --infobox "mkSlackBuild save in $MKSLACKBUILD" 5 30 rm $MKSLACKBUILD 2>/dev/null echo '#!/bin/bash' > $MKSLACKBUILD @@ -673,7 +678,7 @@ function save_mkslackbuild() echo "MK_DOCFILES=\"$MK_DOCFILES\"" >> $MKSLACKBUILD echo "MK_OPTIONS=\"$MK_OPTIONS\"" >> $MKSLACKBUILD echo "MK_PREFIX=\"$MK_PREFIX\"" >> $MKSLACKBUILD - #echo "MK_MD5SUM_EXT=\"$MK_MD5SUM_EXT\"" >> $MKSLACKBUILD + echo "MK_MD5SUM_EXT=\"$MK_MD5SUM_EXT\"" >> $MKSLACKBUILD echo -e "return 0\n\n" >> $MKSLACKBUILD for i in `seq 0 $MAXSECTION`; do @@ -698,7 +703,7 @@ function edit_menu() EDITMENU="$EDITMENU ${SECTION_NAME[i]} ${SECTION_FLAG[i]}" done - SELECT=`eval "dialog --stdout --backtitle \"mkSlackBuild $PROG_VERSION [$MK_PKGNAME]\" --ok-label \"Edit\" --cancel-label \"Main Menu\" --menu \"Select one section to edit\" 20 40 13 $EDITMENU"` + SELECT=`eval "dialog --stdout --backtitle \"Make SlackBuild $PROG_VERSION [$MK_PKGNAME]\" --ok-label \"Edit\" --cancel-label \"Main Menu\" --menu \"Select one section to edit\" 20 40 13 $EDITMENU"` ANSE=$? if [ $ANSE -ne 1 ]; then STATUS=`mk_status $SELECT` @@ -709,17 +714,57 @@ function edit_menu() FLAG=`echo $STATUS | awk '{print $1}'` INDEX=`echo $STATUS | awk '{print $2}'` if [ "$FLAG" = "on" ]; then - SECTION_FLAG[$INDEX]=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --radiolist "Change status from $SELECT" 0 0 0 "on" "enable section" "on" "off" "desable section" "off"` + SECTION_FLAG[$INDEX]=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --radiolist "Change status from $SELECT" 0 0 0 "on" "enable section" "on" "off" "desable section" "off"` elif [ "$FLAG" = "off" ]; then - SECTION_FLAG[$INDEX]=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" --radiolist "Change status from $SELECT" 0 0 0 "on" "enable section" "off" "off" "desable section" "on"` + SECTION_FLAG[$INDEX]=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --radiolist "Change status from $SELECT" 0 0 0 "on" "enable section" "off" "off" "desable section" "on"` fi if [ "${SECTION_FLAG[$INDEX]}" = "on" -o "${SECTION_FLAG[$INDEX]}" = "all" ]; then - $MK_EDITOR ${SELECT}_${MK_PKGNAME}.mkbuild + if [ "$SELECT" = "md5sum_download_and_check" ]; then + md5sum_edit ${SELECT}_${MK_PKGNAME}.mkbuild +# elif [ "$SELECT" = "gpg_signature_check" ]; then +# gpg_edit + else + $MK_EDITOR ${SELECT}_${MK_PKGNAME}.mkbuild + fi fi fi done } +# Edit md5sum +function md5sum_edit() +{ + local SELECT=0 + local FILE=$1 + + if ( grep '\[\[MD5SUM EXTENSION\]\]' $FILE &>/dev/null ); then + SELECT=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --radiolist "Select one option" 0 0 0 "1" "{SRC//.tar.[[SOURCE EXTENSION]]}.[[MD5SUM EXTENSION]]" on "2" "SRC.[[MD5SUM EXTENSION]]" off "3" "MK5SUM CODE" off` + + case $SELECT in + 1) + MK_MD5SUM_EXT="md5sum" + MK_MD5SUM_EXT=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with md5sum extension:" 8 50 $MK_MD5SUM_EXT` + edit_file "MD5SUM EXTENSION" "$MK_MD5SUM_EXT" $FILE + ;; + 2) + MK_MD5SUM_EXT="md5" + MK_MD5SUM_EXT=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with md5sum extension:" 8 50 $MK_MD5SUM_EXT` + eval "sed 's/^MD5SUM_FILE.*$/MD5SUM_FILE=\$SRC.$MK_MD5SUM_EXT/' $FILE > $AUX_TMP" + cp $AUX_TMP $FILE + ;; + 3) + MK_MD5SUM_CODE=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" --inputbox "Enter with md5sum extension:" 8 50 $MK_MD5SUM_CODE` + sed '1! d' $FILE > $AUX_TMP + sed -n '2, /^fi/ p' $FILE | while read LINE; do echo "#$LINE" >> $AUX_TMP; done + sed -n '/^fi/, $ { /^fi/ b; p; }' $FILE >> $AUX_TMP + eval "sed 's/^MD5SUM_SRC.*/MD5SUM_SRC=\"$MK_MD5SUM_CODE\"/' $AUX_TMP > $FILE" + ;; + esac + fi + + $MK_EDITOR $FILE +} + # Test Menu function test_menu() { @@ -737,7 +782,7 @@ function test_menu() EDITMENU="all \"SlackBuild\" $EDITMENU" while [ "$ANST" != "1" ]; do - SECTION=`eval "dialog --stdout --backtitle \"mkSlackBuild $PROG_VERSION [$MK_PKGNAME]\" --cancel-label \"Exit\" --menu \"Select section to test end\" 20 40 13 $EDITMENU"` + SECTION=`eval "dialog --stdout --backtitle \"Make SlackBuild $PROG_VERSION [$MK_PKGNAME]\" --cancel-label \"Exit\" --menu \"Select section to test end\" 20 40 13 $EDITMENU"` ANST=$? if [ $ANST -ne 1 ]; then @@ -751,7 +796,7 @@ function test_menu() sh -n $SLACKBUILD.test if [ $? -eq 0 ]; then echo " --= 0K =--" - DEBUG=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + DEBUG=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --cancel-label "no debug" --menu "Select debug level" 10 35 3 \ "-x" "Simple debug" \ "-xv" "More information" \ @@ -785,7 +830,7 @@ function menu_dependency() { local ANSD=11 while [ $ANSD -ne 0 ]; do - ANSD=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + ANSD=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --cancel-label "Main Menu" --menu "Main Menu:" 0 0 0 \ "1" "Edit Dependency List" \ "2" "Test Dependency List" \ @@ -821,7 +866,7 @@ function test_dependency() local DEP_LIST="" if [ -s $DEPENDENCY_LIST ]; then - for i in `grep '^[^#]' $DEPENDENCY_LIST | sort | uniq`; do + for i in `grep '^[^#]' $DEPENDENCY_LIST | awk '{print $1}' | sort | uniq`; do if [ `ls /var/log/packages/$i-[0-9]* 2>/dev/null` ]; then DEP_LIST="$DEP_LIST $i \"intalled\" off" else @@ -829,7 +874,7 @@ function test_dependency() fi done - DEP_SELECT=`eval "dialog --stdout --separate-output --backtitle \"mkSlackBuild $PROG_VERSION [$MK_PKGNAME]\" --title \" Dependency install check \" --cancel-label \"Continue\" --checklist \"Select packages to remove from dependency list:\" 20 45 13 $DEP_LIST"` + DEP_SELECT=`eval "dialog --stdout --separate-output --backtitle \"Make SlackBuild $PROG_VERSION [$MK_PKGNAME]\" --title \" Dependency install check \" --checklist \"Select packages to remove from dependency list:\" 20 45 13 $DEP_LIST"` for i in $DEP_SELECT; do eval "sed 's/$i$/#$i/' $DEPENDENCY_LIST > $AUX_TMP " @@ -845,10 +890,7 @@ function test_dependency() # Start Program #-------------------------------------------------------------------- # -# Turn off debug -set +x # Start variables -PROG_VERSION=0.9.10 LANG=us BASEDIR=`pwd` AUX_TMP=`mktemp -p /tmp/ aux_tmp.XXXXXX` @@ -902,54 +944,61 @@ fi ANS0=11 while [ $ANS0 -ne 0 ]; do if [ -z $MK_PKGNAME ]; then - ANS0=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + ANS0=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ --cancel-label "Exit" --menu "Main Menu:" 0 0 0 \ "1" "Create New SlackBuild" \ "2" "Open edited SlackBuild" \ "0" "Exit"` - EXIT_STATUS=$? - else - ANS0=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ - --cancel-label "Exit" --menu "Main Menu:" 0 0 0 \ - "1" "Create New SlackBuild" \ - "2" "Open MkSlackBuild" \ - "3" "Edit Sections" \ - "4" "Dependency Menu" \ - "5" "Test Script" \ - "6" "View Doc-Files" \ - "0" "Exit and Save..."` - EXIT_STATUS=$? - fi - if [ $EXIT_STATUS -ne 0 ]; then - ANS0=0 - fi + if [ $? -ne 0 ]; then + ANS0=0 + fi - case $ANS0 in - 1) - create_slackbuild - [ $? -eq 100 ] && MK_PKGNAME="" + case $ANS0 in + 1) + create_slackbuild + [ $? -eq 100 ] && MK_PKGNAME="" ;; - 2) - open_mkslackbuild_dialog - [ $? -eq 100 ] && MK_PKGNAME="" + 2) + open_mkslackbuild_dialog + [ $? -eq 100 ] && MK_PKGNAME="" + ;; + *) + echo "Exit..." + ANS0=0 ;; - 3) - edit_menu + esac + else + ANS0=`dialog --stdout --backtitle "Make SlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + --cancel-label "Exit" --menu "Main Menu:" 0 0 0 \ + "1" "Edit Sections" \ + "2" "Dependency Menu" \ + "3" "Test Script" \ + "4" "View Doc-Files" \ + "0" "Exit and Save..."` + + if [ $? -ne 0 ]; then + ANS0=0 + fi + case $ANS0 in + 1) + edit_menu ;; - 4) - menu_dependency + 2) + menu_dependency ;; - 5) - test_menu + 3) + test_menu ;; - 6) - view_docs + 4) + view_docs ;; - *) - echo "Exit..." + *) + echo "Exit..." + ANS0=0 ;; - esac + esac + fi done if [ ! -z $MK_PKGNAME ]; then |