source: soft/build_system/build_system/repsys/trunk/RepSys/simplerpm.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: 584 bytes
Line 
1#!/usr/bin/python
2from RepSys.util import execcmd
3
4class SRPM:
5    def __init__(self, filename):
6        self.filename = filename
7        self._getinfo()
8
9    def _getinfo(self):
10        cmdstr = "rpm -qp --qf '%%{name} %%{epoch} %%{release} %%{version}' %s"
11        status, output = execcmd(cmdstr % self.filename)
12        self.name, self.epoch, self.release, self.version = output.split()
13        if self.epoch == "(none)":
14            self.epoch = None
15
16    def unpack(self, topdir):
17        execcmd("rpm -i --define '_topdir %s' %s" % (topdir, self.filename))
18
19# vim:et:ts=4:sw=4
Note: See TracBrowser for help on using the repository browser.