]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
createpkg 1.0: adição da variável CREATEPKG_VERSION, para versão; grep '^[^#]' slack...
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Tue, 27 Feb 2007 20:37:52 +0000 (20:37 +0000)
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Tue, 27 Feb 2007 20:37:52 +0000 (20:37 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@196 04377dda-e619-0410-9926-eae83683ac58

trunk/src/createpkg
trunk/utils/mkslackbuild

index 5ab979fbe65566bd979869db42b081c5e5f7e21f..f589d02189a2112ced4fd84c8fa1ec6759f31a86 100644 (file)
@@ -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]`"
index 8220305f3cc5ccd1f6962ade7e4ad6c44f204bb1..b9cda66890e0d7ab2ae3709a2d95c6f11a868422 100755 (executable)
@@ -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