source: soft/build_system/build_system/repsys/tags/V1_6_18/RepSys/commands/co.py @ 1

Last change on this file since 1 was 1, checked in by fasma, 12 years ago

Initial Import from Mandriva's soft revision 224062 and package revision 45733

File size: 799 bytes
Line 
1#!/usr/bin/python
2from RepSys import Error
3from RepSys.command import *
4from RepSys.rpmutil import checkout
5import getopt
6import sys
7
8HELP = """\
9Usage: repsys co [OPTIONS] URL [LOCALPATH]
10
11Options:
12    -r REV  Revision to checkout
13    -h      Show this message
14
15Examples:
16    repsys co http://repos/svn/cnc/snapshot/foo
17    repsys co http://repos/svn/cnc/snapshot/foo foo-pkg
18"""
19
20def parse_options():
21    parser = OptionParser(help=HELP)
22    parser.add_option("-r", dest="revision")
23    opts, args = parser.parse_args()
24    if len(args) not in (1, 2):
25        raise Error, "invalid arguments"
26    opts.pkgdirurl = args[0]
27    if len(args) == 2:
28        opts.path = args[1]
29    else:
30        opts.path = None
31    return opts
32
33def main():
34    do_command(parse_options, checkout)
35
36# vim:et:ts=4:sw=4
Note: See TracBrowser for help on using the repository browser.