pisi can read metadata and files of pisi files on the fly with no need to first

extract them to some place.
This commit is contained in:
Faik Uygur
2008-02-06 12:23:37 +00:00
parent 374716c296
commit 5e9a685edb
2 changed files with 5 additions and 20 deletions
+2 -2
View File
@@ -697,7 +697,7 @@ class Builder:
if pisi.util.is_package_name(os.path.basename(old_package_fn), package_name):
try:
old_pkg = pisi.package.Package(old_package_fn, 'r')
old_pkg.read(pisi.util.join_path(ctx.config.tmp_dir(), 'oldpkg'))
old_pkg.read()
ctx.ui.info(_('(found old version %s)') % old_package_fn)
if str(old_pkg.metadata.package.name) != package_name:
ctx.ui.warning(_('Skipping %s with wrong pkg name ') %
@@ -733,7 +733,7 @@ class Builder:
# compare old files.xml with the new one..
old_pkg = pisi.package.Package(old_package_fn, 'r')
old_pkg.read(pisi.util.join_path(ctx.config.tmp_dir(), 'oldpkg'))
old_pkg.read()
changed = False
fnew = self.files.list
+3 -18
View File
@@ -121,24 +121,9 @@ class Package:
files.parse(self.impl.read_file(ctx.const.files_xml))
return files
def read(self, outdir = None):
if not outdir:
outdir = ctx.config.tmp_dir()
# extract control files
self.extract_pisi_files(outdir)
self.metadata = pisi.metadata.MetaData()
self.metadata.read( os.path.join(outdir, ctx.const.metadata_xml) )
errs = self.metadata.errors()
if errs:
util.print_errors(errs)
raise Error, _("MetaData format wrong")
self.files = pisi.files.Files()
self.files.read( os.path.join(outdir, ctx.const.files_xml) )
if self.files.errors():
raise Error, _("Invalid %s") % ctx.const.files_xml
def read(self):
self.files = self.get_files()
self.metadata = self.get_metadata()
def pkg_dir(self):
packageDir = self.metadata.package.name + '-' \