gnats-prs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnats/613: shell syntax problems in edit-pr


From: bug-gnats
Subject: gnats/613: shell syntax problems in edit-pr
Date: Tue, 13 Jun 2006 11:05:02 -0500 (CDT)

>Number:         613
>Category:       gnats
>Synopsis:       shell syntax problems in edit-pr
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 13 11:05:01 -0500 2006
>Originator:     Stephane Chazelas <address@hidden>
>Release:        
>Description:
 
 Hi guys,
 
 There are some syntax problems in the edit-pr.sh shell script:
 
 There's a missing quote on line 172 (it's OK for the Bourne
 shell and AT&T ksh based sh, but not other shells), and the tr
 syntax, though POSIX is causing trouble with Solaris tr.
 
>Fix:

Index: edit-pr.sh
===================================================================
RCS file: /sources/gnats/gnats/gnats/edit-pr.sh,v
retrieving revision 1.18
diff -u -r1.18 edit-pr.sh
--- edit-pr.sh  31 Dec 2005 21:52:52 -0000      1.18
+++ edit-pr.sh  13 Jun 2006 15:59:30 -0000
@@ -169,7 +169,11 @@
            type="`$QUERY_PR --field-type $field`"
            case $type in
                [Ee][Nn][Uu][Mm])
-                   values=`$QUERY_PR --valid-values $field | tr '\n' ' ' | sed 
's/ *$//g; s/ / | /g;s/^/[ /;s/$/ ]/;`
+                   values=`
+                       $QUERY_PR --valid-values $field |
+                           tr '\n' ' ' |
+                           sed 's/ *$//g; s/ / | /g;s/^/[ /;s/$/ ]/;'
+                   `
                    valslen=`echo "$values" | wc -c`
                    if [ "$valslen" -gt 160 ]
                    then
@@ -177,20 +181,20 @@
                    else
                        desc="<${values} (one line)>";
                    fi
-                   dpat=`echo "$desc" | tr '][*+^$|\()&/' '............'`
+                   dpat=`echo "$desc" | LC_ALL=C tr ']\133*+^$|\134()&/' 
'............'`
                    echo "/^>${field}:/ s/${dpat}//" >> $fixfil
                    echo "/>${field}: ${desc}" >> $new;
                    ;;
                [Mm][Uu][Ll][Tt][Ii][Tt][Ee][Xx][Tt])
                    desc="      <`$QUERY_PR --field-description $field` 
(multiple lines)>";
-                   dpat=`echo "$desc" | tr '][*+^$|\()&/' '............'`
+                   dpat=`echo "$desc" | LC_ALL=C tr ']\133*+^$|\134()&/' 
'............'`
                    echo "s/^${dpat}//" >> $fixfil
                    echo ">${field}:" >> $new;
                    echo "$desc" >> $new;
                    ;;
                *)
                    desc="<`$QUERY_PR --field-description $field` (one line)>"
-                   dpat=`echo "$desc" | tr '][*+^$|\()&/' '............'`
+                   dpat=`echo "$desc" | LC_ALL=C tr ']\133*+^$|\134()&/' 
'............'`
                    echo "/^>${field}:/ s/${dpat}//" >> $fixfil
                    echo ">${field}: ${desc}" >> $new
                    ;;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]