summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakbug
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/drakbug')
-rwxr-xr-xperl-install/standalone/drakbug31
1 files changed, 6 insertions, 25 deletions
diff --git a/perl-install/standalone/drakbug b/perl-install/standalone/drakbug
index caacf1297..d5b0dee0b 100755
--- a/perl-install/standalone/drakbug
+++ b/perl-install/standalone/drakbug
@@ -238,21 +238,14 @@ sub get_pkg_name {
my ($executable) = @_;
my $which_app = chomp_(`which '$executable' 2> /dev/null`);
my $rpm_package;
- my @tmp;
if ($which_app eq "") {
$rpm_package = chomp_(`rpm -q '$executable' --qf '%{NAME}' 2>&1`);
} else {
$rpm_package = chomp_(`rpm -qf '$which_app' --qf '%{NAME}' 2>&1`);
}
- $rpm_package = "" if $rpm_package =~ /not installed$/;
- if ($rpm_package eq "") {
- $rpm_package = chomp_(`rpm -qf '$executable' --qf '%{NAME}' 2>&1`);
- }
- if ($rpm_package =~ /^kernel/) {
- @tmp = split(/-2/, $rpm_package);
- $rpm_package = $tmp[0];
- }
- $rpm_package = N("NOT FOUND") if $rpm_package eq "";
+ $rpm_package = chomp_(`rpm -qf '$executable' --qf '%{NAME}' 2>&1`) if $rpm_package =~ /not installed$/;
+ $rpm_package = (split(/-2/, $rpm_package))[0] if $rpm_package =~ /^kernel/;
+ $rpm_package ||= N("NOT FOUND");
$rpm_package;
}
@@ -320,21 +313,9 @@ sub write_anthill_file() {
}
print F "-" x 80 . "\n";
- if ($kversion->get_active == 1) {
- $bugdesc = "Kernel: $kernel_release\n";
- $bugdesc .= "Uname: " . `uname -a` . "\n";
- print F $bugdesc;
- }
- if ($cpuinfo->get_active == 1) {
- $bugdesc = "Cpuinfo: \n";
- $bugdesc .= cat_("/proc/cpuinfo");
- print F $bugdesc;
- }
- if ($lspci->get_active == 1) {
- $bugdesc = "Lspci Output:\n";
- $bugdesc .= `lspci`;
- print F $bugdesc;
- }
+ print F "Kernel: $kernel_release\n" . "Uname: " . `uname -a` . "\n" if $kversion->get_active;
+ print F "Cpuinfo: \n" . cat_("/proc/cpuinfo") if $cpuinfo->get_active;
+ print F "Lspci Output:\n" . `lspci` if $lspci->get_active;
print F "--- END DRAKBUG REPORT ---\n";
close F or return 1;
return 0