Merge lp:~jelmer/bzr/setup.py-root into lp:bzr

Proposed by Jelmer Vernooij
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 5522
Proposed branch: lp:~jelmer/bzr/setup.py-root
Merge into: lp:bzr
Diff against target: 25 lines (+3/-3)
1 file modified
bzrlib/tests/test_setup.py (+3/-3)
To merge this branch: bzr merge lp:~jelmer/bzr/setup.py-root
Reviewer Review Type Date Requested Status
John A Meinel Approve
bzr-core code Pending
Review via email: mp+40067@code.launchpad.net

Commit message

Run setup.py with --root rather than with --prefix.

Description of the change

This branch changes the setup.py test to use --root rather than --prefix. --root changes the root for all file paths (including /usr/share/apport/ and /etc). This changes fixes the setup.py test inside of the Debian packages.

Presumably it also prevents bzr selftest from writing to /etc and /usr/share/ when run as root.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/4/2010 5:46 AM, Jelmer Vernooij wrote:
> Jelmer Vernooij has proposed merging lp:~jelmer/bzr/setup.py-root into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core): code
>
>
> This branch changes the setup.py test to use --root rather than --prefix. --root changes the root for all file paths (including /usr/share/apport/ and /etc). This changes fixes the setup.py test inside of the Debian packages.
>
> Presumably it also prevents bzr selftest from writing to /etc and /usr/share/ when run as root.

 merge: approve

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzSuggACgkQJdeBCYSNAAOsLwCdGArbHhdN5AJ8kIIQqQV3xC+h
5osAn3mRh7oCa18vo7hLECbFoIhPAwZz
=DTLO
-----END PGP SIGNATURE-----

review: Approve
Revision history for this message
John A Meinel (jameinel) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/test_setup.py'
2--- bzrlib/tests/test_setup.py 2010-09-25 20:08:01 +0000
3+++ bzrlib/tests/test_setup.py 2010-11-04 10:46:06 +0000
4@@ -55,7 +55,7 @@
5 raise TestSkipped('You must have distutils installed to run this test.'
6 ' Usually this can be found by installing "python-dev"')
7 self.log('test_build running in %s' % os.getcwd())
8- install_dir = osutils.mkdtemp()
9+ root_dir = osutils.mkdtemp()
10 # setup.py must be run from the root source directory, but the tests
11 # are not necessarily invoked from there
12 self.source_dir = os.path.dirname(os.path.dirname(bzrlib.__file__))
13@@ -63,10 +63,10 @@
14 self.run_setup(['clean'])
15 # build is implied by install
16 ## self.run_setup(['build'])
17- self.run_setup(['install', '--prefix', install_dir])
18+ self.run_setup(['install', '--root', root_dir])
19 self.run_setup(['clean'])
20 finally:
21- osutils.rmtree(install_dir)
22+ osutils.rmtree(root_dir)
23
24 def run_setup(self, args):
25 args = [sys.executable, './setup.py', ] + args