bootdisk: ui-bugreport (HEAD) [malekith]

PLD CVS pld-cvs-commit w pld.org.pl
Pią, 26 Lip 2002, 12:12:42 CEST


Module name:	bootdisk
Changes by:	malekith	02/07/26 12:12:39

Modified files:
	ui-bugreport

Log message:
- bugfixes
- set proper ip (bugs.pld.org.pl)

Index: ui-bugreport
===================================================================
RCS file: /cvsroot/bootdisk/batch-installer/ui/ui-bugreport,v
diff -d -u -r1.1 -r1.2
--- ui-bugreport	2002/07/25 11:41:04	1.1
+++ ui-bugreport	2002/07/26 10:12:38	1.2
@@ -33,7 +33,7 @@
 # $Id$
 #
 
-SERVER_ADDRESS="192.168.1.1 12345"
+SERVER_ADDRESS="193.219.28.21 17419"
 
 export PATH=.:..:$PATH
 add_title="_Bug _Report"
@@ -139,12 +139,12 @@
   echo
   echo
   echo "================================================================="
-  echo "=== \`$f\`"
+  echo "=== \`$cmd\`"
   echo "================================================================="
   
-  $f
+  $cmd
 
-  echo "=== EOF \`$f\`"
+  echo "=== EOF \`$cmd\`"
 done
 ) > /tmp/bug.txt
 
@@ -160,6 +160,8 @@
   exit 1
 fi
 
+rm -f /tmp/bug.txt.orig
+
 net=$(nls "<br>Note: You don't seem to have network configured,<br>so sending bug report is not likely to work.<br>")
 
 if test -x /sbin/ip ; then
@@ -179,36 +181,73 @@
 </menu>
 EOF
 
-save () {
-    if mount -t vfat /dev/fd0 /mnt ; then
-      :
-    else
-      dial <<EOF
+ask_for_floppy () {
+}
+
+save_report () {
+  cp /tmp/bug.txt /mnt
+  cp_res=$?
+  if umount /mnt && [ $cp_res = 0 ] ; then
+    dial <<EOF
+$(nls "Bug report saved to file %s. Please send it to" bug.txt)<br>
+$(nls "feedback w pld.org.pl, or directly to pld-installer w pld.org.pl")<br>
+$(nls "if you are subscribed there. Thank you!")<br>
+<br>
+            <button>
+EOF
+    return 0
+  else
+    dial <<EOF
+$(nls "Problems saving bug report.")<br>
+<br>
+        <button>
+EOF
+    return 1
+  fi
+}
+
+ask_and_save () {
+  dial <<EOF
 $(nls "Please insert diskette in drive and press")<br>
 $(nls "enter when ready.")<br><br>
        <button>
 EOF
-      if mount -t vfat /dev/fd0 /mnt ; then
-        :
-      else
-        dial <<EOF
+  if mount -t vfat /dev/fd0 /mnt ; then
+    :
+  else
+    dial <<EOF
 $(nls "Cannot mount floppy. Bug report is in %s." /tmp/bug.txt)
 <br><br>
          <button>
 EOF
-	exit 1
-      fi
-    fi
-
-    cp /tmp/bug.txt /mnt
-    umount /mnt
+    exit 1
+  fi
+  
+  if save_report ; then
+    : ok
+  else
     dial <<EOF
-$(nls "Bug report saved to file %s. Please send it to" bug.txt)<br>
-$(nls "feedback w pld.org.pl, or directly to pld-installer w pld.org.pl")<br>
-$(nls "if you are subscribed there. Thank you!")<br>
+$(nls "Problems saving bug report.")<br>
+$(nls "Bug report in file '%s'." /tmp/bug.txt)<br>
 <br>
-            <button>
+       <button>
 EOF
+  fi
+}
+
+save () {
+  # try saving without asking
+  if mount -t vfat /dev/fd0 /mnt ; then
+    if save_report ; then
+      : ok
+    else
+      # but if saving fails:
+      ask_and_save
+    fi
+  else
+    # but if mouting fails:
+    ask_and_save
+  fi
 }
 
 send () {



Więcej informacji o liście dyskusyjnej pld-installer