Mercurial > treepkg
annotate bin/publishpackages.py @ 229:653a45adda50
Prepare for svn managed debian rules directories. So far, the directory
names used for a particular revision were of the form <revision>-1 .
Now the second number (which was always 1 up to now) will become the svn
revision of the debian rules directory. As a first step towards that,
the packager classes now support numbers other than 1 as the second
number in the package directory name.
Update the tests accordingly.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Tue, 13 Jan 2009 13:48:59 +0000 |
parents | ce03e24f6d0f |
children | 55337021fe5b |
rev | line source |
---|---|
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
1 #! /usr/bin/python2.4 |
200
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
2 # Copyright (C) 2007, 2008 by Intevation GmbH |
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
3 # Authors: |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
4 # Bernhard Herzog <bh@intevation.de> |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
5 # |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
6 # This program is free software under the GPL (>=v2) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
7 # Read the file COPYING coming with the software for details. |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
8 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
9 """Publishes selected packages created by treepkg""" |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
10 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
11 import sys |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
12 import os |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
13 import shutil |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
14 from optparse import OptionParser |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
15 from ConfigParser import SafeConfigParser |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
16 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
17 import treepkgcmd |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
18 from treepkg.readconfig import read_config_section |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
19 from treepkg.run import call, capture_output |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
20 from treepkg.cmdexpand import cmdexpand |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
21 from treepkg.util import ensure_directory, listdir_abs |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
22 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
23 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
24 def remove_trailing_slashes(s): |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
25 return s.rstrip("/") |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
26 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
27 def expand_filename(filename): |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
28 """ |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
29 Applies os.path.expanduser and os.path.expandvars to filename |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
30 """ |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
31 return os.path.expandvars(os.path.expanduser(filename)) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
32 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
33 config_desc = ["build_user", "build_host", "build_listpackages", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
34 "publish_user", "publish_host", "publish_apt_archive_update", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
35 ("publish_dir", remove_trailing_slashes), |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
36 ("cachedir", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
37 lambda s: expand_filename(remove_trailing_slashes(s)))] |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
38 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
39 def read_config(filename): |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
40 parser = SafeConfigParser() |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
41 parser.read([filename]) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
42 return read_config_section(parser, "publishpackages", config_desc) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
43 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
44 def parse_commandline(): |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
45 parser = OptionParser() |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
46 parser.set_defaults(config_file=os.path.join(treepkgcmd.topdir, |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
47 "publishpackages.cfg")) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
48 parser.add_option("--config-file", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
49 help=("The configuration file." |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
50 " Default is publishpackages.cfg")) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
51 parser.add_option("--revision", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
52 help=("The revision whose files are to be published." |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
53 " If not given, the latest revision is used")) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
54 parser.add_option("--dist", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
55 help=("The debian distribution name to use on" |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
56 " the publishing system")) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
57 parser.add_option("--section", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
58 help=("The debian distribution section name to use on" |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
59 " the publishing system")) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
60 parser.add_option("--track", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
61 help=("The package track whose files are to be" |
200
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
62 " published. If not given, files of all tracks" |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
63 " will be published")) |
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
64 return parser.parse_args() |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
65 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
66 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
67 def publish_packages_arch(variables, track, revision, dist, section, arch): |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
68 # create web-page on build host |
200
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
69 listpackages_vars = variables.copy() |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
70 |
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
71 if arch == "source": |
200
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
72 listpackages_vars["pkgtype"] = "--source" |
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
73 else: |
200
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
74 listpackages_vars["pkgtype"] = "--binary" |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
75 |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
76 if track: |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
77 listpackages_vars["track"] = ["--track", track] |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
78 else: |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
79 listpackages_vars["track"] = [] |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
80 |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
81 if revision: |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
82 listpackages_vars["revision"] = ["--revision", revision] |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
83 else: |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
84 listpackages_vars["revision"] = [] |
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
85 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
86 files = capture_output(cmdexpand("ssh $build_user$@$build_host" |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
87 " $build_listpackages" |
200
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
88 " @track @revision $pkgtype", |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
89 **listpackages_vars)).strip().split("\n") |
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
90 |
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
91 # scp the packages to the cache dir |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
92 cachedir = variables["cachedir"] |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
93 shutil.rmtree(cachedir, ignore_errors=True) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
94 ensure_directory(cachedir) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
95 userhost = "%(build_user)s@%(build_host)s:" % variables |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
96 call(cmdexpand("scp @files $cachedir/", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
97 files = [userhost + filename for filename in files], |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
98 **variables)) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
99 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
100 # copy the packages to the remote publishing host. Create the |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
101 # destination directory if it doesn't exist yet. |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
102 destdir = os.path.join(variables["publish_dir"], dist, section, arch) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
103 call(cmdexpand("ssh $publish_user$@$publish_host mkdir --parents $destdir", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
104 destdir=destdir, **variables)) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
105 call(cmdexpand("scp @files $publish_user$@$publish_host:$destdir", |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
106 files=listdir_abs(cachedir), destdir=destdir, |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
107 **variables)) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
108 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
109 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
110 def publish_packages(config_filename, track, revision, dist, section): |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
111 config = read_config(config_filename) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
112 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
113 for arch in ["binary-i386", "source"]: |
200
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
114 publish_packages_arch(config, track, revision, dist, section, arch) |
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
115 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
116 # update apt archive |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
117 call(cmdexpand("ssh $publish_user$@$publish_host" |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
118 " $publish_apt_archive_update", |
200
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
119 **config)) |
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
120 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
121 def main(): |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
122 options, args = parse_commandline() |
200
ce03e24f6d0f
publishpackages command: if --track is omitted, publish files of all tracks.
Bernhard Herzog <bh@intevation.de>
parents:
89
diff
changeset
|
123 for required_opt in ["dist", "section"]: |
89
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
124 if getattr(options, required_opt) is None: |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
125 print >>sys.stderr, "The --%s option must be given" % required_opt |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
126 sys.exit(1) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
127 publish_packages(options.config_file, options.track, options.revision, |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
128 options.dist, options.section) |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
129 |
3caf4a5ecbf0
Add scripts that help publish the packages produced by the tree packager
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
130 main() |