https://bugs.contribs.org/show_bug.cgi?id=10373

--- Comment #13 from Jean-Philippe Pialasse <te...@pialasse.com> ---
(In reply to John Crisp from comment #12)
> (In reply to Jean-Philippe Pialasse from comment #11)
> 
> > 
> > You might have two host not working because of this, as the temp
> > configuration file created looks like :
> > 
> 
> No, the localhost was disabled on purpose :-)

well I hope in you case ;) otherwise (localhost or any other job just after the
buggy one) would have been lost too.


I see 3 way of doing :
- add a newline between each job when merging to temp config file (will test to
see what happen with empty lines, I would guess ignored)
- detect missing new line and add it to file
- detect missing newline and add a newline if missing when merging to the temp
config file.

the first would be the easiest

the two other would imply to read last character of the file (ie open it and
read) before doing something.

I have code in mind :


use File::ReadBackwards;# need to add as dependency, available on centos/epel
6,7
$bw = File::ReadBackwards->new($ARGV[0]) or die "can't read 'file' $!";
$lastline = $bw->readline;
print "there is a ending newline\n" if "$lastline" =~ /.*\n\z/

of course changing the last line depending of what we want to do for the 2 last
options


or simply for the first:
-                my
@cmd=('echo','-n','>',$configfile,';','chmod','400',$configfile,';','cat');
+                my
@cmd=('echo','-n','>',$configfile,';','chmod','400',$configfile,';');
                 foreach my $s (@cfgfiles) {
-                        push(@cmd, $s);
+                        push(@cmd, ('cat', $s,';', 'echo','>',$configfile, ';'
));



will give it a try

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
_______________________________________________
Mail for each SME Contribs bug report
To unsubscribe, e-mail contribteam-unsubscr...@lists.contribs.org
Searchable archive at https://lists.contribs.org/mailman/public/contribteam/

Reply via email to