aboutsummaryrefslogtreecommitdiff
path: root/trunk
diff options
context:
space:
mode:
Diffstat (limited to 'trunk')
-rwxr-xr-xtrunk/src/mkbuild20
1 files changed, 15 insertions, 5 deletions
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