> From [email protected] Mon Jul 7 00:39:34 2014
> From: John Burrell <[email protected]>
> To: BLFS Development List <[email protected]>
> Date: Sun, 6 Jul 2014 23:40:21 +0000
> Subject: Re: [blfs-dev] A couple of command inconsistencies
>
> > > In the BLFS commands postlfs, 041-iptables has this line
> > >
> > > --enable-libipq &&
> > >
> > > There is a space after the && which makes it difficult to do a global
> > > delete on the &&
> > >
> > > This is also true for general/251-ruby with this line:
> > >
> > > --docdir=/usr/share/doc/ruby-2.1.2 &&
> > >
> > > Would you kindly remove the space after the && for these two commands to
> > > make them consistent with all the other commands in the xml files.
> > .
> > .
> > >
> >
> >
> > While yes, it's good to have consistency in xml source, a processing of
> > that source should really be 'liberal in what it accepts' as input, at
> > least insofar as allowing for the possibility of such spaces, surely? You
> > could e.g. match on a regex such as '&&[[:blank:]]*$' or similar (depending
> > on what the processing environment will accept regex-wise).
>
> I wrote a script to build the scripts to install the packages for each
> section of BLFS (I was tempted to write after that sentence 'That lay in the
> house that Jack built' but managed to stop myself!). I install as a package
> user so I want to keep the configure, make and install logs. This means
> removing all the && from the end of the command lines.
>
((
* Here we use a much more economical spec than the xml src: and besides,
tying one's work too closely [tautology alert!] to upstream - e.g. scripts
bound tightly to xml src details and structure - is rather fraught
with ever-changing problems.
And even if parsing the xml src directly, your best ROI is likely to be
via a lex/yacc approach, rather than via either shell scripts or xml utils.
* For profiling systems pre-/post- changes, the likes of (a customised
version of) tripwire or similar (e.g. find-xargs-ls-stat-checksums)
can often be the best bet.
One can also use the likes of strace to get more details of the change
processes as they are happening: but that can interfere with the observed
process/system (rather like in quantum-mech).
))
> I use a sed to do this:
>
> -e 's/\(.*\)&&$/\1/'
>
> If the command ends in && this works fine. If it ends in a space it doesn't
> and leaves the && in place, which then causes the script to fail. I've only
> found the two lines noted above that have such a space. To me the space seems
> superfluous.
>
Yes, those points've already been made in your first post, understood,
and addressed in the reply: IOW, you might want to use e.g.:
-e 's/\(.*\)&&[[:blank:]]*$/\1/'
or even
-e 's/\(.*\)[[:blank:]]*&&[[:blank:]]*$/\1/'
or similar, depending on details of the processing environment - e.g. you
might need/want sed's '-r' flag also, &/or change the '[[:blank:]]' to
'[ \t]' (that first char is a single (horizontal-)space char) or to
'[ ]' (a single horiz-space char and a single tab-char), &c.
rgds,
akh
> jb.
>
--
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page