Merge lp://staging/~andrea.corbellini/beeseek/packaging into lp://staging/beeseek/1.0
- packaging
- Merge into 1.0
Proposed by
Andrea Corbellini
Status: | Merged |
---|---|
Approved by: | Andrea Corbellini |
Approved revision: | 336 |
Merged at revision: | not available |
Proposed branch: | lp://staging/~andrea.corbellini/beeseek/packaging |
Merge into: | lp://staging/beeseek/1.0 |
Diff against target: | None lines |
To merge this branch: | bzr merge lp://staging/~andrea.corbellini/beeseek/packaging |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Colangelo | Approve | ||
Review via email: mp+10844@code.staging.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote : | # |
Revision history for this message
Andrea Colangelo (warp10) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile' | |||
2 | --- Makefile 2009-08-09 16:13:30 +0000 | |||
3 | +++ Makefile 2009-08-28 13:32:45 +0000 | |||
4 | @@ -13,20 +13,48 @@ | |||
5 | 13 | # You should have received a copy of the GNU Affero General Public License | 13 | # You should have received a copy of the GNU Affero General Public License |
6 | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
7 | 15 | 15 | ||
10 | 16 | PYTHON=/usr/bin/python | 16 | NAME := beeseek-peer |
11 | 17 | 17 | VERSION := $(shell ./beeseek-peer version --short) | |
12 | 18 | FULLNAME := $(NAME)-$(VERSION) | ||
13 | 19 | PYVERSION := $(shell python -V 2>&1 | egrep -o '([0-9]\.[0-9])') | ||
14 | 20 | PLATFORM := $(shell uname -s | tr A-Z a-z)-$(shell uname -m) | ||
15 | 21 | PKGFILES := build/lib.$(PLATFORM)-$(PYVERSION)/beeseek \ | ||
16 | 22 | build/scripts-$(PYVERSION)/beeseek-peer \ | ||
17 | 23 | beeseek-peer.init config database templates setup.py | ||
18 | 18 | pyflakes_ignore := beeseek/tests/unittests/.*\.py.*(undefined name|imported but unused) | 24 | pyflakes_ignore := beeseek/tests/unittests/.*\.py.*(undefined name|imported but unused) |
19 | 19 | 25 | ||
20 | 20 | build: version-info | 26 | build: version-info |
22 | 21 | $(PYTHON) setup.py build | 27 | python setup.py build |
23 | 22 | 28 | ||
24 | 23 | install: build | 29 | install: build |
26 | 24 | $(PYTHON) setup.py install | 30 | python setup.py install |
27 | 25 | 31 | ||
29 | 26 | version-info: | 32 | version-info: beeseek/_version_info.py |
30 | 33 | beeseek/_version_info.py: | ||
31 | 27 | bzr version-info --python > beeseek/_version_info.py | 34 | bzr version-info --python > beeseek/_version_info.py |
32 | 28 | 35 | ||
33 | 29 | 36 | ||
34 | 37 | dist: build | ||
35 | 38 | mkdir -p dist/$(FULLNAME) | ||
36 | 39 | cp -R $(PKGFILES) dist/$(FULLNAME) | ||
37 | 40 | |||
38 | 41 | tar: dist/$(FULLNAME).tar | ||
39 | 42 | dist/$(FULLNAME).tar: dist | ||
40 | 43 | tar -cf dist/$(FULLNAME).tar -C dist $(FULLNAME) | ||
41 | 44 | |||
42 | 45 | tar.gz: dist/$(FULLNAME).tar.gz | ||
43 | 46 | dist/$(FULLNAME).tar.gz: tar | ||
44 | 47 | gzip -9 dist/$(FULLNAME).tar | ||
45 | 48 | |||
46 | 49 | tar.bz2: dist/$(FULLNAME).tar.bz2 | ||
47 | 50 | dist/$(FULLNAME).tar.bz2: tar | ||
48 | 51 | bzip2 -9 dist/$(FULLNAME).tar | ||
49 | 52 | |||
50 | 53 | zip: dist/$(FULLNAME).zip | ||
51 | 54 | dist/$(FULLNAME).zip: dist | ||
52 | 55 | cd dist; zip -rq $(FULLNAME).zip $(FULLNAME) | ||
53 | 56 | |||
54 | 57 | |||
55 | 30 | pychecker: | 58 | pychecker: |
56 | 31 | find beeseek -name "*.py" | xargs pychecker --limit=100000 | 59 | find beeseek -name "*.py" | xargs pychecker --limit=100000 |
57 | 32 | 60 | ||
58 | @@ -42,12 +70,13 @@ | |||
59 | 42 | pylint -f parseable -r no --enable-checker miscellaneous beeseek | 70 | pylint -f parseable -r no --enable-checker miscellaneous beeseek |
60 | 43 | 71 | ||
61 | 44 | 72 | ||
63 | 45 | docs: | 73 | docs: doc/build |
64 | 74 | doc/build: | ||
65 | 46 | sphinx-build -b html -d doc/build/doctrees -N -c doc/ beeseek/docs doc/build/html | 75 | sphinx-build -b html -d doc/build/doctrees -N -c doc/ beeseek/docs doc/build/html |
66 | 47 | epydoc --html -n"BeeSeek" --no-frames --no-source --simple-term beeseek -o doc/build/html/source | 76 | epydoc --html -n"BeeSeek" --no-frames --no-source --simple-term beeseek -o doc/build/html/source |
67 | 48 | 77 | ||
68 | 49 | clean: | 78 | clean: |
70 | 50 | rm -rf build doc/build dist beeseek/_version_info.py | 79 | rm -rf build dist doc/build beeseek/_version_info.py |
71 | 51 | find . -name "*.pyc" -o -name "*.pyo" -o -name "*~" | xargs rm -f | 80 | find . -name "*.pyc" -o -name "*.pyo" -o -name "*~" | xargs rm -f |
72 | 52 | 81 | ||
73 | 53 | clean-db: | 82 | clean-db: |
74 | 54 | 83 | ||
75 | === modified file 'beeseek/app/directory.py' | |||
76 | --- beeseek/app/directory.py 2009-07-09 11:37:49 +0000 | |||
77 | +++ beeseek/app/directory.py 2009-07-14 16:07:24 +0000 | |||
78 | @@ -15,24 +15,37 @@ | |||
79 | 15 | 15 | ||
80 | 16 | import os | 16 | import os |
81 | 17 | import stat | 17 | import stat |
82 | 18 | import sys | ||
83 | 18 | import tempfile | 19 | import tempfile |
84 | 19 | 20 | ||
85 | 20 | 21 | ||
87 | 21 | tempdirs = tempfile._candidate_tempdir_list() | 22 | lockdirs = tempfile._candidate_tempdir_list() |
88 | 23 | if os.name != 'nt': | ||
89 | 24 | lockdirs.insert(0, '/var/lock') | ||
90 | 22 | 25 | ||
91 | 23 | class Directory(object): | 26 | class Directory(object): |
92 | 24 | 27 | ||
93 | 25 | __slots__ = 'dirlist', '_mode', '_subdirs', '_directory', '_create' | 28 | __slots__ = 'dirlist', '_mode', '_subdirs', '_directory', '_create' |
94 | 26 | 29 | ||
96 | 27 | def __init__(self, dirlist, **kwargs): | 30 | def __init__(self, dirlist, mode='rw', subdirs=(), create=False, |
97 | 31 | adjust=False): | ||
98 | 28 | if isinstance(dirlist, basestring): | 32 | if isinstance(dirlist, basestring): |
99 | 29 | dirlist = (dirlist,) | 33 | dirlist = (dirlist,) |
100 | 34 | if adjust and os.name == 'nt': | ||
101 | 35 | dirlist = self._adjust_for_win(dirlist) | ||
102 | 30 | self.dirlist = tuple(os.path.normcase(os.path.abspath( | 36 | self.dirlist = tuple(os.path.normcase(os.path.abspath( |
103 | 31 | os.path.expanduser(directory))) | 37 | os.path.expanduser(directory))) |
104 | 32 | for directory in dirlist) | 38 | for directory in dirlist) |
108 | 33 | self._mode = kwargs.get('mode', 'rw') | 39 | self._mode = mode |
109 | 34 | self._subdirs = kwargs.get('subdirs', ()) | 40 | self._subdirs = subdirs |
110 | 35 | self._create = kwargs.get('create', ()) | 41 | self._create = create |
111 | 42 | |||
112 | 43 | def _adjust_for_win(self, dirlist): | ||
113 | 44 | basepath = os.path.dirname(sys.executable) | ||
114 | 45 | for directory in dirlist: | ||
115 | 46 | yield os.path.join(basepath, | ||
116 | 47 | 'BeeSeek', | ||
117 | 48 | os.path.basename(directory)) | ||
118 | 36 | 49 | ||
119 | 37 | def _check_permissions(self, directory): | 50 | def _check_permissions(self, directory): |
120 | 38 | strmode = self._mode | 51 | strmode = self._mode |
121 | @@ -41,7 +54,6 @@ | |||
122 | 41 | stat_result = os.stat(directory) | 54 | stat_result = os.stat(directory) |
123 | 42 | usermode = groupmode = othermode = 0 | 55 | usermode = groupmode = othermode = 0 |
124 | 43 | 56 | ||
125 | 44 | # _issuitable() should be called rarely so we can use hasattr() here | ||
126 | 45 | if not hasattr(os, 'getuid') or stat_result.st_uid == os.getuid(): | 57 | if not hasattr(os, 'getuid') or stat_result.st_uid == os.getuid(): |
127 | 46 | if 'r' in strmode: | 58 | if 'r' in strmode: |
128 | 47 | usermode = stat.S_IXUSR | 59 | usermode = stat.S_IXUSR |
129 | 48 | 60 | ||
130 | === modified file 'beeseek/app/options.py' | |||
131 | --- beeseek/app/options.py 2009-08-23 19:12:47 +0000 | |||
132 | +++ beeseek/app/options.py 2009-08-24 15:10:30 +0000 | |||
133 | @@ -15,7 +15,7 @@ | |||
134 | 15 | 15 | ||
135 | 16 | import os | 16 | import os |
136 | 17 | from beeseek.app import instance | 17 | from beeseek.app import instance |
138 | 18 | from beeseek.app.directory import Directory, tempdirs | 18 | from beeseek.app.directory import Directory, lockdirs |
139 | 19 | from beeseek.interface import Interface, implements | 19 | from beeseek.interface import Interface, implements |
140 | 20 | 20 | ||
141 | 21 | 21 | ||
142 | @@ -198,6 +198,14 @@ | |||
143 | 198 | 'Enable the testing mode.') | 198 | 'Enable the testing mode.') |
144 | 199 | 199 | ||
145 | 200 | 200 | ||
146 | 201 | class VersionOptions(BaseOptionList): | ||
147 | 202 | |||
148 | 203 | implements(IOptionList) | ||
149 | 204 | |||
150 | 205 | short = Option(bool, None, ('-s', '--short'), None, | ||
151 | 206 | 'Show just the version number.') | ||
152 | 207 | |||
153 | 208 | |||
154 | 201 | class CommonServiceOptions(CommonOptions): | 209 | class CommonServiceOptions(CommonOptions): |
155 | 202 | 210 | ||
156 | 203 | """Options to deal with the service.""" | 211 | """Options to deal with the service.""" |
157 | @@ -212,7 +220,7 @@ | |||
158 | 212 | lockdir = Option(Directory, 'LockDirectory', | 220 | lockdir = Option(Directory, 'LockDirectory', |
159 | 213 | ('-L', '--lock-dir'), None, | 221 | ('-L', '--lock-dir'), None, |
160 | 214 | 'The directory for lock files.', | 222 | 'The directory for lock files.', |
162 | 215 | default=['/var/lock'] + tempdirs, | 223 | default=lockdirs, |
163 | 216 | convert_default=True) | 224 | convert_default=True) |
164 | 217 | 225 | ||
165 | 218 | user = Option(str, 'User', | 226 | user = Option(str, 'User', |
166 | @@ -235,7 +243,8 @@ | |||
167 | 235 | convert_kwargs={ | 243 | convert_kwargs={ |
168 | 236 | 'subdirs': ('keywords', 'pages', 'configuration', | 244 | 'subdirs': ('keywords', 'pages', 'configuration', |
169 | 237 | 'statistics', 'keys', 'needed-results'), | 245 | 'statistics', 'keys', 'needed-results'), |
171 | 238 | 'create': True}) | 246 | 'create': True, |
172 | 247 | 'adjust': True}) | ||
173 | 239 | 248 | ||
174 | 240 | daemon = Option(bool, 'Daemon', | 249 | daemon = Option(bool, 'Daemon', |
175 | 241 | ('-b', '--daemon'), ('-f', '--foreground'), | 250 | ('-b', '--daemon'), ('-f', '--foreground'), |
176 | @@ -254,7 +263,9 @@ | |||
177 | 254 | testing_default='templates', | 263 | testing_default='templates', |
178 | 255 | convert_default=True, | 264 | convert_default=True, |
179 | 256 | convert_kwargs={ | 265 | convert_kwargs={ |
181 | 257 | 'mode': 'r', 'subdirs': ('css', 'html', 'images', 'javascript')}) | 266 | 'mode': 'r', |
182 | 267 | 'subdirs': ('css', 'html', 'images', 'javascript'), | ||
183 | 268 | 'adjust': True}) | ||
184 | 258 | 269 | ||
185 | 259 | server_hostname = Option(str, 'ServerHostname', | 270 | server_hostname = Option(str, 'ServerHostname', |
186 | 260 | ('-s', '--server'), None, | 271 | ('-s', '--server'), None, |
187 | 261 | 272 | ||
188 | === modified file 'beeseek/app/session.py' | |||
189 | --- beeseek/app/session.py 2009-08-24 12:38:07 +0000 | |||
190 | +++ beeseek/app/session.py 2009-08-24 15:10:30 +0000 | |||
191 | @@ -29,7 +29,7 @@ | |||
192 | 29 | from beeseek.app.command import CommandObject, command | 29 | from beeseek.app.command import CommandObject, command |
193 | 30 | from beeseek.app.baseconfig import ConfigurationParser | 30 | from beeseek.app.baseconfig import ConfigurationParser |
194 | 31 | from beeseek.app.options import ( | 31 | from beeseek.app.options import ( |
196 | 32 | CommonOptions, CommonServiceOptions, StartOptions) | 32 | CommonOptions, VersionOptions, CommonServiceOptions, StartOptions) |
197 | 33 | from beeseek.app.directory import Directory | 33 | from beeseek.app.directory import Directory |
198 | 34 | from beeseek.app.utils import get_argcount | 34 | from beeseek.app.utils import get_argcount |
199 | 35 | 35 | ||
200 | @@ -210,7 +210,10 @@ | |||
201 | 210 | return getattr(self, '_status', 'unknown') | 210 | return getattr(self, '_status', 'unknown') |
202 | 211 | 211 | ||
203 | 212 | # Configuration | 212 | # Configuration |
205 | 213 | configdir = Directory(('/etc/beeseek', '~/.beeseek', 'config'), mode='r') | 213 | # XXX This should be set elsewhere |
206 | 214 | configdir = Directory(('/etc/beeseek', 'config'), | ||
207 | 215 | mode='r', | ||
208 | 216 | adjust=True) | ||
209 | 214 | logfile = open(os.devnull, 'w') | 217 | logfile = open(os.devnull, 'w') |
210 | 215 | debug = False | 218 | debug = False |
211 | 216 | 219 | ||
212 | @@ -645,12 +648,15 @@ | |||
213 | 645 | parser.populate(command_obj.optionlist) | 648 | parser.populate(command_obj.optionlist) |
214 | 646 | print parser.format_option_help() | 649 | print parser.format_option_help() |
215 | 647 | 650 | ||
217 | 648 | @command(CommonOptions) | 651 | @command(VersionOptions) |
218 | 649 | def version(self): | 652 | def version(self): |
219 | 650 | """Show version information.""" | 653 | """Show version information.""" |
223 | 651 | print '%s version %s' % (self.appname, version_info) | 654 | if self.short: |
224 | 652 | if version_info.revno: | 655 | print version_info |
225 | 653 | print 'Revision: %s' % version_info.revno | 656 | else: |
226 | 657 | print '%s version %s' % (self.appname, version_info) | ||
227 | 658 | if version_info.revno: | ||
228 | 659 | print 'Revision: %s' % version_info.revno | ||
229 | 654 | 660 | ||
230 | 655 | 661 | ||
231 | 656 | # Operations queue and threads | 662 | # Operations queue and threads |
232 | 657 | 663 | ||
233 | === modified file 'setup.py' | |||
234 | --- setup.py 2009-08-23 19:12:47 +0000 | |||
235 | +++ setup.py 2009-08-26 13:11:35 +0000 | |||
236 | @@ -23,43 +23,71 @@ | |||
237 | 23 | import os | 23 | import os |
238 | 24 | from distutils.core import setup | 24 | from distutils.core import setup |
239 | 25 | from distutils.command.install_data import install_data | 25 | from distutils.command.install_data import install_data |
241 | 26 | import pwd | 26 | try: |
242 | 27 | import pwd | ||
243 | 28 | except ImportError: | ||
244 | 29 | pwd = None | ||
245 | 27 | import beeseek | 30 | import beeseek |
246 | 28 | 31 | ||
247 | 29 | 32 | ||
248 | 30 | class configure_and_install_data(install_data): | 33 | class configure_and_install_data(install_data): |
249 | 31 | 34 | ||
250 | 35 | def finalize_options(self): | ||
251 | 36 | if self.install_dir is None: | ||
252 | 37 | install_cmd = self.distribution.get_command_obj('install') | ||
253 | 38 | self.install_dir = install_cmd.root or install_cmd.prefix | ||
254 | 39 | dir_specified = self.install_dir | ||
255 | 40 | install_data.finalize_options(self) | ||
256 | 41 | if not dir_specified and os.name != 'nt': | ||
257 | 42 | self.install_dir = os.path.dirname(install_cmd.prefix) | ||
258 | 43 | |||
259 | 32 | def run(self): | 44 | def run(self): |
266 | 33 | data_files = self.data_files = [] | 45 | install_dir = self.install_dir |
267 | 34 | dirs_map = { | 46 | if os.name == 'nt': |
268 | 35 | 'etc/beeseek': 'config', | 47 | dirs_map = { |
269 | 36 | 'var/lib/beeseek/database': 'database', | 48 | 'BeeSeek/config': 'config', |
270 | 37 | 'usr/share/beeseek/templates': 'templates' | 49 | 'BeeSeek/database': 'database', |
271 | 38 | } | 50 | 'BeeSeek/webdata': 'webdata' |
272 | 51 | } | ||
273 | 52 | else: | ||
274 | 53 | dirs_map = { | ||
275 | 54 | 'etc/beeseek': 'config', | ||
276 | 55 | 'var/lib/beeseek/database': 'database', | ||
277 | 56 | 'usr/share/beeseek/templates': 'templates' | ||
278 | 57 | } | ||
279 | 39 | 58 | ||
280 | 40 | for destination, source in dirs_map.iteritems(): | 59 | for destination, source in dirs_map.iteritems(): |
282 | 41 | sourcelen = len(source) + 1 | 60 | destination = os.path.join(install_dir, destination) |
283 | 61 | self.mkpath(destination) | ||
284 | 42 | for directory, subdirs, subfiles in os.walk(source): | 62 | for directory, subdirs, subfiles in os.walk(source): |
305 | 43 | path = os.path.join(destination, directory[sourcelen:]) | 63 | subdirectory = directory[len(source)+1:] |
306 | 44 | subfiles = [os.path.join(directory, filename) | 64 | for subdir in subdirs: |
307 | 45 | for filename in subfiles] | 65 | self.mkpath( |
308 | 46 | data_files.append((path, subfiles)) | 66 | os.path.join(destination, subdirectory, subdir)) |
309 | 47 | 67 | for file_name in subfiles: | |
310 | 48 | install_data.run(self) | 68 | self.copy_file( |
311 | 49 | self.mkpath(os.path.join(self.install_dir, 'etc/init.d')) | 69 | os.path.join(directory, file_name), |
312 | 50 | self.copy_file('beeseek-peer.init', | 70 | os.path.join(destination, subdirectory, file_name)) |
313 | 51 | os.path.join(self.install_dir, | 71 | |
314 | 52 | 'etc/init.d/beeseek-peer')) | 72 | if os.name != 'nt': |
315 | 53 | self.mkpath(os.path.join(self.install_dir, 'var/log/beeseek')) | 73 | self.mkpath(os.path.join(install_dir, 'etc/init.d')) |
316 | 54 | 74 | self.copy_file('beeseek-peer.init', | |
317 | 55 | items = pwd.getpwnam('www-data') | 75 | os.path.join(install_dir, 'etc/init.d/beeseek-peer')) |
318 | 56 | uid, gid = items[2], items[3] | 76 | self.mkpath(os.path.join(install_dir, 'var/log/beeseek')) |
319 | 57 | for path in ('var/log/beeseek', 'var/lib/beeseek'): | 77 | |
320 | 58 | path = os.path.join(self.install_dir, path) | 78 | if not self.dry_run and pwd: |
321 | 59 | for directory, subdirs, subfiles in os.walk(path): | 79 | items = pwd.getpwnam('www-data') |
322 | 60 | os.chown(directory, uid, gid) | 80 | uid, gid = items[2], items[3] |
323 | 61 | for filename in subfiles: | 81 | for path in ('var/log/beeseek', 'var/lib/beeseek'): |
324 | 62 | os.chown(os.path.join(directory, filename), uid, gid) | 82 | path = os.path.join(install_dir, path) |
325 | 83 | for directory, subdirs, subfiles in os.walk(path): | ||
326 | 84 | try: | ||
327 | 85 | os.chown(directory, uid, gid) | ||
328 | 86 | for filename in subfiles: | ||
329 | 87 | os.chown( | ||
330 | 88 | os.path.join(directory, filename), uid, gid) | ||
331 | 89 | except OSError: | ||
332 | 90 | pass | ||
333 | 63 | 91 | ||
334 | 64 | 92 | ||
335 | 65 | def add_packages(metadata): | 93 | def add_packages(metadata): |
336 | @@ -68,10 +96,13 @@ | |||
337 | 68 | packages = metadata['packages'] = [] | 96 | packages = metadata['packages'] = [] |
338 | 69 | for directory, subdirs, subfiles in os.walk(path): | 97 | for directory, subdirs, subfiles in os.walk(path): |
339 | 70 | name = directory[unneeded:].replace(os.path.sep, '.') | 98 | name = directory[unneeded:].replace(os.path.sep, '.') |
344 | 71 | if (name.startswith('beeseek.tests') | 99 | skip = False |
345 | 72 | or name.startswith('beeseek.app.server')): | 100 | for package in exclude_packages: |
346 | 73 | continue | 101 | if name.startswith(package): |
347 | 74 | packages.append(name) | 102 | skip = True |
348 | 103 | break | ||
349 | 104 | if not skip: | ||
350 | 105 | packages.append(name) | ||
351 | 75 | 106 | ||
352 | 76 | def add_description(metadata): | 107 | def add_description(metadata): |
353 | 77 | from beeseek.app import peer | 108 | from beeseek.app import peer |
354 | @@ -83,6 +114,13 @@ | |||
355 | 83 | metadata['description'] = summary.rstrip('.') | 114 | metadata['description'] = summary.rstrip('.') |
356 | 84 | metadata['long_description'] = description.strip() | 115 | metadata['long_description'] = description.strip() |
357 | 85 | 116 | ||
358 | 117 | exclude_packages = [ | ||
359 | 118 | 'beeseek.app.server', | ||
360 | 119 | 'beeseek.docs', | ||
361 | 120 | 'beeseek.testing', | ||
362 | 121 | 'beeseek.tests', | ||
363 | 122 | ] | ||
364 | 123 | |||
365 | 86 | metadata = { | 124 | metadata = { |
366 | 87 | 'name': 'beeseek-peer', | 125 | 'name': 'beeseek-peer', |
367 | 88 | 'version': beeseek.__version__, | 126 | 'version': beeseek.__version__, |
368 | 89 | 127 | ||
369 | === modified file 'testsuite.py' | |||
370 | --- testsuite.py 2009-08-05 16:40:13 +0000 | |||
371 | +++ testsuite.py 2009-08-24 14:52:46 +0000 | |||
372 | @@ -130,6 +130,9 @@ | |||
373 | 130 | for test_case in testlist: | 130 | for test_case in testlist: |
374 | 131 | test_case.run(run_dependencies) | 131 | test_case.run(run_dependencies) |
375 | 132 | testing.Logger.finish() | 132 | testing.Logger.finish() |
376 | 133 | if testing.Logger.failures or testing.Logger.errors: | ||
377 | 134 | sys.exit(1) | ||
378 | 135 | sys.exit(0) | ||
379 | 133 | 136 | ||
380 | 134 | 137 | ||
381 | 135 | if __name__ == '__main__': | 138 | if __name__ == '__main__': |
The new code in this branch helps both users and developers when creating packages. It improves the build process in different ways:
setup.py:
1. Exclude files and directories that are not needed (test files and API documentation).
2. If given, use the --root option instead of --prefix to install data.
Makefile:
1. Avoid the re-build of files already created.
The Makefile also has new commands to create four different types of archives: tar, tar.gz, tar.bz2, zip.
This branch is needed for the creation of distribution packages too.