- pisi-build'in tekrar çalışmasını sağla.

- size bilgisini files'dan çıkart
- files.xml ve metadata.xml için doğru yeri pkg_dir() olarak tanımla.
This commit is contained in:
Barış Metin
2005-06-21 13:41:14 +00:00
parent 0627617632
commit db456c3601
3 changed files with 11 additions and 18 deletions
+4 -5
View File
@@ -107,7 +107,7 @@ class PisiBuild:
metadata.architecture = "Any" # FIXME
metadata.installSize = util.dir_size(d)
print d, metadata.installSize
metadata.write(os.path.join(self.ctx.pkg_work_dir(),"metadata.xml"))
metadata.write(os.path.join(self.ctx.pkg_dir(),"metadata.xml"))
def genFilesXml(self, package):
# the worst function in this project!
@@ -119,15 +119,14 @@ class PisiBuild:
fpath = fpath[len(install_dir):]
depth = 0
ftype = ""
fsize = 0
for path in package.paths:
if fpath.startswith(path.pathname):
if depth < len(path.pathname):
depth = len(path.pathname)
ftype = path.fileType
print fpath, ftype, fsize, fhash
files.append(FileInfo(fpath, ftype, fsize, fhash))
files.write(os.path.join(self.ctx.pkg_work_dir(),"files.xml"))
print fpath, ftype, fhash
files.append(FileInfo(fpath, ftype, fhash))
files.write(os.path.join(self.ctx.pkg_dir(),"files.xml"))
def buildPackages(self):
for package in self.spec.packages:
+6 -12
View File
@@ -6,10 +6,9 @@ from xmlfile import XmlFile
class FileInfo:
def __init__(self, _path = "", _type = "", _size = 0, _hash = ""):
def __init__(self, _path = "", _type = "", _hash = ""):
self.path = _path
self.type = _type
self.size = _size
self.hash = _hash
def readnew(node):
@@ -20,7 +19,6 @@ class FileInfo:
def read(self, node):
self.path = getNodeText(getNode(node, "Path"))
self.type = getNodeText(getNode(node, "Type"))
self.size = int(getNodeText(getNode(node, "Size")))
self.hash = getNodeText(getNode(node, "Hash"))
def elt(self, dom):
@@ -28,16 +26,13 @@ class FileInfo:
## could apparently use helper functions to do this shorter
elt = dom.createElement("File")
pathElt = dom.createElement("Path")
pathElt.appendChild(dom.createTextNode(path))
pathElt.appendChild(dom.createTextNode(self.path))
typeElt = dom.createElement("Type")
typeElt.appendChild(dom.createTextNode(type))
sizeElt = dom.createElement("Size")
sizeElt.appendChild(dom.createTextNode(str(size)))
typeElt.appendChild(dom.createTextNode(self.type))
hashElt = dom.createElement("Hash")
hashElt.appendChild(dom.createTextNode(hash))
hashElt.appendChild(dom.createTextNode(self.hash))
elt.appendChild(pathElt)
elt.appendChild(typeElt)
elt.appendChild(sizeElt)
elt.appendChild(hashElt)
return elt
@@ -58,8 +53,7 @@ class Files(XmlFile):
def write(self, filename):
self.newDOM()
print list
for x in list:
self.dom.appendChild(x.elt(self.dom))
for x in self.list:
print x.elt(self.dom)
+1 -1
View File
@@ -126,7 +126,7 @@ class XmlFile(object):
"""clear DOM"""
from xml.dom.minidom import getDOMImplementation
impl = getDOMImplementation()
dom = impl.createDocument(None, self.rootTag, None)
self.dom = impl.createDocument(None, self.rootTag, None)
def unlink(self):
self.dom.unlink()