File: check-for-missing.py

package info (click to toggle)
gnome-shell 3.4.2-7%2Bdeb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 16,316 kB
  • sloc: ansic: 43,092; sh: 11,950; makefile: 595; xml: 191; python: 13
file content (25 lines) | stat: -rwxr-xr-x 750 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/python
#
# 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>'
# was changed to no longer do anything useful, which made that
# 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:
    f = f.strip()
    if (not os.path.exists(os.path.join(distdir, f)) and
        not any((fnmatch.fnmatch(f, p) for p in excludes))):
        print "File missing from distribution:", f
        status=1

sys.exit(status)