From 5ae11e06f0ca7605a29876a3d840ac8c88f1f40d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 21 Apr 2012 01:50:23 -0400 Subject: v3: sysenv, default processing dir name change * distinguish sisu branch, add sisu branch to processing directory name * if constants, 'DEVELOPER[:maintenance] == :true' then additionally add sisu version number to processing directory name --- lib/sisu/v3/constants.rb | 3 +++ lib/sisu/v3/sysenv.rb | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/constants.rb b/lib/sisu/v3/constants.rb index 439dee68..c7a5c539 100644 --- a/lib/sisu/v3/constants.rb +++ b/lib/sisu/v3/constants.rb @@ -242,6 +242,9 @@ DISABLE={ ncx_navpoint_unique_id: true, }, } +DEVELOPER={ + maintenance: :false, +} __END__ consider: 〔comment〕 diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 442795c9..88ee8ccf 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -101,7 +101,7 @@ module SiSU_Env data=Config::CONFIG['datadir'] + '/doc/sisu' m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @stub_pwd ||=@@pwd[m,1] - prcss_dir='_sisu_processing_' + prcss_dir='_sisu_processing_' + '.' + SiSU_version_dir prcss_dir_tmp_root="/tmp/#{prcss_dir}" prcss_dir_stub="#{prcss_dir}/#{@stub_pwd}" if @@user @@ -2018,16 +2018,19 @@ WOK @rc['processing']['dir'] else defaults[:processing_dir] end + v=SiSU_Env::InfoVersion.instance.get_version + v_dev=(DEVELOPER[:maintenance]==:true) \ + ? "_#{v[:version]}" + : '' path=if proposed_path_base \ and FileTest.directory?(proposed_path_base) \ and File.writable?("#{proposed_path_base}/.") - x=if proposed_dir - "#{proposed_path_base}/#{proposed_dir}" - else - "#{proposed_path_base}/#{defaults[:processing_dir]}" - end + x=proposed_dir \ + ? "#{proposed_path_base}/#{proposed_dir}" + : "#{proposed_path_base}/#{defaults[:processing_dir]}" else defaults[:processing_dir_tmp_root] end + path = path + v_dev end def usr_dir? case root_dir -- cgit v1.2.3