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