aboutsummaryrefslogtreecommitdiffhomepage
path: root/rbuild
diff options
context:
space:
mode:
Diffstat (limited to 'rbuild')
-rw-r--r--rbuild70
1 files changed, 67 insertions, 3 deletions
diff --git a/rbuild b/rbuild
index 94db4416..261c5256 100644
--- a/rbuild
+++ b/rbuild
@@ -37,8 +37,8 @@
#require 'mkmf'
#create_makefile("sisu")
#% manual settings, edit/update as required (note current default settings are obtained from sisu version yml file)
-SiSU_version_next_stable = '5.6.1' #% set version
-SiSU_version_next_unstable = '6.2.2' #% set version
+SiSU_version_next_stable = '5.6.2' #% set version stable current
+SiSU_version_next_unstable = '6.2.3' #% set version unstable dev
#% rake file
SiSU_version_generic_next_stable = '5.4.x'
SiSU_version_generic_next_unstable = '6.0.x'
@@ -148,7 +148,7 @@ module Utils
resp='redo'
print ask + " ['yes', 'no' or 'quit']: "
resp=File.new('/dev/tty').gets.strip #resp=gets.strip
- if resp == 'yes' then true
+ if resp == 'yes' then true
elsif resp == 'no' then false
elsif resp =~/^quit|exit$/ then exit
else puts "[please type: 'yes', 'no' or 'quit']"
@@ -333,6 +333,46 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz
end
self
end
+module GitExtractTaggedVersionBuild
+ def upstream
+ system(%{ git checkout upstream })
+ end
+ def self.git_tagged_versions(vb=nil)
+ if vb.tag
+ v=if vb.tag =~/sisu_[0-9](?:\.[0-9]){0,2}$/ then vb.tag
+ elsif vb.tag =~/^[0-9](?:\.[0-9]){0,2}$/ then 'sisu_' + vb.tag
+ else 'sisu_'
+ end
+ system(%{ git tag -l | ag --nocolor '^#{v}' })
+ end
+ end
+ def self.git_checkout_and_build_version(vb)
+ begin
+ ver=if vb.tag =~/sisu_[0-9]\.[0-9]+\.[0-9]+/ then vb.tag
+ elsif vb.tag =~/^[0-9]\.[0-9]+\.[0-9]+/ then 'sisu_' + vb.tag
+ else vb.branch
+ end
+ install_branch=case vb.branch
+ when /^(?:stable|unstable)$/
+ "gem_create_build_install_#{vb.branch}"
+ when /^(?:all)/
+ 'gem_create_build_install'
+ else
+ 'gem_create_build_install_stable'
+ end
+ commands =<<-WOK
+ git checkout #{ver} &&
+ rake #{install_branch};
+ WOK
+ puts commands
+ system(commands)
+ ensure
+ system(%{
+ git checkout upstream
+ })
+ end
+ end
+end
module Gemspecs
def self.info(vi)
puts <<-WOK
@@ -504,6 +544,7 @@ desc "Setup/Install #{Project_details.name}: bin, lib, conf & data"
task :setup_with_data=> [:setup_base,:setup_data]
desc "check package version"
task :sisuversion => [:sisu_version]
+ task :version => [:sisu_version]
#desc "set package version"
task :sisuversionset => [:sisu_version_set,:changelog_headers]
desc "check gemspec info"
@@ -690,6 +731,29 @@ desc 'Help'
#desc "Setup/Install #{Project_details.name} (uses filelist)"
task :install => [:default_notice,:project]
task :install_bin => [:setup_bin_]
+#desc "search for a version tag e.g. 'tag[5.6.0]'"
+ task :tag, [:tag] do |t, args|
+ args.with_defaults(:tag => Version_info::Next.setting_stable[:version])
+ puts "Check for Version Tag: #{args.tag}"
+ print "Version Tag: "
+ GitExtractTaggedVersionBuild::git_tagged_versions(args)
+ end
+#desc "build and install a specific git tagged version of sisu, e.g. 'build[5.6.0]'"
+ task :build, [:tag, :branch] => :done do |t, args|
+ args.with_defaults(:tag => '5.6.0', :branch => 'stable')
+ puts "Version Tag: #{args.tag}"
+ puts "Branch: #{args.branch}"
+ GitExtractTaggedVersionBuild::git_tagged_versions(args.tag)
+ ans= <<-WOK
+ Gem Install SiSU Version
+ WOK
+ resp=Utils.answer?(ans)
+ exit unless resp
+ GitExtractTaggedVersionBuild::git_checkout_and_build_version(args)
+ end
+ task :done do
+ puts 'done'
+ end
#%% setup/install tasks
task :rant_independence do #notice
resp=''