Commits

Michael Granger committed 2d110ae

- Updated to latest project-utils.

Comments (0)

Files changed (4)

 			diagrams = true
 		end
 
-		oparser.on( "--output=DIR", "-o=DIR", String, "Set the output directory" ) do
+		oparser.on( "--output=DIR", "-o=DIR", String, "Set the output directory" ) do |val|
 			docsdir = val
 		end
 
 #!/usr/bin/ruby
 #
-#	Linguistics Module Install Script
-#	$Id: install.rb,v 1.3 2003/10/09 13:23:09 deveiant Exp $
+#	Module Install Script
+#	$Id: install.rb 11 2005-08-07 03:30:22Z ged $
 #
 #	Thanks to Masatoshi SEKI for ideas found in his install.rb.
 #
-#	Copyright (c) 2001-2004 The FaerieMUD Consortium.
+#	Copyright (c) 2001-2005 The FaerieMUD Consortium.
 #
 #	This is free software. You may use, modify, and/or redistribute this
 #	software under the terms of the Perl Artistic License. (See
 
 require 'find'
 require 'ftools'
+require 'optparse'
 
-
-$version	= %q$Revision: 1.3 $
-$rcsId		= %q$Id: install.rb,v 1.3 2003/10/09 13:23:09 deveiant Exp $
+$version	= %q$Revision: 11 $
+$rcsId		= %q$Id: install.rb 11 2005-08-07 03:30:22Z ged $
 
 # Define required libraries
 RequiredLibraries = [
-	# libraryname, nice name, RAA URL, Download URL
-# 	[ 'hashslice', "Ruby-Hashslice", 
-# 		'http://www.ruby-lang.org/en/raa-list.rhtml?name=Ruby-HashSlice',
-# 		'http://www.devEiate.org/code/Ruby-HashSlice-1.03.tar.gz' ],
+	# libraryname, nice name, RAA URL, Download URL, e.g.,
+	#[ 'strscan', "Strscan", 
+	#	'http://www.ruby-lang.org/en/raa-list.rhtml?name=strscan',
+	#	'http://i.loveruby.net/archive/strscan/strscan-0.6.7.tar.gz',
+	#],
 ]
 
 class Installer
 
 end
 
+
 if $0 == __FILE__
-	header "Linguistics Installer #$version"
+	dryrun = false
 
-	for lib in RequiredLibraries
-		testForRequiredLibrary( *lib )
+	# Parse command-line switches
+	ARGV.options {|oparser|
+		oparser.banner = "Usage: #$0 [options]\n"
+
+		oparser.on( "--verbose", "-v", TrueClass, "Make progress verbose" ) {
+			$VERBOSE = true
+			debugMsg "Turned verbose on."
+		}
+
+		oparser.on( "--dry-run", "-n", TrueClass, "Don't really install anything" ) {
+			debugMsg "Turned dry-run on."
+			dryrun = true
+		}
+
+		# Handle the 'help' option
+		oparser.on( "--help", "-h", "Display this text." ) {
+			$stderr.puts oparser
+			exit!(0)
+		}
+
+		oparser.parse!
+	}
+
+	# Don't do anything if they expect this to be the three-step install script
+	# and they aren't doing the 'install' step.
+	if ARGV.include?( "config" )
+		for lib in RequiredLibraries
+			testForRequiredLibrary( *lib )
+		end
+		puts "Done."
+	elsif ARGV.include?( "setup" )
+		puts "Done."
+	elsif ARGV.empty?
+		for lib in RequiredLibraries
+			testForRequiredLibrary( *lib )
+		end
 	end
 
-	viewOnly = ARGV.include? '-n'
-	verbose = ARGV.include? '-v'
+	if ARGV.empty? || ARGV.include?( "install" )
+		debugMsg "Sitelibdir = '#{CONFIG['sitelibdir']}'"
+		sitelibdir = CONFIG['sitelibdir']
+		debugMsg "Sitearchdir = '#{CONFIG['sitearchdir']}'"
+		sitearchdir = CONFIG['sitearchdir']
 
-	# "Compatibility" with Aoki-san's install.rb
-	if ARGV.include?( 'config' ) || ARGV.include?( 'setup' )
-		print "Ok."
-		exit
+		message "Installing..."
+		i = Installer.new( dryrun )
+		#i.installFiles( "redist", sitelibdir, 0444, verbose )
+		i.installFiles( "lib", sitelibdir, 0444, $VERBOSE )
+
+		message "done.\n"
 	end
-
-	debugMsg "Sitelibdir = '#{CONFIG['sitelibdir']}'"
-	sitelibdir = CONFIG['sitelibdir']
-	debugMsg "Sitearchdir = '#{CONFIG['sitearchdir']}'"
-	sitearchdir = CONFIG['sitearchdir']
-
-	message "Installing\n"
-	i = Installer.new( viewOnly )
-	i.installFiles( "redist", sitelibdir, 0444, verbose )
-	i.installFiles( "lib", sitelibdir, 0444, verbose )
 end
 	
 
 #!/usr/bin/ruby
 #
 #	Distribution Maker Script
-#	$Id: makedist.rb 6 2004-12-02 07:57:32Z ged $
+#	$Id: makedist.rb 13 2005-10-14 06:44:00Z ged $
 #
-#	Copyright (c) 2001, 2002, 2004, The FaerieMUD Consortium.
+#	Copyright (c) 2001-2005, The FaerieMUD Consortium.
 #
 #	This is free software. You may use, modify, and/or redistribute this
 #	software under the terms of the Perl Artistic License. (See
 
 
 # SVN Revision
-SVNRev = %q$Rev: 6 $
+SVNRev = %q$Rev: 13 $
 
 # SVN Id
-SVNId = %q$Id: makedist.rb 6 2004-12-02 07:57:32Z ged $
+SVNId = %q$Id: makedist.rb 13 2005-10-14 06:44:00Z ged $
 
 # SVN URL
 SVNURL = %q$URL: svn+ssh://svn.FaerieMUD.org/usr/local/svn/project-utils/trunk/makedist.rb $
 				uri = getSvnUri()
 				taguri = uri + "tags/#{tag}"
 				message "SVN tag URI: %s\n" % [ taguri ]
-				system( $Programs['svn'], 'cp', uri.to_s, taguri.to_s )
+				system( $Programs['svn'], 'cp', uri.to_s, taguri.to_s,
+					'-m', "Tagging for version %s" % [version] )
 			else
 				errorMessage "No supported version control system. Skipping tag."
 			end
 	message "Making distribution directory #{distName}...\n"
 	Dir.mkdir( distName ) unless FileTest.directory?( distName )
 	for file in filelist
-		File.makedirs( File.dirname(File.join(distName,file)) )
-		File.link( file, File.join(distName,file) )
+		FileUtils.mkdir_p( File.dirname(File.join(distName,file)), :verbose => true )
+		FileUtils.ln( file, File.join(distName,file), :verbose => true )
 	end
 
 	# Make an archive file for each known kind
 #
 #	Install/distribution utility functions
-#	$Id: utils.rb 8 2005-07-13 12:35:15Z ged $
+#	$Id: utils.rb 10 2005-08-07 03:28:54Z ged $
 #
 #	Copyright (c) 2001-2005, The FaerieMUD Consortium.
 #
 	def try( msg, bind=nil )
 		result = ''
 		if msg =~ /^to\s/
-			message = "Trying #{msg}..."
+			message "Trying #{msg}...\n"
 		else
-			message = msg
+			message msg + "\n"
 		end
 			
 		begin
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.