- set ignore_build_no

- fetch_remote_file should return a value for success
This commit is contained in:
Faik Uygur
2008-02-26 13:58:21 +00:00
parent deb0c119ad
commit 88ca19cde2
2 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ Lists previous operations."""
def run(self):
self.init(database = False, write = False)
ctx.set_option('ignore_build_no', True)
if ctx.get_option('snapshot'):
self.take_snapshot()
return
+11 -2
View File
@@ -55,8 +55,10 @@ def fetch_remote_file(package, errors):
except pisi.fetcher.FetchError, e:
errors.append(package)
ctx.ui.info(pisi.util.colorize(_("%s could not be found") % (package), "red"))
return False
else:
ctx.ui.info(_('%s [cached]') % uri.filename())
return True
def takeback(operation):
@@ -88,11 +90,18 @@ def takeback(operation):
paths = []
for pkg in beinstalled:
ctx.ui.info(pisi.util.colorize(_("Downloading %d / %d") % (beinstalled.index(pkg)+1, len(beinstalled)), "yellow"))
fetch_remote_file(pkg, errors)
paths.append(os.path.join(ctx.config.cached_packages_dir(), pkg))
pkg += ctx.const.package_suffix
if fetch_remote_file(pkg, errors):
paths.append(os.path.join(ctx.config.cached_packages_dir(), pkg))
if errors:
ctx.ui.info(_("\nFollowing packages could not be found in repositories and are not cached:\n") +
pisi.util.strlist(errors))
if not ctx.ui.confirm(_('Do you want to continue?')):
return
if paths:
pisi.operations.install.install_pkg_files(paths)
if beremoved:
pisi.operations.remove.remove(beremoved)