Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a hint on how to reinstall broken packages #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pisi/cli/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def run(self):

necessary_permissions = True

broken_packages = []

# True if we should also check the configuration files
check_config = ctx.get_option('config')

Expand All @@ -103,6 +105,7 @@ def run(self):
if check_results['missing'] or check_results['corrupted'] \
or check_results['config']:
ctx.ui.info(util.colorize(_("Broken"), 'brightred'))
broken_packages.append(pkg)
elif check_results['denied']:
# We can't deduce a result when some files
# can't be accessed
Expand Down Expand Up @@ -134,6 +137,14 @@ def run(self):
# Package is not installed
ctx.ui.info(_('Package %s not installed') % pkg)

if len(broken_packages) > 0:
broken_packages_str = ' '.join(broken_packages)

ctx.ui.info("")
ctx.ui.warning(_("Some packages are reported as broken, you may "
"want to repair these packages by running:"))
ctx.ui.warning("sudo eopkg it --reinstall %s" % broken_packages_str)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could result in very large lines is my only concern ..


if not necessary_permissions:
ctx.ui.info("")
ctx.ui.warning(_("Pisi was unable to check the integrity of "
Expand Down