mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-24 06:03:43 +00:00
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:
parent
0baec73a77
commit
490934d055
1 changed files with 24 additions and 0 deletions
24
setup.py
24
setup.py
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue