#!/usr/bin/perl ##Wine Quick Debug Report Maker Thingy (WQDRMK) ##By Adam the Jazz Guy ##(c) 1998 ##Do not say this is yours without my express permisson, or I will ##hunt you down and kill you like the savage animal I am. ##Released under the WINE licence ##Changelog: ##January 26, 1999 - Fixed various bugs... ## - Made newbie mode easier ##January 25, 1999 - Initial Release ## ------------------------------------------- ##| IRCNET/UNDERNET: jazzfan AOL: Jazzrock12 | ##| E-MAIL: magicbox@bestweb.net ICQ: 19617831| ##| Utah Jazz Page @ http://www.gojazz.net | ##| Wine Builds @ http://www.gojazz.net/wine | ## ------------------------------------------- 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; } if ($debuglevel < 3) { print <; chomp $outfile; 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" } } if ($debuglevel > 1) { if ($debuglevel =~ 2) { print <; chomp $wineloc; } print <; until ($winver < 7) { print <; } 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" } 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 > 1) { if ($debuglevel =~ 2) { print <; chomp $lastnlines; if ($lastnlines=~/^\s*$/) { $lastnlines=100; } } elsif ($debuglevel =~ 1) { $lastnlines=100; } if ($debuglevel > 1) { print <; 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"; } 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; } $gccver=`gcc -v 2>&1`; ($leftover,$gccver) = split /\n/,$gccver; chomp $gccver; $cpu=`uname -m`; chomp $cpu; $kernelver=`uname -r`; chomp $kernelver; $ostype=`uname -s`; chomp $ostype; $wineneeds=`ldd $wineloc`; if ($debuglevel < 3) { print <; system("echo quit|$wineloc -debugmsg $debugopts $extraops \"$program\" >& $dbgoutfile"); $lastlines=`tail -n $lastnlines $dbgoutfile`; system("gzip $dbgoutfile"); open(OUTFILE,">$outfile"); print OUTFILE <