summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-03-20 10:50:10 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2019-03-25 16:28:17 +0000
commite9ff2b5276b8838e0cb6b86c6e3dab757e4f83ba (patch)
tree0c81153804113781e934858673a381f917ef7bbd
parent76719ecbb325ebb9e83574b530db166efc121d87 (diff)
bin/install_megadrivers.py: Correctly handle DESTDIR=''
Currently if destdir is set to '' then the resulting libdir will have it's first character replaced by / instead of / being prepended to the string. This was the result of ensuring that that DESTDIR wouldn't be ignored if libdir was absolute, since the only cases that meson allows the libdir to be absolute is if the prefix is /, this won't be a problem. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110211 Fixes: ae3f45c11e3f934939b90445471da8f18b057bc5 ("bin/install_megadrivers: fix DESTDIR and -D*-path") Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (cherry picked from commit 4188dd7879a374b698d5f50c84cd26b2606f1ee3) Squashed with: bin/install_megadrivers.py: Fix regression for set DESTDIR The previous patch tried to address a bug when DESTDIR is '', however, it introduces a bug when DESTDIR is not '', and fakeroot is used. This patch does fix that, and has been tested with the arch pkg-build to ensure it isn't regressed. Fixes: 093a1ade4e24b7dd701a093d30a71efd669fe9c8 ("bin/install_megadrivers.py: Correctly handle DESTDIR=''") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110221 Reviewed-by: Eric Engestrom <eric@engestrom.ch> (cherry picked from commit ed96038e55b37501dae0be09287a6209a966eb85)
-rw-r--r--bin/install_megadrivers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index d29b1911218..ca543e5ce30 100644
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -35,7 +35,11 @@ def main():
args = parser.parse_args()
if os.path.isabs(args.libdir):
- to = os.path.join(os.environ.get('DESTDIR', '/'), args.libdir[1:])
+ destdir = os.environ.get('DESTDIR')
+ if destdir:
+ to = os.path.join(destdir, args.libdir[1:])
+ else:
+ to = args.libdir
else:
to = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], args.libdir)