* diger todo'yu da implement et: files 'lari karsilastir.
* 0.3 versiyonumuz vatanimiza milletimize ve tubitak'imiza hayirli ugurlu olsun
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Project SYSTEM "Project-3.7.dtd">
|
||||
<!-- Project file for project pisi -->
|
||||
<!-- Saved: 2005-08-15, 15:35:13 -->
|
||||
<!-- Copyright (C) 2005 PiSi Development Team, -->
|
||||
<!-- Saved: 2005-08-16, 12:33:37 -->
|
||||
<!-- Copyright (C) 2005 PiSi Development Team, pisi@uludag.org.tr -->
|
||||
<Project version="3.7">
|
||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||
<UIType>Qt</UIType>
|
||||
<Description>The package management software of Pardus distribution.
|
||||
</Description>
|
||||
<Version>0.2</Version>
|
||||
<Author>PiSi Development Team</Author>
|
||||
<Email></Email>
|
||||
<Email>pisi@uludag.org.tr</Email>
|
||||
<Sources>
|
||||
<Source>
|
||||
<Dir>tools</Dir>
|
||||
@@ -143,11 +144,6 @@
|
||||
<Dir>actionsapi</Dir>
|
||||
<Name>coreutils.py</Name>
|
||||
</Source>
|
||||
<Source>
|
||||
<Dir>pisi</Dir>
|
||||
<Dir>cli</Dir>
|
||||
<Name>common.py</Name>
|
||||
</Source>
|
||||
<Source>
|
||||
<Dir>pisi</Dir>
|
||||
<Dir>cli</Dir>
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
# PISI version
|
||||
|
||||
__version__ = "0.2"
|
||||
__version__ = "0.3"
|
||||
|
||||
__all__ = [ 'toplevel', 'packagedb', 'installdb' ]
|
||||
|
||||
|
||||
+34
-8
@@ -265,9 +265,10 @@ class PisiBuild:
|
||||
metadata.package.build = None # means, build no information n/a
|
||||
ui.warning('build number is not available.')
|
||||
else:
|
||||
metadata.package.build = self.get_build_number(metadata.package.name)
|
||||
metadata.package.build = self.calc_build_no(metadata.package.name)
|
||||
|
||||
metadata.write(os.path.join(self.ctx.pkg_dir(), const.metadata_xml))
|
||||
self.metadata = metadata
|
||||
|
||||
def gen_files_xml(self, package):
|
||||
"""Generetes files.xml using the path definitions in specfile and
|
||||
@@ -288,11 +289,11 @@ class PisiBuild:
|
||||
files.append(FileInfo(frpath, ftype, fsize, fhash))
|
||||
|
||||
files.write(os.path.join(self.ctx.pkg_dir(), const.files_xml))
|
||||
self.files = files
|
||||
|
||||
def calc_build_no(self, package_name):
|
||||
"""Calculate build number"""
|
||||
|
||||
def get_build_number(self, package_name):
|
||||
"""Generate build number"""
|
||||
#NOTE: not functional yet..
|
||||
old_package_fn = None
|
||||
# find previous build in config.options.output_dir
|
||||
found = []
|
||||
for root, dirs, files in os.walk(config.options.output_dir):
|
||||
@@ -313,11 +314,37 @@ class PisiBuild:
|
||||
a = filter(lambda (x,y): y != None, found)
|
||||
if a:
|
||||
a.sort(lambda x,y : cmp(x[1],y[1]))
|
||||
old_package_fn = a[0][0]
|
||||
old_build = a[0][1]
|
||||
else:
|
||||
old_build = None
|
||||
# TODO: compare old files.xml with the new one..
|
||||
changed = True
|
||||
|
||||
# compare old files.xml with the new one..
|
||||
old_pkg = Package(old_package_fn, 'r')
|
||||
from os.path import join
|
||||
old_pkg.read(join(config.tmp_dir(), 'oldpkg'))
|
||||
|
||||
# FIXME: TAKE INTO ACCOUNT MINOR CHANGES IN METADATA
|
||||
changed = False
|
||||
fnew = self.files.list
|
||||
fold = old_pkg.files.list
|
||||
fold.sort(lambda x,y : cmp(x.path,y.path))
|
||||
fnew.sort(lambda x,y : cmp(x.path,y.path))
|
||||
if len(fnew) != len(fold):
|
||||
changed = True
|
||||
else:
|
||||
for i in range(len(fold)):
|
||||
fo = fold.pop(0)
|
||||
fn = fnew.pop(0)
|
||||
if fo.path != fn.path:
|
||||
changed = True
|
||||
break
|
||||
else:
|
||||
if fo.hash != fn.hash:
|
||||
changed = True
|
||||
break
|
||||
|
||||
# set build number
|
||||
if old_build is None:
|
||||
ui.warning('(old package lacks a build no, setting build no to 0.)')
|
||||
return 0
|
||||
@@ -326,7 +353,6 @@ class PisiBuild:
|
||||
else:
|
||||
return old_build
|
||||
|
||||
|
||||
def build_packages(self):
|
||||
"""Build each package defined in PSPEC file. After this process there
|
||||
will be .pisi files hanging around, AS INTENDED ;)"""
|
||||
|
||||
Reference in New Issue
Block a user