]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
mkbuild-1.0.2: correção a opção commit. O gentoo adicionou um gif que estava dando...
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Tue, 7 Aug 2007 16:35:54 +0000 (16:35 +0000)
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Tue, 7 Aug 2007 16:35:54 +0000 (16:35 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@412 04377dda-e619-0410-9926-eae83683ac58

trunk/src/mkbuild

index dc4625371c2a927d06f05aaecf19e35fb4178f23..d02dbbd6cb7fdce201832c2684c0e15b744a4535 100755 (executable)
@@ -18,8 +18,8 @@
 #
 # Based in model generic.SlackBuild of Luiz
 #
-# Version 1.0.1
-PROG_VERSION=1.0.1
+# Version 1.0.2
+PROG_VERSION=1.0.2
 PROG_NAME=`basename $0`
 
 #--------------------------------------------------------------------
@@ -436,6 +436,13 @@ function change_others_parameters {
     done
 }
 
+function get_slackbuild_path {
+
+    # Search SlackBuild Path in gentoo tree
+    eval "lynx -connect_timeout=10 -dump http://gentoo-portage.com/Search?search=$PKG_NAME  | tr -d ' ' | grep '^[a-z].*\/$PKG_NAME\$' | head --lines=1"
+
+}
+
 function commit_slackbuild {
 
     # Commit SlackBuild in local Slack.Sarava tree
@@ -450,15 +457,18 @@ function commit_slackbuild {
     # Get SlackBuild path
     # Get SlackBuild path in parameter file
     SLACKBUILD_PATH=`validate_parameter "$SLACKBUILD_PATH" "SLACKBUILD PATH" ""`
+    [ $VERBOSE -eq $on ] && echo "[[SLACKBUILD PATH]]=\"$SLACKBUILD_PATH\""
+
     # Get SlackBuild path in slackbuild local tree
-    if [ $? -ne 0 ]; then
+    if [ -z $SLACKBUILD_PATH ]; then
         SLACKBUILD_PATH=`find $SLACKBUILDS_DIR -name $SLACKBUILD | xargs dirname`
     fi
+
     # Get SlackBuild path in gentoo-portage tree
-    if [ "$SLACKBUILD_PATH" == "" ]; then
+    if [ -z $SLACKBUILD_PATH ]; then
         # Mount SlackBuild path
         [ $VERBOSE -eq $on ] && echo -e "\nFind SlackBuild PATH in Slack.Sarava tree..."
-        AUX=`lynx -connect_timeout=10 -dump http://gentoo-portage.com/Search?search=$PKG_NAME | sed -n '/Results:/,+1 { /Results:/ b ; p }' | head --lines=1 | tr -d " "`
+        AUX=`get_slackbuild_path`
         [ ! -z $AUX ] && SLACKBUILD_PATH="`dirname $AUX | tr - /`/`basename $AUX`" || SLACKBUILD_PATH="others/unclassified/$PKG_NAME"
     fi