diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-01-29 15:14:02 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-01-30 21:28:21 +0000 |
commit | c491d48b9d081125f242227ff9e543abbbb838d8 (patch) | |
tree | 141b736903f99dfd44e29d7785232581ee452ade /mesonbuild/minstall.py | |
parent | f72ee8e742a171db74ed32b54b85953b8dfe1d77 (diff) | |
download | meson-c491d48b9d081125f242227ff9e543abbbb838d8.zip meson-c491d48b9d081125f242227ff9e543abbbb838d8.tar.gz meson-c491d48b9d081125f242227ff9e543abbbb838d8.tar.bz2 |
minstall: Add --destdir command line option
Diffstat (limited to 'mesonbuild/minstall.py')
-rw-r--r-- | mesonbuild/minstall.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py index 98608c7..db08dfe 100644 --- a/mesonbuild/minstall.py +++ b/mesonbuild/minstall.py @@ -53,6 +53,7 @@ if T.TYPE_CHECKING: profile: bool quiet: bool wd: str + destdir: str symlink_warning = '''Warning: trying to copy a symlink that points to a file. This will copy the file, @@ -72,6 +73,8 @@ def add_arguments(parser: argparse.Namespace) -> None: help='Only overwrite files that are older than the copied file.') parser.add_argument('--quiet', default=False, action='store_true', help='Do not print every file that was installed.') + parser.add_argument('--destdir', default=None, + help='Sets or overrides DESTDIR environment. (Since 0.57.0)') class DirMaker: def __init__(self, lf: T.TextIO): @@ -406,6 +409,10 @@ class Installer: with open(datafilename, 'rb') as ifile: d = self.check_installdata(pickle.load(ifile)) + # Override in the env because some scripts could be relying on it. + if self.options.destdir is not None: + os.environ['DESTDIR'] = self.options.destdir + destdir = os.environ.get('DESTDIR', '') fullprefix = destdir_join(destdir, d.prefix) |