Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 13
- Log:
Initial import of Typo 2.6.0 sources from a downloaded Tarball.
Typo is a Ruby On Rails based blog engine.
- Author:
- adh
- Date:
- Sat Jul 22 22:25:02 +0100 2006
- Size:
- 3398 Bytes
- Properties:
- Property svn:executable is set
1 | #!/usr/bin/ruby |
2 | # |
3 | # BlueCloth Module Install Script |
4 | # $Id: install.rb,v 1.3 2003/10/09 13:23:09 deveiant Exp $ |
5 | # |
6 | # Thanks to Masatoshi SEKI for ideas found in his install.rb. |
7 | # |
8 | # Copyright (c) 2001-2004 The FaerieMUD Consortium. |
9 | # |
10 | # This is free software. You may use, modify, and/or redistribute this |
11 | # software under the terms of the Perl Artistic License. (See |
12 | # http://language.perl.com/misc/Artistic.html) |
13 | # |
14 | |
15 | require './utils.rb' |
16 | include UtilityFunctions |
17 | |
18 | require 'rbconfig' |
19 | include Config |
20 | |
21 | require 'find' |
22 | require 'ftools' |
23 | |
24 | |
25 | $version = %q$Revision: 1.3 $ |
26 | $rcsId = %q$Id: install.rb,v 1.3 2003/10/09 13:23:09 deveiant Exp $ |
27 | |
28 | # Define required libraries |
29 | RequiredLibraries = [ |
30 | # libraryname, nice name, RAA URL, Download URL |
31 | [ 'strscan', "StrScan", |
32 | 'http://raa.ruby-lang.org/list.rhtml?name=strscan', |
33 | 'http://i.loveruby.net/archive/strscan/strscan-0.6.7.tar.gz' ], |
34 | [ 'logger', "Devel-Logger", |
35 | 'http://raa.ruby-lang.org/list.rhtml?name=devel-logger', |
36 | 'http://rrr.jin.gr.jp/download/devel-logger-1_2_2.tar.gz' ], |
37 | ] |
38 | |
39 | class Installer |
40 | |
41 | @@PrunePatterns = [ |
42 | /CVS/, |
43 | /~$/, |
44 | %r:(^|/)\.:, |
45 | /\.tpl$/, |
46 | ] |
47 | |
48 | def initialize( testing=false ) |
49 | @ftools = (testing) ? self : File |
50 | end |
51 | |
52 | ### Make the specified dirs (which can be a String or an Array of Strings) |
53 | ### with the specified mode. |
54 | def makedirs( dirs, mode=0755, verbose=false ) |
55 | dirs = [ dirs ] unless dirs.is_a? Array |
56 | |
57 | oldumask = File::umask |
58 | File::umask( 0777 - mode ) |
59 | |
60 | for dir in dirs |
61 | if @ftools == File |
62 | File::mkpath( dir, $verbose ) |
63 | else |
64 | $stderr.puts "Make path %s with mode %o" % [ dir, mode ] |
65 | end |
66 | end |
67 | |
68 | File::umask( oldumask ) |
69 | end |
70 | |
71 | def install( srcfile, dstfile, mode=nil, verbose=false ) |
72 | dstfile = File.catname(srcfile, dstfile) |
73 | unless FileTest.exist? dstfile and File.cmp srcfile, dstfile |
74 | $stderr.puts " install #{srcfile} -> #{dstfile}" |
75 | else |
76 | $stderr.puts " skipping #{dstfile}: unchanged" |
77 | end |
78 | end |
79 | |
80 | public |
81 | |
82 | def installFiles( src, dstDir, mode=0444, verbose=false ) |
83 | directories = [] |
84 | files = [] |
85 | |
86 | if File.directory?( src ) |
87 | Find.find( src ) {|f| |
88 | Find.prune if @@PrunePatterns.find {|pat| f =~ pat} |
89 | next if f == src |
90 | |
91 | if FileTest.directory?( f ) |
92 | directories << f.gsub( /^#{src}#{File::Separator}/, '' ) |
93 | next |
94 | |
95 | elsif FileTest.file?( f ) |
96 | files << f.gsub( /^#{src}#{File::Separator}/, '' ) |
97 | |
98 | else |
99 | Find.prune |
100 | end |
101 | } |
102 | else |
103 | files << File.basename( src ) |
104 | src = File.dirname( src ) |
105 | end |
106 | |
107 | dirs = [ dstDir ] |
108 | dirs |= directories.collect {|d| File.join(dstDir,d)} |
109 | makedirs( dirs, 0755, verbose ) |
110 | files.each {|f| |
111 | srcfile = File.join(src,f) |
112 | dstfile = File.dirname(File.join( dstDir,f )) |
113 | |
114 | if verbose |
115 | if mode |
116 | $stderr.puts "Install #{srcfile} -> #{dstfile} (mode %o)" % mode |
117 | else |
118 | $stderr.puts "Install #{srcfile} -> #{dstfile}" |
119 | end |
120 | end |
121 | |
122 | @ftools.install( srcfile, dstfile, mode, verbose ) |
123 | } |
124 | end |
125 | |
126 | end |
127 | |
128 | if $0 == __FILE__ |
129 | header "BlueCloth Installer #$version" |
130 | |
131 | for lib in RequiredLibraries |
132 | testForRequiredLibrary( *lib ) |
133 | end |
134 | |
135 | viewOnly = ARGV.include? '-n' |
136 | verbose = ARGV.include? '-v' |
137 | |
138 | debugMsg "Sitelibdir = '#{CONFIG['sitelibdir']}'" |
139 | sitelibdir = CONFIG['sitelibdir'] |
140 | debugMsg "Sitearchdir = '#{CONFIG['sitearchdir']}'" |
141 | sitearchdir = CONFIG['sitearchdir'] |
142 | |
143 | message "Installing\n" |
144 | i = Installer.new( viewOnly ) |
145 | i.installFiles( "lib", sitelibdir, 0444, verbose ) |
146 | end |
147 | |
148 | |
149 | |
150 |