File: gccbug-posix.dpatch

package info (click to toggle)
gcc-3.3 1%3A3.3.6ds1-28
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 25,812 kB
  • ctags: 262
  • sloc: sh: 10,321; makefile: 1,050; perl: 155; awk: 23; cpp: 14
file content (84 lines) | stat: -rw-r--r-- 2,523 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#! /bin/sh -e

# DP: Make gccbug POSIX compliant (patch by David Weinehall)
# DP: http://www.opengroup.org/onlinepubs/009695399/utilities/test.html

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

--- gcc/gccbug.in~	2004-06-15 04:43:16.000000000 +0200
+++ gcc/gccbug.in	2004-07-04 23:51:38.000000000 +0200
@@ -165,7 +165,7 @@
         ;;
     -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; $REMOVE_TEMP; exit 1; fi
 	shift ; IN_FILE="$1"
-	if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
+	if [ "$IN_FILE" != "-" ] && [ ! -r "$IN_FILE" ]; then
 	  echo "$COMMAND: cannot read $IN_FILE"
 	  $REMOVE_TEMP
 	  exit 1
@@ -237,7 +237,7 @@
 # Catch some signals. ($xs kludge needed by Sun /bin/sh)
 xs=0
 trap '$REMOVE_TEMP; exit $xs' 0
-trap 'echo "$COMMAND: Aborting ..."; $REMOVE_TEMP; xs=1; exit' 1 3 13 15
+trap 'echo "$COMMAND: Aborting ..."; $REMOVE_TEMP; xs=1; exit' HUP QUIT PIPE TERM
 
 # If they told us to use a specific file, then do so.
 if [ -n "$IN_FILE" ]; then
@@ -258,16 +258,16 @@
   fi
 else
 
-  if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+  if [ -n "$PR_FORM" ] && [ -z "$PRINT_INTERN" ]; then
     # If their PR_FORM points to a bogus entry, then bail.
-    if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
+    if [ ! -f "$PR_FORM" ] || [ ! -r "$PR_FORM" ] || [ ! -s "$PR_FORM" ]; then
       echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
       sleep 1
       PRINT_INTERN=bad_prform
     fi
   fi
 
-  if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
+  if [ -n "$PR_FORM" ] && [ -z "$PRINT_INTERN" ]; then
     cp $PR_FORM $TEMP || 
       ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
   else
@@ -359,7 +359,7 @@
     done
   fi
 
-  if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
+  if [ "$PRINT" = true ] || [ "$PRINT_INTERN" = true ]; then
     cat $TEMP
     xs=0; exit
   fi
@@ -467,7 +467,7 @@
     CNT=`expr $CNT + 1`
   fi
 
-  [ $CNT -lt 6 -a -z "$BATCH" ] && 
+  [ $CNT -lt 6 ] && [ -z "$BATCH" ] && 
     echo "Errors were found with the problem report."
 
   while true; do