aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-01-29 14:41:11 -0800
committerJussi Pakkanen <jpakkane@gmail.com>2019-01-30 23:20:49 +0200
commite2797755116725afb85eca6829d071b650cbe899 (patch)
tree69d89ad0fb7e8f347132028c1d77e0f9a9d457e0
parentc5a78c9e495058e61a4456fca6b6854b3823fc90 (diff)
downloadmeson-e2797755116725afb85eca6829d071b650cbe899.zip
meson-e2797755116725afb85eca6829d071b650cbe899.tar.gz
meson-e2797755116725afb85eca6829d071b650cbe899.tar.bz2
dist: Handle git worktrees, which have a .git file instead of dir
This is the second most straight forward stupid way of handling this (with usiing os.path.exists) as the most stupid obvious way. The only major advantage is that having .git as something other than a file or directory still doesn't register. Fixes: #3378
-rw-r--r--mesonbuild/scripts/dist.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/scripts/dist.py b/mesonbuild/scripts/dist.py
index f49492c..a8d9674 100644
--- a/mesonbuild/scripts/dist.py
+++ b/mesonbuild/scripts/dist.py
@@ -188,7 +188,8 @@ def run(args):
dist_name = build.project_name + '-' + build.project_version
- if os.path.isdir(os.path.join(src_root, '.git')):
+ _git = os.path.join(src_root, '.git')
+ if os.path.isdir(_git) or os.path.isfile(_git):
names = create_dist_git(dist_name, src_root, bld_root, dist_sub, build.dist_scripts)
elif os.path.isdir(os.path.join(src_root, '.hg')):
names = create_dist_hg(dist_name, src_root, bld_root, dist_sub, build.dist_scripts)