[51958] trunk/base
jmr at macports.org
jmr at macports.org
Sun Jun 7 03:57:16 PDT 2009
Revision: 51958
http://trac.macports.org/changeset/51958
Author: jmr at macports.org
Date: 2009-06-07 03:57:16 -0700 (Sun, 07 Jun 2009)
Log Message:
-----------
another round of switching external commands over to use findBinary
Modified Paths:
--------------
trunk/base/configure
trunk/base/configure.ac
trunk/base/src/port1.0/port_autoconf.tcl.in
trunk/base/src/port1.0/portbuild.tcl
trunk/base/src/port1.0/portfetch.tcl
trunk/base/src/port1.0/portpatch.tcl
trunk/base/src/port1.0/portutil.tcl
Modified: trunk/base/configure
===================================================================
--- trunk/base/configure 2009-06-07 10:54:08 UTC (rev 51957)
+++ trunk/base/configure 2009-06-07 10:57:16 UTC (rev 51958)
@@ -724,17 +724,25 @@
HAVE_LAUNCHD
HDIUTIL
MAKE
+BSDMAKE
ZIP
UNZIP
TAR
SED
RSYNC
RMDIR
+PATCH
+NICE
+LIPO
GZIP
+HG
GIT
SVN
CVS
+FILE
+DSCL
DITTO
+DIFF
CPIO
CP
CHOWN
@@ -3878,6 +3886,46 @@
fi
+# Extract the first word of "diff", so it can be a program name with args.
+set dummy diff; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DIFF+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $DIFF in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+DIFF=$ac_cv_path_DIFF
+if test -n "$DIFF"; then
+ { $as_echo "$as_me:$LINENO: result: $DIFF" >&5
+$as_echo "$DIFF" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
# Extract the first word of "ditto", so it can be a program name with args.
set dummy ditto; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3918,6 +3966,86 @@
fi
+# Extract the first word of "dscl", so it can be a program name with args.
+set dummy dscl; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DSCL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $DSCL in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_DSCL="$DSCL" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_DSCL="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+DSCL=$ac_cv_path_DSCL
+if test -n "$DSCL"; then
+ { $as_echo "$as_me:$LINENO: result: $DSCL" >&5
+$as_echo "$DSCL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "file", so it can be a program name with args.
+set dummy file; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_FILE+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $FILE in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_FILE="$FILE" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_FILE="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+FILE=$ac_cv_path_FILE
+if test -n "$FILE"; then
+ { $as_echo "$as_me:$LINENO: result: $FILE" >&5
+$as_echo "$FILE" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
# Extract the first word of "cvs", so it can be a program name with args.
set dummy cvs; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -4038,6 +4166,46 @@
fi
+# Extract the first word of "hg", so it can be a program name with args.
+set dummy hg; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_HG+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $HG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_HG="$HG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+HG=$ac_cv_path_HG
+if test -n "$HG"; then
+ { $as_echo "$as_me:$LINENO: result: $HG" >&5
+$as_echo "$HG" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
# Extract the first word of "gzip", so it can be a program name with args.
set dummy gzip; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -4078,6 +4246,126 @@
fi
+# Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_LIPO+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $LIPO in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_LIPO="$LIPO" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+LIPO=$ac_cv_path_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "nice", so it can be a program name with args.
+set dummy nice; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_NICE+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $NICE in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_NICE="$NICE" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_NICE="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+NICE=$ac_cv_path_NICE
+if test -n "$NICE"; then
+ { $as_echo "$as_me:$LINENO: result: $NICE" >&5
+$as_echo "$NICE" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "patch", so it can be a program name with args.
+set dummy patch; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PATCH+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $PATCH in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATCH=$ac_cv_path_PATCH
+if test -n "$PATCH"; then
+ { $as_echo "$as_me:$LINENO: result: $PATCH" >&5
+$as_echo "$PATCH" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
# Extract the first word of "rmdir", so it can be a program name with args.
set dummy rmdir; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -4318,6 +4606,46 @@
fi
+# Extract the first word of "bsdmake", so it can be a program name with args.
+set dummy bsdmake; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BSDMAKE+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $BSDMAKE in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_BSDMAKE="$BSDMAKE" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_BSDMAKE="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+BSDMAKE=$ac_cv_path_BSDMAKE
+if test -n "$BSDMAKE"; then
+ { $as_echo "$as_me:$LINENO: result: $BSDMAKE" >&5
+$as_echo "$BSDMAKE" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
# Extract the first word of "make", so it can be a program name with args.
set dummy make; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac 2009-06-07 10:54:08 UTC (rev 51957)
+++ trunk/base/configure.ac 2009-06-07 10:57:16 UTC (rev 51958)
@@ -90,17 +90,25 @@
AC_PATH_PROG(CHOWN, [chown], [], [$PATH:/usr/sbin])
AC_PATH_PROG(CP, [cp], [])
AC_PATH_PROG(CPIO, [cpio], [])
+AC_PATH_PROG(DIFF, [diff], [])
AC_PATH_PROG(DITTO, [ditto], [])
+AC_PATH_PROG(DSCL, [dscl], [])
+AC_PATH_PROG(FILE, [file], [])
AC_PATH_PROG(CVS, [cvs], [])
AC_PATH_PROG(SVN, [svn], [])
AC_PATH_PROG(GIT, [git], [])
+AC_PATH_PROG(HG, [hg], [])
AC_PATH_PROG(GZIP, [gzip], [])
+AC_PATH_PROG(LIPO, [lipo], [])
+AC_PATH_PROG(NICE, [nice], [])
+AC_PATH_PROG(PATCH, [patch], [])
AC_PATH_PROG(RMDIR, [rmdir], [])
AC_PATH_PROG(RSYNC, [rsync], [])
AC_PATH_PROG(SED, [sed])
AC_PATH_PROG(TAR, [tar])
AC_PATH_PROG(UNZIP, [unzip])
AC_PATH_PROG(ZIP, [zip])
+AC_PATH_PROG(BSDMAKE, [bsdmake])
AC_PATH_PROG(MAKE, [make])
AC_PATH_PROG(HDIUTIL, [hdiutil], [])
AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
Modified: trunk/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- trunk/base/src/port1.0/port_autoconf.tcl.in 2009-06-07 10:54:08 UTC (rev 51957)
+++ trunk/base/src/port1.0/port_autoconf.tcl.in 2009-06-07 10:57:16 UTC (rev 51958)
@@ -34,16 +34,26 @@
variable bzip2_path "@BZIP2@"
variable cp_path "@CP@"
variable cpio_path "@CPIO@"
+ variable diff_path "@DIFF@"
variable ditto_path "@DITTO@"
+ variable dscl_path "@DSCL@"
+ variable file_path "@FILE@"
variable cvs_path "@CVS@"
variable svn_path "@SVN@"
variable git_path "@GIT@"
+ variable hg_path "@HG@"
variable gzip_path "@GZIP@"
+ variable lipo_path "@LIPO@"
+ variable nice_path "@NICE@"
+ variable patch_path "@PATCH@"
variable rmdir_path "@RMDIR@"
variable rsync_path "@RSYNC@"
variable unzip_path "@UNZIP@"
variable zip_path "@ZIP@"
variable lsbom_path "@LSBOM@"
+ variable make_path "@MAKE@"
+ variable gnumake_path "@GNUMAKE@"
+ variable bsdmake_path "@BSDMAKE@"
variable mkbom_path "@MKBOM@"
variable mtree_path "@MTREE@"
variable pax_path "@PAX@"
Modified: trunk/base/src/port1.0/portbuild.tcl
===================================================================
--- trunk/base/src/port1.0/portbuild.tcl 2009-06-07 10:54:08 UTC (rev 51957)
+++ trunk/base/src/port1.0/portbuild.tcl 2009-06-07 10:57:16 UTC (rev 51958)
@@ -62,38 +62,35 @@
proc portbuild::build_getmaketype {args} {
if {![exists build.type]} {
- return make
+ return [findBinary make $portutil::autoconf::make_path]
}
switch -exact -- [option build.type] {
bsd {
if {[option os.platform] == "darwin"} {
- return bsdmake
+ return [findBinary bsdmake $portutil::autoconf::bsdmake_path]
} elseif {[option os.platform] == "freebsd"} {
- return make
+ return [binaryInPath make]
} else {
- return pmake
+ return [binaryInPath pmake]
}
}
gnu {
if {[option os.platform] == "darwin"} {
- return gnumake
+ return [findBinary gnumake $portutil::autoconf::gnumake_path]
} elseif {[option os.platform] == "linux"} {
- return make
+ return [binaryInPath make]
} else {
- return gmake
+ return [binaryInPath gmake]
}
}
pbx {
- set pbxbuild "pbxbuild"
- set xcodebuild "xcodebuild"
-
if {[option os.platform] != "darwin"} {
return -code error "[format [msgcat::mc "This port requires 'pbxbuild/xcodebuild', which is not available on %s."] [option os.platform]]"
}
- if {[catch {set xcodebuild [binaryInPath $xcodebuild]}] == 0} {
+ if {[catch {set xcodebuild [binaryInPath xcodebuild]}] == 0} {
return $xcodebuild
- } elseif {[catch {set pbxbuild [binaryInPath $pbxbuild]}] == 0} {
+ } elseif {[catch {set pbxbuild [binaryInPath pbxbuild]}] == 0} {
return $pbxbuild
} else {
return -code error "Neither pbxbuild nor xcodebuild were found on this system!"
@@ -101,7 +98,7 @@
}
default {
ui_warn "[format [msgcat::mc "Unknown build.type %s, using 'gnumake'"] [option build.type]]"
- return gnumake
+ return [findBinary gnumake $portutil::autoconf::gnumake_path]
}
}
}
@@ -114,7 +111,7 @@
if {![string is integer -strict $nice] || $nice <= 0} {
return ""
}
- return "nice -n $nice "
+ return "[findBinary nice $portutil::autoconf::nice_path] -n $nice "
}
proc portbuild::build_getmakejobs {args} {
Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl 2009-06-07 10:54:08 UTC (rev 51957)
+++ trunk/base/src/port1.0/portfetch.tcl 2009-06-07 10:57:16 UTC (rev 51958)
@@ -58,8 +58,8 @@
master_sites.mirror_subdir patch_sites.mirror_subdir \
cvs.module cvs.root cvs.password cvs.date cvs.tag cvs.method \
svn.url svn.revision svn.method \
- git.url git.branch \
- hg.url hg.tag
+ git.cmd git.url git.branch \
+ hg.cmd hg.url hg.tag
# XXX we use the command framework to buy us some useful features,
# but this is not a user-modifiable command
@@ -70,7 +70,7 @@
default extract.suffix .tar.gz
default fetch.type standard
-default cvs.cmd {$portutil::autoconf::cvs_path}
+default cvs.cmd {[findBinary cvs $portutil::autoconf::cvs_path]}
default cvs.password ""
default cvs.dir {${workpath}}
default cvs.method {export}
@@ -82,7 +82,7 @@
default cvs.args ""
default cvs.post_args {"${cvs.module}"}
-default svn.cmd {$portutil::autoconf::svn_path}
+default svn.cmd {[findBinary svn $portutil::autoconf::svn_path]}
default svn.dir {${workpath}}
default svn.method {export}
default svn.revision ""
@@ -91,9 +91,11 @@
default svn.args ""
default svn.post_args {"${svn.url}"}
+default git.cmd {[findBinary git $portutil::autoconf::git_path]}
default git.dir {${workpath}}
default git.branch {}
+default hg.cmd {[findBinary hg $portutil::autoconf::hg_path]}
default hg.dir {${workpath}}
default hg.tag {tip}
@@ -483,7 +485,7 @@
set savecmd ${cvs.cmd}
set saveargs ${cvs.args}
set savepost_args ${cvs.post_args}
- set cvs.cmd "echo ${cvs.password} | $portutil::autoconf::cvs_path"
+ set cvs.cmd "echo ${cvs.password} | ${cvs.cmd}"
set cvs.args login
set cvs.post_args ""
if {[catch {command_exec cvs -notty "" "2>&1"} result]} {
@@ -508,24 +510,8 @@
# Perform an svn fetch
proc portfetch::svnfetch {args} {
- global workpath prefix_frozen
- global svn.env svn.cmd svn.args svn.post_args svn.revision svn.url svn.method
+ global svn.args svn.revision svn.method
- # Look for the svn command, either in the path or in the prefix
- set goodcmd 0
- foreach svncmd "${svn.cmd} ${prefix_frozen}/bin/svn svn" {
- if { [file executable ${svncmd}] } {
- set svn.cmd $svncmd
- set goodcmd 1
- break;
- }
- }
- if { !$goodcmd } {
- ui_error "The subversion tool (svn) is required to fetch ${svn.url}."
- ui_error "Please install the subversion port before proceeding."
- return -code error [msgcat::mc "Subversion check out failed"]
- }
-
set svn.args "${svn.method} ${svn.args}"
if {[string length ${svn.revision}]} {
set svn.args "${svn.args} -r ${svn.revision}"
@@ -544,23 +530,9 @@
# Perform a git fetch
proc portfetch::gitfetch {args} {
- global worksrcpath prefix_frozen
- global git.url git.branch git.sha1
+ global worksrcpath
+ global git.url git.branch git.sha1 git.cmd
- # Look for the git command
- set git.cmd {}
- foreach gitcmd "$portutil::autoconf::git_path $prefix_frozen/bin/git git" {
- if {[file executable $gitcmd]} {
- set git.cmd $gitcmd
- break
- }
- }
- if {${git.cmd} == {}} {
- ui_error "git is required to fetch ${git.url}"
- ui_error "Please install the git-core port before proceeding."
- return -code error [msgcat::mc "Git command not found"]
- }
-
set options "-q"
if {[string length ${git.branch}] == 0} {
# if we're just using HEAD, we can make a shallow repo
@@ -591,22 +563,8 @@
# Perform a mercurial fetch.
proc portfetch::hgfetch {args} {
global worksrcpath prefix_frozen
- global hg.url hg.tag
+ global hg.url hg.tag hg.cmd
- # Look for the hg command.
- set hg.cmd {}
- foreach hgcmd "$prefix_frozen/bin/hg hg" {
- if {[file executable $hgcmd]} {
- set hg.cmd $hgcmd
- break
- }
- }
- if {${hg.cmd} == {}} {
- ui_error "hg is required to fetch ${hg.url}"
- ui_error "Please install the mercurial port before proceeding."
- return -code error [msgcat::mc "Mercurial command not found"]
- }
-
set cmdstring "${hg.cmd} clone --rev ${hg.tag} ${hg.url} ${worksrcpath} 2>&1"
ui_debug "Executing: $cmdstring"
if {[catch {system $cmdstring} result]} {
Modified: trunk/base/src/port1.0/portpatch.tcl
===================================================================
--- trunk/base/src/port1.0/portpatch.tcl 2009-06-07 10:54:08 UTC (rev 51957)
+++ trunk/base/src/port1.0/portpatch.tcl 2009-06-07 10:57:16 UTC (rev 51958)
@@ -49,7 +49,7 @@
# Set up defaults
default patch.asroot no
default patch.dir {${worksrcpath}}
-default patch.cmd patch
+default patch.cmd {[findBinary patch $portutil::autoconf::patch_path]}
default patch.pre_args -p0
proc portpatch::patch_main {args} {
@@ -57,38 +57,35 @@
# First make sure that patchfiles exists and isn't stubbed out.
if {![exists patchfiles]} {
- return 0
+ return 0
}
ui_msg "$UI_PREFIX [format [msgcat::mc "Applying patches to %s"] [option name]]"
foreach patch [option patchfiles] {
- set patch_file [getdistname $patch]
- if {[file exists [option filespath]/$patch_file]} {
- lappend patchlist [option filespath]/$patch_file
- } elseif {[file exists [option distpath]/$patch_file]} {
- lappend patchlist [option distpath]/$patch_file
- } else {
- return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
+ set patch_file [getdistname $patch]
+ if {[file exists [option filespath]/$patch_file]} {
+ lappend patchlist [option filespath]/$patch_file
+ } elseif {[file exists [option distpath]/$patch_file]} {
+ lappend patchlist [option distpath]/$patch_file
+ } else {
+ return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
+ }
}
- }
if {![info exists patchlist]} {
- return -code error [msgcat::mc "Patch files missing"]
+ return -code error [msgcat::mc "Patch files missing"]
}
_cd [option worksrcpath]
+ set gzcat "[findBinary gzip $portutil::autoconf::gzip_path] -dc"
+ set bzcat "[findBinary bzip2 $portutil::autoconf::bzip2_path] -dc"
foreach patch $patchlist {
- ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] $patch]"
- if {[option os.platform] == "linux"} {
- set gzcat "zcat"
- } else {
- set gzcat "gzcat"
+ ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] $patch]"
+ switch -- [file extension $patch] {
+ .Z -
+ .gz {command_exec patch "$gzcat \"$patch\" | (" ")"}
+ .bz2 {command_exec patch "$bzcat \"$patch\" | (" ")"}
+ default {command_exec patch "" "< '$patch'"}
+ }
}
- switch -glob -- [file tail $patch] {
- *.Z -
- *.gz {command_exec patch "$gzcat \"$patch\" | (" ")"}
- *.bz2 {command_exec patch "bzcat \"$patch\" | (" ")"}
- default {command_exec patch "" "< '$patch'"}
- }
- }
return 0
}
Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl 2009-06-07 10:54:08 UTC (rev 51957)
+++ trunk/base/src/port1.0/portutil.tcl 2009-06-07 10:57:16 UTC (rev 51958)
@@ -1172,7 +1172,7 @@
foreach arch $universal_archlist {
append lipoSources "-arch ${arch} ${workpath}/${arch}/${file} "
}
- system "lipo ${lipoSources}-create -output ${file}"
+ system "[findBinary lipo $portutil::autoconf::lipo_path] ${lipoSources}-create -output ${file}"
}
}
@@ -2068,12 +2068,13 @@
}
if {${os.platform} eq "darwin"} {
- exec dscl . -create /Users/${name} Password ${passwd}
- exec dscl . -create /Users/${name} UniqueID ${uid}
- exec dscl . -create /Users/${name} PrimaryGroupID ${gid}
- exec dscl . -create /Users/${name} RealName ${realname}
- exec dscl . -create /Users/${name} NFSHomeDirectory ${home}
- exec dscl . -create /Users/${name} UserShell ${shell}
+ set dscl [findBinary dscl $portutil::autoconf::dscl_path]
+ exec $dscl . -create /Users/${name} Password ${passwd}
+ exec $dscl . -create /Users/${name} UniqueID ${uid}
+ exec $dscl . -create /Users/${name} PrimaryGroupID ${gid}
+ exec $dscl . -create /Users/${name} RealName ${realname}
+ exec $dscl . -create /Users/${name} NFSHomeDirectory ${home}
+ exec $dscl . -create /Users/${name} UserShell ${shell}
} else {
# XXX adduser is only available for darwin, add more support here
ui_warn "WARNING: adduser is not implemented on ${os.platform}."
@@ -2099,11 +2100,12 @@
}
if {${os.platform} eq "darwin"} {
- exec dscl . -create /Groups/${name} Password ${passwd}
- exec dscl . -create /Groups/${name} RealName ${realname}
- exec dscl . -create /Groups/${name} PrimaryGroupID ${gid}
+ set dscl [findBinary dscl $portutil::autoconf::dscl_path]
+ exec $dscl . -create /Groups/${name} Password ${passwd}
+ exec $dscl . -create /Groups/${name} RealName ${realname}
+ exec $dscl . -create /Groups/${name} PrimaryGroupID ${gid}
if {${users} ne ""} {
- exec dscl . -create /Groups/${name} GroupMembership ${users}
+ exec $dscl . -create /Groups/${name} GroupMembership ${users}
}
} else {
# XXX addgroup is only available for darwin, add more support here
@@ -2261,7 +2263,7 @@
set exec-lipo [concat ${exec-lipo} [list "-arch" "${arch}" "${base}/${arch}${file}"]]
}
set exec-lipo [concat ${exec-lipo}]
- system "/usr/bin/lipo ${exec-lipo} -create -output ${target}${file}"
+ system "[findBinary lipo $portutil::autoconf::lipo_path] ${exec-lipo} -create -output ${target}${file}"
}
# private function
@@ -2285,7 +2287,7 @@
ui_debug "ba: '${basearch}' ('${archs}')"
foreach arch [lrange ${archs} 1 end] {
# checking for differences; TODO: error more gracefully on non-equal files
- exec "/usr/bin/diff" "-q" "${base}/${basearch}${file}" "${base}/${arch}${file}"
+ exec [findBinary diff $portutil::autoconf::diff_path] "-q" "${base}/${basearch}${file}" "${base}/${arch}${file}"
}
ui_debug "ba: '${basearch}'"
file copy "${base}/${basearch}${file}" "${target}${file}"
@@ -2314,7 +2316,7 @@
set fpath [string range "${file}" [string length "${basepath}"] [string length "${file}"]]
if {${fpath} != ""} {
# determine the type (dir/file/link)
- set filetype [exec "/usr/bin/file" "-b" "${basepath}${fpath}"]
+ set filetype [exec [findBinary file $portutil::autoconf::file_path] "-b" "${basepath}${fpath}"]
switch -regexp ${filetype} {
directory {
# just create directories
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090607/bb0cc281/attachment-0001.html>
More information about the macports-changes
mailing list