From 88ca19cde2b4a250e69e175a78b8d5f020fc24fd Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Tue, 26 Feb 2008 13:58:21 +0000 Subject: [PATCH] - set ignore_build_no - fetch_remote_file should return a value for success --- pisi/cli/history.py | 2 +- pisi/operations/history.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pisi/cli/history.py b/pisi/cli/history.py index ea0c8127..48a4844e 100644 --- a/pisi/cli/history.py +++ b/pisi/cli/history.py @@ -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 diff --git a/pisi/operations/history.py b/pisi/operations/history.py index 799c65a1..b5854164 100644 --- a/pisi/operations/history.py +++ b/pisi/operations/history.py @@ -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)