Mercurial > treepkg
annotate recipes/kde/enterprise/generic.py @ 440:383d23c6bfde
Merged revisions 346-386 via svnmerge from
svn+ssh://svn.wald.intevation.org/treepkg/branches/treepkg-status
........
r346 | bricks | 2010-07-07 17:40:48 +0200 (Mi, 07 Jul 2010) | 2 lines
added classed for treepkg status xml generation
........
r347 | bricks | 2010-07-08 12:07:39 +0200 (Do, 08 Jul 2010) | 10 lines
renamed new status dir to info because of a naming conflict with status.py
let the user specify a treepkg name in the config
the name is propagated to PackagerGroup
[treepkg]
name: <treepkgname>
becomes:
pg = PackagerGroup(...)
pg.name
........
r348 | bricks | 2010-07-08 15:25:07 +0200 (Do, 08 Jul 2010) | 3 lines
moved test file to test main dir
fixed missing : after def statement
........
r349 | bricks | 2010-07-08 17:59:52 +0200 (Do, 08 Jul 2010) | 2 lines
added treepkg_dir andd tracks_dir attributes to PackageGroup
........
r350 | bricks | 2010-07-08 18:00:32 +0200 (Do, 08 Jul 2010) | 2 lines
changed <millpath> to <trackspath>
........
r351 | bricks | 2010-07-08 18:08:39 +0200 (Do, 08 Jul 2010) | 2 lines
check if config file exists to get usefull error output
........
r352 | bricks | 2010-07-08 18:11:13 +0200 (Do, 08 Jul 2010) | 2 lines
write first info about tracks
........
r353 | bricks | 2010-07-09 12:20:49 +0200 (Fr, 09 Jul 2010) | 2 lines
get all log files
........
r354 | bricks | 2010-07-09 14:42:42 +0200 (Fr, 09 Jul 2010) | 2 lines
added md5sum function
........
r355 | bricks | 2010-07-09 15:15:15 +0200 (Fr, 09 Jul 2010) | 4 lines
implemented nearly all info
only arch and os info are missing
........
r356 | bricks | 2010-07-09 16:19:17 +0200 (Fr, 09 Jul 2010) | 2 lines
Bugfix: source was not defined
........
r357 | bricks | 2010-07-09 16:44:52 +0200 (Fr, 09 Jul 2010) | 3 lines
fixed some typos
added missing add_checksum methond
........
r358 | bricks | 2010-07-09 17:06:15 +0200 (Fr, 09 Jul 2010) | 2 lines
fixed status line for revision
........
r359 | bricks | 2010-07-12 14:10:34 +0200 (Mo, 12 Jul 2010) | 2 lines
let the user specify num revisions that should be shown in the info
........
r360 | bricks | 2010-07-12 14:21:39 +0200 (Mo, 12 Jul 2010) | 2 lines
missed in last commit
........
r361 | bricks | 2010-07-12 17:06:22 +0200 (Mo, 12 Jul 2010) | 2 lines
add os config statement
........
r362 | bricks | 2010-07-12 17:47:42 +0200 (Mo, 12 Jul 2010) | 3 lines
moved packages and logs to revision tag
implemented os and arch info
........
r363 | bricks | 2010-07-13 14:23:28 +0200 (Di, 13 Jul 2010) | 2 lines
updated test readconfig for os config variable
........
r364 | bricks | 2010-07-13 14:24:14 +0200 (Di, 13 Jul 2010) | 2 lines
moved common publish functions to a seperate module
........
r365 | bricks | 2010-07-13 16:26:11 +0200 (Di, 13 Jul 2010) | 2 lines
moved arch info to each package info
........
r366 | bricks | 2010-07-13 18:46:17 +0200 (Di, 13 Jul 2010) | 2 lines
inital checkin for new publishpackages processing
........
r367 | bricks | 2010-07-21 17:52:15 +0200 (Mi, 21 Jul 2010) | 2 lines
implemented parsing from xml string
........
r368 | bricks | 2010-07-22 12:17:42 +0200 (Do, 22 Jul 2010) | 2 lines
copy binary-all packages in all binary-xyz dirs
........
r369 | bricks | 2010-07-22 12:26:40 +0200 (Do, 22 Jul 2010) | 2 lines
fixed small bugs
........
r370 | bricks | 2010-07-22 13:02:36 +0200 (Do, 22 Jul 2010) | 2 lines
added a new root element which is called TreepkgRoot for Treepkg Info classes
........
r371 | bricks | 2010-07-22 13:09:52 +0200 (Do, 22 Jul 2010) | 3 lines
fixed some small issues
remember: run pychecker BEFORE the commit
........
r372 | bricks | 2010-07-22 18:01:43 +0200 (Do, 22 Jul 2010) | 2 lines
improved publishdebianpackages and fixed a lot of bugs in the xml info parsing part
........
r373 | bricks | 2010-07-23 18:40:38 +0200 (Fr, 23 Jul 2010) | 2 lines
implemented CacheDb to store copied Packages from build host
........
r374 | bricks | 2010-07-26 10:28:48 +0200 (Mo, 26 Jul 2010) | 2 lines
moved data handling in publishdebianpackages into seperate module
........
r375 | bricks | 2010-07-26 11:42:07 +0200 (Mo, 26 Jul 2010) | 2 lines
fixed some typos
........
r376 | bricks | 2010-07-26 12:12:40 +0200 (Mo, 26 Jul 2010) | 2 lines
first version of incremental copying debian packages to cachedir
........
r377 | bricks | 2010-07-26 14:58:50 +0200 (Mo, 26 Jul 2010) | 2 lines
incremental copying only changed debian packages
........
r378 | bricks | 2010-07-26 15:39:10 +0200 (Mo, 26 Jul 2010) | 3 lines
use md5 instead of hashlib module
(md5 is deprecated in favour of hashlib in python 2.5)
........
r379 | bricks | 2010-07-26 15:46:19 +0200 (Mo, 26 Jul 2010) | 2 lines
make treepkg compatible to python 2.4
........
r380 | bricks | 2010-07-26 15:50:49 +0200 (Mo, 26 Jul 2010) | 2 lines
fixed last commit (db instead of sqlite3)
........
r381 | bricks | 2010-07-27 10:54:15 +0200 (Di, 27 Jul 2010) | 2 lines
fixed wrong import statement
........
r382 | bricks | 2010-07-27 10:54:34 +0200 (Di, 27 Jul 2010) | 2 lines
removed unnecessary debug output
........
r383 | bricks | 2010-07-27 18:28:22 +0200 (Di, 27 Jul 2010) | 2 lines
check if upload hook is empty
........
r384 | bricks | 2010-07-28 09:35:21 +0200 (Mi, 28 Jul 2010) | 2 lines
run rsync only an arch dirs that are present in the current treepkg
........
r385 | bricks | 2010-07-28 09:35:54 +0200 (Mi, 28 Jul 2010) | 2 lines
add helper tool to list content of a cache db
........
r386 | bricks | 2010-07-28 10:33:48 +0200 (Mi, 28 Jul 2010) | 3 lines
fixed a typo
regex fails if option is empty
........
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Fri, 06 Aug 2010 13:28:47 +0000 |
parents | 51c447a6792e |
children | 31b64ebe4b42 |
rev | line source |
---|---|
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
1 # Copyright (C) 2007 - 2010 by Intevation GmbH |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
2 # Authors: |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
3 # Bernhard Herzog <bh@intevation.de> |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
4 # Bjoern Ricks <bjoern.ricks@intevation.de> |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
5 # |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
6 # This program is free software under the GPL (>=v2) |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
7 # Read the file COPYING coming with the software for details. |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
8 |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
9 """Base classes for all kde entperprise packagers""" |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
10 |
286
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
11 import re |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
12 import time |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
13 import logging |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
14 |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
15 import treepkg.packager |
286
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
16 import treepkg.subversion as subversion |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
17 |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
18 |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
19 class SourcePackager(treepkg.packager.SourcePackager): |
275
c0cbd133b607
Define changemsg_template in BaseSourcePackager and not in the kdepim
Bernhard Herzog <bh@intevation.de>
parents:
274
diff
changeset
|
20 |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
21 def __init__(self, *args, **kw): |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
22 super(SourcePackager, self).__init__(*args, **kw) |
283
cd10b835d9b8
kdepim recipes: introduce a BaseRevisionPackager that allows the track
Bernhard Herzog <bh@intevation.de>
parents:
280
diff
changeset
|
23 self.enterprise_version = (self.parent.pkg_date + "." |
cd10b835d9b8
kdepim recipes: introduce a BaseRevisionPackager that allows the track
Bernhard Herzog <bh@intevation.de>
parents:
280
diff
changeset
|
24 + str(self.revision)) |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
25 |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
26 def determine_package_version(self, directory): |
381
51c447a6792e
merged maemo packager into enterprise packager
Bjoern Ricks <bricks@intevation.de>
parents:
357
diff
changeset
|
27 revision = self.revision |
51c447a6792e
merged maemo packager into enterprise packager
Bjoern Ricks <bricks@intevation.de>
parents:
357
diff
changeset
|
28 rules_revision = self.parent.rules_revision |
51c447a6792e
merged maemo packager into enterprise packager
Bjoern Ricks <bricks@intevation.de>
parents:
357
diff
changeset
|
29 pkg_revision = self.parent.pkg_revision |
51c447a6792e
merged maemo packager into enterprise packager
Bjoern Ricks <bricks@intevation.de>
parents:
357
diff
changeset
|
30 pkg_date = self.parent.pkg_date |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
31 enterprise_version = self.enterprise_version |
381
51c447a6792e
merged maemo packager into enterprise packager
Bjoern Ricks <bricks@intevation.de>
parents:
357
diff
changeset
|
32 |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
33 return self.track.version_template % locals() |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
34 |
276
f3dee156e3e3
Add pkgbaseversion parameter to the prepare_sources_for_tarball method
Bernhard Herzog <bh@intevation.de>
parents:
275
diff
changeset
|
35 def prepare_sources_for_tarball(self, pkgbasedir, pkgbaseversion): |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
36 self.update_version_numbers(pkgbasedir) |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
37 |
274
2676abfc0e1d
Refactoring: Implement do_package in treepkg.packager.SourcePackager.
Bernhard Herzog <bh@intevation.de>
parents:
273
diff
changeset
|
38 def update_version_numbers(self, pkgbasedir): |
2676abfc0e1d
Refactoring: Implement do_package in treepkg.packager.SourcePackager.
Bernhard Herzog <bh@intevation.de>
parents:
273
diff
changeset
|
39 """Updates the version numbers in the code in pkgbasedir. |
2676abfc0e1d
Refactoring: Implement do_package in treepkg.packager.SourcePackager.
Bernhard Herzog <bh@intevation.de>
parents:
273
diff
changeset
|
40 The default implementation does nothing. Derived classes should |
2676abfc0e1d
Refactoring: Implement do_package in treepkg.packager.SourcePackager.
Bernhard Herzog <bh@intevation.de>
parents:
273
diff
changeset
|
41 override this method if necessary. |
2676abfc0e1d
Refactoring: Implement do_package in treepkg.packager.SourcePackager.
Bernhard Herzog <bh@intevation.de>
parents:
273
diff
changeset
|
42 """ |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
43 |
381
51c447a6792e
merged maemo packager into enterprise packager
Bjoern Ricks <bricks@intevation.de>
parents:
357
diff
changeset
|
44 def get_change_msg(self): |
51c447a6792e
merged maemo packager into enterprise packager
Bjoern Ricks <bricks@intevation.de>
parents:
357
diff
changeset
|
45 return self.changemsg_template % dict(revision=self.revision, |
51c447a6792e
merged maemo packager into enterprise packager
Bjoern Ricks <bricks@intevation.de>
parents:
357
diff
changeset
|
46 pkg_date=self.parent.pkg_date, |
51c447a6792e
merged maemo packager into enterprise packager
Bjoern Ricks <bricks@intevation.de>
parents:
357
diff
changeset
|
47 rules_revision=self.parent.rules_revision) |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
48 |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
49 class RevisionPackager(treepkg.packager.RevisionPackager): |
283
cd10b835d9b8
kdepim recipes: introduce a BaseRevisionPackager that allows the track
Bernhard Herzog <bh@intevation.de>
parents:
280
diff
changeset
|
50 |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
51 source_packager_cls = SourcePackager |
301
3fcebc5cf93c
Do not require subclassing of
Bernhard Herzog <bh@intevation.de>
parents:
293
diff
changeset
|
52 |
283
cd10b835d9b8
kdepim recipes: introduce a BaseRevisionPackager that allows the track
Bernhard Herzog <bh@intevation.de>
parents:
280
diff
changeset
|
53 def __init__(self, *args, **kw): |
cd10b835d9b8
kdepim recipes: introduce a BaseRevisionPackager that allows the track
Bernhard Herzog <bh@intevation.de>
parents:
280
diff
changeset
|
54 self.pkg_date = kw.pop("pkg_date", |
cd10b835d9b8
kdepim recipes: introduce a BaseRevisionPackager that allows the track
Bernhard Herzog <bh@intevation.de>
parents:
280
diff
changeset
|
55 time.strftime("%Y%m%d", time.localtime())) |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
56 super(RevisionPackager, self).__init__(*args, **kw) |
283
cd10b835d9b8
kdepim recipes: introduce a BaseRevisionPackager that allows the track
Bernhard Herzog <bh@intevation.de>
parents:
280
diff
changeset
|
57 |
cd10b835d9b8
kdepim recipes: introduce a BaseRevisionPackager that allows the track
Bernhard Herzog <bh@intevation.de>
parents:
280
diff
changeset
|
58 |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
59 class PackageTrack(treepkg.packager.PackageTrack): |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
60 |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
61 revision_packager_cls = RevisionPackager |
309
3749b8285b93
Do not require subclassing of recipes.kde_enterprise_3_5.base.BasePackageTrack.
Bernhard Herzog <bh@intevation.de>
parents:
301
diff
changeset
|
62 |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
63 extra_config_desc = [("tags_url", str, ""), |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
64 ("tags_pattern", str, ""), |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
65 ("tags_subdir", str, ""), |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
66 ("tags_rules_subdir", str, "")] |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
67 |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
68 def __init__(self, *args, **kw): |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
69 tags_url = kw.pop("tags_url") |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
70 tags_pattern = kw.pop("tags_pattern") |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
71 tags_subdir = kw.pop("tags_subdir") |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
72 tags_rules_subdir = kw.pop("tags_rules_subdir") |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
73 super(PackageTrack, self).__init__(*args, **kw) |
286
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
74 self.tag_detector = subversion.TagDetector(tags_url, tags_pattern, |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
75 tags_subdir) |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
76 self.tag_rules_detector = subversion.TagDetector(tags_url, tags_pattern, |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
77 tags_rules_subdir) |
355
8a07fc5e15b3
added some logging output
Bjoern Ricks <bricks@intevation.de>
parents:
354
diff
changeset
|
78 self.found_tag_rules = False |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
79 if tags_rules_subdir: |
355
8a07fc5e15b3
added some logging output
Bjoern Ricks <bricks@intevation.de>
parents:
354
diff
changeset
|
80 self.found_tag_rules = True |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
81 |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
82 def packager_for_new_revision(self): |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
83 logging.info("Checking tags") |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
84 self.tag_url = None |
355
8a07fc5e15b3
added some logging output
Bjoern Ricks <bricks@intevation.de>
parents:
354
diff
changeset
|
85 self.use_tag_rules = self.found_tag_rules |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
86 tag_url, tag_revision = self.tag_detector.newest_tag_revision() |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
87 tag_rules_url, tag_rules_revision = self.tag_rules_detector.newest_tag_revision() |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
88 logging.info("Found: %s: %s", tag_url, tag_revision) |
355
8a07fc5e15b3
added some logging output
Bjoern Ricks <bricks@intevation.de>
parents:
354
diff
changeset
|
89 logging.info("Found rules: %s: %s", tag_rules_url, tag_rules_revision) |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
90 if self.use_tag_rules and tag_rules_url is None: |
355
8a07fc5e15b3
added some logging output
Bjoern Ricks <bricks@intevation.de>
parents:
354
diff
changeset
|
91 self.use_tag_rules = False # maybe it's better to raise an exception |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
92 if tag_url is not None: |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
93 if not self.use_tag_rules: |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
94 tag_rules_revision = self.rules_working_copy.last_changed_revision() |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
95 revision = (tag_revision, tag_rules_revision) |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
96 logging.info("New revision is %s", revision) |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
97 if revision not in self.get_revision_numbers(): |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
98 logging.info("Revision %s has not been packaged yet", |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
99 revision) |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
100 self.tag_url = tag_url |
280
d2382953b2c8
When building a tagged revision, make sure to explicitly use the
Bernhard Herzog <bh@intevation.de>
parents:
276
diff
changeset
|
101 self.tag_revision = tag_revision |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
102 self.tag_rules_url = tag_rules_url |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
103 self.tag_rules_revision = tag_rules_revision |
286
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
104 tag_date, tag_change_count = self.tag_pkg_parameters(tag_url) |
293
faeeac2c4c71
Replace debrevision_prefix with pkg_revision_template. Their meaning is
Bernhard Herzog <bh@intevation.de>
parents:
286
diff
changeset
|
105 pkg_revision = (self.pkg_revision_template |
337
781074885633
Check in of local Enterprise recipe changes
Andre Heinecke <aheinecke@intevation.de>
parents:
314
diff
changeset
|
106 % dict(pkg_revision=tag_change_count, |
781074885633
Check in of local Enterprise recipe changes
Andre Heinecke <aheinecke@intevation.de>
parents:
314
diff
changeset
|
107 rules_revision=revision[1])) |
286
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
108 return self.revision_packager_cls(self, tag=tag_url, |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
109 pkg_revision=pkg_revision, |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
110 pkg_date=tag_date, |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
111 *revision) |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
112 else: |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
113 logging.info("Revision %s has already been packaged.", |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
114 revision) |
357
eb6445552640
added a small comment about the behaviour of this packager
Bjoern Ricks <bricks@intevation.de>
parents:
355
diff
changeset
|
115 |
eb6445552640
added a small comment about the behaviour of this packager
Bjoern Ricks <bricks@intevation.de>
parents:
355
diff
changeset
|
116 # tag has been built -> build trunk |
eb6445552640
added a small comment about the behaviour of this packager
Bjoern Ricks <bricks@intevation.de>
parents:
355
diff
changeset
|
117 # don't use rules from tags for trunk |
354
0970a3cca4a6
only export debian dir from tag if a tag is build
Bjoern Ricks <bricks@intevation.de>
parents:
350
diff
changeset
|
118 self.use_tag_rules = False |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
119 return super(PackageTrack, self).packager_for_new_revision() |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
120 |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
121 def export_sources(self, to_dir): |
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
122 if self.tag_url is not None: |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
123 logging.info("Exporting sources for tarball from %r to %r", |
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
124 self.tag_url, to_dir) |
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
125 self.working_copy.export_tag(self.tag_url, to_dir, |
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
126 revision=self.tag_revision) |
271
12facd1b5f19
Implement tag detection for the KDEPIM enterprise 3.5 packages. This is
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
127 else: |
314
2c345bfbfb90
Create generic kde enterprise packager by copying and adapting
Bernhard Herzog <bh@intevation.de>
parents:
309
diff
changeset
|
128 super(PackageTrack, self).export_sources(to_dir) |
286
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
129 |
349
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
130 def copy_debian_directory(self, to_dir): |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
131 if self.use_tag_rules: |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
132 logging.info("Exporting debian package description from %s to %s", |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
133 self.tag_rules_url, to_dir) |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
134 self.rules_working_copy.export_tag(self.tag_rules_url, to_dir) |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
135 else: |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
136 super(PackageTrack, self).copy_debian_directory(to_dir) |
ae68f75f0e71
treepkg is able to use package descriptions from tags now
Bjoern Ricks <bricks@intevation.de>
parents:
337
diff
changeset
|
137 |
286
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
138 def tag_pkg_parameters(self, tag_url): |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
139 match = re.search(r"/enterprise[^.]*\.[^.]*\." |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
140 r"(?P<date>[0-9]{8})\.(?P<baserev>[0-9]+)/", |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
141 tag_url) |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
142 if match: |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
143 date = match.group("date") |
350
b41f54880572
removed obsolete cast to int
Bjoern Ricks <bricks@intevation.de>
parents:
349
diff
changeset
|
144 baserev = match.group("baserev") |
286
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
145 xml_log = subversion.log_xml(tag_url, baserev) |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
146 revisions = subversion.extract_tag_revisions(xml_log) |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
147 tag_change_count = len(revisions) |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
148 return (date, tag_change_count) |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
149 else: |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
150 raise RuntimeError("Cannot determine tag parameters from %r" |
4376c5315c72
kdepim 3.5 recipes: Use the official tag date as the date in the package
Bernhard Herzog <bh@intevation.de>
parents:
283
diff
changeset
|
151 % tag_url) |