diff options
Diffstat (limited to 'attoconf/lib/install.py')
-rw-r--r-- | attoconf/lib/install.py | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/attoconf/lib/install.py b/attoconf/lib/install.py index 1a55c29..f43b2a1 100644 --- a/attoconf/lib/install.py +++ b/attoconf/lib/install.py @@ -20,7 +20,7 @@ from __future__ import print_function, division, absolute_import import os from ..classy import ClassyProject -from ..types import shell_word, filepath, quoted_string +from ..types import shell_word, filepath, quoted_string, maybe def package(build, PACKAGE): @@ -33,48 +33,48 @@ def prefix(build, PREFIX): pass def exec_prefix(build, EPREFIX): - if EPREFIX is None: + if not EPREFIX: PREFIX = build.vars['PREFIX'] build.vars['EXEC_PREFIX'] = PREFIX build.vars['EPREFIX'] = build.vars['EXEC_PREFIX'] def bindir(build, DIR): - if DIR is None: + if not DIR: EPREFIX = build.vars['EPREFIX'] build.vars['BINDIR'] = os.path.join(EPREFIX, 'bin') def sbindir(build, DIR): - if DIR is None: + if not DIR: EPREFIX = build.vars['EPREFIX'] build.vars['SBINDIR'] = os.path.join(EPREFIX, 'sbin') def libexecdir(build, DIR): - if DIR is None: + if not DIR: EPREFIX = build.vars['EPREFIX'] build.vars['LIBEXECDIR'] = os.path.join(EPREFIX, 'libexec') def sysconfdir(build, DIR): - if DIR is None: + if not DIR: PREFIX = build.vars['PREFIX'] build.vars['SYSCONFDIR'] = os.path.join(PREFIX, 'etc') def sharedstatedir(build, DIR): - if DIR is None: + if not DIR: PREFIX = build.vars['PREFIX'] build.vars['SHAREDSTATEDIR'] = os.path.join(PREFIX, 'com') def localstatedir(build, DIR): - if DIR is None: + if not DIR: PREFIX = build.vars['PREFIX'] build.vars['LOCALSTATEDIR'] = os.path.join(PREFIX, 'var') def libdir(build, DIR): - if DIR is None: + if not DIR: EPREFIX = build.vars['EPREFIX'] build.vars['LIBDIR'] = os.path.join(EPREFIX, 'lib') def includedir(build, DIR): - if DIR is None: + if not DIR: PREFIX = build.vars['PREFIX'] build.vars['INCLUDEDIR'] = os.path.join(PREFIX, 'include') @@ -82,59 +82,59 @@ def oldincludedir(build, DIR): pass def datarootdir(build, DIR): - if DIR is None: + if not DIR: PREFIX = build.vars['PREFIX'] build.vars['DATAROOTDIR'] = os.path.join(PREFIX, 'share') def datadir(build, DIR): - if DIR is None: + if not DIR: DATAROOTDIR = build.vars['DATAROOTDIR'] build.vars['DATADIR'] = DATAROOTDIR def packagedatadir(build, DIR): - if DIR is None: + if not DIR: DATADIR = build.vars['DATADIR'] PACKAGE = build.vars['PACKAGE'] build.vars['PACKAGEDATADIR'] = os.path.join(DATADIR, PACKAGE) def infodir(build, DIR): - if DIR is None: + if not DIR: DATAROOTDIR = build.vars['DATAROOTDIR'] build.vars['INFODIR'] = os.path.join(DATAROOTDIR, 'info') def localedir(build, DIR): - if DIR is None: + if not DIR: DATAROOTDIR = build.vars['DATAROOTDIR'] build.vars['LOCALEDIR'] = os.path.join(DATAROOTDIR, 'locale') def mandir(build, DIR): - if DIR is None: + if not DIR: DATAROOTDIR = build.vars['DATAROOTDIR'] build.vars['MANDIR'] = os.path.join(DATAROOTDIR, 'man') def docdir(build, DIR): - if DIR is None: + if not DIR: DATAROOTDIR = build.vars['DATAROOTDIR'] PACKAGE = build.vars['PACKAGE'] build.vars['DOCDIR'] = os.path.join(DATAROOTDIR, 'doc', PACKAGE) def htmldir(build, DIR): - if DIR is None: + if not DIR: DOCDIR = build.vars['DOCDIR'] build.vars['HTMLDIR'] = DOCDIR def dvidir(build, DIR): - if DIR is None: + if not DIR: DOCDIR = build.vars['DOCDIR'] build.vars['DVIDIR'] = DOCDIR def pdfdir(build, DIR): - if DIR is None: + if not DIR: DOCDIR = build.vars['DOCDIR'] build.vars['PDFDIR'] = DOCDIR def psdir(build, DIR): - if DIR is None: + if not DIR: DOCDIR = build.vars['DOCDIR'] build.vars['PSDIR'] = DOCDIR @@ -179,93 +179,93 @@ class Install(ClassyProject): type=filepath, check=prefix, help='install architecture-independent files in PREFIX', hidden=False) - self.add_option('--exec-prefix', init=None, - type=filepath, check=exec_prefix, + self.add_option('--exec-prefix', init='', + type=maybe(filepath), check=exec_prefix, help='install architecture-dependent files in EPREFIX', hidden=False, help_var='EPREFIX', help_def='PREFIX') - self.order.append('EPREFIX') + self.order.append('EPREFIX') # TODO remove for 1.0 self.order.append(None) self.add_help('Fine tuning of the installation directories:', hidden=False) - self.add_option('--bindir', init=None, - type=filepath, check=bindir, + self.add_option('--bindir', init='', + type=maybe(filepath), check=bindir, help='user executables', hidden=False, help_var='DIR', help_def='EPREFIX/bin') - self.add_option('--sbindir', init=None, - type=filepath, check=sbindir, + self.add_option('--sbindir', init='', + type=maybe(filepath), check=sbindir, help='system admin executables', hidden=False, help_var='DIR', help_def='EPREFIX/sbin') - self.add_option('--libexecdir', init=None, - type=filepath, check=libexecdir, + self.add_option('--libexecdir', init='', + type=maybe(filepath), check=libexecdir, help='program executables', hidden=False, help_var='DIR', help_def='EPREFIX/libexec') - self.add_option('--sysconfdir', init=None, - type=filepath, check=sysconfdir, + self.add_option('--sysconfdir', init='', + type=maybe(filepath), check=sysconfdir, help='read-only single-machine data', hidden=False, help_var='DIR', help_def='PREFIX/etc') - self.add_option('--sharedstatedir', init=None, - type=filepath, check=sharedstatedir, + self.add_option('--sharedstatedir', init='', + type=maybe(filepath), check=sharedstatedir, help='modifiable architecture-independent data', hidden=False, help_var='DIR', help_def='PREFIX/com') - self.add_option('--localstatedir', init=None, - type=filepath, check=localstatedir, + self.add_option('--localstatedir', init='', + type=maybe(filepath), check=localstatedir, help='modifiable single-machine data', hidden=False, help_var='DIR', help_def='PREFIX/var') - self.add_option('--libdir', init=None, - type=filepath, check=libdir, + self.add_option('--libdir', init='', + type=maybe(filepath), check=libdir, help='object code libraries', hidden=False, help_var='DIR', help_def='EPREFIX/lib') - self.add_option('--includedir', init=None, - type=filepath, check=includedir, + self.add_option('--includedir', init='', + type=maybe(filepath), check=includedir, help='C header files', hidden=False, help_var='DIR', help_def='PREFIX/include') self.add_option('--oldincludedir', init='/usr/include', type=filepath, check=oldincludedir, help='C header files for non-gcc', hidden=False, help_var='DIR') - self.add_option('--datarootdir', init=None, - type=filepath, check=datarootdir, + self.add_option('--datarootdir', init='', + type=maybe(filepath), check=datarootdir, help='read-only arch.-independent data root', hidden=False, help_var='DIR', help_def='PREFIX/share') - self.add_option('--datadir', init=None, - type=filepath, check=datadir, + self.add_option('--datadir', init='', + type=maybe(filepath), check=datadir, help='read-only architecture-independent data', hidden=False, help_var='DIR', help_def='DATAROOTDIR') - self.add_option('--packagedatadir', init=None, - type=filepath, check=packagedatadir, + self.add_option('--packagedatadir', init='', + type=maybe(filepath), check=packagedatadir, help='data specific to this package (please set datadir instead)', hidden=False, help_var='DIR', help_def='DATADIR/PACKAGE') - self.add_option('--infodir', init=None, - type=filepath, check=infodir, + self.add_option('--infodir', init='', + type=maybe(filepath), check=infodir, help='info documentation', hidden=False, help_var='DIR', help_def='DATAROOTDIR/info') - self.add_option('--localedir', init=None, - type=filepath, check=localedir, + self.add_option('--localedir', init='', + type=maybe(filepath), check=localedir, help='locale-dependent data', hidden=False, help_var='DIR', help_def='DATAROOTDIR/locale') - self.add_option('--mandir', init=None, - type=filepath, check=mandir, + self.add_option('--mandir', init='', + type=maybe(filepath), check=mandir, help='man documentation', hidden=False, help_var='DIR', help_def='DATAROOTDIR/man') - self.add_option('--docdir', init=None, - type=filepath, check=docdir, + self.add_option('--docdir', init='', + type=maybe(filepath), check=docdir, help='documentation root', hidden=False, help_var='DIR', help_def='DATAROOTDIR/doc/PACKAGE') - self.add_option('--htmldir', init=None, - type=filepath, check=htmldir, + self.add_option('--htmldir', init='', + type=maybe(filepath), check=htmldir, help='html documentation', hidden=False, help_var='DIR', help_def='DOCDIR') - self.add_option('--dvidir', init=None, - type=filepath, check=dvidir, + self.add_option('--dvidir', init='', + type=maybe(filepath), check=dvidir, help='dvi documentation', hidden=False, help_var='DIR', help_def='DOCDIR') - self.add_option('--pdfdir', init=None, - type=filepath, check=pdfdir, + self.add_option('--pdfdir', init='', + type=maybe(filepath), check=pdfdir, help='pdf documentation', hidden=False, help_var='DIR', help_def='DOCDIR') - self.add_option('--psdir', init=None, - type=filepath, check=psdir, + self.add_option('--psdir', init='', + type=maybe(filepath), check=psdir, help='ps documentation', hidden=False, help_var='DIR', help_def='DOCDIR') |