#!/usr/bin/ruby # # Ruby script to build the P4Ruby distribution with Ruby 1.8. # require "makemodule" require "ftools" class P4Ruby18 # => Empty constructor def initialize end include P4RubyCommon # Copy a file into a directory - creating the target directories as # required # def filecopy( srcpath, topdir ) dstpath = topdir + "/" + srcpath dstdir = File.dirname( dstpath ) File.makedirs( dstdir ) File.copy( srcpath, dstpath ) end # # Remove a directory recursively. # def cleanup( path ) if File.directory?( path ) Dir.foreach( path ) do |ent| next if ent == '.' or ent == '..' p = path + '/' + ent cleanup( p ) end Dir.rmdir( path ) else File.safe_unlink( path ) end end # # Populate the distribution directory # def populate( build_dir ) Dir.mkdir( build_dir ) or raise( RuntimeError, "Can't create #{build_dir}" ) # # Copy the release notes into 'RELNOTES.txt'. This is ugly, but we need # a way to include the release notes in the distribution, but still store # them in the standard place # File.copy( @@RELNOTES_PATH, "RELNOTES.txt" ) mfest = File.open( "MANIFEST" ) files = mfest.readlines() mfest.close files.each do |file| file.sub!( /\r?\n/, "" ) filecopy( file, build_dir ) end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 14682 | Git Fusion |
Git Fusion branch management Imported from Git ghost-of-change-num: 960958 ghost-of-sha1: 005052ae424bd69f426f7209e741ca1c8c3253c7 ghost-precedes-sha1: ad052c71a568ef12165e143a6866ad9ceffbb4a1 parent-branch: None@960958 push-state: incomplete |
||
#1 | 14603 | jmistry |
Rewrite 'makedist' to support Ruby 1.9 When building P4Ruby with 'jam', 'makedist' will fail because it contains 1.8 specific modules and methods. This change separates this out, moving non-version specific methods to the module P4RubyCommon (makemodule.rb). Version specific stuff has been moved to two separate classes; P4Ruby18 (make1.8.rb) and P4Ruby19 (make1.9.rb). 'makedist' now checks RUBY_VERSION and creates an instance of the appropriate class depending on the version of Ruby used. |