From c321c597e63e200d33d499e395d5269b48e90b6f Mon Sep 17 00:00:00 2001 From: rudson Date: Tue, 7 Aug 2007 16:35:54 +0000 Subject: mkbuild-1.0.2: correção a opção commit. O gentoo adicionou um gif que estava dando erro na filtragem do path do slackbuild. Troquei o filtro para algo mais funcional, de forma que alterações posteriores possam ser melhor suportadas. 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@412 04377dda-e619-0410-9926-eae83683ac58 --- trunk/src/mkbuild | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'trunk/src/mkbuild') diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild index dc46253..d02dbbd 100755 --- a/trunk/src/mkbuild +++ b/trunk/src/mkbuild @@ -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 -- cgit v1.2.3