From b5e0271aba1b66dc72f4598331ffbeac099df849 Mon Sep 17 00:00:00 2001 From: Adam the Jazz Guy Date: Tue, 9 Feb 1999 14:07:49 +0000 Subject: [PATCH] Fixed formatting of code Now changes to directory of program to be run before starting wine --- tools/bug_report.pl | 473 ++++++++++++++++++++++++-------------------- 1 file changed, 262 insertions(+), 211 deletions(-) diff --git a/tools/bug_report.pl b/tools/bug_report.pl index 8a40c7a3625..fc8d8357b2d 100755 --- a/tools/bug_report.pl +++ b/tools/bug_report.pl @@ -6,6 +6,8 @@ ##hunt you down and kill you like the savage animal I am. ##Released under the WINE licence ##Changelog: +##February 3, 1999 - Fix to chdir to the program's directory +##February 1, 1999 - Cleaned up code ##January 26, 1999 - Fixed various bugs... ## - Made newbie mode easier ##January 25, 1999 - Initial Release @@ -15,47 +17,54 @@ ##| Utah Jazz Page @ http://www.gojazz.net | ##| Wine Builds @ http://www.gojazz.net/wine | ## ------------------------------------------- +sub do_var { + $var=$_[0]; + $var =~ s/\t//g; + return $var; +} open STDERR, ">&SAVEERR"; open STDERR, ">&STDOUT"; $ENV{'SHELL'}="/bin/bash"; -print <; chomp $debuglevel; until ($debuglevel < 4) { -print "Enter a number from 1-3!"; -$debuglevel=; -chomp $debuglevel; -} + print "Enter a number from 1-3!\n"; + $debuglevel=; + chomp $debuglevel; +} if ($debuglevel < 3) { -print <; @@ -64,199 +73,233 @@ print "Enter the file for the debug output (The second file):\n"; $dbgoutfile=; chomp $dbgoutfile; if ($debuglevel =~ 1) { -print "Looking for wine...\n"; -$wineloc=`which wine`; -chomp $wineloc; -if ($wineloc =~ "") { -print "Couldn't find wine...\n"; -print <; -chomp $wineloc; -} -else { -print "Found wine: $wineloc\n" -} + print "Looking for wine...\n"; + $wineloc=`which wine`; + chomp $wineloc; + if ($wineloc =~ "") { + print "Couldn't find wine...\n"; + $var3 = qq{ + Enter the full path to wine. The path should look like + /path/to/wine/wine. Get it? It's the directories leading up to the + wine file, and then the actual wine file (Example: /home/wine/wine): + }; + print do_var($var3); + $wineloc=; + chomp $wineloc; + } else { + print "Found wine: $wineloc\n" + } } if ($debuglevel > 1) { -if ($debuglevel =~ 2) { -print <; + chomp $wineloc; } -elsif ($debuglevel =~ 3) { -print "Enter the full path to wine (Example: /home/wine/wine):\n"; -} -$wineloc=; -chomp $wineloc; -} -print <; until ($winver < 7) { -print <; } + $var6 = qq{ + No! Enter a number from 0 to 7 that corresponds to your windows version! + }; + print do_var($var6); + $winver=; +} chomp $winver; -if ($winver =~ 0) { $winver="None Installed"; } -elsif ($winver =~ 1) { $winver="Windows 3.x"; } -elsif ($winver =~ 2) { $winver="Windows 95"; } -elsif ($winver =~ 3) { $winver="Windows 98"; } -elsif ($winver =~ 4) { $winver="Windows NT 3.5x"; } -elsif ($winver =~ 5) { $winver="Windows NT 4.x"; } -elsif ($winver =~ 6) { $winver="Windows NT 5.x"; } -elsif ($winver =~ 7) { -print "OK. What version of Windows are you using?\n"; -$winver=; -chomp $winver; } +if ($winver =~ 0) { + $winver="None Installed"; +} elsif ($winver =~ 1) { + $winver="Windows 3.x"; +} elsif ($winver =~ 2) { + $winver="Windows 95"; +} elsif ($winver =~ 3) { + $winver="Windows 98"; +} elsif ($winver =~ 4) { + $winver="Windows NT 3.5x"; +} elsif ($winver =~ 5) { + $winver="Windows NT 4.x"; +} elsif ($winver =~ 6) { + $winver="Windows NT 5.x"; +} elsif ($winver =~ 7) { + print "OK. What version of Windows are you using?\n"; + $winver=; + chomp $winver; +} if ($debuglevel < 3) { -print <; chomp $program; -print <; chomp $progname; -print <; chomp $progbits; until ($progbits < 3) { -print "You must enter 0, 1 or 2!\n"; -$progbits=; -chomp $progbits } -if ($progbits =~ 0) { $progbits=Win16 } -elsif ($progbits =~ 1) { $progbits=Win32 } -else { $progbits = "Unsure" } + print "You must enter 0, 1 or 2!\n"; + $progbits=; + chomp $progbits +} +if ($progbits =~ 0) { + $progbits=Win16 +} elsif ($progbits =~ 1) { + $progbits=Win32 +} else { + $progbits = "Unsure" +} if ($debuglevel > 1) { -if ($debuglevel =~ 2) { -print <; -chomp $debugopts; -if ($debugopts=~/-debugmsg /) { -($crap, $debugopts) = / /,$debugopts; } -if ($debugopts=~/^\s*$/) { $debugopts="+relay"; } } -elsif ($debuglevel =~ 1) { -$debugopts = "+relay"; } + if ($debuglevel =~ 2) { + $var11 = qq{ + Enter any extra debug options. Default is +relay - If you don't + know what options to use, just hit enter, and I'll use those (Example, the + developer tells you to re-run with -debugmsg +dosfs,+module you would type + in +dosfs,+module). Hit enter if you're not sure what to do: + }; + print do_var($var11); + } elsif ($debuglevel =~ 3) { + $var12 = qq{ + Enter any debug options you would like to use. Just enter parts after + -debugmsg. Default is +relay: + }; + print do_var($var12); + } + $debugopts=; + chomp $debugopts; + if ($debugopts=~/-debugmsg /) { + ($crap, $debugopts) = / /,$debugopts; + } + if ($debugopts=~/^\s*$/) { + $debugopts="+relay"; + } +} elsif ($debuglevel =~ 1) { + $debugopts = "+relay"; +} if ($debuglevel > 1) { -if ($debuglevel =~ 2) { -print <; + chomp $lastnlines; + if ($lastnlines=~/^\s*$/) { + $lastnlines=100; + } +} elsif ($debuglevel =~ 1) { + $lastnlines=100; } -elsif ($debuglevel =~ 3) { -print <; -chomp $lastnlines; -if ($lastnlines=~/^\s*$/) { $lastnlines=100; } } -elsif ($debuglevel =~ 1) { -$lastnlines=100; } -if ($debuglevel > 1) { -print <; -chomp $extraops; -} -elsif ($debuglevel =~ 1) { -$extraops="-managed"; +if ($debuglevel > 1) { + $var15 = qq{ + Enter any extra options you want to pass to WINE. Strongly recommended you + include -managed: + }; + print do_var($var15); + $extraops=; + chomp $extraops; +} elsif ($debuglevel =~ 1) { + $extraops="-managed"; } print "Enter your distribution name (Example: Redhat 5.0):\n"; $dist=; chomp $dist; if ($debuglevel > 1) { -if ($debuglevel =~ 2) { -print <; + chomp $configopts; + if ($configopts=~/\s*/) { + $configopts="None"; + } +} elsif ($debuglevel =~ 1) { + $configopts="None"; } -elsif ($debuglevel =~ 3) { -print <; -chomp $configopts; -if ($configopts=~/\s*/) { $configopts="None"; } } -elsif ($debuglevel =~ 1) { -$configopts="None"; } if ($debuglevel > 1) { -if ($debuglevel =~ 2) { -print <; -chomp $winever; -$winever=~s/ //g; -if ($winever=~/[0-9]+/) { -$winever .= " CVS"; -} -else { -$winever = `$wineloc -v 2>&1`; -chomp $winever; -} } -elsif ($debuglevel =~ 1) { -$winever=`$wineloc -v 2>&1`; -chomp $winever; + if ($debuglevel =~ 2) { + $var18 = qq{ + Is your wine version CVS or from a .tar.gz file? As in... did you download it + off a website/ftpsite or did you/have you run cvs on it to update it? + For CVS: YYMMDD, where YY is the year (99), MM is the month (01), and DD + is the day (14), that you last updated it (Example: 990114). + For tar.gz: Just hit enter and I'll figure out the version for you: + }; + print do_var($var18); + } elsif ($debuglevel =~ 3) { + $var19 = qq{ + Is your wine from CVS? Enter the last CVS update date for it here, in + YYMMDD form (If it's from a tarball, just hit enter): + }; + print do_var($var19); + } + $winever=; + chomp $winever; + $winever=~s/ //g; + if ($winever=~/[0-9]+/) { + $winever .= " CVS"; + } + else { + $winever = `$wineloc -v 2>&1`; + chomp $winever; + } +} elsif ($debuglevel =~ 1) { + $winever=`$wineloc -v 2>&1`; + chomp $winever; } $gccver=`gcc -v 2>&1`; ($leftover,$gccver) = split /\n/,$gccver; @@ -269,24 +312,29 @@ $ostype=`uname -s`; chomp $ostype; $wineneeds=`ldd $wineloc`; if ($debuglevel < 3) { -print <; +$dir=$program; +$dir=~m#(.*)/#; +$dir=$1; +chdir($dir); system("echo quit|$wineloc -debugmsg $debugopts $extraops \"$program\" >& $dbgoutfile"); $lastlines=`tail -n $lastnlines $dbgoutfile`; system("gzip $dbgoutfile"); @@ -312,7 +360,7 @@ $lastlines I have a copy of the full debug report, if it is needed. Thank you! EOM -print <