Re: Problem with shtool on IRIX6

2007-10-05 Thread Ralf S. Engelschall
On Thu, Oct 04, 2007, Joerg Lehrke wrote:

 I know that IRIX is not a supported platform, but the problem I found there
 can be avoided easily.  /bin/sh messes up the opt_e string within the install
 command of shtool. Especially the MySQL RPM build fails on IRIX because of
 this. Since OpenPKG provides a BASH this shell should be used for all crucial
 scripts. At least we were on the safe side this way, what you think?

So, there is no bug in GNU shtool's shtool install command, but the
/bin/sh of IRIX fails over the opt_e variable, right? Strange! Is
opt_e something special in IRIX /bin/sh? Well, ok...

In general I also prefer to use GNU bash inside OpenPKG, but in the
particular case of GNU shtool I would like to better stay with just
the vendor's /bin/sh. Why? Well, how should I explain this I know
that the author of GNU shtool uses OpenPKG as its unofficial field
test area for his tool ;-) So, if OpenPKG starts running its shtool
version under GNU bash, then the GNU shtool author could be certainly
less sure that GNU shtool _really_ works on all major Unix platform
out-of-the-box.

Nevertheless I would like to see GNU shtool working with IRIX' /bin/sh
out-of-the-box. So, can we give the upstream author a little bit of
details about the problem? Is just the _name_ of the variable the
problem? Or its particular use? I can ensure that the upstream author
looks at our issue in more detail if we have the necessary information
at hand for him... ;-)

   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com

__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org


Re: Problem with shtool on IRIX6

2007-10-05 Thread Joerg Lehrke
The problem is caused by following block within the shtool install
function:
#   adjust the target file
if [ .$opt_e != . ]; then
sed='sed'
OIFS=$IFS; IFS=$ASC_NL; set -- $opt_e; IFS=$OIFS
for e
do
sed=$sed -e '$e'
done

Here is was BASH does within the MySQL RPM build:
s;@l_susr@;root;g
s;@l_sgrp@;sys;g
s;@l_suid@;0;g
s;@l_sgid@;0;g
s;@l_musr@;opkg;g
s;@l_mgrp@;opkg;g
s;@l_muid@;100;g
s;@l_mgid@;100;g
s;@l_rusr@;opkg-r;g
s;@l_rgrp@;opkg-r;g
s;@l_ruid@;101;g
s;@l_rgid@;101;g
s;@l_nusr@;opkg-n;g
s;@l_ngrp@;opkg-n;g
s;@l_nuid@;102;g
s;@l_ngid@;102;g
s;@l_prefix@;/opt/openpkg;g
s;@l_prefix_static@;/opt/openpkg;g
/\/\{0,1\}with_bdb/d
/\/\{0,1\}with_innobase/d != . ]
+ sed=sed
+ OIFS='
'
+ IFS='
'
+ set -- 's;@l_susr@;root;g' 's;@l_sgrp@;sys;g' 's;@l_suid@;0;g'
's;@l_sgid@;0;g' 's;@l_musr@;opkg;g' 's;@l_mgrp@;opkg;g'
's;@l_muid@;100;g' 's;@l_mgid@;100;g' 's;@l_rusr@;opkg-r;g'
's;@l_rgrp@;opkg-r;g' 's;@l_ruid@;101;g' 's;@l_rgid@;101;g'
's;@l_nusr@;opkg-n;g' 's;@l_ngrp@;opkg-n;g' 's;@l_nuid@;102;g'
's;@l_ngid@;102;g' 's;@l_prefix@;/opt/openpkg;g'
's;@l_prefix_static@;/opt/openpkg;g' '/\/\{0,1\}with_bdb/d' '/\/\{0,1
\}with_innobase/d'
+ IFS='


compared with the IRIX /bin/sh:
s;@l_susr@;root;g
s;@l_sgrp@;sys;g
s;@l_suid@;0;g
s;@l_sgid@;0;g
s;@l_musr@;opkg;g
s;@l_mgrp@;opkg;g
s;@l_muid@;100;g
s;@l_mgid@;100;g
s;@l_rusr@;opkg-r;g
s;@l_rgrp@;opkg-r;g
s;@l_ruid@;101;g
s;@l_rgid@;101;g
s;@l_nusr@;opkg-n;g
s;@l_ngrp@;opkg-n;g
s;@l_nuid@;102;g
s;@l_ngid@;102;g
s;@l_prefix@;/opt/openpkg;g
s;@l_prefix_static@;/opt/openpkg;g
/\/\{0,1\}with_bdb/d
/\/\{0,1\}with_innobase/d' '!=' . ']'
+ sed=sed
+ OIFS=

