Merge lp:~maxb/bzr/no-install-apport into lp:bzr

Proposed by Max Bowsher
Status: Merged
Approved by: Martin Pool
Approved revision: no longer in the source branch.
Merged at revision: 5496
Proposed branch: lp:~maxb/bzr/no-install-apport
Merge into: lp:bzr
Diff against target: 23 lines (+0/-13)
1 file modified
setup.py (+0/-13)
To merge this branch: bzr merge lp:~maxb/bzr/no-install-apport
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+38463@code.launchpad.net

Commit message

Remove installation of apport configuration from setup.py

Description of the change

I propose that we should not try to install Apport configuration files if setup.py is run as root.

If Bazaar is being built as a Debian/Ubuntu package, this code is not relevant, as setup.py is either executed as normal non-root (in which case it does nothing), or under fakeroot (in which case this causes the install to fail, since it tries to write to the real system).

This code would only be triggered in the eventuality of someone doing something like 'sudo python setup.py install', in which case:
 * it's rather unlikely that Apport is even installed
 * there's a distinct possibility the install might be run with --prefix or similar options which change installation directories, in which case it's very bad manners for the package to write to /etc or /usr

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

thanks

review: Approve
Revision history for this message
Martin Pool (mbp) 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 'setup.py'
2--- setup.py 2010-09-30 08:49:08 +0000
3+++ setup.py 2010-10-14 21:31:06 +0000
4@@ -728,19 +728,6 @@
5 # easy_install one
6 DATA_FILES = [('man/man1', ['bzr.1'])]
7
8- if sys.platform != 'win32':
9- # see https://wiki.kubuntu.org/Apport/DeveloperHowTo
10- #
11- # checking the paths and hardcoding the check for root is a bit gross,
12- # but I don't see a cleaner way to find out the locations in a way
13- # that's going to align with the hardcoded paths in apport.
14- if os.geteuid() == 0:
15- DATA_FILES += [
16- ('/usr/share/apport/package-hooks',
17- ['apport/source_bzr.py']),
18- ('/etc/apport/crashdb.conf.d/',
19- ['apport/bzr-crashdb.conf']),]
20-
21 # std setup
22 ARGS = {'scripts': ['bzr'],
23 'data_files': DATA_FILES,