2014-08-29 14:23:56 +00:00
|
|
|
#!/usr/bin/python3
|
2010-02-23 00:21:42 +00:00
|
|
|
#
|
|
|
|
# This is a simple script that we use to check for files in git
|
|
|
|
# and not in the distribution. It was previously written in shell
|
|
|
|
# and inlined in the Makefile.am, but 'git ls-files --exclude=<pattern>'
|
2011-03-07 02:39:20 +00:00
|
|
|
# was changed to no longer do anything useful, which made that
|
2010-02-23 00:21:42 +00:00
|
|
|
# too challenging to be worthwhile.
|
|
|
|
|
|
|
|
import fnmatch, os, subprocess, sys
|
|
|
|
|
|
|
|
srcdir=sys.argv[1]
|
|
|
|
distdir=sys.argv[2]
|
|
|
|
excludes=sys.argv[3:]
|
|
|
|
|
|
|
|
os.chdir(srcdir)
|
|
|
|
|
|
|
|
status=0
|
|
|
|
for f in subprocess.Popen(["git", "ls-files"], stdout=subprocess.PIPE).stdout:
|
2014-08-29 14:23:56 +00:00
|
|
|
f = f.decode('utf-8').strip()
|
2010-02-23 00:21:42 +00:00
|
|
|
if (not os.path.exists(os.path.join(distdir, f)) and
|
|
|
|
not any((fnmatch.fnmatch(f, p) for p in excludes))):
|
2014-08-29 14:23:56 +00:00
|
|
|
print("File missing from distribution:", f)
|
2010-02-23 00:21:42 +00:00
|
|
|
status=1
|
|
|
|
|
|
|
|
sys.exit(status)
|