+ IFS=

+ set -- s;@l_susr@;root;g s;@l_sgrp@;sys;g s;@l_suid@;0;g
s;@l_sgid@;0;g s;@l_musr@;opkg;g s;@l_mgrp@;opkg;g s;@l_muid@;100;g
s;@l_mgid@;100;g s;@l_rusr@;opkg-r;g s;@l_rgrp@;opkg-r;g
s;@l_ruid@;101;g s;@l_rgid@;101;g s;@l_nusr@;opkg-n;g
s;@l_ngrp@;opkg-n;g s;@l_nuid@;102;g s;@l_ngid@;102;g
s;@l_prefix@;/opt/openpkg;g s;@l_prefix_static@;/opt/openpkg;g /
\/\0with_bdb/d /\/\1\with_bdb/d /\/\0with_innobase/d /\/\1
\with_innobase/d
+ IFS=


As you can see this will break the further SED execution.

I did no further analysis but modified the OpenPKG shtool to use its
BASH.

 Cheers,
  Jorg

__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org


Re: Problem with shtool on IRIX6

2007-10-05 Thread Ralf S. Engelschall
On Fri, Oct 05, 2007, Joerg Lehrke wrote:

 The problem is caused by following block within the shtool install
 function:
 [...]

Ah, I see. Well, mysql.spec's usage of shtool subst with _arbitrary_
complex sed(1) style -e options is already the source of the trouble.
I'll see what we can do for GNU shtool but in the meantime I've changed
mysql.spec to use a regular simple sed(1) call. That's just fine here,
too.
   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com

__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org


Re: Problem with shtool on IRIX6

2007-10-05 Thread Christoph Schug
On Fri, Oct 05, 2007, Ralf S. Engelschall wrote:

 On Fri, Oct 05, 2007, Joerg Lehrke wrote:
 
  The problem is caused by following block within the shtool install
  function:
  [...]
 
 Ah, I see. Well, mysql.spec's usage of shtool subst with _arbitrary_
 complex sed(1) style -e options is already the source of the trouble.
 I'll see what we can do for GNU shtool but in the meantime I've changed
 mysql.spec to use a regular simple sed(1) call. That's just fine here,
 too.

I don't feel very comfortable with the solution applied to the MySQL
package. To be honest, the sed expressions in question aren't that
complex. As there might be other expressions, similar or not, which
would also not work under IRIX, we end up with a vaguely definied
list of functionality which is not working as documented. So on
what features can we rely on and which ones not in the future? This
might affect dozens of packages. If the problem can be fixed on this
very specific platform, IRIX, why not define the %{l_shool} macro
differently on that platform, maybe one can expand it to '%{l_bash}
%{l_prefix}/lib/openpkg/shtool' on IRIX and stick with the default on
all the other platforms.

-cs

__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org


Re: Problem with shtool on IRIX6

2007-10-05 Thread Ralf S. Engelschall
On Fri, Oct 05, 2007, Christoph Schug wrote:

 On Fri, Oct 05, 2007, Ralf S. Engelschall wrote:

  On Fri, Oct 05, 2007, Joerg Lehrke wrote:
 
   The problem is caused by following block within the shtool install
   function:
   [...]
 
  Ah, I see. Well, mysql.spec's usage of shtool subst with _arbitrary_
  complex sed(1) style -e options is already the source of the trouble.
  I'll see what we can do for GNU shtool but in the meantime I've changed
  mysql.spec to use a regular simple sed(1) call. That's just fine here,
  too.

 I don't feel very comfortable with the solution applied to the MySQL
 package. To be honest, the sed expressions in question aren't that
 complex. As there might be other expressions, similar or not, which
 would also not work under IRIX, we end up with a vaguely definied
 list of functionality which is not working as documented. So on
 what features can we rely on and which ones not in the future? This
 might affect dozens of packages. If the problem can be fixed on this
 very specific platform, IRIX, why not define the %{l_shool} macro
 differently on that platform, maybe one can expand it to '%{l_bash}
 %{l_prefix}/lib/openpkg/shtool' on IRIX and stick with the default on
 all the other platforms.

Well, I have to agree that it really was just a workaround here. If
someone can come up with a better solution (a fix for GNU shtool?)
I would be happy. I just was not able to find one by looking at the
provides outputs. I do not see why the stuff fails on IRIX. At least
s/../../ commands never caused us such trouble, so I guess it is
related to the other sed commands used here.

   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com

__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org