diff options
-rw-r--r-- | trunk/src/createpkg | 6 | ||||
-rwxr-xr-x | trunk/utils/mkslackbuild | 66 |
2 files changed, 59 insertions, 13 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 5ab979f..f589d02 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -31,6 +31,8 @@ # Createpkg functions #--------------------------------------------------- +CREATEPKG_VERSION="1.0" + function error_codes { # Slackbuilds error codes @@ -129,6 +131,7 @@ function build_repo { function usage { # Help mensage + echo -e "$CL_COMMU Createpkg version $CREATEPKG_VERSION $CL_OFF\n" echo -e "$CL_COMMU Usage: createpkg [--install/-i] package-name $CL_OFF" echo -e "$CL_COMMU createpkg --no-deps/-np package-name $CL_OFF" echo -e "$CL_COMMU createpkg --search/-s package-name $CL_OFF" @@ -136,7 +139,6 @@ function usage { echo -e "$CL_COMMU createpkg --list/-l $CL_OFF" echo -e "$CL_COMMU createpkg --sync $CL_OFF" echo -e "$CL_COMMU createpkg --help/-h $CL_OFF" - } function check_config { @@ -439,7 +441,7 @@ fi if [ ! -z "$SLACK_REQUIRED" -a "$NO_DEPS" != "1" ]; then # this routine checks for dependencies in package's slack-required - ( cat $SLACK_REQUIRED | while read dep; do + ( grep '^[^#]' $SLACK_REQUIRED | while read dep; do if [ ! -z "$dep" ]; then PROGRAM="`echo $dep | awk '{ print $1 }'`" CONDITION="`echo $dep | awk '{ print $2 }' | tr [=\>\<] [egl]`" 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 |