summaryrefslogtreecommitdiff
blob: 485a1ff9d907d6c55aa64a319e0e107444f72b1c (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
--- misc/xine-check	2004-02-17 20:56:16.000000000 +0000
+++ misc/xine-check	2004-02-17 20:56:16.000000000 +0000
@@ -567,6 +567,7 @@
     short=
     description=
     tmpfile=/tmp/xine-check-dsc.$$
+    check_tmpfile;
     true >$tmpfile
     cat $messagefile | while read line; do
 	if $found; then
@@ -714,6 +715,45 @@
   read answer
 }
 
+check_bugreport() {
+  if test -f "$bugreport"; then
+    echo "Hmmm, I already found a bug report in ${bugreport}."
+    if yesno "Do you want me to overwrite that file?"; then
+      rm "$bugreport" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+
+  if test -h "$bugreport"; then
+    echo "Hmmm, I already found another file in ${bugreport}."
+    if yesno "Do you want me to try to overwrite that file?"; then
+      rm "$bugreport" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+}
+
+check_logfile() {
+  if test -h "$logfile"; then
+    echo "Hmmm, I already found another file in ${logfile}."
+    if yesno "Do you want me to try to overwrite that file?"; then
+      rm "$logfile" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+}
+
+check_tmpfile() {
+  if test -h "$tmpfile"; then
+    rm "$tmpfile" || clean_exit 1
+  fi
+}
 
 # command line
 while [ "$#" -gt 0 ]; do
@@ -763,12 +803,11 @@
 if [ "$runmode" = "bugreport" ]; then
   do_log=true
   logfile=/tmp/xine-check.log
+  check_logfile;
   echo logging to ${logfile}...
   echo >$logfile
 fi
 
-
-
 ## actual checks start here:
 
 case `id` in
@@ -1173,16 +1212,6 @@
   clean_exit 0    
 fi
 
-if test -f "$bugreport"; then
-  echo "Hmmm, I already found a bug report in ${bugreport}."
-  if yesno "Do you want me to overwrite that file?"; then
-    rm "$bugreport"
-  else
-    echo "Okay, aborting on your request."
-    clean_exit 0
-  fi
-fi
-  
 echo
 echo
 if yesno "Could you solve your xine problems using the previous hints?"; then
@@ -1190,6 +1219,8 @@
   clean_exit
 fi
 
+check_bugreport;
+
 echo
 echo "What kind of trouble does xine cause for you?"
 echo
--- misc/xine-check.sh.in	2004-02-17 20:56:16.000000000 +0000
+++ misc/xine-check.sh.in	2004-02-17 20:56:16.000000000 +0000
@@ -567,6 +567,7 @@
     short=
     description=
     tmpfile=/tmp/xine-check-dsc.$$
+    check_tmpfile;
     true >$tmpfile
     cat $messagefile | while read line; do
 	if $found; then
@@ -714,6 +715,45 @@
   read answer
 }
 
+check_bugreport() {
+  if test -f "$bugreport"; then
+    echo "Hmmm, I already found a bug report in ${bugreport}."
+    if yesno "Do you want me to overwrite that file?"; then
+      rm "$bugreport" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+
+  if test -h "$bugreport"; then
+    echo "Hmmm, I already found another file in ${bugreport}."
+    if yesno "Do you want me to try to overwrite that file?"; then
+      rm "$bugreport" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+}
+
+check_logfile() {
+  if test -h "$logfile"; then
+    echo "Hmmm, I already found another file in ${logfile}."
+    if yesno "Do you want me to try to overwrite that file?"; then
+      rm "$logfile" || clean_exit 1
+    else
+      echo "Okay, aborting on your request."
+      clean_exit 0
+    fi
+  fi
+}
+
+check_tmpfile() {
+  if test -h "$tmpfile"; then
+    rm "$tmpfile" || clean_exit 1
+  fi
+}
 
 # command line
 while [ "$#" -gt 0 ]; do
@@ -763,12 +803,11 @@
 if [ "$runmode" = "bugreport" ]; then
   do_log=true
   logfile=/tmp/xine-check.log
+  check_logfile;
   echo logging to ${logfile}...
   echo >$logfile
 fi
 
-
-
 ## actual checks start here:
 
 case `id` in
@@ -1173,16 +1212,6 @@
   clean_exit 0    
 fi
 
-if test -f "$bugreport"; then
-  echo "Hmmm, I already found a bug report in ${bugreport}."
-  if yesno "Do you want me to overwrite that file?"; then
-    rm "$bugreport"
-  else
-    echo "Okay, aborting on your request."
-    clean_exit 0
-  fi
-fi
-  
 echo
 echo
 if yesno "Could you solve your xine problems using the previous hints?"; then
@@ -1190,6 +1219,8 @@
   clean_exit
 fi
 
+check_bugreport;
+
 echo
 echo "What kind of trouble does xine cause for you?"
 echo