source: soft/build_system/build_system/repsys/tags/V1_5_7/RepSys/commands/rpmlog.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: 991 bytes
Line 
1#!/usr/bin/python
2#
3# This program will convert the output of "svn log" to be suitable
4# for usage in an rpm %changelog session.
5#
6from RepSys import Error
7from RepSys.command import *
8from RepSys.log import svn2rpm
9import getopt
10import sys
11
12HELP = """\
13Usage: repsys rpmlog [OPTIONS] REPPKGDIRURL
14
15Options:
16    -r REV   Collect logs from given revision to revision 0
17    -n NUM   Output only last NUM entries
18    -h       Show this message
19
20Examples:
21    repsys rpmlog https://repos/snapshot/python
22"""
23
24def parse_options():
25    parser = OptionParser(help=HELP)
26    parser.add_option("-r", dest="revision")
27    parser.add_option("-n", dest="size", type="int")
28    opts, args = parser.parse_args()
29    if len(args) != 1:
30        raise Error, "invalid arguments"
31    opts.pkgdirurl = default_parent(args[0])
32    return opts
33
34def rpmlog(pkgdirurl, revision, size):
35    sys.stdout.write(svn2rpm(pkgdirurl, revision, size))
36
37def main():
38    do_command(parse_options, rpmlog)
39
40# vim:sw=4:ts=4:et
Note: See TracBrowser for help on using the repository browser.