Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 284877 Details for
Bug 380943
sys-apps/udev-discover: Sysfs browsing tool focused on helping udev users and developers (new package)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0006-Interpolate-PREFIX-at-build-stage-using-prefix-from-.patch
0006-Interpolate-PREFIX-at-build-stage-using-prefix-from-.patch (text/plain), 2.50 KB, created by
Ed Catmur
on 2011-08-28 12:52:07 UTC
(
hide
)
Description:
0006-Interpolate-PREFIX-at-build-stage-using-prefix-from-.patch
Filename:
MIME Type:
Creator:
Ed Catmur
Created:
2011-08-28 12:52:07 UTC
Size:
2.50 KB
patch
obsolete
>From 06a0133318baeb4fd95321865fd22fdc6c20c5ab Mon Sep 17 00:00:00 2001 >From: Ed Catmur <ed@catmur.co.uk> >Date: Sun, 28 Aug 2011 12:36:23 +0100 >Subject: [PATCH 6/7] Interpolate PREFIX at build stage, using prefix from > options or install > >--- > setup.py | 51 ++++++++++++++++++++++++++------------------------- > 1 files changed, 26 insertions(+), 25 deletions(-) > >diff --git a/setup.py b/setup.py >index 41f8b14..fcbf19c 100644 >--- a/setup.py >+++ b/setup.py >@@ -11,38 +11,39 @@ from distutils.command.install_data import install_data > from distutils.log import warn, info, error, fatal > from distutils.dep_util import newer > >-# Get current Python version >-python_version = platform.python_version_tuple() >+PO_DIR = 'po' >+MO_DIR = os.path.join('build', 'mo') > >-# Setup the default install prefix >-prefix = sys.prefix >+class BuildData(build): > >-# Check our python is version 2.6 or higher >-if python_version[0] >= 2 and python_version[1] >= 6: >- ## Set file location prefix accordingly >- prefix = '/usr/local' >+ user_options = [ >+ ('prefix=', None, "installation prefix"), >+ ] > >-# Get the install prefix if one is specified from the command line >-for arg in sys.argv: >- if arg.startswith('--prefix='): >- prefix = arg[9:] >- prefix = os.path.expandvars(prefix) >+ def initialize_options(self): >+ build.initialize_options(self) >+ self.prefix = None > >-# Gen .in files with @PREFIX@ replaced >-for filename in ['udev-discover']: >- infile = open(filename + '.in', 'r') >- data = infile.read().replace('@PREFIX@', prefix) >- infile.close() >+ def finalize_options(self): >+ build.finalize_options(self) >+ if not self.prefix: >+ install = self.distribution.get_command_obj('install', False) >+ if install: >+ self.prefix = install.prefix >+ else: >+ self.prefix = sys.prefix > >- outfile = open(filename, 'w') >- outfile.write(data) >- outfile.close() >+ def run (self): >+ # Gen .in files with @PREFIX@ replaced >+ for filename in ['udev-discover']: >+ infile = open(filename + '.in', 'r') >+ data = infile.read().replace('@PREFIX@', self.prefix) >+ infile.close() > >-PO_DIR = 'po' >-MO_DIR = os.path.join('build', 'mo') >+ outfile = open(filename, 'w') >+ outfile.write(data) >+ outfile.close() > >-class BuildData(build): >- def run (self): > build.run (self) > > for po in glob.glob (os.path.join (PO_DIR, '*.po')): >-- >1.7.6.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 380943
:
284869
|
284871
|
284873
|
284875
| 284877 |
284879