4IpYnXoV83AAKd1KxT5TO3 changeset

Changeset386538386430 (b)
ParentNone (a)
ab
0+--- easy_install.rb     2010-11-23 05:24:57.000000000 +0000
0++++ easy_install.rb.orig        2010-11-23 04:53:48.000000000 +0000
0+@@ -34,18 +34,16 @@
0+ 
0+           begin
0+             # first check to see if we can import it
0+-            output = shell_out!("python -c \"import #{name}\"", :returns=>[0,1]).stderr
0+-            if output.include? "ImportError"
0+-              # then check to see if its on the path
0+-              output = shell_out!("python -c \"import sys; print sys.path\"", :returns=>[0,1]).stdout
0+-              if output.downcase.include? "#{name.downcase}"
0+-                check = true
0+-              end
0+-            else
0++            output = shell_out!("python -c \"import #{name}\"").stderr
0++            unless output.include? "ImportError"
0+               check = true
0+             end
0+           rescue
0+-            # it's probably not installed
0++            # then check to see if its on the path
0++            output = shell_out!("python -c \"import sys; print sys.path\"").stdout
0++            if output.downcase.include? "#{name.downcase}"
0++              check = true
0++            end
0+           end
0+ 
0+           check
0+@@ -68,18 +66,8 @@
0+               output = shell_out!("python -c \"import #{@new_resource.package_name}; print #{@new_resource.package_name}.__version__\"").stdout
0+               package_version = output.strip
0+             rescue
0+-              output = shell_out!("python -c \"import sys; print sys.path\"", :returns=>[0,1]).stdout
0+-             
0+-              output_array = output.gsub(/[\[\]]/,'').split(/\s*,\s*/)
0+-              package_path = ""
0+-               
0+-              output_array.each do |entry|
0+-                if entry.downcase.include?(@new_resource.package_name)
0+-                  package_path = entry
0+-                end
0+-              end
0+-                 
0+-              package_path[/\S\S(.*)\/(.*)-(.*)-py(.*).egg\S/]
0++              output = shell_out!("python -c \"import #{@new_resource.package_name}; print #{@new_resource.package_name}.__path__\"").stdout
0++              output[/\S\S(.*)\/(.*)-(.*)-py(.*).egg\S/]
0+               package_version = $3
0+             end
0+           end
0+@@ -123,4 +111,4 @@
0+       end
0+     end
0+   end
0+-end
0++end
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--- Revision None
+++ Revision 386538386430
@@ -0,0 +1,55 @@
+--- easy_install.rb 2010-11-23 05:24:57.000000000 +0000
++++ easy_install.rb.orig 2010-11-23 04:53:48.000000000 +0000
+@@ -34,18 +34,16 @@
+
+ begin
+ # first check to see if we can import it
+- output = shell_out!("python -c \"import #{name}\"", :returns=>[0,1]).stderr
+- if output.include? "ImportError"
+- # then check to see if its on the path
+- output = shell_out!("python -c \"import sys; print sys.path\"", :returns=>[0,1]).stdout
+- if output.downcase.include? "#{name.downcase}"
+- check = true
+- end
+- else
++ output = shell_out!("python -c \"import #{name}\"").stderr
++ unless output.include? "ImportError"
+ check = true
+ end
+ rescue
+- # it's probably not installed
++ # then check to see if its on the path
++ output = shell_out!("python -c \"import sys; print sys.path\"").stdout
++ if output.downcase.include? "#{name.downcase}"
++ check = true
++ end
+ end
+
+ check
+@@ -68,18 +66,8 @@
+ output = shell_out!("python -c \"import #{@new_resource.package_name}; print #{@new_resource.package_name}.__version__\"").stdout
+ package_version = output.strip
+ rescue
+- output = shell_out!("python -c \"import sys; print sys.path\"", :returns=>[0,1]).stdout
+-
+- output_array = output.gsub(/[\[\]]/,'').split(/\s*,\s*/)
+- package_path = ""
+-
+- output_array.each do |entry|
+- if entry.downcase.include?(@new_resource.package_name)
+- package_path = entry
+- end
+- end
+-
+- package_path[/\S\S(.*)\/(.*)-(.*)-py(.*).egg\S/]
++ output = shell_out!("python -c \"import #{@new_resource.package_name}; print #{@new_resource.package_name}.__path__\"").stdout
++ output[/\S\S(.*)\/(.*)-(.*)-py(.*).egg\S/]
+ package_version = $3
+ end
+ end
+@@ -123,4 +111,4 @@
+ end
+ end
+ end
+-end
++end