aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys/commands/upload.py
blob: 49840a623b16eff759a7cd750bad47b57b9865fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from RepSys import Error
from RepSys.command import *
from RepSys.rpmutil import upload

HELP = """\
Usage: repsys upload [OPTIONS] [PATH]

Upload a given file to the binary sources repository.

It will also update the contents of the 'sources' file and left it
uncommited.

If the path is a directory, all the contents of the directory will be
uploaded or removed.

Options:
    -a      find all possible binary sources inside PATH
    -c      automatically commit the 'sources' file
    -A      do not 'svn add' the 'sources' file
    -h      help

"""

def parse_options():
    parser = OptionParser(help=HELP)
    parser.add_option("-c", dest="commit", default=False,
            action="store_true")
    parser.add_option("-A", dest="addsources", default=True,
            action="store_false")
    parser.add_option("-a", dest="auto", default=False, action="store_true")
    opts, args = parser.parse_args()
    if len(args):
        opts.paths = args
    else:
        raise Error, "you need to provide a path"
    return opts

def main():
    do_command(parse_options, upload)