1
# properties.py -- Properties of a build
2
# Copyright (C) 2006 James Westby <jw+debian@jameswestby.net>
4
# This file is part of bzr-builddeb.
6
# bzr-builddeb is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
11
# bzr-builddeb is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with bzr-builddeb; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
class BuildProperties(object):
23
"""Properties of this specific build"""
25
def __init__(self, changelog, build_dir, tarball_dir, top_level):
26
self._changelog = changelog
27
self._build_dir = build_dir
28
self._tarball_dir = tarball_dir
29
self._top_level = top_level
32
return self._changelog.package
34
def upstream_version(self):
35
return self._changelog.upstream_version
37
def debian_version(self):
38
return self._changelog.debian_version
40
def full_version(self):
41
return self._changelog.full_version
43
def full_version_no_epoch(self):
44
if self._changelog.debian_version is None:
45
return self.upstream_version()
46
return self.upstream_version() + "-" + self.debian_version()
49
return self._build_dir
51
def source_dir(self, relative=True):
53
return os.path.join(self.build_dir(),
54
self.package()+"-"+self.upstream_version())
56
return self.package()+"-"+self.upstream_version()
58
def tarball_dir(self):
59
return self._tarball_dir
62
return self._top_level
64
# vim: ts=2 sts=2 sw=2