[65096] trunk/base

perry at macports.org perry at macports.org
Sun Mar 21 16:56:33 PDT 2010


Revision: 65096
          http://trac.macports.org/changeset/65096
Author:   perry at macports.org
Date:     2010-03-21 16:56:30 -0700 (Sun, 21 Mar 2010)
Log Message:
-----------
Added fetch.type bzr support (Addresses #23436).

Modified Paths:
--------------
    trunk/base/configure
    trunk/base/configure.ac
    trunk/base/src/port1.0/port_autoconf.tcl.in
    trunk/base/src/port1.0/portfetch.tcl

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2010-03-21 19:54:22 UTC (rev 65095)
+++ trunk/base/configure	2010-03-21 23:56:30 UTC (rev 65096)
@@ -697,6 +697,7 @@
 GIT
 SVN
 CVS
+BZR
 FILE
 DSCL
 DIFF
@@ -4409,6 +4410,46 @@
 fi
 
 
+# Extract the first word of "bzr", so it can be a program name with args.
+set dummy bzr; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BZR+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $BZR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_BZR="$BZR" # 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_BZR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+BZR=$ac_cv_path_BZR
+if test -n "$BZR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BZR" >&5
+$as_echo "$BZR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2010-03-21 19:54:22 UTC (rev 65095)
+++ trunk/base/configure.ac	2010-03-21 23:56:30 UTC (rev 65096)
@@ -93,6 +93,7 @@
 AC_PATH_PROG(DIFF, [diff], [])
 AC_PATH_PROG(DSCL, [dscl], [])
 AC_PATH_PROG(FILE, [file], [])
+AC_PATH_PROG(BZR, [bzr], [])
 AC_PATH_PROG(CVS, [cvs], [])
 AC_PATH_PROG(SVN, [svn], [])
 AC_PATH_PROG(GIT, [git], [])

Modified: trunk/base/src/port1.0/port_autoconf.tcl.in
===================================================================
--- trunk/base/src/port1.0/port_autoconf.tcl.in	2010-03-21 19:54:22 UTC (rev 65095)
+++ trunk/base/src/port1.0/port_autoconf.tcl.in	2010-03-21 23:56:30 UTC (rev 65096)
@@ -37,6 +37,7 @@
 	variable diff_path "@DIFF@"
 	variable dscl_path "@DSCL@"
 	variable file_path "@FILE@"
+	variable bzr_path "@BZR@"
 	variable cvs_path "@CVS@"
 	variable svn_path "@SVN@"
 	variable git_path "@GIT@"

Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl	2010-03-21 19:54:22 UTC (rev 65095)
+++ trunk/base/src/port1.0/portfetch.tcl	2010-03-21 23:56:30 UTC (rev 65096)
@@ -50,6 +50,7 @@
 options master_sites patch_sites extract.suffix distfiles patchfiles use_bzip2 use_lzma use_xz use_zip use_7z use_dmg dist_subdir \
     fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \
     master_sites.mirror_subdir patch_sites.mirror_subdir \
+    bzr.url bzr.revision \
     cvs.module cvs.root cvs.password cvs.date cvs.tag cvs.method \
     svn.url svn.revision svn.method \
     git.cmd git.url git.branch \
@@ -57,6 +58,7 @@
 
 # XXX we use the command framework to buy us some useful features,
 # but this is not a user-modifiable command
+commands bzr
 commands cvs
 commands svn
 
@@ -64,6 +66,13 @@
 default extract.suffix .tar.gz
 default fetch.type standard
 
+default bzr.cmd {[findBinary bzr $portutil::autoconf::bzr_path]}
+default bzr.dir {${workpath}}
+default bzr.revision {-1}
+default bzr.pre_args {"--builtin --no-aliases checkout --lightweight"}
+default bzr.args ""
+default bzr.post_args {"-r ${bzr.revision} ${bzr.url} ${worksrcdir}"}
+
 default cvs.cmd {[findBinary cvs $portutil::autoconf::cvs_path]}
 default cvs.password ""
 default cvs.dir {${workpath}}
@@ -160,6 +169,9 @@
     global os.platform os.major
     if {[string equal ${action} "set"]} {
         switch $args {
+            bzr {
+                depends_fetch-append bin:bzr:bzr
+            }
             cvs {
                 depends_fetch-append bin:cvs:cvs
             }
@@ -196,6 +208,7 @@
 proc portfetch::suffix {distname} {
     global extract.suffix fetch.type
     switch -- "${fetch.type}" {
+        bzr         -
         cvs         -
         svn         -
         git         -
@@ -271,6 +284,19 @@
     checkdistfiles fetch_urls
 }
 
+# Perform a bzr fetch
+proc portfetch::bzrfetch {args} {
+    if {[catch {command_exec bzr "" "2>&1"} result]} {
+        return -code error [msgcat::mc "Bazaar checkout failed"]
+    }
+
+    if {[info exists patchfiles]} {
+        return [portfetch::fetchfiles]
+    }
+
+    return 0
+}
+
 # Perform a CVS login and fetch, storing the CVS login
 # information in a custom .cvspass file
 proc portfetch::cvsfetch {args} {
@@ -541,6 +567,7 @@
 
     # Fetch the files
     switch -- "${fetch.type}" {
+        bzr     { return [bzrfetch] }
         cvs     { return [cvsfetch] }
         svn     { return [svnfetch] }
         git     { return [gitfetch] }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100321/1d5bc168/attachment.html>


More information about the macports-changes mailing list