From fa7629510d472720ade29a02446b7e17d473dac1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 12 Nov 2014 21:30:15 -0500 Subject: v5 v6: version & changelog (upstream "UnFrozen" early) * "UnFrozen" prior to original time intended (end of Debian Freeze for Jessie), reason: the upstream bugfix 5.7.2 intended for Jessie (packaged for Debian as 5.7.1-2) was not accepted; this means even if another patch does get sent for Jessie, it will not be from upstream branch) * post Debian:Jessie development commits --- setup/sisu_version.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setup') diff --git a/setup/sisu_version.rb b/setup/sisu_version.rb index 2d777c03..572a8819 100644 --- a/setup/sisu_version.rb +++ b/setup/sisu_version.rb @@ -1,7 +1,7 @@ #% constants module SiSUversion - SiSU_version_next_stable = '5.7.2' #% set version stable current - SiSU_version_next_unstable = '6.3.2' #% set version unstable dev + SiSU_version_next_stable = '5.8.0' #% set version stable current + SiSU_version_next_unstable = '6.4.0' #% set version unstable dev #% qi quick install file SiSU_version_generic_next_stable = '5.4.x' SiSU_version_generic_next_unstable = '6.0.x' -- cgit v1.2.3 From 1db1a6e8411bed7ce63e2e717f55ee07f08b6157 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 13 Nov 2014 10:24:45 -0500 Subject: qi, (quick install) header update (also rbuild) --- setup/qi_libs.rb | 2 +- setup/qi_libs_base.rb | 2 +- setup/rbuild_libs.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'setup') diff --git a/setup/qi_libs.rb b/setup/qi_libs.rb index 6fa6cde7..331ed72e 100644 --- a/setup/qi_libs.rb +++ b/setup/qi_libs.rb @@ -285,7 +285,7 @@ proceed? } end def self.changelog_header(vi) <<-WOK -%% #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) +** #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vi[:version]} http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vi[:version]}-1 http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz diff --git a/setup/qi_libs_base.rb b/setup/qi_libs_base.rb index ec01af19..982625e0 100644 --- a/setup/qi_libs_base.rb +++ b/setup/qi_libs_base.rb @@ -234,7 +234,7 @@ proceed? } end def self.changelog_header(vi) <<-WOK -%% #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) +** #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vi[:version]} http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vi[:version]}-1 http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz diff --git a/setup/rbuild_libs.rb b/setup/rbuild_libs.rb index 8389c836..9dc55bf7 100644 --- a/setup/rbuild_libs.rb +++ b/setup/rbuild_libs.rb @@ -284,7 +284,7 @@ proceed? } end def self.changelog_header(vi) <<-WOK -%% #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) +** #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vi[:version]} http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vi[:version]}-1 http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz -- cgit v1.2.3 From 4db4dcc886b85bf9db43d66025452fb33c94a9dd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 26 Nov 2014 09:12:11 -0500 Subject: c&d: project dir structure, libs moved under new branch names * libs & version files under new branch names: current & develop * previously under branch version numbers (v5|v6) * version .yml files moved * associated adjustments made as required, notably to: bin/sisu se* qi* (file headers); breakage potential, testing required * [on dir names, want release to (alphabetically) precede next/development, considered (cur|dev) (current|(dev|development|progress|next)) (stable|unstable), alpha sorting fail (release|(next|develop))] --- setup/qi_libs.rb | 257 ++++++++++++++++++++++++++++++++++++++++---------- setup/qi_libs_base.rb | 2 +- setup/rbuild_libs.rb | 27 +++--- setup/sisu_version.rb | 6 +- 4 files changed, 226 insertions(+), 66 deletions(-) (limited to 'setup') diff --git a/setup/qi_libs.rb b/setup/qi_libs.rb index 331ed72e..80ccc8d8 100644 --- a/setup/qi_libs.rb +++ b/setup/qi_libs.rb @@ -138,7 +138,7 @@ module Utils end module Install #%% using a directory and its mapping - def self.setup_find_create(dir_get,dir_put,exclude_files=['']) #primary, + def self.setup_find_create(dir_get,dir_put,exclude_files=[''],act) #primary, begin Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f| stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join @@ -146,13 +146,17 @@ module Install action=case when File.file?(f) unless f =~/#{exclude_files.inspect}/ - cp(f,place) - Utils.chmod_file(place) + unless act==:dryrun + cp(f,place) + Utils.chmod_file(place) + end "-> #{dir_put}/" end when File.directory?(f) - FileUtils.mkpath(place) \ - unless FileTest.directory?(place) + if not FileTest.directory?(place) \ + and not act==:dryrun + FileUtils.mkpath(place) + end "./#{dir_get}/" else '?' end @@ -162,18 +166,27 @@ module Install puts "\n\n[ are you root? required for install ]" end end - def self.setup_find_cp_r(dir_get,dir_put) #secondary, using recursive copy + def self.setup_find_cp_r(dir_get,dir_put,act) #secondary, using recursive copy begin Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f| stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join place="#{dir_put}/#{stub}" case when File.file?(f) - cp_r(f,place) - Utils.chmod_util(place) + unless act==:dryrun + cp_r(f,place) + Utils.chmod_util(place) + else + puts "--> #{place}" + end when File.directory?(f) - mkdir(place) \ - unless FileTest.directory?(place) + unless FileTest.directory?(place) + unless act==:dryrun + mkdir(place) + else + puts "mkdir -p #{place}" + end + end end end rescue @@ -182,18 +195,21 @@ module Install end end module Version_info - def self.contents(vi) + def self.contents(vi,rel=:release) + release=if rel ==:pre_release then '_pre_rel' + else '' + end <<-WOK --- :project: #{vi[:project]} -:version: #{vi[:version]} +:version: #{vi[:version]}#{release} :date_stamp: #{vi[:date_stamp]} :date: "#{vi[:date]}" WOK end module Current def self.yml_file_path(version) - "data/sisu/#{version}/v/version.yml" + "data/sisu/version/#{version}.yml" end def self.settings(file) v="#{Dir.pwd}/#{file}" @@ -202,6 +218,12 @@ module Version_info else '' end end + def self.changelog_file_stable + 'data/doc/sisu/CHANGELOG_v5' + end + def self.changelog_file_unstable + 'data/doc/sisu/CHANGELOG_v6' + end def self.file_stable yml_file_path(SiSU_version_dir_stable) end @@ -209,10 +231,16 @@ module Version_info yml_file_path(SiSU_version_dir_unstable) end def self.setting_stable - settings(file_stable) + hsh=settings(file_stable) + hsh[:version_number]=/([0-9]+\.[0-9]+\.[0-9]+)/. + match(hsh[:version])[1] + hsh end def self.setting_unstable - settings(file_unstable) + hsh=settings(file_unstable) + hsh[:version_number]=/([0-9]+\.[0-9]+\.[0-9]+)/. + match(hsh[:version])[1] + hsh end def self.content_stable Version_info.contents(setting_stable) @@ -236,11 +264,11 @@ module Version_info def self.setting_unstable settings(SiSU_version_next_unstable) end - def self.content_stable - Version_info.contents(setting_stable) + def self.content_stable(rel) + Version_info.contents(setting_stable,rel) end - def self.content_unstable - Version_info.contents(setting_unstable) + def self.content_unstable(rel) + Version_info.contents(setting_unstable,rel) end end module Update @@ -250,7 +278,8 @@ module Version_info with: #{vi_hash_next.sort} -#{vi_content_current} becoming: +#{vi_content_current} +becoming: #{vi_content_next} proceed? } resp=Utils.answer?(ans) @@ -265,39 +294,168 @@ proceed? } end end end - def self.update_stable + def self.update_stable(rel=:release) version_info_update_commit( Version_info::Current.file_stable, Version_info::Current.setting_stable, Version_info::Current.content_stable, Version_info::Next.setting_stable, - Version_info::Next.content_stable + Version_info::Next.content_stable(rel), ) end - def self.update_unstable + def self.update_unstable(rel=:release) version_info_update_commit( Version_info::Current.file_unstable, Version_info::Current.setting_unstable, Version_info::Current.content_unstable, Version_info::Next.setting_unstable, - Version_info::Next.content_unstable + Version_info::Next.content_unstable(rel), ) end def self.changelog_header(vi) + vn=/([0-9]+\.[0-9]+\.[0-9]+)/.match(vi[:version])[1] <<-WOK -** #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) -http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vi[:version]} -http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vi[:version]}-1 -http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz - sisu_#{vi[:version]}.orig.tar.xz - sisu_#{vi[:version]}-1.dsc +** #{vn}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) +http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vn} +http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vn}-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_#{vn}.orig.tar.xz + sisu_#{vn}.orig.tar.xz + sisu_#{vn}-1.dsc WOK end + def self.changelog_header_release(filename,ch,vi) + ans=%{update #{Project_details.name.downcase} changelog header, open version: + + #{ch} +proceed? } + resp=Utils.answer?(ans) + if resp + fn="#{Dir.pwd}/#{filename}" + if File.writable?(fn) + changelog_arr_current = IO.readlines(fn) + changelog_arr_next=[] + changelog_arr_current.each do |line| + changelog_arr_next <<=if line =~/^\*\* [0-9]+\.[0-9]+\.[0-9]+(?:_pre_rel)?\.orig\.tar\.xz \(Open commit window: [0-9]{4}-[0-9]{2}-[0-9]{2}; Pre-Release\)\)$/ + "** #{vi[:version]}.orig.tar.xz " \ + + "(#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')})\n" + else line + end + end + if changelog_arr_current.length == changelog_arr_next.length + changelog_file=File.new(fn,'w+') + changelog_arr_next.flatten.each do |line| + changelog_file << line + end + changelog_file.close + else puts "expected changelog arrays to have same length, in: #{changelog_arr_current.length}, out: #{changelog_arr_next.length}" + end + else + puts %{*WARN* is the file or directory writable? could not create #{filename}} + end + end + end + def self.changelog_header_stable_filename + Version_info::Current.changelog_file_stable + end + def self.changelog_header_unstable_filename + Version_info::Current.changelog_file_unstable + end def self.changelog_header_stable - changelog_header(Version_info::Current.setting_stable) + ch=changelog_header(Version_info::Current.setting_stable) + changelog_header_release( + changelog_header_stable_filename, + ch, + Version_info::Current.setting_stable + ) end def self.changelog_header_unstable - changelog_header(Version_info::Current.setting_unstable) + ch=changelog_header(Version_info::Current.setting_unstable) + changelog_header_release( + changelog_header_unstable_filename, + ch, + Version_info::Current.setting_unstable + ) + end + def self.changelog_header_pre_release(vi) + vn=/([0-9]+\.[0-9]+\.[0-9]+)/.match(vi[:version])[1] + <<-WOK +** #{vn}.orig.tar.xz (Open commit window: #{vi[:date]}; Pre-Release)) +http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vn} +http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vn}-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_#{vn}.orig.tar.xz + sisu_#{vn}.orig.tar.xz + sisu_#{vn}-1.dsc + WOK + end + def self.changelog_header_pre_release_write(filename,ch) + ans=%{update #{Project_details.name.downcase} changelog header, open version: + + #{ch} +proceed? } + resp=Utils.answer?(ans) + if resp + fn="#{Dir.pwd}/#{filename}" + if File.writable?(fn) + changelog_arr_current = IO.readlines(fn) + changelog_arr_next=[] + changelog_arr_current.each do |line| + changelog_arr_next <<=if line =~/^--- HEAD ---$/ + line << ("\n" + ch) + else line + end + end + if changelog_arr_current.length == changelog_arr_next.length + changelog_file=File.new(fn,'w+') + changelog_arr_next.flatten.each do |line| + changelog_file << line + end + changelog_file.close + else puts "expected changelog arrays to have same length, in: #{changelog_arr_current.length}, out: #{changelog_arr_next.length}" + end + else + puts %{*WARN* is the file or directory writable? could not create #{filename}} + end + end + end + def self.changelog_header_stable_pre_release + ch=changelog_header_pre_release(Version_info::Current.setting_stable) + changelog_header_pre_release_write(changelog_header_stable_filename,ch) + end + def self.changelog_header_unstable_pre_release + ch=changelog_header_pre_release(Version_info::Current.setting_unstable) + changelog_header_pre_release_write(changelog_header_unstable_filename,ch) + end + def self.commit_changelog(rel=:release,msg) + system(%{ + git commit -a -m"#{msg}" + git commit --amend + }) + end + def self.tag_upstream + system(%{ + git tag -a sisu_#{SiSU_version_next_stable} -m"SiSU #{SiSU_version_next_stable}" + }) + end + def self.changelog_header_commit(rel=:release) + msg=(rel == :pre_release) \ + ? "version & changelog, open commit window" + : "version & changelog, tag for release" + ans=%{commit #{msg}:\n\nproceed? } + resp=Utils.answer?(ans) + if resp + commit_changelog(rel,msg) + end + end + def self.changelog_header_commit_tag_upstream(rel=:release) + msg=(rel == :pre_release) \ + ? "version & changelog, open commit window" + : "version & changelog, tag for release" + ans=%{commit #{msg}:\n\nproceed? } + resp=Utils.answer?(ans) + if resp + commit_changelog(rel,msg) + tag_upstream + end end end self @@ -359,7 +517,7 @@ module Gemspecs puts <<-WOK -- name: #{vi[:project].downcase} -version: #{vi[:version]} +version: #{vi[:version_number]} date: #{vi[:date]} summary: #{vi[:project]} WOK @@ -368,14 +526,14 @@ summary: #{vi[:project]} <<-WOK Gem::Specification.new do |s| s.name = '#{vi[:project].downcase}' - s.version = '#{vi[:version]}' + s.version = '#{vi[:version_number]}' s.date = '#{vi[:date]}' s.summary = '#{vi[:project]}' s.description = '#{Project_details.name} gem' s.authors = ["Ralph Amissah"] s.email = 'ralph.amissah@gmail.com' s.files = Dir['lib/#{Project_details.name.downcase}/#{version}/*.rb'] + - Dir['data/#{Project_details.name.downcase}/#{version}/v/version.yml'] + + Dir['data/#{Project_details.name.downcase}/version/#{version}.yml'] + Dir['data/#{Project_details.name.downcase}/image/*'] + Dir['bin/#{Project_details.name.downcase}gem'] + Dir['bin/#{Project_details.name.downcase}'] @@ -406,12 +564,12 @@ end def self.filename_stable Project_details.name.downcase \ + '-' \ - + Version_info::Current.setting_stable[:version] + + Version_info::Current.setting_stable[:version_number] end def self.filename_unstable Project_details.name.downcase \ + '-' \ - + Version_info::Current.setting_unstable[:version] + + Version_info::Current.setting_unstable[:version_number] end def self.info_stable Gemspecs.info(Version_info::Current.setting_stable) @@ -462,12 +620,12 @@ end def self.filename_stable Project_details.name.downcase \ + '-' \ - + Version_info::Next.setting_stable[:version] + + Version_info::Next.setting_stable[:version_number] end def self.filename_unstable Project_details.name.downcase \ + '-' \ - + Version_info::Next.setting_unstable[:version] + + Version_info::Next.setting_unstable[:version_number] end def self.setting_stable Gemspecs.contents( @@ -504,18 +662,17 @@ end module Package def self.sequence puts <<-WOK - --update-version # update package version + --open-version # update package version + --version-and-tag-for-release # git tags upstream version # not included: - # --tag # git tags upstream version - # --merge # git merge upstream tag into debian/sid - # --dch # dch create and edit - # --dch-commit # dch commit - # --build # git-buildpackage - # --git_push # git push changes - # --dput # dput package - # --reprepro_update # reprepro update - # --reprepro_push # reprepro rsync changes + # --merge # git merge upstream tag into debian/sid + # --dch # dch create and edit + # --dch-commit # dch commit + # --build # git-buildpackage + # --git_push # git push changes + # --dput # dput package + # --reprepro_update # reprepro update + # --reprepro_push # reprepro rsync changes WOK end end - diff --git a/setup/qi_libs_base.rb b/setup/qi_libs_base.rb index 982625e0..126811c8 100644 --- a/setup/qi_libs_base.rb +++ b/setup/qi_libs_base.rb @@ -142,7 +142,7 @@ module Version_info end module Current def self.yml_file_path(version) - "data/sisu/#{version}/v/version.yml" + "data/sisu/version/#{version}.yml" end def self.settings(file) v="#{Dir.pwd}/#{file}" diff --git a/setup/rbuild_libs.rb b/setup/rbuild_libs.rb index 9dc55bf7..b999704b 100644 --- a/setup/rbuild_libs.rb +++ b/setup/rbuild_libs.rb @@ -192,7 +192,7 @@ module Version_info end module Current def self.yml_file_path(version) - "data/sisu/#{version}/v/version.yml" + "data/sisu/version/#{version}.yml" end def self.settings(file) v="#{Dir.pwd}/#{file}" @@ -208,10 +208,16 @@ module Version_info yml_file_path(SiSU_version_dir_unstable) end def self.setting_stable - settings(file_stable) + hsh=settings(file_stable) + hsh[:version_number]=/([0-9]+\.[0-9]+\.[0-9]+)/. + match(hsh[:version])[1] + hsh end def self.setting_unstable - settings(file_unstable) + hsh=settings(file_unstable) + hsh[:version_number]=/([0-9]+\.[0-9]+\.[0-9]+)/. + match(hsh[:version])[1] + hsh end def self.content_stable Version_info.contents(setting_stable) @@ -373,7 +379,7 @@ module Gemspecs puts <<-WOK -- name: #{vi[:project].downcase} -version: #{vi[:version]} +version: #{vi[:version_number]} date: #{vi[:date]} summary: #{vi[:project]} WOK @@ -382,14 +388,14 @@ summary: #{vi[:project]} <<-WOK Gem::Specification.new do |s| s.name = '#{vi[:project].downcase}' - s.version = '#{vi[:version]}' + s.version = '#{vi[:version_number]}' s.date = '#{vi[:date]}' s.summary = '#{vi[:project]}' s.description = '#{Project_details.name} gem' s.authors = ["Ralph Amissah"] s.email = 'ralph.amissah@gmail.com' s.files = Dir['lib/#{Project_details.name.downcase}/#{version}/*.rb'] + - Dir['data/#{Project_details.name.downcase}/#{version}/v/version.yml'] + + Dir['data/#{Project_details.name.downcase}/#{version}/version.yml'] + Dir['data/#{Project_details.name.downcase}/image/*'] + Dir['bin/#{Project_details.name.downcase}gem'] + Dir['bin/#{Project_details.name.downcase}'] @@ -420,12 +426,12 @@ end def self.filename_stable Project_details.name.downcase \ + '-' \ - + Version_info::Current.setting_stable[:version] + + Version_info::Current.setting_stable[:version_number] end def self.filename_unstable Project_details.name.downcase \ + '-' \ - + Version_info::Current.setting_unstable[:version] + + Version_info::Current.setting_unstable[:version_number] end def self.info_stable Gemspecs.info(Version_info::Current.setting_stable) @@ -476,12 +482,12 @@ end def self.filename_stable Project_details.name.downcase \ + '-' \ - + Version_info::Next.setting_stable[:version] + + Version_info::Next.setting_stable[:version_number] end def self.filename_unstable Project_details.name.downcase \ + '-' \ - + Version_info::Next.setting_unstable[:version] + + Version_info::Next.setting_unstable[:version_number] end def self.setting_stable Gemspecs.contents( @@ -515,4 +521,3 @@ end end end end - diff --git a/setup/sisu_version.rb b/setup/sisu_version.rb index 572a8819..38216303 100644 --- a/setup/sisu_version.rb +++ b/setup/sisu_version.rb @@ -3,10 +3,8 @@ module SiSUversion SiSU_version_next_stable = '5.8.0' #% set version stable current SiSU_version_next_unstable = '6.4.0' #% set version unstable dev #% qi quick install file - SiSU_version_generic_next_stable = '5.4.x' - SiSU_version_generic_next_unstable = '6.0.x' - SiSU_version_dir_stable = 'v5' - SiSU_version_dir_unstable = 'v6' + SiSU_version_dir_stable = 'current' + SiSU_version_dir_unstable = 'develop' end module Dev GPGpubKey = '1BB4B289' -- cgit v1.2.3 From 72fbfab2726d93281f7cd6b4fa395f90512d41ab Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 8 Apr 2015 10:49:37 -0400 Subject: qi (quick install) fix --- setup/qi_libs.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setup') diff --git a/setup/qi_libs.rb b/setup/qi_libs.rb index 80ccc8d8..90359a5c 100644 --- a/setup/qi_libs.rb +++ b/setup/qi_libs.rb @@ -138,14 +138,14 @@ module Utils end module Install #%% using a directory and its mapping - def self.setup_find_create(dir_get,dir_put,exclude_files=[''],act) #primary, + def self.setup_find_create(dir_get,dir_put,exclude_files=['\*'],act) #primary, begin Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f| stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join place="#{dir_put}/#{stub}" action=case when File.file?(f) - unless f =~/#{exclude_files.inspect}/ + unless f =~/#{exclude_files.join("|")}/ unless act==:dryrun cp(f,place) Utils.chmod_file(place) -- cgit v1.2.3 From 490b37178dc413e8a3280dd2619be51d9280ce52 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 10 Apr 2015 17:46:22 -0400 Subject: install related, qi (quick install) & rake --- setup/qi_libs.rb | 66 ++++++++++++++++++++++++++++++++++++++++++---------- setup/rbuild_libs.rb | 4 ++-- 2 files changed, 56 insertions(+), 14 deletions(-) (limited to 'setup') diff --git a/setup/qi_libs.rb b/setup/qi_libs.rb index 90359a5c..9d11cecd 100644 --- a/setup/qi_libs.rb +++ b/setup/qi_libs.rb @@ -5,6 +5,9 @@ module Project_details def self.name 'SiSU' end + def self.description + 'documents - structuring, publishing in multiple formats and search' + end def self.thor "ruby-thor files for the installation/setup of #{name}" end @@ -207,6 +210,40 @@ module Version_info :date: "#{vi[:date]}" WOK end + def self.git_version_extract + if FileTest.file?('/usr/bin/git') + x=`git describe --long --tags 2>&1`.strip. + gsub(/^[a-z_-]*([0-9.]+)/,'\1'). + gsub(/([^-]*-g)/,'r\1'). + gsub(/-/,'.') + x=(x=~/^[0-9]+\.[0-9]+\.[0-9]+\.r[0-9]+\.g[0-9a-f]{7}/) \ + ? x + : nil + else nil + end + end + def self.version_number_use(vi) + (git_version_extract.nil?) \ + ? (vi[:version]) + : git_version_extract + end + def self.version_number_info(vi) + (Version_info.version_number_use(vi) != vi[:version_number]) \ + ? (%{#{vi[:version_number]} from git #{Version_info.version_number_use(vi)}}) + : vi[:version_number] + end + def self.version_number_info_stable + vi=Version_info::Current.setting_stable + (Version_info.version_number_use(vi) != vi[:version_number]) \ + ? (%{#{vi[:version_number]} from git #{Version_info.version_number_use(vi)}}) + : vi[:version_number] + end + def self.version_number_info_unstable + vi=Version_info::Current.setting_unstable + (Version_info.version_number_use(vi) != vi[:version_number]) \ + ? (%{#{vi[:version_number]} from git #{Version_info.version_number_use(vi)}}) + : vi[:version_number] + end module Current def self.yml_file_path(version) "data/sisu/version/#{version}.yml" @@ -272,6 +309,13 @@ module Version_info end end module Update + def self.version_number(vi) + /([0-9]+\.[0-9]+\.[0-9]+)/.match(vi[:version])[1] + end + def self.version_number_stable + vi=Version_info::Current.setting_stable + /([0-9]+\.[0-9]+\.[0-9]+)/.match(vi[:version])[1] + end def self.version_info_update_commit(filename,vi_hash_current,vi_content_current,vi_hash_next,vi_content_next) ans=%{update #{Project_details.name.downcase} version info replacing: #{vi_hash_current.sort} @@ -313,7 +357,7 @@ proceed? } ) end def self.changelog_header(vi) - vn=/([0-9]+\.[0-9]+\.[0-9]+)/.match(vi[:version])[1] + vn=version_number(vi) <<-WOK ** #{vn}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vn} @@ -333,9 +377,8 @@ proceed? } fn="#{Dir.pwd}/#{filename}" if File.writable?(fn) changelog_arr_current = IO.readlines(fn) - changelog_arr_next=[] - changelog_arr_current.each do |line| - changelog_arr_next <<=if line =~/^\*\* [0-9]+\.[0-9]+\.[0-9]+(?:_pre_rel)?\.orig\.tar\.xz \(Open commit window: [0-9]{4}-[0-9]{2}-[0-9]{2}; Pre-Release\)\)$/ + changelog_arr_next=changelog_arr_current.each.map do |line| + if line =~/^\*\* [0-9]+\.[0-9]+\.[0-9]+(?:_pre_rel)?\.orig\.tar\.xz \(Open commit window: [0-9]{4}-[0-9]{2}-[0-9]{2}; Pre-Release\)\)$/ "** #{vi[:version]}.orig.tar.xz " \ + "(#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')})\n" else line @@ -377,7 +420,7 @@ proceed? } ) end def self.changelog_header_pre_release(vi) - vn=/([0-9]+\.[0-9]+\.[0-9]+)/.match(vi[:version])[1] + vn=version_number(vi) <<-WOK ** #{vn}.orig.tar.xz (Open commit window: #{vi[:date]}; Pre-Release)) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vn} @@ -397,8 +440,7 @@ proceed? } fn="#{Dir.pwd}/#{filename}" if File.writable?(fn) changelog_arr_current = IO.readlines(fn) - changelog_arr_next=[] - changelog_arr_current.each do |line| + changelog_arr_next=changelog_arr_current.each.map do |line| changelog_arr_next <<=if line =~/^--- HEAD ---$/ line << ("\n" + ch) else line @@ -522,18 +564,18 @@ date: #{vi[:date]} summary: #{vi[:project]} WOK end - def self.contents(vi,version) + def self.contents(vi,branch) <<-WOK Gem::Specification.new do |s| s.name = '#{vi[:project].downcase}' s.version = '#{vi[:version_number]}' s.date = '#{vi[:date]}' - s.summary = '#{vi[:project]}' - s.description = '#{Project_details.name} gem' + s.summary = '#{Version_info.version_number_info(vi)}' + s.description = '#{Project_details.description}' s.authors = ["Ralph Amissah"] s.email = 'ralph.amissah@gmail.com' - s.files = Dir['lib/#{Project_details.name.downcase}/#{version}/*.rb'] + - Dir['data/#{Project_details.name.downcase}/version/#{version}.yml'] + + s.files = Dir['lib/#{Project_details.name.downcase}/#{branch}/*.rb'] + + Dir['data/#{Project_details.name.downcase}/version/#{branch}.yml'] + Dir['data/#{Project_details.name.downcase}/image/*'] + Dir['bin/#{Project_details.name.downcase}gem'] + Dir['bin/#{Project_details.name.downcase}'] diff --git a/setup/rbuild_libs.rb b/setup/rbuild_libs.rb index b999704b..5345631b 100644 --- a/setup/rbuild_libs.rb +++ b/setup/rbuild_libs.rb @@ -137,14 +137,14 @@ module Utils end module Install #%% using a directory and its mapping - def self.setup_find_create(dir_get,dir_put,exclude_files=['']) #primary, + def self.setup_find_create(dir_get,dir_put,exclude_files=['\*'],act) #primary, begin Find.find("#{Project_details.dir.pwd}/#{dir_get}") do |f| stub=f.scan(/#{Project_details.dir.pwd}\/#{dir_get}\/(\S+)/).join place="#{dir_put}/#{stub}" action=case when File.file?(f) - unless f =~/#{exclude_files.inspect}/ + unless f =~/#{exclude_files.join("|")}/ cp(f,place) Utils.chmod_file(place) "-> #{dir_put}/" -- cgit v1.2.3 From 2f5043b905e0286586e0aa9812e36391c783efde Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 21 Apr 2015 13:16:50 -0400 Subject: qi libs, minor, remove debian specific url --- setup/qi_libs.rb | 27 ++++++--------------------- setup/qi_libs_base.rb | 2 -- 2 files changed, 6 insertions(+), 23 deletions(-) (limited to 'setup') diff --git a/setup/qi_libs.rb b/setup/qi_libs.rb index 9d11cecd..cad5e68a 100644 --- a/setup/qi_libs.rb +++ b/setup/qi_libs.rb @@ -64,7 +64,7 @@ module Project_details end def self.version stamp={} - v="#{dir.pwd}/conf/sisu/version.yml" + v="#{dir.pwd}/data/sisu/version.yml" if File.exist?(v) stamp=YAML::load(File::open(v)) stamp[:version] @@ -199,9 +199,9 @@ module Install end module Version_info def self.contents(vi,rel=:release) - release=if rel ==:pre_release then '_pre_rel' - else '' - end + release=rel ==:pre_release \ + ? '_pre_rel' + : '' <<-WOK --- :project: #{vi[:project]} @@ -361,10 +361,8 @@ proceed? } <<-WOK ** #{vn}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vn} -http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vn}-1 http://www.jus.uio.no/sisu/pkg/src/sisu_#{vn}.orig.tar.xz sisu_#{vn}.orig.tar.xz - sisu_#{vn}-1.dsc WOK end def self.changelog_header_release(filename,ch,vi) @@ -424,10 +422,8 @@ proceed? } <<-WOK ** #{vn}.orig.tar.xz (Open commit window: #{vi[:date]}; Pre-Release)) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vn} -http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vn}-1 http://www.jus.uio.no/sisu/pkg/src/sisu_#{vn}.orig.tar.xz sisu_#{vn}.orig.tar.xz - sisu_#{vn}-1.dsc WOK end def self.changelog_header_pre_release_write(filename,ch) @@ -441,7 +437,7 @@ proceed? } if File.writable?(fn) changelog_arr_current = IO.readlines(fn) changelog_arr_next=changelog_arr_current.each.map do |line| - changelog_arr_next <<=if line =~/^--- HEAD ---$/ + if line =~/^--- HEAD ---$/ line << ("\n" + ch) else line end @@ -533,18 +529,7 @@ module GitExtractTaggedVersionBuild puts commands begin system(commands) - rescue # shell error not caught by ruby, using rake - #install_branches=[] - #install_branches << 'gem_create_build_stable' \ - # if options[:stable] - #install_branches << 'gem_create_build_unstable' \ - # if options[:unstable] - #commands =%{git checkout #{ver} && } - #install_branches.each do |install_branch| - # commands += %{rake #{install_branch};} - #end - #puts commands - #system(commands) + rescue end rescue ensure diff --git a/setup/qi_libs_base.rb b/setup/qi_libs_base.rb index 126811c8..4126fa3f 100644 --- a/setup/qi_libs_base.rb +++ b/setup/qi_libs_base.rb @@ -236,10 +236,8 @@ proceed? } <<-WOK ** #{vi[:version]}.orig.tar.xz (#{vi[:date]}:#{vi[:date_stamp].gsub(/20\d\dw/,'')}) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_#{vi[:version]} -http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_#{vi[:version]}-1 http://www.jus.uio.no/sisu/pkg/src/sisu_#{vi[:version]}.orig.tar.xz sisu_#{vi[:version]}.orig.tar.xz - sisu_#{vi[:version]}-1.dsc WOK end def self.changelog_header_stable -- cgit v1.2.3