source: soft/build_system/build_system/repsys/tags/V1_6_17_1/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: 1.1 KB
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    -T FILE  %changelog template file to be used
19    -h       Show this message
20
21Examples:
22    repsys rpmlog https://repos/snapshot/python
23"""
24
25def parse_options():
26    parser = OptionParser(help=HELP)
27    parser.add_option("-r", dest="revision")
28    parser.add_option("-n", dest="size", type="int")
29    parser.add_option("-T", "--template", dest="template", type="string")
30    opts, args = parser.parse_args()
31    if len(args) != 1:
32        raise Error, "invalid arguments"
33    opts.pkgdirurl = default_parent(args[0])
34    return opts
35
36def rpmlog(pkgdirurl, revision, size, template):
37    sys.stdout.write(svn2rpm(pkgdirurl, revision, size, template=template))
38
39def main():
40    do_command(parse_options, rpmlog)
41
42# vim:sw=4:ts=4:et
Note: See TracBrowser for help on using the repository browser.