File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -48,16 +48,13 @@ if not python_version.version_compare(python_version_req)
48
48
endif
49
49
50
50
# Do we build from a git repository?
51
- # Suppose we do if and only if a .git directory exists.
51
+ # Suppose we do if and only if a ' .git' directory or file exists.
52
52
cmd_py = '''
53
53
import os
54
54
import sys
55
- sys.exit(0 if os.path.isdir("@0@") else 1 )
55
+ sys.exit(os.path.isdir("@0@") or os.path.isfile("@0@") )
56
56
''' .format(project_source_root / ' .git' )
57
- is_git_build = run_command (python3, ' -c' , cmd_py).returncode() == 0
58
- # In Unix-like system, an alternative is
59
- # is_git_build = run_command('test', '-d', project_source_root / '.git').returncode() == 0
60
- # Python code can be used in all operating sytems where Meson can run.
57
+ is_git_build = run_command (python3, ' -c' , cmd_py).returncode() != 0
61
58
62
59
# Options.
63
60
maintainer_mode_opt = get_option (' maintainer-mode' )
You can’t perform that action at this time.
0 commit comments