/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: John Arbash Meinel
  • Date: 2011-04-20 14:27:19 UTC
  • mto: This revision was merged to the branch mainline in revision 5837.
  • Revision ID: john@arbash-meinel.com-20110420142719-advs1k5vztqzbrgv
Fix bug #767177. Be more agressive with file.close() calls.

Our test suite gets a number of thread leaks and failures because it happens to get async
SFTPFile.close() calls. (if an SFTPFile closes due to __del__ it is done as an async request,
while if you call SFTPFile.close() it is done as a synchronous request.)
We have a couple other cases, probably. Namely SFTPTransport.get() also does an async
prefetch of the content, so if you don't .read() you'll also leak threads that think they
are doing work that you want.

The biggest change here, though, is using a try/finally in a generator, which is not 
python2.4 compatible.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
28
28
PLUGIN_TARGET=plugin-release
29
29
PYTHON_BUILDFLAGS=
30
30
 
31
 
.PHONY: all clean extensions pyflakes api-docs check-nodocs check
 
31
.PHONY: all clean realclean extensions pyflakes api-docs check-nodocs check
32
32
 
33
33
all: extensions
34
34
 
39
39
check: docs check-nodocs
40
40
 
41
41
check-nodocs: extensions
 
42
        set -e
42
43
        # Generate a stream for PQM to watch.
43
 
        $(PYTHON) -Werror -O ./bzr selftest --subunit $(tests) | tee selftest.log
 
44
        -$(RM) -f selftest.log
 
45
        $(PYTHON) -Werror -Wignore::ImportWarning -O ./bzr selftest --subunit $(tests) | tee selftest.log
 
46
        # An empty log file should catch errors in the $(PYTHON)
 
47
        # command above (the '|' swallow any errors since 'make'
 
48
        # sees the 'tee' exit code for the whole line
 
49
        if [ ! -s selftest.log ] ; then exit 1 ; fi
44
50
        # Check that there were no errors reported.
45
51
        subunit-stats < selftest.log
46
52
 
60
66
        $(PYTHON) setup.py clean
61
67
        -find . -name "*.pyc" -o -name "*.pyo" -o -name "*.so" | xargs rm -f
62
68
 
 
69
realclean: clean
 
70
        # Remove files which are autogenerated but included by the tarball.
 
71
        rm -f bzrlib/*_pyx.c
 
72
        rm -f bzrlib/_simple_set_pyx.h bzrlib/_simple_set_pyx_api.h
 
73
 
63
74
# Build API documentation
64
75
docfiles = bzr bzrlib
65
76
api-docs:
133
144
        doc/developers/Makefile \
134
145
        doc/developers/make.bat
135
146
 
 
147
NEWS_FILES = $(wildcard doc/en/release-notes/bzr-*.txt)
 
148
 
136
149
doc/en/user-reference/index.txt: $(MAN_DEPENDENCIES)
137
150
        $(PYTHON) tools/generate_docs.py -o $@ rstx
138
151
 
139
 
doc/en/release-notes/index.txt: NEWS tools/generate_release_notes.py
140
 
        $(PYTHON) tools/generate_release_notes.py NEWS $@
 
152
doc/en/release-notes/index.txt: $(NEWS_FILES) tools/generate_release_notes.py
 
153
        $(PYTHON) tools/generate_release_notes.py $@ $(NEWS_FILES)
141
154
 
142
155
doc/%/Makefile: doc/en/Makefile
143
156
        $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
296
309
        $(rst2html) --stylesheet=default.css $< $@
297
310
 
298
311
%.html: %.txt
299
 
        $(rst2html) --stylesheet=../../default.css $< $@
 
312
        $(rst2html) --stylesheet=../../default.css $< "$@"
300
313
 
301
 
doc/en/release-notes/NEWS.txt: NEWS
302
 
        $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
 
314
doc/en/release-notes/NEWS.txt: $(NEWS_FILES) tools/generate_release_notes.py
 
315
        $(PYTHON) tools/generate_release_notes.py "$@" $(NEWS_FILES)
303
316
 
304
317
upgrade_guide_dependencies =  $(wildcard $(addsuffix /*.txt, doc/en/upgrade-guide)) 
305
318