From: Simon McVittie Date: Tue, 8 Aug 2023 11:02:51 +0000 (+0100) Subject: meson: Allow `sudo meson install`, which doesn't set `DESTDIR` X-Git-Tag: dbus-1.15.8~13^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14c1dcd322c493cd994d677c9cbb2edbbf0525f2;p=thirdparty%2Fdbus.git meson: Allow `sudo meson install`, which doesn't set `DESTDIR` This is generally not recommended (dbus should usually be installed from the OS distributor's packages, which should install into a staging directory using `DESTDIR`), but we'll want to use it in Gitlab-CI. Signed-off-by: Simon McVittie --- diff --git a/tools/meson-compat-install-emptydirs.py b/tools/meson-compat-install-emptydirs.py index 0fc76287a..45ae62de0 100755 --- a/tools/meson-compat-install-emptydirs.py +++ b/tools/meson-compat-install-emptydirs.py @@ -9,10 +9,10 @@ import sys from pathlib import Path for d in sys.argv[1].split(':'): - if os.path.isabs(d) and 'DESTDIR' in os.environ: + if os.path.isabs(d): p = Path(d) d = p.relative_to(p.anchor) - dest = os.path.join(os.environ['DESTDIR'], d) + dest = os.path.join(os.environ.get('DESTDIR', '/'), d) else: dest = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], d) diff --git a/tools/meson-compat-install-symlink.py b/tools/meson-compat-install-symlink.py index 6e7ac333f..69ff2a66d 100755 --- a/tools/meson-compat-install-symlink.py +++ b/tools/meson-compat-install-symlink.py @@ -14,7 +14,7 @@ link_name, d, pointing_to = sys.argv[1:] if os.path.isabs(d): p = Path(d) d = p.relative_to(p.anchor) - dest = os.path.join(os.environ['DESTDIR'], d) + dest = os.path.join(os.environ.get('DESTDIR', '/'), d) else: dest = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], d)