- set ignore_build_no
- fetch_remote_file should return a value for success
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@ Lists previous operations."""
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.init(database = False, write = False)
|
self.init(database = False, write = False)
|
||||||
|
ctx.set_option('ignore_build_no', True)
|
||||||
if ctx.get_option('snapshot'):
|
if ctx.get_option('snapshot'):
|
||||||
self.take_snapshot()
|
self.take_snapshot()
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -55,8 +55,10 @@ def fetch_remote_file(package, errors):
|
|||||||
except pisi.fetcher.FetchError, e:
|
except pisi.fetcher.FetchError, e:
|
||||||
errors.append(package)
|
errors.append(package)
|
||||||
ctx.ui.info(pisi.util.colorize(_("%s could not be found") % (package), "red"))
|
ctx.ui.info(pisi.util.colorize(_("%s could not be found") % (package), "red"))
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
ctx.ui.info(_('%s [cached]') % uri.filename())
|
ctx.ui.info(_('%s [cached]') % uri.filename())
|
||||||
|
return True
|
||||||
|
|
||||||
def takeback(operation):
|
def takeback(operation):
|
||||||
|
|
||||||
@@ -88,11 +90,18 @@ def takeback(operation):
|
|||||||
paths = []
|
paths = []
|
||||||
for pkg in beinstalled:
|
for pkg in beinstalled:
|
||||||
ctx.ui.info(pisi.util.colorize(_("Downloading %d / %d") % (beinstalled.index(pkg)+1, len(beinstalled)), "yellow"))
|
ctx.ui.info(pisi.util.colorize(_("Downloading %d / %d") % (beinstalled.index(pkg)+1, len(beinstalled)), "yellow"))
|
||||||
fetch_remote_file(pkg, errors)
|
pkg += ctx.const.package_suffix
|
||||||
paths.append(os.path.join(ctx.config.cached_packages_dir(), pkg))
|
if fetch_remote_file(pkg, errors):
|
||||||
|
paths.append(os.path.join(ctx.config.cached_packages_dir(), pkg))
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
ctx.ui.info(_("\nFollowing packages could not be found in repositories and are not cached:\n") +
|
ctx.ui.info(_("\nFollowing packages could not be found in repositories and are not cached:\n") +
|
||||||
pisi.util.strlist(errors))
|
pisi.util.strlist(errors))
|
||||||
if not ctx.ui.confirm(_('Do you want to continue?')):
|
if not ctx.ui.confirm(_('Do you want to continue?')):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if paths:
|
||||||
|
pisi.operations.install.install_pkg_files(paths)
|
||||||
|
|
||||||
|
if beremoved:
|
||||||
|
pisi.operations.remove.remove(beremoved)
|
||||||
|
|||||||
Reference in New Issue
Block a user