source: soft/build_system/build_system/upload/robot/trunk/gen-description.py @ 1

Last change on this file since 1 was 1, checked in by fasma, 13 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# Project         : Mandrake Linux
4# Module          : bin
5# File            : gen-description.py
6# Version         : $Id: gen-description.py 868 2004-07-21 08:31:50Z mandrake $
7# Author          : Frederic Lepied
8# Created On      : Tue Mar  9 21:06:15 2004
9#---------------------------------------------------------------
10
11import Pkg
12import sys
13import rpm
14import time
15
16desc = '''%%package %s
17Updated: %s
18Importance: bugfix
19
20%%pre
21%s
22
23%%description
24%s
25'''
26
27a={}
28
29for p in sys.argv[1:]:
30#    sys.stderr.write("processing %s\n" % p)
31    pkg = Pkg.Pkg(p, '/tmp')
32    name=pkg[rpm.RPMTAG_NAME]
33    changelog=pkg[rpm.RPMTAG_CHANGELOGTEXT][0]
34    description=pkg[rpm.RPMTAG_DESCRIPTION]
35    srpm=pkg[rpm.RPMTAG_SOURCERPM]
36    t=time.ctime(pkg[rpm.RPMTAG_BUILDTIME])
37    if a.has_key(srpm):
38        a[srpm][0] = a[srpm][0] + ' ' + name
39    else:
40         a[srpm] = [name, t, changelog, description]
41
42for srpm in a.keys():
43    p=a[srpm]
44    print desc % (p[0], p[1], p[2], p[3])
45
46# gen-description.py ends here
Note: See TracBrowser for help on using the repository browser.