Created
July 10, 2017 23:35
-
-
Save ehelms/d3446cca93937f22fc0d2350b0e06020 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
Dir.mkdir('tmp_repo') unless File.exist?('tmp_repo') | |
spec_dirs = if ARGV[0] | |
if ARGV[0].include?('/') | |
Dir.glob("#{ARGV[0]}*.spec") | |
else | |
Dir.glob("#{ARGV[0]}*/*.spec") | |
end | |
else | |
Dir.glob('**/*.spec') | |
end | |
spec_dirs.each do |dir| | |
package = File.basename(dir).gsub('.spec', '') | |
if (srpm = Dir.glob("tmp_repo/#{package}*").first) | |
File.delete(srpm) | |
end | |
Dir.chdir(File.dirname(dir)) do | |
system('../setup_sources.sh .') | |
system('tito build --test --srpm --dist=.el7 --output ../tmp_repo') | |
end | |
end | |
spec_dirs.each do |dir| | |
spec = File.basename(dir) | |
package = spec.gsub('.spec', '') | |
#next if Dir.glob("build_repo/results/**/#{package}*.el7/*.rpm").first | |
puts "Building for #{package}" | |
system("mockchain -r mock/el7-nonscl.cfg --recurse -l build_repo tmp_repo/#{package}*") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment