diff --git a/popt/popt.pspec b/popt/popt.pspec
index d16bbddf..4cc19f07 100644
--- a/popt/popt.pspec
+++ b/popt/popt.pspec
@@ -20,10 +20,7 @@
popt-1.7-uclibc.patch.gz
-
- make
- 1.8
-
+ make
@@ -49,9 +46,7 @@
devel:library
-
- gettext
-
+ gettext
/usr/lib/
diff --git a/src/specfile.py b/src/specfile.py
index 3de5d079..eebfb5c6 100644
--- a/src/specfile.py
+++ b/src/specfile.py
@@ -13,6 +13,11 @@ class PatchInfo:
self.filename = getNodeText(node)
self.compressionType = getNodeAttribute(node, "compressionType")
+class DepInfo:
+ def __init__(self, node):
+ self.package = getNodeText(node).strip()
+ self.versionFrom = getNodeAttribute(node, "versionFrom")
+
class SpecFile(XmlFile):
"""A class for reading/writing from/to a PSPEC (PISI SPEC) file."""
@@ -27,9 +32,14 @@ class SpecFile(XmlFile):
patchElts = self.getChildElts("PSPEC/Source/Patches")
patches = [ PatchInfo(p) for p in patchElts ]
for x in patches:
- print "fn:", x.filename
- print "ct:", x.compressionType
-
+ print "patch fn:", x.filename
+ print "patch ct:", x.compressionType
+ buildDepElts = self.getChildElts("PSPEC/Source/BuildDependencies")
+ buildDeps = [DepInfo(d) for d in buildDepElts]
+ for x in buildDeps:
+ print "patch nm:", x.package
+ print "patch vf:", x.versionFrom
+
def verify(self):
"""Verify PSPEC structures, are they what we want of them?"""
return True
diff --git a/src/xmlfile.py b/src/xmlfile.py
index 42a503ff..318c33b8 100644
--- a/src/xmlfile.py
+++ b/src/xmlfile.py
@@ -25,6 +25,10 @@ def getNodeText(node):
else:
raise XmlError("getNodeText: Expected text node, got something else!")
+# get only child elements
+def getChildElts(node):
+ return filter(lambda x:x.nodeType==x.ELEMENT_NODE, node.childNodes)
+
# xmlfile class that further abstracts a dom object
class XmlFile(object):
@@ -49,7 +53,7 @@ class XmlFile(object):
node = self.getNode(tagpath)
return filter(lambda x:x.nodeType==type, node.childNodes)
- # get only child elements, slightly better than Serdar's sol'n :> -- exa
+ # get only child elements
def getChildElts(self, tagpath):
""" returns the children of the given path, only with given type """
node = self.getNode(tagpath)