[Pkg-bazaar-commits] ./bzr-builddeb/trunk r220: * Avoid failing the testsuite because of a user's ~/.bazaar/builddeb.conf.

James Westby jw+debian at jameswestby.net
Thu May 15 13:29:39 UTC 2008


------------------------------------------------------------
revno: 220
committer: James Westby <jw+debian at jameswestby.net>
branch nick: trunk
timestamp: Wed 2008-03-19 21:33:05 +0000
message:
  * Avoid failing the testsuite because of a user's ~/.bazaar/builddeb.conf.
modified:
  __init__.py
  debian/changelog
  tests/blackbox/test_builddeb.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2008-03-06 23:57:35 +0000
+++ b/__init__.py	2008-03-19 21:33:05 +0000
@@ -149,13 +149,15 @@
   source_opt = Option('source', help="Build a source package, uses "
                       +"source-builder, which defaults to \"dpkg-buildpackage "
                       +"-rfakeroot -uc -us -S\"", short_name='S')
+  no_user_conf = Option('no-user-config', help="Stop builddeb from reading the user's "
+                        +"config file. Used mainly for tests")
   takes_args = ['branch?']
   aliases = ['bd']
   takes_options = [working_tree_opt, export_only_opt,
       dont_purge_opt, use_existing_opt, result_opt, builder_opt, merge_opt,
       build_dir_opt, orig_dir_opt, ignore_changes_opt, ignore_unknowns_opt,
       quick_opt, reuse_opt, native_opt, split_opt, export_upstream_opt,
-      export_upstream_revision_opt, source_opt, 'revision']
+      export_upstream_revision_opt, source_opt, 'revision', no_user_conf]
 
   def run(self, branch=None, verbose=False, working_tree=False,
           export_only=False, dont_purge=False, use_existing=False,
@@ -163,14 +165,18 @@
           orig_dir=None, ignore_changes=False, ignore_unknowns=False,
           quick=False, reuse=False, native=False, split=False,
           export_upstream=None, export_upstream_revision=None,
-          source=False, revision=None):
+          source=False, revision=None, no_user_config=False):
 
     goto_branch(branch)
 
     tree, relpath = WorkingTree.open_containing('.')
     
-    config = DebBuildConfig([(local_conf, True), (global_conf, True),
-                             (default_conf, False)])
+    if no_user_config:
+        config_files = [(local_conf, True), (default_conf, False)]
+    else:
+        config_files = [(local_conf, True), (global_conf, True),
+                             (default_conf, False)]
+    config = DebBuildConfig(config_files)
 
     if reuse:
       info("Reusing existing build dir")

=== modified file 'debian/changelog'
--- a/debian/changelog	2008-03-19 20:33:17 +0000
+++ b/debian/changelog	2008-03-19 21:33:05 +0000
@@ -28,8 +28,9 @@
     in bd-do.
   * Update the dependencies on bzr and bzrtools to more recent versions.
   * Update the VCS-Bzr: header for the new branch location.
+  * Avoid failing the testsuite because of a user's ~/.bazaar/builddeb.conf.
 
- -- James Westby <jw+debian at jameswestby.net>  Wed, 19 Mar 2008 20:32:30 +0000
+ -- James Westby <jw+debian at jameswestby.net>  Wed, 19 Mar 2008 21:27:37 +0000
 
 bzr-builddeb (0.92) unstable; urgency=low
 

=== modified file 'tests/blackbox/test_builddeb.py'
--- a/tests/blackbox/test_builddeb.py	2008-03-05 17:00:51 +0000
+++ b/tests/blackbox/test_builddeb.py	2008-03-19 21:33:05 +0000
@@ -70,7 +70,8 @@
     self.run_bzr("bd --help")
 
   def test_builddeb_not_package(self):
-    self.run_bzr_error(['Could not find changelog'], 'builddeb')
+    self.run_bzr_error(['Could not find changelog'], 'builddeb '
+            '--no-user-conf')
 
   def build_really_simple_tree(self):
     tree = self.make_unpacked_source()
@@ -83,27 +84,31 @@
 
   def test_builddeb_uses_working_tree(self):
     self.build_really_simple_tree()
-    self.run_bzr("builddeb --native --builder true --dont-purge")
+    self.run_bzr("builddeb --no-user-conf --native --builder true "
+            "--dont-purge")
     self.assertInBuildDir([self.commited_file, self.uncommited_file])
     self.assertNotInBuildDir([self.unadded_file])
 
   def test_builddeb_uses_revision_when_told(self):
     self.build_really_simple_tree()
-    self.run_bzr("builddeb --native --builder true --dont-purge -r-1")
+    self.run_bzr("builddeb --no-user-conf "
+            "--native --builder true --dont-purge -r-1")
     self.assertInBuildDir([self.commited_file])
     self.assertNotInBuildDir([self.unadded_file, self.uncommited_file])
 
   def test_builddeb_error_on_two_revisions(self):
     tree = self.make_unpacked_source()
     self.run_bzr_error(['--revision takes exactly one revision specifier.'],
-                       "builddeb --native --builder true -r0..1")
+                       "builddeb --no-user-conf --native --builder "
+                       "true -r0..1")
 
   def test_builddeb_allows_building_revision_0(self):
     self.build_really_simple_tree()
     # This may break if there is something else that needs files in the
     # branch before the changelog is looked for.
     self.run_bzr_error(['Could not find changelog'],
-                       "builddeb --native --builder true --dont-purge -r0")
+                       "builddeb --no-user-conf --native --builder true "
+                       "--dont-purge -r0")
     self.assertNotInBuildDir([self.commited_file, self.unadded_file,
                               self.uncommited_file])
 
@@ -119,7 +124,8 @@
 
   def test_builder(self):
     tree = self.make_unpacked_source()
-    self.run_bzr('bd --dont-purge --native --builder "touch built"')
+    self.run_bzr('bd --no-user-conf --dont-purge --native --builder '
+            '"touch built"')
     self.assertInBuildDir('built')
 
   def test_hooks(self):
@@ -132,7 +138,7 @@
       f.write('pre-build = touch pre-build\npost-build = touch post-build\n')
     finally:
       f.close()
-    self.run_bzr('bd --dont-purge --builder true')
+    self.run_bzr('bd --no-user-conf --dont-purge --builder true')
     self.failUnlessExists('pre-export')
     self.assertInBuildDir(['pre-build', 'post-build'])
 
@@ -154,7 +160,7 @@
       f.write('export-upstream-revision = tag:test-$UPSTREAM_VERSION\n')
     finally:
       f.close()
-    self.run_bzr('bd --dont-purge --builder true')
+    self.run_bzr('bd --no-user-conf --dont-purge --builder true')
     self.assertInBuildDir(['a'])
     self.assertNotInBuildDir(['b'])
 



More information about the Pkg-bazaar-commits mailing list