Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lpato:sll7
yum
BZ-1357083-clean-all-add-hint-rm-rf.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File BZ-1357083-clean-all-add-hint-rm-rf.patch of Package yum
commit 01a6780fd310cbf0027e98fad97aca324f952196 Author: Michal Domonkos <mdomonko@redhat.com> Date: Thu Mar 9 14:02:25 2017 +0100 Add hint about rm -rf for yum clean all. BZ 1357083 diff --git a/cli.py b/cli.py index 862992b..5f7c4ae 100755 --- a/cli.py +++ b/cli.py @@ -1718,6 +1718,23 @@ class YumBaseCli(yum.YumBase, output.YumOutput): if 'all' in userlist: self.verbose_logger.log(yum.logginglevels.INFO_2, _('Cleaning up everything')) + + # Print a "maybe you want rm -rf" hint to compensate for the fact + # that yum clean all is often misunderstood. Don't do that, + # however, if cachedir is non-default as we would have to replace + # arbitrary yum vars with * and that could produce a harmful + # command, e.g. for /mydata/$myvar we would say rm -rf /mydata/* + cachedir = self.conf.cachedir + if cachedir.startswith(('/var/cache/yum', '/var/tmp/yum-')): + # Take just the first 3 path components + rmdir = '/'.join(cachedir.split('/')[:4]) + self.verbose_logger.log( + yum.logginglevels.INFO_2, + _('Maybe you want: rm -rf %s, to also free up space taken ' + 'by orphaned data from disabled or removed repos' + % rmdir), + ) + pkgcode, pkgresults = self.cleanPackages() hdrcode, hdrresults = self.cleanHeaders() xmlcode, xmlresults = self.cleanMetadata()
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor