Adds the last updated date to the output

git-svn-id: file:///home/svn/framework3/trunk@7497 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-11-13 22:50:12 +00:00
parent 8a2a16c921
commit eabfff5aca
3 changed files with 16 additions and 10 deletions

View File

@ -27,6 +27,7 @@ class Framework
RepoUpdated = ::Msf::Util::SVN.updated
RepoUpdatedDays = ::Msf::Util::SVN.days_since_update
RepoUpdatedDaysNote = ::Msf::Util::SVN.last_updated_friendly
RepoUpdatedDate = ::Msf::Util::SVN.last_updated_date
RepoRoot = ::Msf::Util::SVN.root
# API Version

View File

@ -197,7 +197,8 @@ class Core
oldwarn = nil
banner << "#{framework.stats.num_payloads} payloads - #{framework.stats.num_encoders} encoders - #{framework.stats.num_nops} nops\n"
if ( ::Msf::Framework::RepoRevision.to_i > 0)
banner << " =[ svn r#{::Msf::Framework::RepoRevision} updated #{::Msf::Framework::RepoUpdatedDaysNote}\n"
tstamp = ::Msf::Framework::RepoUpdatedDate.strftime("%Y.%m.%d")
banner << " =[ svn r#{::Msf::Framework::RepoRevision} updated #{::Msf::Framework::RepoUpdatedDaysNote} (#{tstamp})\n"
if(::Msf::Framework::RepoUpdatedDays > 7)
oldwarn = []
oldwarn << "Warning: This copy of the Metasploit Framework was last updated #{::Msf::Framework::RepoUpdatedDaysNote}."

View File

@ -40,23 +40,23 @@ class SVN
end
def self.revision
info = load_root
info[:revision]
@@info ||= load_root
@@info[:revision]
end
def self.updated
info = load_root
info[:updated]
@@info ||= load_root
@@info[:updated]
end
def self.root
info = load_root
info[:root]
@@info ||= load_root
@@info[:root]
end
def self.days_since_update
info = load_root
svnt = info[:updated]
@@info ||= load_root
svnt = @@info[:updated]
if(not svnt)
return
end
@ -67,7 +67,7 @@ class SVN
diff = self.days_since_update
case diff
when nil
"at a unknown date"
"at an unknown date"
when -2.0 .. 1.0
"today"
when 1.0 .. 2.0
@ -81,6 +81,10 @@ class SVN
end
end
def self.last_updated_date
@@info ||= load_root
Date.parse(@@info[:updated])
end
end
end