From 490934d055be3aac6c8922dd9ac18b2c5442ca3b Mon Sep 17 00:00:00 2001 From: calvin Date: Sat, 12 Mar 2005 00:21:28 +0000 Subject: [PATCH] check manifest files on build git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2429 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- setup.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/setup.py b/setup.py index 8449c15c..2c43408a 100755 --- a/setup.py +++ b/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)