Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 267821 Details for
Bug 397471
[RFE] [PATCH] database consistency check
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
yum-check.patch
yum-check.patch (text/plain), 3.46 KB, created by
Pierre Ossman
on 2007-11-23 22:07:25 UTC
(
hide
)
Description:
yum-check.patch
Filename:
MIME Type:
Creator:
Pierre Ossman
Created:
2007-11-23 22:07:25 UTC
Size:
3.46 KB
patch
obsolete
>--- cli.py.orig 2007-11-23 22:53:52.000000000 +0100 >+++ cli.py 2007-11-23 22:36:31.000000000 +0100 >@@ -83,6 +83,7 @@ > self.registerCommand(yumcommands.ShellCommand()) > self.registerCommand(yumcommands.DepListCommand()) > self.registerCommand(yumcommands.RepoListCommand()) >+ self.registerCommand(yumcommands.CheckCommand()) > > def registerCommand(self, command): > for name in command.getNames(): >@@ -1018,6 +1019,71 @@ > else: > return 2, ['%d Package(s) to remove' % len(pkgs_used)] > >+ def checkDB(self): >+ installed = self.rpmdb.returnPackages() >+ >+ missing_deps = False >+ lookup = {} >+ >+ for pkg in installed: >+ missing = [] >+ for req in pkg.requires: >+ if req[0].startswith('rpmlib('): >+ continue >+ if lookup.has_key(req): >+ continue >+ >+ if self.rpmdb.getProvides(*req): >+ lookup[req] = True >+ else: >+ missing.append(req) >+ >+ if missing: >+ if not missing_deps: >+ self.verbose_logger.log(yum.logginglevels.INFO_2, >+ 'The following packages have unmet dependencies:') >+ self.verbose_logger.log(yum.logginglevels.INFO_2, '') >+ missing_deps = True >+ >+ self.verbose_logger.log(yum.logginglevels.INFO_2, >+ ' %s depends on:' % pkg.name) >+ for req in missing: >+ self.verbose_logger.log(yum.logginglevels.INFO_2, >+ ' %s' % yum.misc.prco_tuple_to_string(req)) >+ self.verbose_logger.log(yum.logginglevels.INFO_2, '') >+ >+ duplicates = False >+ lookup = {} >+ >+ for pkg in installed: >+ if lookup.has_key(pkg.name): >+ if pkg.name in self.conf.installonlypkgs: >+ continue >+ >+ if lookup[pkg.name] > 1: >+ continue >+ >+ if not duplicates: >+ self.verbose_logger.log(yum.logginglevels.INFO_2, >+ 'Duplicate copies were found of the following packages:') >+ self.verbose_logger.log(yum.logginglevels.INFO_2, '') >+ duplicates = True >+ >+ self.verbose_logger.log(yum.logginglevels.INFO_2, >+ ' %s' % pkg.name) >+ >+ lookup[pkg.name] += 1 >+ else: >+ lookup[pkg.name] = 1 >+ >+ if duplicates: >+ self.verbose_logger.log(yum.logginglevels.INFO_2, '') >+ >+ if missing_deps or duplicates: >+ return 0, ['Database is inconcistent'] >+ else: >+ return 0, ['Database is consistent'] >+ > > > def _promptWanted(self): >--- yumcommands.py.orig 2007-11-23 22:53:59.000000000 +0100 >+++ yumcommands.py 2007-11-23 20:45:41.000000000 +0100 >@@ -500,4 +500,20 @@ > > def needTs(self, base, basecmd, extcmds): > return False >- >+ >+class CheckCommand(YumCommand): >+ >+ def getNames(self): >+ return ['check'] >+ >+ def doCommand(self, base, basecmd, extcmds): >+ base.verbose_logger.log(logginglevels.INFO_2, >+ "Checking RPM database integrity") >+ try: >+ return base.checkDB() >+ except yum.Errors.YumBaseError, e: >+ return 1, [str(e)] >+ >+ def needTs(self, base, basecmd, extcmds): >+ return False >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 397471
: 267821