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
pull/4853/head
Dylan Baker 6 years ago committed by Jussi Pakkanen
parent c5a78c9e49
commit e279775511
  1. 3
      mesonbuild/scripts/dist.py

@ -188,7 +188,8 @@ def run(args):
dist_name = build.project_name + '-' + build.project_version 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) 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')): 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) names = create_dist_hg(dist_name, src_root, bld_root, dist_sub, build.dist_scripts)

Loading…
Cancel
Save