Mercurial > treepkg
annotate recipes/kde/enterprise/tags.py @ 515:e5698096f1ec
fix indentation
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Wed, 10 Nov 2010 11:35:47 +0000 |
parents | e44c9c3f69f8 |
children | e90a21cfbc3b |
rev | line source |
---|---|
358
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
1 # Copyright (C) 2007 - 2010 by Intevation GmbH |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
2 # Authors: |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
3 # Bernhard Herzog <bh@intevation.de> |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
4 # Bjoern Ricks <bjoern.ricks@intevation.de> |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
5 # |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
6 # This program is free software under the GPL (>=v2) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
7 # Read the file COPYING coming with the software for details. |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
8 |
499
e44c9c3f69f8
consolidate enterprise packagers
Bjoern Ricks <bricks@intevation.de>
parents:
498
diff
changeset
|
9 """PackageTrack for kde entperprise tag only builds""" |
358
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
10 |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
11 import logging |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
12 |
499
e44c9c3f69f8
consolidate enterprise packagers
Bjoern Ricks <bricks@intevation.de>
parents:
498
diff
changeset
|
13 import recipes.kde.enterprise.generic as enterprise |
358
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
14 |
499
e44c9c3f69f8
consolidate enterprise packagers
Bjoern Ricks <bricks@intevation.de>
parents:
498
diff
changeset
|
15 class PackageTrack(enterprise.PackageTrack): |
358
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
16 |
499
e44c9c3f69f8
consolidate enterprise packagers
Bjoern Ricks <bricks@intevation.de>
parents:
498
diff
changeset
|
17 """In contrast to recipes.kde.enterprise.generic.PackageTrack |
e44c9c3f69f8
consolidate enterprise packagers
Bjoern Ricks <bricks@intevation.de>
parents:
498
diff
changeset
|
18 this PackageTrack either builds trunk or newest tag""" |
e44c9c3f69f8
consolidate enterprise packagers
Bjoern Ricks <bricks@intevation.de>
parents:
498
diff
changeset
|
19 |
e44c9c3f69f8
consolidate enterprise packagers
Bjoern Ricks <bricks@intevation.de>
parents:
498
diff
changeset
|
20 revision_packager_cls = enterprise.RevisionPackager |
358
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
21 |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
22 def __init__(self, *args, **kw): |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
23 super(PackageTrack, self).__init__(*args, **kw) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
24 |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
25 def packager_for_new_revision(self): |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
26 logging.info("Checking tags") |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
27 self.tag_url = None |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
28 self.use_tag_rules = self.found_tag_rules |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
29 tag_url, tag_revision = self.tag_detector.newest_tag_revision() |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
30 tag_rules_url, tag_rules_revision = self.tag_rules_detector.newest_tag_revision() |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
31 logging.info("Found: %s: %s", tag_url, tag_revision) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
32 logging.info("Found rules: %s: %s", tag_rules_url, tag_rules_revision) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
33 if self.use_tag_rules and tag_rules_url is None: |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
34 self.use_tag_rules = False # maybe it's better to raise an exception |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
35 if tag_url is not None: |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
36 if not self.use_tag_rules: |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
37 tag_rules_revision = self.rules_working_copy.last_changed_revision() |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
38 revision = (tag_revision, tag_rules_revision) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
39 logging.info("New revision is %s", revision) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
40 if revision not in self.get_revision_numbers(): |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
41 logging.info("Revision %s has not been packaged yet", |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
42 revision) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
43 self.tag_url = tag_url |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
44 self.tag_revision = tag_revision |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
45 self.tag_rules_url = tag_rules_url |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
46 self.tag_rules_revision = tag_rules_revision |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
47 tag_date, tag_change_count = self.tag_pkg_parameters(tag_url) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
48 pkg_revision = (self.pkg_revision_template |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
49 % dict(pkg_revision=tag_change_count, |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
50 rules_revision=revision[1])) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
51 return self.revision_packager_cls(self, tag=tag_url, |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
52 pkg_revision=pkg_revision, |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
53 pkg_date=tag_date, |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
54 *revision) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
55 else: |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
56 logging.info("Revision %s has already been packaged.", |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
57 revision) |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
58 |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
59 else: # tag_url is not set -> build trunk |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
60 # don't use rules from tags for trunk builds |
2524213a6e4f
added packager that is able to build only tags for enterprise builds
Bjoern Ricks <bricks@intevation.de>
parents:
diff
changeset
|
61 self.use_tag_rules = False |
499
e44c9c3f69f8
consolidate enterprise packagers
Bjoern Ricks <bricks@intevation.de>
parents:
498
diff
changeset
|
62 return super(PackageTrack, self).new_revsision_packager() |