Browse Source

remove subversion support

Brent Cook 3 years ago
parent
commit
5a72f2df16

+ 0
- 8
lib/msf/core/framework.rb View File

@@ -38,14 +38,6 @@ class Framework
38 38
 
39 39
   Revision = "$Revision$"
40 40
 
41
-  # Repository information
42
-  RepoRevision        = ::Msf::Util::SVN.revision
43
-  RepoUpdated         = ::Msf::Util::SVN.updated
44
-  RepoUpdatedDays     = ::Msf::Util::SVN.days_since_update
45
-  RepoUpdatedDaysNote = ::Msf::Util::SVN.last_updated_friendly
46
-  RepoUpdatedDate     = ::Msf::Util::SVN.last_updated_date
47
-  RepoRoot            = ::Msf::Util::SVN.root
48
-
49 41
   # EICAR canary
50 42
   EICARCorrupted      = ::Msf::Util::EXE.is_eicar_corrupted?
51 43
 

+ 0
- 4
lib/msf/core/modules/loader/directory.rb View File

@@ -32,10 +32,6 @@ class Msf::Modules::Loader::Directory < Msf::Modules::Loader::Base
32 32
   def each_module_reference_name(path, opts={})
33 33
     whitelist = opts[:whitelist] || []
34 34
     ::Dir.foreach(path) do |entry|
35
-      if entry.downcase == '.svn'
36
-        next
37
-      end
38
-
39 35
       full_entry_path = ::File.join(path, entry)
40 36
       type = entry.singularize
41 37
 

+ 2
- 10
lib/msf/ui/console/command_dispatcher/core.rb View File

@@ -2837,16 +2837,8 @@ class Core
2837 2837
   # Returns the revision of the framework and console library
2838 2838
   #
2839 2839
   def cmd_version(*args)
2840
-    svn_console_version = "$Revision: 15168 $"
2841
-    svn_metasploit_version = Msf::Framework::Revision.match(/ (.+?) \$/)[1] rescue nil
2842
-    if svn_metasploit_version
2843
-      print_line("Framework: #{Msf::Framework::Version}.#{svn_metasploit_version}")
2844
-    else
2845
-      print_line("Framework: #{Msf::Framework::Version}")
2846
-    end
2847
-    print_line("Console  : #{Msf::Framework::Version}.#{svn_console_version.match(/ (.+?) \$/)[1]}")
2848
-
2849
-    return true
2840
+    print_line("Framework: #{Msf::Framework::Version}")
2841
+    print_line("Console  : #{Msf::Framework::Version}")
2850 2842
   end
2851 2843
 
2852 2844
   def cmd_grep_help

+ 0
- 4
lib/msf/util.rb View File

@@ -21,7 +21,3 @@ end
21 21
 
22 22
 # Executable generation and encoding
23 23
 require 'msf/util/exe'
24
-
25
-# Parse SVN entries
26
-require 'msf/util/svn'
27
-

+ 0
- 120
lib/msf/util/svn.rb View File

@@ -1,120 +0,0 @@
1
-# -*- coding: binary -*-
2
-###
3
-#
4
-# framework-util-svn
5
-# --------------
6
-#
7
-# The class provides methods for parsing the SVN information in the framework directory
8
-#
9
-###
10
-
11
-require 'date'
12
-
13
-module Msf
14
-module Util
15
-class SVN
16
-
17
-  def self.load_root
18
-    info = {}
19
-    path = ::File.join(::File.dirname(__FILE__), "..", "..", "..", ".svn", "entries")
20
-    if !::File.exists?(path)
21
-      return info
22
-    end
23
-    contents = ''
24
-    File.open(path, "rb") do |fd|
25
-      contents = fd.read(::File.size(path))
26
-    end
27
-    if contents.include? "<?xml"
28
-      require 'rexml/document'
29
-      rd = REXML::Document.new(contents).root
30
-      rd.elements.each { |e|
31
-        if e.attributes['name'] == ""
32
-          info[:root] = e.attributes['url']
33
-          info[:revision] = e.attributes['revision']
34
-          info[:updated] = e.attributes['committed-date']
35
-          break
36
-        end
37
-      }
38
-    else
39
-      ents = contents.split("\x0c")
40
-      ents[0].split("\n").each do |line|
41
-        line.strip!
42
-        next if line.empty?
43
-        case line
44
-        when /framework3/
45
-          info[:root] = line
46
-        when /^\d+$/
47
-          info[:revision] = line.to_i
48
-        when /^\d{4}-\d.*T/
49
-          info[:updated] = line
50
-        end
51
-        break if (info[:root] and info[:revision] and info[:updated])
52
-      end
53
-    end
54
-    info
55
-  end
56
-
57
-  def self.revision
58
-    @@info ||= load_root
59
-    @@info[:revision]
60
-  end
61
-
62
-  def self.updated
63
-    @@info ||= load_root
64
-    @@info[:updated]
65
-  end
66
-
67
-  def self.root
68
-    @@info ||= load_root
69
-    @@info[:root]
70
-  end
71
-
72
-  def self.days_since_update
73
-    @@info ||= load_root
74
-    svnt = @@info[:updated]
75
-    if(not svnt)
76
-      return
77
-    end
78
-
79
-    # Date.parse and Date.strptime are both broken beyond repair in
80
-    # ruby 1.8.6 and older.  Just bail if the parsing doesn't work.
81
-    begin
82
-      diff = (Date.parse(Time.now.to_s) - Date.parse(svnt)).to_f
83
-    rescue ArgumentError
84
-    end
85
-  end
86
-
87
-  def self.last_updated_friendly
88
-    diff = self.days_since_update
89
-    case diff
90
-    when nil
91
-      "at an unknown date"
92
-    when -2.0 .. 1.0
93
-      "today"
94
-    when 1.0 .. 2.0
95
-      "yesterday"
96
-    else
97
-      if (diff.to_i > 7)
98
-        "%red#{diff.to_i} days ago%clr"
99
-      else
100
-        "#{diff.to_i} days ago"
101
-      end
102
-    end
103
-  end
104
-
105
-  def self.last_updated_date
106
-    @@info ||= load_root
107
-                svnt = @@info[:updated]
108
-                if(not svnt)
109
-                        return
110
-                end
111
-    begin
112
-      Date.parse(@@info[:updated])
113
-    rescue ArgumentError
114
-    end
115
-  end
116
-
117
-end
118
-end
119
-end
120
-

Loading…
Cancel
Save