* forgot these, sorry

This commit is contained in:
Eray Özkural
2006-05-09 12:36:27 +00:00
parent 37a9ff825e
commit a8b8877991
2 changed files with 14 additions and 6 deletions
+8
View File
@@ -41,6 +41,10 @@ from pisi.version import Version
class Error(pisi.Error): class Error(pisi.Error):
pass pass
class PisiUpgradeException(pisi.Exception):
def __init__(self):
pisi.Exception.__init__(self, _("Upgrading PISI requires database rebuild and restart"))
# high level operations # high level operations
def install(packages, reinstall = False): def install(packages, reinstall = False):
@@ -420,6 +424,10 @@ def upgrade_pkg_names(A = [], bypass_safety = False):
install_op = atomicoperations.Install(path) install_op = atomicoperations.Install(path)
install_op.install(True) 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): def plan_upgrade(A, ignore_build = False):
# try to construct a pisi graph of packages to # try to construct a pisi graph of packages to
# install / reinstall # install / reinstall
+6 -6
View File
@@ -38,9 +38,9 @@ except ImportError:
pylzma = None pylzma = None
ZIP_BZIP2 = 12 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: class FileEntry:
"""File-like object used to access entries in a ZipFile""" """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: if zinfo.compress_type == ZIP_BZIP2 and not bzip2:
raise RuntimeError, \ raise RuntimeError, \
"Compression requires the (missing) bzip2 module" "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, \ raise RuntimeError, \
"Compression requires the (missing) pylzma module" "Compression requires the (missing) pylzma module"
@@ -246,7 +246,7 @@ class ZipFileExt(ZipFile):
else: else:
zinfo.compress_size = file_size 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. # unfortunately pylzma.compressobj is not implemented yet.
# So in order to calculate the CRC, we are going to read # So in order to calculate the CRC, we are going to read
# all the file at once until it is implemented. # all the file at once until it is implemented.
@@ -288,8 +288,8 @@ class ZipFileExt(ZipFile):
## if not bzip2: ## if not bzip2:
## raise RuntimeError, \ ## raise RuntimeError, \
## "De-compression requires the (missing) bzip2 module" ## "De-compression requires the (missing) bzip2 module"
## return LZMAFileEntry(self.fp, zinfo.compress_size) ## return LZMAFileEntry(self.fp, zinfo.compress_size)
elif zinfo.compress_type == ZIP_LZMA: elif zinfo.compress_type == ZIP_LZMA_BOGUS:
if not pylzma: if not pylzma:
raise RuntimeError, \ raise RuntimeError, \
"De-compression requires the (missing) pylzma module" "De-compression requires the (missing) pylzma module"