Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:languages:ruby:extensions
rubygem-libv8
regenerate_files.rb
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File regenerate_files.rb of Package rubygem-libv8
#!/usr/bin/env ruby require 'fileutils' version = ARGV[0] open('libv8-' + version + '.gemspec') do |gemspec| open('libv8-' + version + '.gemspec.tmp', 'w:UTF-8') do |tmp| gemspec.each_line do |l| tmp.write l unless l.index('s.files') end end end builddir = Dir.glob(ENV['RPM_BUILD_DIR'] + '/*')[0] s_files = [] Dir.glob(builddir + '/**/{*,.*}') do |f| unless File.directory?(f) if File.symlink? f link = File.readlink(f) abslink = File.expand_path(File.join(File.dirname(f), link)) if File.exist? abslink FileUtils.rm_rf f FileUtils.copy(abslink, f) s_files << f.gsub(builddir + '/', '') else puts "#{f}'s symlink #{link}, absolute path #{abslink} doesn't exist" end else s_files << f.gsub(builddir + '/', '') end end end str = 's.files = [' s_files.each do |s| str += "\"#{s}\"," end str = str.gsub(/\,$/, ']').force_encoding('utf-8') open('libv8-' + version + '.gemspec.tmp') do |tmp| open('libv8-' + version + '.gemspec.new', 'w:UTF-8') do |gemspec| tmp.each_line do |l| gemspec.write l gemspec.write str if l.index('s.summary') end end end FileUtils.mv 'libv8-' + version + '.gemspec.new', 'libv8-' + version + '.gemspec'
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor