Mailinglist Archive: opensuse-buildservice (206 mails)

< Previous Next >
[opensuse-buildservice] osc patch
  • From: Flavio Castelli <fcastelli@xxxxxxxxxx>
  • Date: Wed, 4 Mar 2009 17:14:25 +0100
  • Message-id: <200903041714.26002.fcastelli@xxxxxxxxxx>
Hello, I wrote a small patch for osc.
It simply adds a new variable inside the Linkinfo class. This variable holds
the rev value specified inside the _link files.

I have handled it because an osc plugin I wrote needs this field.

As you can see the code is really simple.

Cheers
Flavio
Index: osc/core.py
===================================================================
--- osc/core.py (revision 6684)
+++ osc/core.py (working copy)
@@ -202,6 +202,7 @@
self.lsrcmd5 = None
self.srcmd5 = None
self.error = None
+ self.rev = None

def read(self, linkinfo_node):
"""read in the linkinfo metadata from the <linkinfo> element passed as
@@ -216,6 +217,7 @@
self.lsrcmd5 = linkinfo_node.get('lsrcmd5')
self.srcmd5 = linkinfo_node.get('srcmd5')
self.error = linkinfo_node.get('error')
+ self.rev = linkinfo_node.get('rev')

def islink(self):
"""returns True if the linkinfo is not empty, otherwise False"""
@@ -238,8 +240,8 @@
def __str__(self):
"""return an informatory string representation"""
if self.islink() and not self.isexpanded():
- return 'project %s, package %s, xsrcmd5 %s' \
- % (self.project, self.package, self.xsrcmd5)
+ return 'project %s, package %s, xsrcmd5 %s, rev %s' \
+ % (self.project, self.package, self.xsrcmd5, self.rev)
elif self.islink() and self.isexpanded():
if self.haserror():
return 'broken link to project %s, package %s, srcmd5 %s,
lsrcmd5 %s: %s' \
< Previous Next >
Follow Ups