Sha256: 2b8bc5de5c351d30de569833a922bddd1edbbf20a859ee7868bc37b697d1b223

Contents?: true

Size: 625 Bytes

Versions: 35

Compression:

Stored size: 625 Bytes

Contents

require 'fileutils'
require 'find'

def process(file)
  puts "Post-processing #{file}"
  File.open(file) do |input|
    File.open("#{file}.pp", "w") do |output|
      input.each_line do |line|
        yield output, line
      end
    end
  end
  FileUtils.mv("#{file}.pp", "#{file}")
end

Find.find(".") do |file|
  if file =~ /Makefile.in$/ then
    process(file) do |out, line|
      # automake doesn't properly enclose $distdir in quotes
      if line !~ /echo / then
        line.gsub!(/([^"'])(\$\(distdir\))/, '\1"\2"')
      end
      line.gsub!(/(\$\(MKDIR_P\).*`)/, 'eval \1')
      out.puts line
    end
  end
end

Version data entries

35 entries across 35 versions & 6 rubygems

Version Path
rice-3.0.0 post-automake.rb
rice2-2.2.1 post-automake.rb
rice2-2.2.0 post-automake.rb
rice-2.2.0 post-automake.rb
rice-2.1.3 post-automake.rb
rice-2.1.2 post-automake.rb
rice-2.1.1 post-automake.rb
rice-2.1.0 post-automake.rb
rice-2.0.0 post-automake.rb
rice-1.7.0 post-automake.rb
rice-1.6.3 post-automake.rb
jameskilton-rice-1.2.0 post-automake.rb
rice-1.6.2 post-automake.rb
rice-1.6.1 post-automake.rb
rice-1.6.0 post-automake.rb
rice-1.6.0.pre post-automake.rb
rice-1.5.3 post-automake.rb
rice-1.5.2 post-automake.rb
keyme-rice-1.5.1.keyme1 post-automake.rb
keyme-rice-1.5.1.keyme post-automake.rb