bh@287: #! /usr/bin/python bh@287: # Copyright (C) 2007, 2008, 2009 by Intevation GmbH bh@106: # Authors: bh@106: # Bernhard Herzog bh@106: # bh@106: # This program is free software under the GPL (>=v2) bh@106: # Read the file COPYING coming with the software for details. bh@106: bh@106: """Script to partially initialize the tree packager bh@106: bh@106: The script assumes that the config file for the tree packager already bh@106: contains the settings for the individual packagers. This script will at bh@106: least create the base directory for all packagers configured in the bh@106: configuration file and perhaps do other checks and initializations bh@106: depending on the packager classes used. The output indicates what has bh@106: been done and what still needs to be done manually. bh@106: """ bh@106: bh@106: bh@106: import treepkgcmd bh@106: from treepkg.options import create_parser bh@106: from treepkg.packager import create_package_track, PackagerGroup bh@106: from treepkg.readconfig import read_config bh@106: bh@106: bh@106: def init_treepkg(config_file): bh@106: treepkg_opts, packager_opts = read_config(config_file) bh@106: group = PackagerGroup([create_package_track(**opts) bh@106: for opts in packager_opts], bh@106: **treepkg_opts) bh@106: for track in group.get_package_tracks(): bh@106: track.init_treepkg() bh@106: bh@106: bh@106: def parse_commandline(): bh@106: parser = create_parser() bh@106: return parser.parse_args() bh@106: bh@106: bh@106: def main(): bh@106: options, args = parse_commandline() bh@106: init_treepkg(options.config_file) bh@106: bh@106: main()