Index: configure
===================================================================
--- configure	(revision 65067)
+++ configure	(working copy)
@@ -698,6 +698,7 @@
 GIT
 SVN
 CVS
+BZR
 FILE
 DSCL
 DIFF
@@ -4410,6 +4411,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
Index: src/port1.0/portfetch.tcl
===================================================================
--- src/port1.0/portfetch.tcl	(revision 65067)
+++ src/port1.0/portfetch.tcl	(working copy)
@@ -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,12 @@
 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.args {"checkout --lightweight"}
+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 +168,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 +207,7 @@
 proc portfetch::suffix {distname} {
     global extract.suffix fetch.type
     switch -- "${fetch.type}" {
+        bzr         -
         cvs         -
         svn         -
         git         -
@@ -271,6 +283,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 +566,7 @@
 
     # Fetch the files
     switch -- "${fetch.type}" {
+        bzr     { return [bzrfetch] }
         cvs     { return [cvsfetch] }
         svn     { return [svnfetch] }
         git     { return [gitfetch] }
Index: src/port1.0/port_autoconf.tcl.in
===================================================================
--- src/port1.0/port_autoconf.tcl.in	(revision 65067)
+++ src/port1.0/port_autoconf.tcl.in	(working copy)
@@ -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@"
Index: configure.ac
===================================================================
--- configure.ac	(revision 65067)
+++ configure.ac	(working copy)
@@ -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], [])
