From d111a2e7e558e9073166c95137a1d66d4aa2dd82 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Tue, 9 Jun 2020 17:31:09 +0100
Subject: [PATCH] build-relocatable-install: Don't redirect srcdir into DESTDIR
 if not there

This enables us to use --srcdir=$(pwd) when running from a git checkout.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 build-relocatable-install.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/build-relocatable-install.py b/build-relocatable-install.py
index 3238f1ec0..d0bc4ab25 100755
--- a/build-relocatable-install.py
+++ b/build-relocatable-install.py
@@ -220,7 +220,9 @@ def main():
 
     if args.destdir:
         args.prefix = args.destdir + args.prefix
-        args.srcdir = args.destdir + args.srcdir
+
+        if os.path.exists(args.destdir + args.srcdir):
+            args.srcdir = args.destdir + args.srcdir
 
     if args.archive is None and args.output is None:
         parser.error('Either --archive or --output is required')
-- 
GitLab