Mercurial > treepkg
comparison runtreepkg.py @ 27:206d63ee310e
cope with unknown packager names in runtreepkg.py
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Wed, 14 Mar 2007 18:22:52 +0100 |
parents | 2bfb84bc4350 |
children | 78cf5f6778ec |
comparison
equal
deleted
inserted
replaced
26:06fba656dde8 | 27:206d63ee310e |
---|---|
6 # This program is free software under the GPL (>=v2) | 6 # This program is free software under the GPL (>=v2) |
7 # Read the file COPYING coming with the software for details. | 7 # Read the file COPYING coming with the software for details. |
8 | 8 |
9 """Starts the tree packager""" | 9 """Starts the tree packager""" |
10 | 10 |
11 import sys | |
11 import os | 12 import os |
12 import logging | 13 import logging |
13 from optparse import OptionParser | 14 from optparse import OptionParser |
14 | 15 |
15 from treepkg.packager import create_package_line, PackagerGroup | 16 from treepkg.packager import create_package_line, PackagerGroup |
41 options, args = parse_commandline() | 42 options, args = parse_commandline() |
42 | 43 |
43 initialize_logging() | 44 initialize_logging() |
44 | 45 |
45 treepkg_opts, packager_opts = read_config(options.config_file) | 46 treepkg_opts, packager_opts = read_config(options.config_file) |
47 | |
46 if args: | 48 if args: |
47 packager_opts = [opts for opts in packager_opts if opts["name"] in args] | 49 packager_opts = [opts for opts in packager_opts if opts["name"] in args] |
48 # check whether we got all of the names in args: | 50 # check whether we got all of the names in args: |
49 for opts in packager_opts: | 51 for opts in packager_opts: |
50 name = opts["name"] | 52 name = opts["name"] |
51 if name in args: | 53 if name in args: |
52 args.remove(name) | 54 args.remove(name) |
53 for name in args: | 55 for name in args: |
54 print >>sys.stderr, "No package lines found named %r" % name | 56 print >>sys.stderr, "No package lines found named %r" % name |
55 group = PackagerGroup([create_package_line(**opts) | 57 |
56 for opts in packager_opts], | 58 if packager_opts: |
57 **treepkg_opts) | 59 group = PackagerGroup([create_package_line(**opts) |
58 if options.once: | 60 for opts in packager_opts], |
59 group.check_package_lines() | 61 **treepkg_opts) |
60 else: | 62 if options.once: |
61 group.run() | 63 group.check_package_lines() |
64 else: | |
65 group.run() | |
62 | 66 |
63 main() | 67 main() |