* a little less verbosity

* fix: downgrading to old upstream release is OK.
This commit is contained in:
Eray Özkural
2006-06-13 21:57:14 +00:00
parent d3392980e8
commit 0a0982a0eb
2 changed files with 11 additions and 10 deletions
+8 -7
View File
@@ -221,12 +221,13 @@ class Install(AtomicOperation):
# is this a downgrade? confirm this action. # is this a downgrade? confirm this action.
if self.ask_reinstall and (not upgrade): if self.ask_reinstall and (not upgrade):
if Version(pkg.version) < Version(iversion): if Version(pkg.version) < Version(iversion):
x = _('Downgrade to old upstream version?') #x = _('Downgrade to old upstream version?')
x = None
elif Version(pkg.release) < Version(irelease): elif Version(pkg.release) < Version(irelease):
x = _('Downgrade to old distribution release?') x = _('Downgrade to old distribution release?')
else: else:
x = _('Downgrade to old distribution build?') x = _('Downgrade to old distribution build?')
if not ctx.ui.confirm(x): if x and not ctx.ui.confirm(x):
raise Error(_('Package downgrade declined')) raise Error(_('Package downgrade declined'))
# schedule for reinstall # schedule for reinstall
@@ -288,17 +289,17 @@ class Install(AtomicOperation):
if self.reinstall: if self.reinstall:
util.clean_dir(self.old_path) util.clean_dir(self.old_path)
ctx.ui.info(_('Storing %s, ') % ctx.const.files_xml) ctx.ui.info(_('Storing %s, ') % ctx.const.files_xml, verbose=True)
self.package.extract_file(ctx.const.files_xml, self.package.pkg_dir()) self.package.extract_file(ctx.const.files_xml, self.package.pkg_dir())
ctx.ui.info(_('Storing %s.') % ctx.const.metadata_xml) ctx.ui.info(_('Storing %s.') % ctx.const.metadata_xml, verbose=True)
self.package.extract_file(ctx.const.metadata_xml, self.package.pkg_dir()) self.package.extract_file(ctx.const.metadata_xml, self.package.pkg_dir())
for pcomar in self.metadata.package.providesComar: for pcomar in self.metadata.package.providesComar:
fpath = os.path.join(ctx.const.comar_dir, pcomar.script) fpath = os.path.join(ctx.const.comar_dir, pcomar.script)
# comar prefix is added to the pkg_dir while extracting comar # comar prefix is added to the pkg_dir while extracting comar
# script file. so we'll use pkg_dir as destination. # script file. so we'll use pkg_dir as destination.
ctx.ui.info(_('Storing %s') % fpath) ctx.ui.info(_('Storing %s') % fpath, verbose=True)
self.package.extract_file(fpath, self.package.pkg_dir()) self.package.extract_file(fpath, self.package.pkg_dir())
def register_comar_scripts(self): def register_comar_scripts(self):
@@ -345,10 +346,10 @@ class Install(AtomicOperation):
break break
if not ctx.get_option('bypass_ldconfig'): if not ctx.get_option('bypass_ldconfig'):
if shared: if shared:
ctx.ui.info(_("Regenerating /etc/ld.so.cache...")) ctx.ui.info(_("Regenerating /etc/ld.so.cache..."), verbose=True)
util.env_update() util.env_update()
else: else:
ctx.ui.warning(_("Bypassing ldconfig")) ctx.ui.info(_("Bypassing ldconfig"), verbose=True)
def install_single(pkg, upgrade = False): def install_single(pkg, upgrade = False):
"""install a single package from URI or ID""" """install a single package from URI or ID"""
+3 -3
View File
@@ -15,7 +15,7 @@
generic file abstraction that allows us to use URIs for everything generic file abstraction that allows us to use URIs for everything
we support only the simple read case ATM we support only the simple read case ATM
we are just encapsulating a common pattern in our program, nothing big. we are just encapsulating a common pattern in our program, nothing big.
like all pisi classes, it has been programmed in a non-restricting way like all pisi classes, it has been programmed in a non-restrictive way
""" """
import os import os
@@ -115,12 +115,12 @@ class File:
raise AlreadyHaveException(uri, localfile) raise AlreadyHaveException(uri, localfile)
if uri.is_remote_file(): if uri.is_remote_file():
ctx.ui.info(_("Fetching %s") % uri.get_uri()) ctx.ui.info(_("Fetching %s") % uri.get_uri(), verbose=True)
fetch_url(uri, transfer_dir) fetch_url(uri, transfer_dir)
else: else:
# copy to transfer dir, # copy to transfer dir,
localfile = join(transfer_dir, uri.filename()) localfile = join(transfer_dir, uri.filename())
ctx.ui.info(_("Copying %s to transfer dir") % uri.get_uri()) ctx.ui.info(_("Copying %s to transfer dir") % uri.get_uri(), verbose=True)
shutil.copy(uri.get_uri(), transfer_dir) shutil.copy(uri.get_uri(), transfer_dir)
else: else:
localfile = uri.get_uri() #TODO: use a special function here? localfile = uri.get_uri() #TODO: use a special function here?