Mercurial > treepkg
comparison recipes/kde/enterprise/branch_3_5/kdepim.py @ 315:57034905ac4c
Copy the enterprise 3.5 packagers to the refactored kde enterprise
packagers and adapt them to the new base classes.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Thu, 03 Dec 2009 11:19:39 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
314:2c345bfbfb90 | 315:57034905ac4c |
---|---|
1 # Copyright (C) 2007, 2008, 2009 by Intevation GmbH | |
2 # Authors: | |
3 # Bernhard Herzog <bh@intevation.de> | |
4 # | |
5 # This program is free software under the GPL (>=v2) | |
6 # Read the file COPYING coming with the software for details. | |
7 | |
8 """Packager that builds KDE-PIM debian packages from the enterprise35 branch. | |
9 """ | |
10 | |
11 import os | |
12 import time | |
13 import re | |
14 | |
15 import treepkg.util | |
16 import treepkg.packager | |
17 | |
18 import recipes.kde.enterprise.generic as generic | |
19 | |
20 | |
21 class SourcePackager(generic.SourcePackager): | |
22 | |
23 def kdepim_version(self, directory): | |
24 """Determine the kdepim version. | |
25 | |
26 The version is taken from the kdepim.lsm file. | |
27 """ | |
28 return treepkg.util.extract_lsm_version(os.path.join(directory, | |
29 "kdepim.lsm")) | |
30 | |
31 def determine_package_version(self, directory): | |
32 enterprise_version = self.enterprise_version | |
33 kdepimversion = self.kdepim_version(directory) | |
34 version_template = \ | |
35 "%(kdepimversion)s.enterprise.0.%(enterprise_version)s" | |
36 return version_template % locals() | |
37 | |
38 def update_version_numbers(self, pkgbasedir): | |
39 """Overrides the inherited method to update version numbers in the code | |
40 """ | |
41 versionstring = "(enterprise35 %s)" % self.enterprise_version | |
42 failed = [] | |
43 for versionfile in ["kmail/kmversion.h", "kontact/src/main.cpp", | |
44 "korganizer/version.h"]: | |
45 if not treepkg.util.replace_in_file(os.path.join(pkgbasedir, | |
46 versionfile), | |
47 "\(enterprise35 ([^)]*)\)", | |
48 versionstring): | |
49 failed.append(versionfile) | |
50 if failed: | |
51 raise RuntimeError("kdepim: failed to update version numbers in %s" | |
52 % (", ".join(failed),)) | |
53 | |
54 | |
55 class RevisionPackager(generic.RevisionPackager): | |
56 | |
57 source_packager_cls = SourcePackager | |
58 | |
59 | |
60 class PackageTrack(generic.PackageTrack): | |
61 | |
62 revision_packager_cls = RevisionPackager |