Mercurial > treepkg
annotate recipes/kde_enterprise_3_5/kdepim.py @ 310:26c15a0f0e52
When stopping because of an error, do not raise the exception again as
it leads to confusing double tracebacks in the log. Instead, simply log
the reason for the stopping and stop in the same way a stop instruction
is handled.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Wed, 02 Dec 2009 14:46:37 +0000 |
parents | 860bb7269caa |
children |
rev | line source |
---|---|
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
161
diff
changeset
|
1 # Copyright (C) 2007, 2008, 2009 by Intevation GmbH |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
2 # Authors: |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
3 # Bernhard Herzog <bh@intevation.de> |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
4 # |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
5 # This program is free software under the GPL (>=v2) |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
6 # Read the file COPYING coming with the software for details. |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
7 |
159
3f2ec4314855
Changed matching string enterprise->enterprise35, so it matches
Bernhard Reiter <bernhard@intevation.de>
parents:
132
diff
changeset
|
8 """Packager that builds KDE-PIM debian packages from the enterprise35 branch. |
3f2ec4314855
Changed matching string enterprise->enterprise35, so it matches
Bernhard Reiter <bernhard@intevation.de>
parents:
132
diff
changeset
|
9 """ |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
10 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
11 import os |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
12 import time |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
13 import re |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
14 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
15 import treepkg.util |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
16 import treepkg.packager |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
17 |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
161
diff
changeset
|
18 import base |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
19 |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
161
diff
changeset
|
20 class SourcePackager(base.BaseSourcePackager): |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
21 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
22 pkg_basename = "kdepim" |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
23 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
24 def kdepim_version(self, directory): |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
25 """Determine the kdepim version. |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
26 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
27 The version is taken from the kdepim.lsm file. |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
28 """ |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
29 return treepkg.util.extract_lsm_version(os.path.join(directory, |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
30 "kdepim.lsm")) |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
31 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
32 def determine_package_version(self, directory): |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
33 enterprise_version = self.enterprise_version |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
34 kdepimversion = self.kdepim_version(directory) |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
35 version_template = "%(kdepimversion)s.enterprise.0.%(enterprise_version)s" |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
36 return version_template % locals() |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
37 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
38 def update_version_numbers(self, pkgbasedir): |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
39 """Overrides the inherited method to update version numbers in the code |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
40 """ |
159
3f2ec4314855
Changed matching string enterprise->enterprise35, so it matches
Bernhard Reiter <bernhard@intevation.de>
parents:
132
diff
changeset
|
41 versionstring = "(enterprise35 %s)" % self.enterprise_version |
161
710538908609
kdepim recipe: raise an error if not all version replacements could be done
Bernhard Herzog <bh@intevation.de>
parents:
159
diff
changeset
|
42 failed = [] |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
43 for versionfile in ["kmail/kmversion.h", "kontact/src/main.cpp", |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
44 "korganizer/version.h"]: |
161
710538908609
kdepim recipe: raise an error if not all version replacements could be done
Bernhard Herzog <bh@intevation.de>
parents:
159
diff
changeset
|
45 if not treepkg.util.replace_in_file(os.path.join(pkgbasedir, |
710538908609
kdepim recipe: raise an error if not all version replacements could be done
Bernhard Herzog <bh@intevation.de>
parents:
159
diff
changeset
|
46 versionfile), |
710538908609
kdepim recipe: raise an error if not all version replacements could be done
Bernhard Herzog <bh@intevation.de>
parents:
159
diff
changeset
|
47 "\(enterprise35 ([^)]*)\)", |
710538908609
kdepim recipe: raise an error if not all version replacements could be done
Bernhard Herzog <bh@intevation.de>
parents:
159
diff
changeset
|
48 versionstring): |
710538908609
kdepim recipe: raise an error if not all version replacements could be done
Bernhard Herzog <bh@intevation.de>
parents:
159
diff
changeset
|
49 failed.append(versionfile) |
710538908609
kdepim recipe: raise an error if not all version replacements could be done
Bernhard Herzog <bh@intevation.de>
parents:
159
diff
changeset
|
50 if failed: |
710538908609
kdepim recipe: raise an error if not all version replacements could be done
Bernhard Herzog <bh@intevation.de>
parents:
159
diff
changeset
|
51 raise RuntimeError("kdepim: failed to update version numbers in %s" |
710538908609
kdepim recipe: raise an error if not all version replacements could be done
Bernhard Herzog <bh@intevation.de>
parents:
159
diff
changeset
|
52 % (", ".join(failed),)) |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
53 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
54 |
284
860bb7269caa
kdepim 3.5 recipes: Use the new BaseRevisionPackager
Bernhard Herzog <bh@intevation.de>
parents:
275
diff
changeset
|
55 class RevisionPackager(base.BaseRevisionPackager): |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
56 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
57 source_packager_cls = SourcePackager |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
58 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
59 |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
161
diff
changeset
|
60 class PackageTrack(base.BasePackageTrack): |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
61 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
62 revision_packager_cls = RevisionPackager |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
63 |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
64 svn_external_subdirs = ["admin"] |