From a8b88779915946c6b95bfd58837653d586c85ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Tue, 9 May 2006 12:36:27 +0000 Subject: [PATCH] * forgot these, sorry --- pisi/operations.py | 8 ++++++++ pisi/zipfileext.py | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pisi/operations.py b/pisi/operations.py index 0abace81..4228e162 100644 --- a/pisi/operations.py +++ b/pisi/operations.py @@ -41,6 +41,10 @@ from pisi.version import Version class Error(pisi.Error): pass +class PisiUpgradeException(pisi.Exception): + def __init__(self): + pisi.Exception.__init__(self, _("Upgrading PISI requires database rebuild and restart")) + # high level operations def install(packages, reinstall = False): @@ -419,6 +423,10 @@ def upgrade_pkg_names(A = [], bypass_safety = False): for path in paths: install_op = atomicoperations.Install(path) install_op.install(True) + + if 'pisi' in order: + ctx.ui.warning(_("PISI package has been upgraded. Updating database and restarting. Please wait.")) + raise PisiUpgradeException() def plan_upgrade(A, ignore_build = False): # try to construct a pisi graph of packages to diff --git a/pisi/zipfileext.py b/pisi/zipfileext.py index 60e6b93b..c8e12e50 100644 --- a/pisi/zipfileext.py +++ b/pisi/zipfileext.py @@ -38,9 +38,9 @@ except ImportError: pylzma = None ZIP_BZIP2 = 12 -ZIP_LZMA = 255 +ZIP_LZMA_BOGUS = 255 -compression_methods = [ZIP_STORED, ZIP_DEFLATED, ZIP_BZIP2, ZIP_LZMA] +compression_methods = [ZIP_STORED, ZIP_DEFLATED, ZIP_BZIP2, ZIP_LZMA_BOGUS] class FileEntry: """File-like object used to access entries in a ZipFile""" @@ -188,7 +188,7 @@ class ZipFileExt(ZipFile): if zinfo.compress_type == ZIP_BZIP2 and not bzip2: raise RuntimeError, \ "Compression requires the (missing) bzip2 module" - if zinfo.compress_type == ZIP_LZMA and not pylzma: + if zinfo.compress_type == ZIP_LZMA_BOGUS and not pylzma: raise RuntimeError, \ "Compression requires the (missing) pylzma module" @@ -246,7 +246,7 @@ class ZipFileExt(ZipFile): else: zinfo.compress_size = file_size - elif zinfo.compress_type == ZIP_LZMA: + elif zinfo.compress_type == ZIP_LZMA_BOGUS: # unfortunately pylzma.compressobj is not implemented yet. # So in order to calculate the CRC, we are going to read # all the file at once until it is implemented. @@ -288,8 +288,8 @@ class ZipFileExt(ZipFile): ## if not bzip2: ## raise RuntimeError, \ ## "De-compression requires the (missing) bzip2 module" -## return LZMAFileEntry(self.fp, zinfo.compress_size) - elif zinfo.compress_type == ZIP_LZMA: +## return LZMAFileEntry(self.fp, zinfo.compress_size) + elif zinfo.compress_type == ZIP_LZMA_BOGUS: if not pylzma: raise RuntimeError, \ "De-compression requires the (missing) pylzma module"