public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* solaris "nawk" fixes edit-pr awk: syntax error
@ 2002-03-14 10:54 doug.mildram
  2002-05-20  5:28 ` Milan Zamazal
  0 siblings, 1 reply; 4+ messages in thread
From: doug.mildram @ 2002-03-14 10:54 UTC (permalink / raw)
  To: help-gnats

Running edit-pr under solaris in some instances, 
e.g.  changing State: or another reason-required field,
      causes edit-pr to attempt to prompt you for a reason,
         but under solaris, instead it barfs out:

awk: syntax error near line 24
awk: illegal statement near line 24

I recalled that there was a "nawk", newer than "awk", and Solaris
   keeps them both in /bin, foolishly? choosing not to make "nawk"
   the default "awk".    I found that edit-pr was really calling 

$LIBEXECDIR/gnats/diff-prs
         ....which is a "sh" script that really just does "awk",

and lucky me, nawk   seems to silence the lambs,
  and may even stop edit-pr from getting into a sick loop where it
   offers you to "(a)bort or (r)etry? " , 
      but (due to awk error) (r)etry silently bombs out, 
      so edit-pr keeps saying "(a)bort or (r)etry? "
              until you (a)bort....
      at which point it claims that 
"Changed pr is in /tmp/epNNNN"  (NNNN==PID),
      but...............the "trap" in edit-pr has REMOVED $new.


MINOR suggestion: no harm in littering /tmp with epNNNN files.
     around line 120 in edit-pr I'm changing
#trap 'rm -f $new $new.old $change_msg $fixfil ; exit 0' 0
                                    changing to
trap 'rm -f       $new.old $change_msg $fixfil ; exit 0' 0


MAJOR FIX: for solaris  diff-prs   ....change awk to nawk.

25c25
< awk '
---
> nawk '


_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: solaris "nawk" fixes edit-pr awk: syntax error
  2002-03-14 10:54 solaris "nawk" fixes edit-pr awk: syntax error doug.mildram
@ 2002-05-20  5:28 ` Milan Zamazal
  2002-05-20 11:42   ` Mel Hatzis
  0 siblings, 1 reply; 4+ messages in thread
From: Milan Zamazal @ 2002-05-20  5:28 UTC (permalink / raw)
  To: doug.mildram; +Cc: help-gnats

>>>>> "dm" == doug mildram <doug.mildram@mindspeed.com> writes:

    dm> MINOR suggestion: no harm in littering /tmp with epNNNN files.
    dm>      around line 120 in edit-pr I'm changing
    dm> #trap 'rm -f $new $new.old $change_msg $fixfil ; exit 0' 0
    dm>                                     changing to
    dm> trap 'rm -f       $new.old $change_msg $fixfil ; exit 0' 0

Thanks for the suggestion.  It's a good idea, but I removed $new only
from the second trap (error signals).

Frankly, I don't know what `trap ... 0' is (no /bin/sh manual here
around).  If any /bin/sh guru knows, please enlighten me.

    dm> MAJOR FIX: for solaris  diff-prs   ....change awk to nawk.

Well, there sometimes occur Solaris compatibility bugs.  They are
usually unpleasant bugs, since they occur only on certain Solaris
versions.  I am sorry, but I rather spend my spare time fixing bugs
present on free systems (such as GNU/Linux, GNU/HURD or free versions of
BSD), I hope you understand it.  If someone submits reasonable
compatibility patches, I'll incorporate it, of course.

Regards,

Milan Zamazal

-- 
If we are going to start removing packages because of the quality of the
software, wonderful.  I move to remove all traces of the travesty of editors,
vi, from Debian, since obviously as editors they are less than alpha quality
software.                                   -- Manoj Srivastava in debian-devel

_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: solaris "nawk" fixes edit-pr awk: syntax error
  2002-05-20  5:28 ` Milan Zamazal
@ 2002-05-20 11:42   ` Mel Hatzis
  2002-05-26  8:37     ` Milan Zamazal
  0 siblings, 1 reply; 4+ messages in thread
From: Mel Hatzis @ 2002-05-20 11:42 UTC (permalink / raw)
  To: Milan Zamazal; +Cc: doug.mildram, help-gnats

Milan Zamazal wrote:
>>>>>>"dm" == doug mildram <doug.mildram@mindspeed.com> writes:
>>>>>>
> 
>     dm> MINOR suggestion: no harm in littering /tmp with epNNNN files.
>     dm>      around line 120 in edit-pr I'm changing
>     dm> #trap 'rm -f $new $new.old $change_msg $fixfil ; exit 0' 0
>     dm>                                     changing to
>     dm> trap 'rm -f       $new.old $change_msg $fixfil ; exit 0' 0
> 
> Thanks for the suggestion.  It's a good idea, but I removed $new only
> from the second trap (error signals).
> 
> Frankly, I don't know what `trap ... 0' is (no /bin/sh manual here
> around).  If any /bin/sh guru knows, please enlighten me.

The 'trap' command as used above basically let's the shell perform
an action (in this case the 'rm') when it exits - using '0' as the
second argument means the trap is executed for both normal exits as
well as interrupts.

The use of single quotes means variable and command substitution
of the command is done when the trap is executed rather than when
the trap is set.

An excellent resource for additional information is O'Reilly's
'Unix Power Tools' by Peek, O'Reilly and Loukides.

> 
>     dm> MAJOR FIX: for solaris  diff-prs   ....change awk to nawk.
> 
> Well, there sometimes occur Solaris compatibility bugs.  They are
> usually unpleasant bugs, since they occur only on certain Solaris
> versions.  I am sorry, but I rather spend my spare time fixing bugs
> present on free systems (such as GNU/Linux, GNU/HURD or free versions of
> BSD), I hope you understand it.  If someone submits reasonable
> compatibility patches, I'll incorporate it, of course.
> 

Perhaps you could conditionally set an 'awk' variable based on
the output of 'uname -sr' in this case.

--
Mel Hatzis
Juniper Networks, Inc.




_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: solaris "nawk" fixes edit-pr awk: syntax error
  2002-05-20 11:42   ` Mel Hatzis
@ 2002-05-26  8:37     ` Milan Zamazal
  0 siblings, 0 replies; 4+ messages in thread
From: Milan Zamazal @ 2002-05-26  8:37 UTC (permalink / raw)
  To: Mel Hatzis; +Cc: doug.mildram, help-gnats

>>>>> "MH" == Mel Hatzis <hatzis@juniper.net> writes:

    MH> using '0' as the second argument means the trap is executed for
    MH> both normal exits as well as interrupts.

This is what I needed to know, thank you.  So I made another fix in the
trap handling of edit-pr, hopefully it's right now.

    MH> Perhaps you could conditionally set an 'awk' variable based on
    MH> the output of 'uname -sr' in this case.

Patches welcome. :-)

Regards,

Milan Zamazal

-- 
http://www.zamazal.org

_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-26 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-14 10:54 solaris "nawk" fixes edit-pr awk: syntax error doug.mildram
2002-05-20  5:28 ` Milan Zamazal
2002-05-20 11:42   ` Mel Hatzis
2002-05-26  8:37     ` Milan Zamazal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).