From 90d3eab4409a446adfc16f23da215855cba7ea6b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:03:25 -0400 Subject: v5 v6: composite (inserts), missing includes doesn't give an error, fix * (Closes: #744379) see sisu.org for comment --- data/doc/sisu/CHANGELOG_v5 | 3 +++ data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v5/composite.rb | 9 +++++---- lib/sisu/v6/composite.rb | 14 ++++++-------- sisu.org | 20 +++++++++++++++++++- 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 12c16c8a..0b357d41 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -43,6 +43,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.5.orig.tar.xz * composite, fix includes, provide extra newline after inserted comment (Closes: #744360) "includes do not work properly" +* composite (inserts), missing includes doesn't give an error, fix + (Closes: #744379) see sisu.org for comment + * added sisu.org emacs:evil:org mode notes related to sisu development %% 5.3.4.orig.tar.xz (2014-02-14:06/5) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 92e8413e..b4b0311d 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -33,6 +33,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * composite, fix includes, provide extra newline after inserted comment (Closes: #744360) "includes do not work properly" +* composite (inserts), missing includes doesn't give an error, fix + (Closes: #744379) see sisu.org for comment + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v5/composite.rb b/lib/sisu/v5/composite.rb index cd281e26..adc88e52 100644 --- a/lib/sisu/v5/composite.rb +++ b/lib/sisu/v5/composite.rb @@ -141,11 +141,11 @@ module SiSU_Assemble end if not @code_flag \ and i !~/^%+\s/ - i=i.gsub(/^([123]|:?[ABC])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) + i=i.gsub(/^([123]|:?[ABCD])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) if i =~/^@\S+?:/ i=i.gsub(/\n/m,"\n% "). gsub(/\n%\s+$/m,''). - gsub(/^@\S+?:/m,"\n% [imported header:] ") #off imported headers + gsub(/^@\S+?:/m,"\n% [imported header:] ") #off imported headers end end file[:prepared] << i @@ -171,6 +171,7 @@ module SiSU_Assemble or para =~/^(?:<<\s*)\|(\S+?)\|@\|.+?\|(?:req(?:quire)?\b|\s*\})?/ \ or para =~/^r\{(.+?)\}/ #depreciated loadfile=$1.strip + src_ssm=@opt.fns.sub(/\.ssm\.sst/,'.ssm') if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) @@ -200,7 +201,7 @@ module SiSU_Assemble file[:prepared] else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end else tuned_file << para @@ -255,7 +256,7 @@ module SiSU_Assemble @ssm << loadfile else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end end diff --git a/lib/sisu/v6/composite.rb b/lib/sisu/v6/composite.rb index 02e9543e..79603e26 100644 --- a/lib/sisu/v6/composite.rb +++ b/lib/sisu/v6/composite.rb @@ -141,11 +141,11 @@ module SiSU_Assemble end if not @code_flag \ and i !~/^%+\s/ - i=i.gsub(/^([123]|:?[ABC])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) + i=i.gsub(/^([123]|:?[ABCD])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) if i =~/^@\S+?:/ i=i.gsub(/\n/m,"\n% "). gsub(/\n%\s+$/m,''). - gsub(/^@\S+?:/m,"\n% [imported header:] ") #off imported headers + gsub(/^@\S+?:/m,"\n% [imported header:] ") #off imported headers end end file[:prepared] << i @@ -166,11 +166,9 @@ module SiSU_Assemble tuned_file,imagedir=[],[] SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Composite Document',"[#{@opt.f_pth[:lng_is]}] #{@opt.fno}").grey_title_hi unless @opt.act[:quiet][:set]==:on data.each do |para| - if para =~/^<<\s+(\S+?\.ss[it])$/ \ - or para =~/^<<\{(\S+?\.ss[it])\}$/ \ - or para =~/^(?:<<\s*)\|(\S+?)\|@\|.+?\|(?:req(?:quire)?\b|\s*\})?/ \ - or para =~/^r\{(.+?)\}/ #depreciated + if para =~/^<<\s+(\S+?\.ss[it])$/ loadfile=$1.strip + src_ssm=@opt.fns.sub(/\.ssm\.sst/,'.ssm') if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) @@ -200,7 +198,7 @@ module SiSU_Assemble file[:prepared] else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end else tuned_file << para @@ -255,7 +253,7 @@ module SiSU_Assemble @ssm << loadfile else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end end diff --git a/sisu.org b/sisu.org index 358fa0b9..22174f23 100644 --- a/sisu.org +++ b/sisu.org @@ -1346,7 +1346,7 @@ semicolon, he would add one. Regards, Daniel -**** TODO [#B] #744379 [w|u] sisu: missing includes doesn't give an error +**** DONE (5.3.5::6.0.5) [#B] #744379 [w|u] sisu: missing includes doesn't give an error :processing:fix: From: Daniel Baumann @@ -1368,6 +1368,24 @@ string in the output (pdf). Regards, Daniel +***** NOTES/COMMENTS + +5.3.4-1 writes the following to the screen: +"ERROR test.ssm.sst requires invalid or non-existent file: foo.ssi" + +and unsatisfactorily within the text output it writes no error message but the include instruction: + +"<< foo.ssi" + +5.3.5, the current "fix"/ solution, is to add an error message within the text rather than to stop processing with an error. +In addition to (i) slightly modified (you could say corrected) to the following: + +"ERROR test.ssm requires an invalid or non-existent file: foo.ssi" + +the following is written within the text output: + +"<< foo.ssi [ERROR test.ssm requires an invalid or non-existent file: foo.ssi]" + **** TODO [#D] #744381 [w|u] sisu syntax: inconsistency \:copyright: and \:license: -- cgit v1.2.3