aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys/commands/patchspec.py
blob: 155ff4ff31eeb7f9ce5f6155503eedc5ba2aa288 (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
#!/usr/bin/python
#
# This program will try to patch a spec file from a given package url.
#
from RepSys import Error
from RepSys.rpmutil import patch_spec
from RepSys.command import *
import getopt
import sys

HELP = """\
Usage: repsys patchspec [OPTIONS] REPPKGURL PATCHFILE

Options:
    -l LOG  Use LOG as log message
    -h      Show this message

Examples:
    repsys patchspec http://repos/svn/cnc/snapshot/foo
"""

def parse_options():
    parser = OptionParser(help=HELP)
    parser.add_option("-l", dest="log", default="")
    opts, args = parser.parse_args()
    if len(args) != 2:
        raise Error, "invalid arguments"
    opts.pkgdirurl = default_parent(args[0])
    opts.patchfile = args[1]
    return opts

def main():
    do_command(parse_options, patch_spec)

# vim:et:ts=4:sw=4