check manifest files on build

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2429 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2005-03-12 00:21:28 +00:00
parent 0baec73a77
commit 490934d055

View file

@ -238,6 +238,29 @@ def list_message_files(package, suffix=".po"):
return _list
def check_manifest ():
"""
Snatched from roundup.sf.net.
Check that the files listed in the MANIFEST are present when the
source is unpacked.
"""
try:
f = open('MANIFEST')
except:
print '\n*** SOURCE WARNING: The MANIFEST file is missing!'
return
try:
manifest = [l.strip() for l in f.readlines()]
finally:
f.close()
err = [line for line in manifest if not os.path.exists(line)]
if err:
n = len(manifest)
print '\n*** SOURCE WARNING: There are files missing (%d/%d found)!'%(
n-len(err), n)
print 'Missing:', '\nMissing: '.join(err)
class MyBuild (build, object):
"""
Custom build command.
@ -254,6 +277,7 @@ class MyBuild (build, object):
msgfmt.make(_src, _build_dst)
def run (self):
check_manifest()
self.build_message_files()
build.run(self)