diff options
Diffstat (limited to 'trunk/utils')
-rwxr-xr-x | trunk/utils/mkslackbuild | 66 |
1 files changed, 55 insertions, 11 deletions
diff --git a/trunk/utils/mkslackbuild b/trunk/utils/mkslackbuild index 8220305..b9cda66 100755 --- a/trunk/utils/mkslackbuild +++ b/trunk/utils/mkslackbuild @@ -9,7 +9,7 @@ # Slackbuilds são scripts utilizados no Slackware para gerar # pacotes tgz. # -# Version 0.9.9 +# Version 0.9.10 # #-------------------------------------------------------------------- # Functions @@ -32,8 +32,8 @@ function view_file() # Exit function function mk_exit() { - [ ! -z $SLACKBUILD ] && [ -e $SLACKBUILD ] && echo "SlackBuild save in $SLACKBUILD" - [ ! -z $MKSLACKBUILD ] && [ -e $MKSLACKBUILD ] && echo "mkSlackBuild save in $SLACKBUILD" + #[ ! -z $SLACKBUILD ] && [ -e $SLACKBUILD ] && echo "SlackBuild save in $SLACKBUILD" + #[ ! -z $MKSLACKBUILD ] && [ -e $MKSLACKBUILD ] && echo "mkSlackBuild save in $SLACKBUILD" clean_all exit $1 @@ -780,6 +780,31 @@ function test_menu() done } +# Dependency Menu +function menu_dependency() +{ + local ANSD=11 + while [ $ANSD -ne 0 ]; do + ANSD=`dialog --stdout --backtitle "mkSlackBuild $PROG_VERSION [$MK_PKGNAME]" \ + --cancel-label "Main Menu" --menu "Main Menu:" 0 0 0 \ + "1" "Edit Dependency List" \ + "2" "Test Dependency List" \ + "0" "Main Menu"` + + [ $? -ne 0 ] && ANSD=0 + + case $ANSD in + 1) + edit_dependency + ;; + 2) + test_dependency + ;; + esac + + done +} + # Dependency list edit function edit_dependency() { @@ -790,10 +815,29 @@ function edit_dependency() $MK_EDITOR $DEPENDENCY_LIST } -# Test SlackBuild script -function exec_script() +# Check dependency and comment not found dependencies +function test_dependency() { - return 0 + local DEP_LIST="" + + if [ -s $DEPENDENCY_LIST ]; then + for i in `grep '^[^#]' $DEPENDENCY_LIST | sort | uniq`; do + if [ `ls /var/log/packages/$i-[0-9]* 2>/dev/null` ]; then + DEP_LIST="$DEP_LIST $i \"intalled\" off" + else + DEP_LIST="$DEP_LIST $i \"unintalled\" on" + 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"` + + for i in $DEP_SELECT; do + eval "sed 's/$i$/#$i/' $DEPENDENCY_LIST > $AUX_TMP " + eval "sed 's/$i /#$i /' $AUX_TMP > $DEPENDENCY_LIST" + eval "sed 's/$i\t/#$i\t/' $DEPENDENCY_LIST > $AUX_TMP" + cp $AUX_TMP $DEPENDENCY_LIST + done + fi } # @@ -804,7 +848,7 @@ function exec_script() # Turn off debug set +x # Start variables -PROG_VERSION=0.9.9 +PROG_VERSION=0.9.10 LANG=us BASEDIR=`pwd` AUX_TMP=`mktemp -p /tmp/ aux_tmp.XXXXXX` @@ -869,9 +913,9 @@ while [ $ANS0 -ne 0 ]; do --cancel-label "Exit" --menu "Main Menu:" 0 0 0 \ "1" "Create New SlackBuild" \ "2" "Open MkSlackBuild" \ - "3" "Edit SlackBuild Sections" \ - "4" "Edit Dependency List" \ - "5" "Test SlackBuild Script" \ + "3" "Edit Sections" \ + "4" "Dependency Menu" \ + "5" "Test Script" \ "6" "View Doc-Files" \ "0" "Exit and Save..."` EXIT_STATUS=$? @@ -894,7 +938,7 @@ while [ $ANS0 -ne 0 ]; do edit_menu ;; 4) - edit_dependency + menu_dependency ;; 5) test_menu |