Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=x11testing.git;a=commitdiff;h=dc181f1f1b22ec01ce84ec48d5ddf43c706e82ca

commit dc181f1f1b22ec01ce84ec48d5ddf43c706e82ca
Author: Michel Hermier <[email protected]>
Date:   Sat Oct 20 12:09:47 2012 +0200

util.sh

* Make _F_cd_path default values smarter by checking the path existance.
If not found use the other commonly used scheme (bad practice) to have
the source at the base of the source dir.

diff --git a/source/include/util.sh b/source/include/util.sh
index c272c6a..29774fc 100644
--- a/source/include/util.sh
+++ b/source/include/util.sh
@@ -33,7 +33,8 @@
# searching for the version
# * _F_archive_grepv (defaults to empty): grep -v for a regexp before
# searching for the version
-# * _F_cd_path (defaults to $_F_archive_name$Fpkgversep$_F_archive_ver)
+# * _F_cd_path (defaults to $_F_archive_name$Fpkgversep$_F_archive_ver if found
+# in the sources, else defaults to '.')
# * _F_conf_configure (defaults to ./configure)
# * _F_conf_perl_pipefrom: if set, pipe the output of this command in Fconf()
# for perl packages
@@ -273,11 +274,14 @@ Fcd() {
fi
if [ -z "$_F_cd_path" ]; then
_F_cd_path="$_F_archive_name$Fpkgversep$_F_archive_ver"
+               if [ ! -d "$Fsrcdir/$_F_cd_path" ]; then
+                       _F_cd_path='.'
+               fi
fi

if [ "$Fsrcdir" = `pwd` ]; then
if [ "$#" -eq 1 ]; then
-                       Fmessage "Going to the source directory..."
+                       Fmessage "Changing source directory to: $1"
cd "$Fsrcdir/$1" || Fdie
elif [ "$#" -eq 0 ]; then
Fcd "$_F_cd_path"
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to