rubygem-gem2rpm/gem2rpm-change-default-template.diff

23 lines
549 B
Diff
Raw Normal View History

Index: gem2rpm-0.8.1/bin/gem2rpm
===================================================================
--- gem2rpm-0.8.1.orig/bin/gem2rpm
+++ gem2rpm-0.8.1/bin/gem2rpm
@@ -69,6 +69,16 @@ rest = opts.permute(ARGV)
template = nil
if template_file.nil?
+ f = open("/etc/os-release", "r") if File.exists?("/etc/os-release")
+ if f
+ f.read.split('\n').each do |line|
+ line.match(%r{^ID=(.*)$}) { |m| template_file=m[1] }
+ end
+ f.close
+ f = nil
+ end
+end
+if template_file.nil?
template = Gem2Rpm::TEMPLATE
else
begin