* dependency'lerde versionFrom versionTo'yu implement et
* metadata write kisminda metadata class'ini kullan
This commit is contained in:
+9
-2
@@ -11,6 +11,8 @@ import util
|
||||
from ui import ui
|
||||
from context import ctx
|
||||
from sourcearchive import SourceArchive
|
||||
from files import Files
|
||||
from specfile import SpecFile, MetaData
|
||||
|
||||
class PisiBuildError(Exception):
|
||||
pass
|
||||
@@ -98,9 +100,14 @@ class PisiBuild:
|
||||
|
||||
def genMetaDataXml(self, package):
|
||||
#test
|
||||
metadata = MetaData()
|
||||
d = self.ctx.pkg_install_dir()
|
||||
c = util.dir_size(d)
|
||||
print d, c
|
||||
metadata.distribution = "Pardus" # from context?
|
||||
metadata.distributionRelease = "0.1"
|
||||
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"))
|
||||
|
||||
def genFilesXml(self, package):
|
||||
# the worst function in this project!
|
||||
|
||||
+7
-3
@@ -4,16 +4,20 @@
|
||||
import installdb
|
||||
import packagedb
|
||||
import ui
|
||||
from version import Version
|
||||
|
||||
# FIXME: this is supposed to handle all those attributes
|
||||
def satisfiesDep(pkg, depinfo):
|
||||
"""determine if a package satisfies given dependency spec"""
|
||||
if not installdb.is_installed(depinfo.package):
|
||||
return False
|
||||
else:
|
||||
(version, release) = installdb.get_info(pkg)
|
||||
# FIXME: specific processing for attributes
|
||||
return True
|
||||
ret = True
|
||||
if depinfo.versionFrom:
|
||||
ret &= Version(version) >= Version(depinfo.versionFrom)
|
||||
if depinfo.versionTo:
|
||||
ret &= Version(version) <= Version(depinfo.versionTo)
|
||||
return ret
|
||||
|
||||
def installDeps(pkg):
|
||||
return packagedb.get_package(pkg).installDeps
|
||||
|
||||
+5
-1
@@ -105,7 +105,11 @@ class MetaData(SpecFile):
|
||||
distribution = self.getNodeText("Source/Distribution")
|
||||
distributionRelease = self.getNodeText("Source/DistributionRelease")
|
||||
architecture = self.getNodeText("Source/Architecture")
|
||||
installSize = self.getNodeText("Source/InstallSize")
|
||||
installSize = int(self.getNodeText("Source/InstallSize"))
|
||||
|
||||
def write(self, filename):
|
||||
ui.info("METADATA WRITE NOT IMPLEMENTED")
|
||||
pass
|
||||
|
||||
def verify():
|
||||
if len(packages) != 1:
|
||||
|
||||
@@ -5,6 +5,10 @@ import util
|
||||
class Version:
|
||||
def __init__(self, verstring):
|
||||
self.comps = map(lambda x: int(x), util.multisplit(verstring,'.-'))
|
||||
self.verstring = verstring
|
||||
|
||||
def string():
|
||||
return self.verstring
|
||||
|
||||
def pred(self,rhs,pred):
|
||||
for i in range(0, len(comps)-1):
|
||||
|
||||
Reference in New Issue
Block a user