[yum-commits] Branch 'yum-3_2_X' - 2 commits - cli.py
James Antill
james at osuosl.org
Tue Feb 10 15:13:08 UTC 2009
cli.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
New commits:
commit 02ba2b258e803c1a9c489a0fb6683f324ea1aac3
Author: James Antill <james at and.org>
Date: Tue Feb 10 09:48:32 2009 -0500
Sort pkgs in --version
diff --git a/cli.py b/cli.py
index 25f9fc9..0374667 100644
--- a/cli.py
+++ b/cli.py
@@ -208,7 +208,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
done = False
def sm_ui_time(x):
return time.strftime("%Y-%m-%d %H:%M", time.gmtime(x))
- for pkg in self.rpmdb.returnPackages(patterns=yum_progs):
+ for pkg in sorted(self.rpmdb.returnPackages(patterns=yum_progs)):
# We should only have 1 version of each...
if done: print ""
done = True
commit fc49719f337a56fdf2cc3037d4ca3c759d893174
Author: James Antill <james at and.org>
Date: Tue Feb 10 09:45:19 2009 -0500
Use user cache dirs. instead of going cache-only, BZ 460782
diff --git a/cli.py b/cli.py
index baf019f..25f9fc9 100644
--- a/cli.py
+++ b/cli.py
@@ -1099,10 +1099,18 @@ class YumOptionParser(OptionParser):
# Handle remaining options
if opts.assumeyes:
self.base.conf.assumeyes =1
- # seems a good place for it - to go back to yum 3.0.X behavior
- # if not root then caching is enabled
- if opts.cacheonly or self.base.conf.uid != 0:
+
+ # Instead of going cache-only for a non-root user, try to use a
+ # user writable cachedir. If that fails fall back to cache-only.
+ if opts.cacheonly:
self.base.conf.cache = 1
+ elif self.base.conf.uid != 0:
+ cachedir = yum.misc.getCacheDir()
+ if cachedir is None:
+ self.base.conf.cache = 1
+ else:
+ self.base.conf.cachedir = cachedir
+ self.base.repos.setCacheDir(cachedir)
if opts.obsoletes:
self.base.conf.obsoletes = 1
More information about the Yum-commits
mailing list