Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/tags/RELEASE_1_4_7/uninstall.rb

Revision 557, 1.6 kB (checked in by nahi, 6 years ago)

Added WSDL4R installation.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to author date id revision
Line 
1 #!/usr/bin/env ruby
2
3 require 'rbconfig'
4 require 'ftools'
5 require '_installedFiles'
6
7 include Config
8
9 RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
10 DSTPATH = CONFIG["sitedir"] + "/" +  RV
11
12 $installed = InstalledFiles.new
13
14 def join( *arg )
15   File.join( *arg )
16 end
17
18 def uninstall( name, path )
19   filePath = join( path, File.basename( name ))
20   if FileTest.exist?( filePath )
21     target = InstalledFile.new( filePath )
22     if $installed.uninstall( target )
23       STDERR.puts "File: #{ target.path } uninstalled."
24     end
25   end
26 end
27
28 def delPath( dirPath )
29   entries = Dir.entries( dirPath )
30   entries.delete( "." )
31   entries.delete( ".." )
32
33   if entries.empty?
34     Dir.unlink( dirPath )
35   else
36     STDERR.puts "Directory: #{ dirPath } is not empty.  The directory is not removed."
37   end
38 end
39
40 begin
41   Dir[ 'lib/soap/*.rb' ].each do | name |
42     uninstall( name, join( DSTPATH, 'soap' ))
43   end
44   Dir[ 'lib/wsdl/*.rb' ].each do | name |
45     uninstall( name, join( DSTPATH, 'wsdl' ))
46   end
47   Dir[ 'lib/wsdl/soap/*.rb' ].each do | name |
48     uninstall( name, join( DSTPATH, 'wsdl', 'soap' ))
49   end
50   Dir[ 'lib/wsdl/xmlSchema/*.rb' ].each do | name |
51     uninstall( name, join( DSTPATH, 'wsdl', 'xmlSchema' ))
52   end
53   Dir[ 'redist/soap/*.rb' ].each do | name |
54     uninstall( name, join( DSTPATH, 'soap' ))
55   end
56   Dir[ 'redist/*.rb' ].each do | name |
57     uninstall( name, DSTPATH )
58   end
59
60   delPath( join( DSTPATH, 'soap' ))
61   delPath( join( DSTPATH, 'wsdl', 'xmlSchema' ))
62   delPath( join( DSTPATH, 'wsdl', 'soap' ))
63   delPath( join( DSTPATH, 'wsdl' ))
64
65   $installed.dump
66
67   puts "uninstall succeed!"
68
69 rescue
70   puts "uninstall failed!"
71   puts $!
72
73 end
Note: See TracBrowser for help on using the browser.