]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - misc/build_helpers/check-build.py
e293c6a1bea5313062f1bff2bed2b67fa11d27c7
[tahoe-lafs/tahoe-lafs.git] / misc / build_helpers / check-build.py
1 #! /usr/bin/env python
2
3 # This helper script is used with the 'test-desert-island' Makefile target.
4
5 import sys
6
7 good = True
8 build_out = sys.argv[1]
9 mode = sys.argv[2]
10
11 print
12
13 for line in open(build_out, "r"):
14     if mode == "no-downloads":
15         # when setup_requires= uses
16         # misc/dependencies/setuptools-0.6c8.egg, it causes a
17         # "Downloading: misc/dependencies/.." line to be emitted,
18         # which doesn't count as a network download.  Lines that start
19         # with "Reading" indicate that it is fetching web pages in
20         # order to check for newer versions of packages. As long as it
21         # doesn't actually download any packages then it still passes
22         # this test. That is: it *would* have succeeded if you were on
23         # a Desert Island, an airplane with no network, behind a
24         # corporate firewall that disallows such connections, or if
25         # you had turned off your network prior to running "python
26         # setup.py build". A stronger requirement would be that it
27         # doesn't even try to check for new packages on remote hosts
28         # if it has all the packages that it needs locally, but we
29         # currently don't enforce that stronger requirement.
30         if line.startswith("Downloading http:"):
31             print line,
32             good = False
33 if good:
34     if mode == "no-downloads":
35         print "Good: build did not try to download any files"
36     sys.exit(0)
37 else:
38     if mode == "no-downloads":
39         print "Failed: build tried to download files"
40     sys.exit(1)