comparison treepkg/readconfig.py @ 511:e5b66539f893

new variable to set choose the scm for sources and debian dirs svn_url and git_url are now deprecated in favour of url and scm_type added a tag detector for git in kde enterprise packager
author Bjoern Ricks <bricks@intevation.de>
date Tue, 09 Nov 2010 17:20:47 +0000
parents 5fda6768bef6
children 3e08d6546d52
comparison
equal deleted inserted replaced
510:1f04bd88fca3 511:e5b66539f893
25 25
26 26
27 def convert_subversion_subset(raw): 27 def convert_subversion_subset(raw):
28 """Converts the string representation an svn subset into internal form 28 """Converts the string representation an svn subset into internal form
29 The format in the config file is typically: 29 The format in the config file is typically:
30 svn_url: svn://example.com/repository/trunk 30 url: svn://example.com/repository/trunk
31 svn_subset: -N . 31 svn_subset: -N .
32 subdir1 32 subdir1
33 subdir2 33 subdir2
34 34
35 Each line of the svn_subset value consists of an optional flag 35 Each line of the svn_subset value consists of an optional flag
64 return subset 64 return subset
65 65
66 66
67 packager_desc = [ 67 packager_desc = [
68 "name", "base_dir", 68 "name", "base_dir",
69 ("svn_url", str,""), 69 ("url", str, ""),
70 ("svn_url", str, ""),
70 ("svn_subset", convert_subversion_subset, ""), 71 ("svn_subset", convert_subversion_subset, ""),
71 ("svn_externals", shlex.split, ""), 72 ("svn_externals", shlex.split, ""),
72 ("rules_svn_url", str, ""), ("packager_class", str, "treepkg.packager"), 73 ("rules_url", str, ""), ("packager_class", str, "treepkg.packager"),
73 ("root_cmd", shlex.split, "sudo"), "builderconfig", 74 ("root_cmd", shlex.split, "sudo"), "builderconfig",
74 "deb_email", "deb_fullname", ("deb_build_options", str, ""), 75 "deb_email", "deb_fullname", ("deb_build_options", str, ""),
75 ("version_template", str, "%(revision)s"), 76 ("version_template", str, "%(revision)s"),
76 "pkg_revision_template", ("pkg_basename", str, ""), 77 "pkg_revision_template", ("pkg_basename", str, ""),
77 ("handle_dependencies", convert_bool), 78 ("handle_dependencies", convert_bool),
78 ("signing_key_id", str, ""), 79 ("signing_key_id", str, ""),
79 ("changelog_msg_template", str, "Update to revision %(revision)s"), 80 ("changelog_msg_template", str, "Update to revision %(revision)s"),
80 ("git_branch", str,""), 81 ("branch", str,""),
81 ("git_url", str,""),
82 ("os", str, ""), 82 ("os", str, ""),
83 ("builder_cls", str, "PBuilder"), 83 ("builder_cls", str, "PBuilder"),
84 ("status_hook", str, "") 84 ("status_hook", str, "")
85 ] 85 ]
86 86
146 packager_class = "treepkg.packager" 146 packager_class = "treepkg.packager"
147 module = packager.import_packager_module(packager_class) 147 module = packager.import_packager_module(packager_class)
148 desc = packager_desc + module.PackageTrack.extra_config_desc 148 desc = packager_desc + module.PackageTrack.extra_config_desc
149 packager_options = read_config_section(parser, section, desc, 149 packager_options = read_config_section(parser, section, desc,
150 defaults=vars) 150 defaults=vars)
151 if not packager_options.get("svn_url") \ 151 if not packager_options.get("url") and \
152 and not packager_options.get('git_url'): 152 not packager_options.get("svn_url"):
153 print >>sys.stderr, "Missing repository URL in section %r" \ 153 print >>sys.stderr, "Missing repository URL in section %r" \
154 % (section) 154 % (section)
155 sys.exit(1) 155 sys.exit(1)
156 elif packager_options.get("svn_url") \
157 and packager_options.get('git_url'):
158 print >>sys.stderr, \
159 "Warning: git_url in section %r will be ignored" \
160 % (section)
161 packagers.append(packager_options) 156 packagers.append(packager_options)
162 157
163 # main config 158 # main config
164 treepkg = read_config_section(parser, "treepkg", treepkg_desc) 159 treepkg = read_config_section(parser, "treepkg", treepkg_desc)
165 160
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)