ref: refs/heads/jr_ntp
commit d546a248ba4124e8fa8d73d0fc2cf8b917bbb68b
Author: Klaus Kämpf
Date: Thu Sep 10 11:41:36 2009 +0200
Use mtime from base class
---
plugins/patches/app/models/patch.rb | 11 -----------
plugins/patches/app/models/resolvable.rb | 5 ++---
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/plugins/patches/app/models/patch.rb b/plugins/patches/app/models/patch.rb
index c7625bf..d53e900 100644
--- a/plugins/patches/app/models/patch.rb
+++ b/plugins/patches/app/models/patch.rb
@@ -3,17 +3,6 @@ require 'resolvable'
# Model for patches available via package kit
class Patch < Resolvable
- # returns the modification time of
- # the patch status, which you can use
- # for cache policy purposes
- def self.mtime
- # we look for the most recent (max) modification time
- # of either the package database or libzypp cache files
- [ File.stat("/var/lib/rpm/Packages").mtime,
- File.stat("/var/cache/zypp/solv").mtime,
- * Dir["/var/cache/zypp/solv/*/solv"].map{ |x| File.stat(x).mtime } ].max
- end
-
def to_xml( options = {} )
xml = options[:builder] ||= Builder::XmlMarkup.new(options)
xml.instruct! unless options[:skip_instruct]
diff --git a/plugins/patches/app/models/resolvable.rb b/plugins/patches/app/models/resolvable.rb
index fc25636..8aba62b 100644
--- a/plugins/patches/app/models/resolvable.rb
+++ b/plugins/patches/app/models/resolvable.rb
@@ -21,9 +21,8 @@ class Resolvable
@resolvable_id = id_val
end
- # returns the modification time of
- # the patch status, which you can use
- # for cache policy purposes
+ # returns the modification time of the resolvable
+ # which you can use for cache policy purposes
def self.mtime
# we look for the most recent (max) modification time
# of either the package database or libzypp cache files
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org