comparison bin/publishpackages.py @ 249:a3f106580525

Add config settings "distribution" and "section" so that they don't have to be specified when running bin/publishpackages.py most of the time. Add them to demopublishpackages.cfg as well.
author Bernhard Herzog <bh@intevation.de>
date Mon, 09 Mar 2009 16:00:44 +0000
parents 55337021fe5b
children 8052aabada8b
comparison
equal deleted inserted replaced
248:5dd710b167d2 249:a3f106580525
28 """ 28 """
29 Applies os.path.expanduser and os.path.expandvars to filename 29 Applies os.path.expanduser and os.path.expandvars to filename
30 """ 30 """
31 return os.path.expandvars(os.path.expanduser(filename)) 31 return os.path.expandvars(os.path.expanduser(filename))
32 32
33 config_desc = ["build_user", "build_host", "build_listpackages", 33 config_desc = ["distribution", "section",
34 "build_user", "build_host", "build_listpackages",
34 "publish_user", "publish_host", "publish_apt_archive_update", 35 "publish_user", "publish_host", "publish_apt_archive_update",
35 ("publish_dir", remove_trailing_slashes), 36 ("publish_dir", remove_trailing_slashes),
36 ("cachedir", 37 ("cachedir",
37 lambda s: expand_filename(remove_trailing_slashes(s)))] 38 lambda s: expand_filename(remove_trailing_slashes(s)))]
38 39
111 112
112 113
113 def publish_packages(config_filename, track, revision, dist, section): 114 def publish_packages(config_filename, track, revision, dist, section):
114 config = read_config(config_filename) 115 config = read_config(config_filename)
115 116
117 if dist is None:
118 dist = config["distribution"]
119 if section is None:
120 section = config["section"]
121
116 for arch in ["binary-i386", "source"]: 122 for arch in ["binary-i386", "source"]:
117 publish_packages_arch(config, track, revision, dist, section, arch) 123 publish_packages_arch(config, track, revision, dist, section, arch)
118 124
119 # update apt archive 125 # update apt archive
120 call(cmdexpand("ssh $publish_user$@$publish_host" 126 call(cmdexpand("ssh $publish_user$@$publish_host"
121 " $publish_apt_archive_update", 127 " $publish_apt_archive_update",
122 **config)) 128 **config))
123 129
124 def main(): 130 def main():
125 options, args = parse_commandline() 131 options, args = parse_commandline()
126 for required_opt in ["dist", "section"]:
127 if getattr(options, required_opt) is None:
128 print >>sys.stderr, "The --%s option must be given" % required_opt
129 sys.exit(1)
130 publish_packages(options.config_file, options.track, options.revision, 132 publish_packages(options.config_file, options.track, options.revision,
131 options.dist, options.section) 133 options.dist, options.section)
132 134
133 main() 135 main()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)