From 9ef1a48f646f3451ed70cd48904c86c686a0eb68 Mon Sep 17 00:00:00 2001 From: rudson Date: Tue, 27 Feb 2007 20:37:52 +0000 Subject: createpkg 1.0: adição da variável CREATEPKG_VERSION, para versão; grep '^[^#]' slack-required, para permitir comentários no slack-required. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@196 04377dda-e619-0410-9926-eae83683ac58 --- trunk/utils/mkslackbuild | 66 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 11 deletions(-) (limited to 'trunk/utils') 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 -- cgit v1.2.3