summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-09-09 10:23:00 +0000
committerThierry Vignaud <tv@mandriva.org>2008-09-09 10:23:00 +0000
commitd9d1cf81d8f790ca6fa3c724a224d937365fed37 (patch)
treece70f1fe5e425801ec156c01c6d514a2e7ccbd61
parent65fef868cad8ab92295b012f17250a0d40c2f7e5 (diff)
downloaddrakx-d9d1cf81d8f790ca6fa3c724a224d937365fed37.tar
drakx-d9d1cf81d8f790ca6fa3c724a224d937365fed37.tar.gz
drakx-d9d1cf81d8f790ca6fa3c724a224d937365fed37.tar.bz2
drakx-d9d1cf81d8f790ca6fa3c724a224d937365fed37.tar.xz
drakx-d9d1cf81d8f790ca6fa3c724a224d937365fed37.zip
add a bug ID
-rw-r--r--perl-install/install/NEWS2
1 files changed, 1 insertions, 1 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 8cf9e35d3..5a2891b57 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -12,7 +12,7 @@ Version 11.34 - 2 September 2008
- fix buggy blocking wait_message occuring in diskdrake
(using a more powerful strategy to ensure such blocking wait_message won't
- bother us anymore)
+ bother us anymore) (#43527)
- fix sizing some label (workarounding infamous 6 years old gnome bug #101968)
- increase help popup size when browsing services or packages
w-r--r--perl-install/commands.pm18
-rw-r--r--perl-install/crypto.pm2
-rw-r--r--perl-install/detect_devices.pm13
-rw-r--r--perl-install/devices.pm2
-rw-r--r--perl-install/diskdrake/hd_gtk.pm2
-rw-r--r--perl-install/fs.pm4
-rw-r--r--perl-install/ftp.pm2
-rw-r--r--perl-install/harddrake/data.pm4
-rw-r--r--perl-install/harddrake/ui.pm4
-rw-r--r--perl-install/install_any.pm4
-rw-r--r--perl-install/install_steps_gtk.pm4
-rw-r--r--perl-install/install_steps_interactive.pm10
-rw-r--r--perl-install/interactive/gtk.pm2
-rw-r--r--perl-install/interactive/newt.pm2
-rw-r--r--perl-install/interactive/stdio.pm4
-rw-r--r--perl-install/my_gtk.pm6
-rw-r--r--perl-install/network/network.pm6
-rw-r--r--perl-install/network/smb.pm2
-rw-r--r--perl-install/network/tools.pm4
-rw-r--r--perl-install/partition_table/dos.pm2
-rw-r--r--perl-install/partition_table/mac.pm2
-rw-r--r--perl-install/pkgs.pm2
-rw-r--r--perl-install/printer/cups.pm4
-rw-r--r--perl-install/printer/detect.pm16
-rw-r--r--perl-install/printer/gimp.pm9
-rw-r--r--perl-install/printer/main.pm85
-rw-r--r--perl-install/printer/office.pm17
-rw-r--r--perl-install/printer/printerdrake.pm505
-rw-r--r--perl-install/resize_fat/dir_entry.pm2
-rw-r--r--perl-install/resize_fat/main.pm4
-rw-r--r--perl-install/run_program.pm2
-rwxr-xr-xperl-install/scanner.pm2
-rw-r--r--perl-install/steps.pm2
-rw-r--r--perl-install/swap.pm8
-rw-r--r--perl-install/ugtk.pm4
-rw-r--r--perl-install/unused/scsi.pm2
40 files changed, 387 insertions, 400 deletions
diff --git a/perl-install/Xconfig/xfreeX.pm b/perl-install/Xconfig/xfreeX.pm
index ca2f91423..5853342f9 100644
--- a/perl-install/Xconfig/xfreeX.pm
+++ b/perl-install/Xconfig/xfreeX.pm
@@ -284,7 +284,7 @@ sub add_Section {
}
sub remove_Section {
my ($raw_X, $Section, $when) = @_;
- @$raw_X = grep { $_->{name} ne $Section || ($when && $when->($_->{l})) } @$raw_X;
+ @$raw_X = grep { $_->{name} ne $Section || $when && $when->($_->{l}) } @$raw_X;
$raw_X;
}
sub get_Sections {
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 9fa757230..e183f46f1 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -128,7 +128,7 @@ sub setupBootloader {
$boot : fsedit::get_root($fstab, 'boot')->{device});
}
} else {
- $in->set_help(arch() =~ /sparc/ ? "setupSILOGeneral" : arch() =~ /ppc/ ? 'setupYabootGeneral' :"setupBootloader") unless $::isStandalone; #- TO MERGE ?
+ $in->set_help(arch() =~ /sparc/ ? "setupSILOGeneral" : arch() =~ /ppc/ ? 'setupYabootGeneral' : "setupBootloader") unless $::isStandalone; #- TO MERGE ?
my @silo_install_lang = (N("First sector of drive (MBR)"), N("First sector of boot partition"));
my $silo_install_lang = $silo_install_lang[$b->{use_partition}];
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index e13f250aa..81737f4c8 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -631,7 +631,7 @@ sub install_yaboot {
if ($_->{type} eq "image") {
my $of_dev = '';
- if (($boot !~ /$_->{root}/) && $boot) {
+ if ($boot !~ /$_->{root}/ && $boot) {
$of_dev = get_of_dev($boot);
print F "$_->{type}=$of_dev," . substr($_->{kernel_or_dev}, 5);
} else {
@@ -640,7 +640,7 @@ sub install_yaboot {
}
print F "\tlabel=", substr($_->{label}, 0, 15); #- lilo doesn't handle more than 15 char long labels
print F "\troot=$_->{root}";
- if (($boot !~ /$_->{root}/) && $boot) {
+ if ($boot !~ /$_->{root}/ && $boot) {
print F "\tinitrd=$of_dev," . substr($_->{initrd}, 5) if $_->{initrd};
} else {
print F "\tinitrd=$of_dev,$_->{initrd}" if $_->{initrd};
@@ -732,8 +732,8 @@ sub install_silo {
}
log::l("Installing boot loader...");
$::testing and return;
- run_program::rooted($::prefix, "silo", "2>", "/tmp/.error", $silo->{use_partition} ? ("-t") : ()) or
- run_program::rooted_or_die($::prefix, "silo", "2>", "/tmp/.error", "-p", "2", $silo->{use_partition} ? ("-t") : ());
+ run_program::rooted($::prefix, "silo", "2>", "/tmp/.error", $silo->{use_partition} ? "-t" : ()) or
+ run_program::rooted_or_die($::prefix, "silo", "2>", "/tmp/.error", "-p", "2", $silo->{use_partition} ? "-t" : ());
unlink "$::prefix/tmp/.error";
#- try writing in the prom.
diff --git a/perl-install/bootlook.pm b/perl-install/bootlook.pm
index 2eba6b460..58cd29cf7 100644
--- a/perl-install/bootlook.pm
+++ b/perl-install/bootlook.pm
@@ -117,8 +117,8 @@ if (member( $cur_res, qw( 785 788 791 794))) {
#- and check that lilo is the correct loader
$no_bootsplash ||= chomp_(`detectloader -q`) ne 'LILO';
my @thms;
-my @lilo_thms = (($themes{'default'}) ?() :qw(default));
-my @boot_thms = (($themes{'default'}) ?() :qw(default));
+my @lilo_thms = ($themes{'default'} ? () : qw(default));
+my @boot_thms = ($themes{'default'} ? () : qw(default));
chdir($themes{'path'}); #- we must change directory for correct @thms assignement
foreach (all('.')) {
if (-d $themes{'path'} . $_ && m/^[^.]/) {
@@ -156,8 +156,8 @@ $B_create->signal_connect(clicked => sub {
$combo{'thms'}->entry->signal_connect(changed => sub {
my $thm_txt = $combo{'thms'}->entry->get_text();
- $combo{'lilo'}->entry->set_text(member($thm_txt, @lilo_thms) ? $thm_txt : ($themes{'default'} || 'default'));
- $combo{'boot'}->entry->set_text(member($thm_txt, @boot_thms) ? $thm_txt : ($themes{'default'} || 'default'));
+ $combo{'lilo'}->entry->set_text(member($thm_txt, @lilo_thms) ? $thm_txt : $themes{'default'} || 'default');
+ $combo{'boot'}->entry->set_text(member($thm_txt, @boot_thms) ? $thm_txt : $themes{'default'} || 'default');
});
@@ -376,7 +376,7 @@ sub parse_etc_passwd {
do {
@user_info = getpwent();
($uname, $uid) = @user_info[0,2];
- push (@usernames, $uname) if ($uid > 500) and !($uname eq "nobody");
+ push (@usernames, $uname) if $uid > 500 and !($uname eq "nobody");
} while @user_info;
}
@@ -408,7 +408,7 @@ sub isXlaunched {
}
sub updateInit {
- my $runlevel = ($x_mode) ? 5 : 3;
+ my $runlevel = $x_mode ? 5 : 3;
substInFile { s/^id:\d:initdefault:\s*$/id:$runlevel:initdefault:\n/ } "/etc/inittab";
}
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index f871cf6ea..f5cc2f44c 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -54,7 +54,7 @@ sub grep_ {
@_ == 0 || $h and die "usage: grep <regexp> [files...]\n";
my $r = shift;
$r = qr/$r/i if $i;
- @ARGV = @_; (/$r/ ? $v || print : $v && print) while <>;
+ @ARGV = @_; (/$r/ xor $v) and print while <>;
}
sub tr_ {
@@ -193,11 +193,11 @@ sub rights {
if (vec(pack("S", $_[0]), $i, 1)) {
my ($val, $place) = $i >= 9 ? @{$rights[$i]} : ($rights[$i], $i);
my $old = \substr($r, 8 - $place, 1);
- $$old = ($$old eq '-' && $i >= 9) ? uc $val : $val;
+ $$old = $$old eq '-' && $i >= 9 ? uc $val : $val;
}
}
my @types = split //, "_pc_d_b_-_l_s";
- $types[$_[0] >> 12 & 0xf] . $r;
+ $types[($_[0] >> 12) & 0xf] . $r;
}
sub displaySize {
@@ -268,14 +268,14 @@ sub dd {
$h{$1} = $2;
}
local (*IF, *OF); my ($tmp, $nb, $read);
- ref $h{if} eq 'GLOB' ? *IF = $h{if} : sysopen(IF, $h{if}, 0) || die "error: can't open file $h{if}\n";
- ref $h{of} eq 'GLOB' ? *OF = $h{of} : sysopen(OF, $h{of}, 0x41) || die "error: can't open file $h{of}\n";
+ ref $h{if} eq 'GLOB' ? (*IF = $h{if}) : sysopen(IF, $h{if}, 0) || die "error: can't open file $h{if}\n";
+ ref $h{of} eq 'GLOB' ? (*OF = $h{of}) : sysopen(OF, $h{of}, 0x41) || die "error: can't open file $h{of}\n";
$h{bs} = removeXiBSuffix($h{bs});
for ($nb = 0; !$h{count} || $nb < $h{count}; $nb++) {
printf "\r%02.1d%%", 100 * $nb / $h{count} if $h{count} && $percent;
- $read = sysread(IF, $tmp, $h{bs}) or $h{count} ? die "error: can't read block $nb\n" : last;
+ $read = sysread(IF, $tmp, $h{bs}) or ($h{count} ? die "error: can't read block $nb\n" : last);
syswrite(OF, $tmp) or die "error: can't write block $nb\n";
$read < $h{bs} and $read = 1, last;
}
@@ -473,9 +473,9 @@ $dev, $size, $used, $free, $use, $mntpoint
$use = int(100 * ($size - $free) / $size);
$used = $size - $free;
if ($h) {
- $used = int ($used / 1024) . "M";
- $size = int ($size / 1024) . "M";
- $free = int ($free / 1024) . "M";
+ $used = int($used / 1024 . "M");
+ $size = int($size / 1024 . "M");
+ $free = int($free / 1024 . "M");
}
write DF if $size;
}
diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm
index eae03336d..c44723e14 100644
--- a/perl-install/crypto.pm
+++ b/perl-install/crypto.pm
@@ -44,7 +44,7 @@ use ftp;
%mirrors = ();
-sub mirror2text { $mirrors{$_[0]} && ($mirrors{$_[0]}[0] . '|' . $_[0]) }
+sub mirror2text { $mirrors{$_[0]} && $mirrors{$_[0]}[0] . '|' . $_[0] }
sub mirrors {
unless (keys %mirrors) {
#- contact the following URL to retrieve list of mirror.
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 3ad4c31b6..23a867c2f 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -286,7 +286,7 @@ sub getIDE() {
my $type = ${{ disk => 'hd', cdrom => 'cdrom', tape => 'tape', floppy => 'fd' }}{$t} or next;
my $info = chomp_(cat_("$d/model")) || "(none)";
- my $num = ord (($d =~ /(.)$/)[0]) - ord 'a';
+ my $num = ord(($d =~ /(.)$/)[0]) - ord 'a';
my ($vendor, $model) = map {
if_($info =~ /^$_(-|\s)*(.*)/, $eide_hds{$_}, $2);
} keys %eide_hds;
@@ -640,23 +640,20 @@ sub whatUsbport() {
# Extract the printer data from the ID string
my ($manufacturer, $model, $serialnumber, $description) =
("", "", "", "");
- if (($idstr =~ /MFG:([^;]+);/) ||
- ($idstr =~ /MANUFACTURER:([^;]+);/)) {
+ if ($idstr =~ /MFG:([^;]+);/ || $idstr =~ /MANUFACTURER:([^;]+);/) {
$manufacturer = $1;
$manufacturer =~ s/Hewlett[-\s_]Packard/HP/;
$manufacturer =~ s/HEWLETT[-\s_]PACKARD/HP/;
}
# For HP's multi-function devices the real model name is in the "SKU"
# field. So use this field with priority for $model when it exists.
- if (($idstr =~ /MDL:([^;]+);/) ||
- ($idstr =~ /MODEL:([^;]+);/)) {
+ if ($idstr =~ /MDL:([^;]+);/ || $idstr =~ /MODEL:([^;]+);/) {
$model ||= $1;
}
if ($idstr =~ /SKU:([^;]+);/) {
$model = $1;
}
- if (($idstr =~ /DES:([^;]+);/) ||
- ($idstr =~ /DESCRIPTION:([^;]+);/)) {
+ if ($idstr =~ /DES:([^;]+);/ || $idstr =~ /DESCRIPTION:([^;]+);/) {
$description = $1;
$description =~ s/Hewlett[-\s_]Packard/HP/;
$description =~ s/HEWLETT[-\s_]PACKARD/HP/;
@@ -665,7 +662,7 @@ sub whatUsbport() {
$serialnumber = $1;
}
# Was there a manufacturer and a model in the string?
- if (($manufacturer eq "") || ($model eq "")) {
+ if ($manufacturer eq "" || $model eq "") {
next;
}
# No description field? Make one out of manufacturer and model.
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 32c52904c..20e5c157b 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -27,7 +27,7 @@ sub size($) {
for ($high = 1; $high > 0 && &$valid_offset($high); $high *= 2) { $low = $high }
while ($low < $high - 1) {
- $mid = int ($low + $high) / 2;
+ $mid = int(($low + $high) / 2);
&$valid_offset($mid) ? $low : $high = $mid;
}
$low + 1;
diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm
index f8852466c..bbbcc6bdc 100644
--- a/perl-install/diskdrake/hd_gtk.pm
+++ b/perl-install/diskdrake/hd_gtk.pm
@@ -95,7 +95,7 @@ sub main {
if $::isStandalone;
$in->ask_warn('',
N("If you plan to use aboot, be carefull to leave a free space (2048 sectors is enough)
-at the beginning of the disk")) if (arch() eq 'alpha') and !$::isEmbedded;
+at the beginning of the disk")) if arch() eq 'alpha' and !$::isEmbedded;
$w->main;
}
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index 0c07e5d9a..f60807af0 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -396,8 +396,8 @@ sub mount_options_help {
my $prev_tp = $tp;
$tp = /^\.(TP|RE)/;
my ($s) = /^\.B (.*)/;
- if ($prev_tp && $s eq '\-o' .. /X^/) {
- if (my $v = $prev_tp && $s =~ /^[a-z]/i .. $tp) {
+ if (($prev_tp && $s eq '\-o') .. /X^/) {
+ if (my $v = ($prev_tp && $s =~ /^[a-z]/i) .. $tp) {
if ($v == 1) {
$s = $short{$s} || $s;
$option = exists $help{$s} && !$help{$s} ? $s : '';
diff --git a/perl-install/ftp.pm b/perl-install/ftp.pm
index f9a046e2d..3123edc34 100644
--- a/perl-install/ftp.pm
+++ b/perl-install/ftp.pm
@@ -56,7 +56,7 @@ sub getFile {
eval { $$retr->close if $$retr };
$@ and rewindGetFile(); #- in case Timeout got us on "->close"
$$retr = $ftp->retr($f) and return $$retr;
- ($ftp->code == 550) and log::l("FTP: 550 file unavailable"), return;
+ $ftp->code == 550 and log::l("FTP: 550 file unavailable"), return;
rewindGetFile();
log::l("ftp get failed, sleeping before trying again");
sleep 1;
diff --git a/perl-install/harddrake/data.pm b/perl-install/harddrake/data.pm
index 25909bb2d..479623d9d 100644
--- a/perl-install/harddrake/data.pm
+++ b/perl-install/harddrake/data.pm
@@ -11,7 +11,7 @@ my @devices = detect_devices::probeall(1);
# Update me each time you handle one more devices class (aka configurator)
sub unknown {
- grep { ($_->{media_type} !~ /tape|SERIAL_(USB|SMBUS)|Printer|DISPLAY|MULTIMEDIA_(VIDEO|AUDIO|OTHER)|STORAGE_(IDE|SCSI|OTHER)|BRIDGE|NETWORK/) && ($_->{driver} ne '^(scanner|usbvideo)$') && $_->{type} ne 'network' && $_->{driver} !~ /Mouse:USB|class\|Mouse/ } @devices;
+ grep { $_->{media_type} !~ /tape|SERIAL_(USB|SMBUS)|Printer|DISPLAY|MULTIMEDIA_(VIDEO|AUDIO|OTHER)|STORAGE_(IDE|SCSI|OTHER)|BRIDGE|NETWORK/ && $_->{driver} ne '^(scanner|usbvideo)$' && $_->{type} ne 'network' && $_->{driver} !~ /Mouse:USB|class\|Mouse/ } @devices;
}
@@ -28,7 +28,7 @@ our @tree =
["DVDROM", "DVD-ROM", "cd.png", "", sub { grep { ! detect_devices::isBurner($_) } detect_devices::dvdroms() }, 0 ],
["TAPE", "Tape", "tape.png", "", \&detect_devices::tapes, 0 ],
["VIDEO", "Videocard", "video.png", "$sbindir/XFdrake", sub { grep { $_->{driver} =~ /^(Card|Server):/ || $_->{media_type} =~ /DISPLAY_VGA/ } @devices }, 1 ],
- ["TV", "Tvcard", "tv.png", "/usr/bin/XawTV", sub { grep { ($_->{media_type} =~ /MULTIMEDIA_VIDEO/ && $_->{bus} eq 'PCI') || $_->{driver} eq 'usbvision' } @devices }, 0 ],
+ ["TV", "Tvcard", "tv.png", "/usr/bin/XawTV", sub { grep { $_->{media_type} =~ /MULTIMEDIA_VIDEO/ && $_->{bus} eq 'PCI' || $_->{driver} eq 'usbvision' } @devices }, 0 ],
["MULTIMEDIA_OTHER", "Other MultiMedia devices", "multimedia.png", "", sub { grep { $_->{media_type} =~ /MULTIMEDIA_OTHER/ } @devices }, 0 ],
["AUDIO", "Soundcard", "sound.png", "$sbindir/draksound", sub { grep { $_->{media_type} =~ /MULTIMEDIA_AUDIO/ } @devices }, 0 ],
["WEBCAM", "Webcam", "webcam.png", "", sub { grep { $_->{media_type} =~ /MULTIMEDIA_VIDEO/ && $_->{bus} ne 'PCI' } @devices }, 0 ],
diff --git a/perl-install/harddrake/ui.pm b/perl-install/harddrake/ui.pm
index b6e6da7b2..34c9a670d 100644
--- a/perl-install/harddrake/ui.pm
+++ b/perl-install/harddrake/ui.pm
@@ -148,7 +148,7 @@ sub detect {
if (exists $_->{bus} && $_->{bus} eq 'ide') {
$_->{channel} = $_->{channel} ? N("secondary") : N("primary");
delete $_->{info};
- } elsif ((exists $_->{id}) && ($_->{bus} ne 'PCI')) {
+ } elsif ((exists $_->{id}) && $_->{bus} ne 'PCI') {
# SCSI detection incoherency:
my $i = $_;
$_->{bus_location} = join ':', map { sprintf("%lx", $i->{$_}) } qw(bus id);
@@ -226,7 +226,7 @@ sub new {
foreach my $i (sort keys %$current_device) {
if ($fields{$i}[0]) {
$text->insert("", $text->style->black, "", $fields{$i}[0] . ": ");
- $text->insert("", ($i eq 'driver' && $current_device->{$i} eq 'unknown') ? $wcolor : $color,
+ $text->insert("", $i eq 'driver' && $current_device->{$i} eq 'unknown' ? $wcolor : $color,
"", "$current_device->{$i}\n\n");
} else { print "Skip \"$i\" field => \"$current_device->{$i}\"\n\n" }
}
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 8e94b6bbe..a5a185759 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -379,7 +379,7 @@ sub setDefaultPackages {
$o->{compssUsersChoice}{USB} = 1 if modules::get_probeall("usb-interface");
$o->{compssUsersChoice}{PCMCIA} = 1 if detect_devices::hasPCMCIA();
$o->{compssUsersChoice}{HIGH_SECURITY} = 1 if $o->{security} > 3;
- $o->{compssUsersChoice}{BIGMEM} = 1 if !$::oem && (availableRamMB() > 800) && (arch() !~ /ia64/);
+ $o->{compssUsersChoice}{BIGMEM} = 1 if !$::oem && availableRamMB() > 800 && arch() !~ /ia64/;
$o->{compssUsersChoice}{SMP} = 1 if detect_devices::hasSMP();
$o->{compssUsersChoice}{CDCOM} = 1 if grep { $_->{descr} =~ /commercial/i } values %{$o->{packages}{mediums}};
$o->{compssUsersChoice}{'3D'} = 1 if
@@ -963,7 +963,7 @@ sub generate_automatic_stage1_params {
adsluser => 'adslu', adslpass => 'adslp', hostname => 'hos', domain => 'dom', server => 'ser',
directory => 'dir', user => 'use', pass => 'pas', disk => 'dis', partition => 'par');
- 'automatic='.join(',', map { (/^([^:]+)(:.*)/ && $aliases{$1}) ? $aliases{$1}.$2 : $_ } @ks);
+ 'automatic='.join(',', map { /^([^:]+)(:.*)/ && $aliases{$1} ? $aliases{$1}.$2 : $_ } @ks);
}
sub guess_mount_point {
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 40e6cdb35..e29efddf0 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -48,8 +48,8 @@ sub new($$) {
unless (-d "/var/log") { mkdir("/var/log") }
local $SIG{CHLD} = sub { $ok = 0 if waitpid(-1, c::WNOHANG()) > 0 };
unless (fork) {
- exec $_[0], (arch() =~ /^sparc/ || arch() eq "ppc" ? () : ("-kb")), "-dpms", "-s", "240",
- ($_[0] =~ /Xpmac/ ? $xpmac_opts !~ /ofonly/ ? ("-mode", "17", "-depth", "32") : ("-mach64") :()),
+ exec $_[0], (arch() =~ /^sparc/ || arch() eq "ppc" ? () : "-kb"), "-dpms", "-s", "240",
+ ($_[0] =~ /Xpmac/ ? $xpmac_opts !~ /ofonly/ ? ("-mode", "17", "-depth", "32") : "-mach64" : ()),
($_[0] =~ /Xsun/ || $_[0] =~ /Xpmac/ ? ("-fp", "/usr/X11R6/lib/X11/fonts:unscaled") :
("-allowMouseOpenFail", "-xf86config", $f)) or exit 1;
}
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 8490e72f3..0514093ff 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -1063,7 +1063,7 @@ sub configurePrinter {
#- try to determine if a question should be asked to the user or
#- if he is autorized to configure multiple queues.
- my $ask_multiple_printer = ($::expert || $clicked) && 2 || ($o && printer::detect::local_detect());
+ my $ask_multiple_printer = ($::expert || $clicked) && 2 || $o && printer::detect::local_detect();
$ask_multiple_printer-- or return;
#- install packages needed for printer::getinfo()
@@ -1074,9 +1074,9 @@ sub configurePrinter {
my $printer = $o->{printer} ||= {};
eval { add2hash($printer, printer::main::getinfo($o->{prefix})) };
- $printer->{PAPERSIZE} = (($o->{lang} =~ /^en_US/) ||
- ($o->{lang} =~ /^en_CA/) ||
- ($o->{lang} =~ /^fr_CA/)) ? 'Letter' : 'A4';
+ $printer->{PAPERSIZE} = ($o->{lang} =~ /^en_US/ ||
+ $o->{lang} =~ /^en_CA/ ||
+ $o->{lang} =~ /^fr_CA/) ? 'Letter' : 'A4';
printer::printerdrake::main($printer, $o, $ask_multiple_printer, sub { install_interactive::upNetwork($o, 'pppAvoided') });
}
@@ -1156,7 +1156,7 @@ sub addUser {
push @{$o->{users}}, { password => 'mandrake', realname => 'default', icon => 'automagic' }
if !member('mandrake', map { $_->{name} } @{$o->{users}});
}
- if (($o->{security} >= 1 || $clicked)) {
+ if ($o->{security} >= 1 || $clicked) {
any::ask_users($o->{prefix}, $o, $o->{users}, $o->{security});
}
any::get_autologin($o->{prefix}, $o);
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm
index 53d7d72c2..b4c09afe6 100644
--- a/perl-install/interactive/gtk.pm
+++ b/perl-install/interactive/gtk.pm
@@ -115,7 +115,7 @@ sub create_clist {
$l[($j + $curr) % @l] =~ /$start_reg$word/i and last;
}
$j == @l ?
- $starting_word = '' :
+ ($starting_word = '') :
$select->(($j + $curr) % @l);
$timeout = Gtk->timeout_add($forgetTime, sub { $timeout = $starting_word = ''; 0 });
diff --git a/perl-install/interactive/newt.pm b/perl-install/interactive/newt.pm
index b15b92a57..2f5f18791 100644
--- a/perl-install/interactive/newt.pm
+++ b/perl-install/interactive/newt.pm
@@ -144,7 +144,7 @@ sub ask_fromW_real {
} @{$e->{list}};
};
} else {
- $w = Newt::Component::Entry(-1, -1, '', 20, ($e->{hidden} && 1 << 11) | 1 << 2);
+ $w = Newt::Component::Entry(-1, -1, '', 20, ($e->{hidden} && 1 << 11) | (1 << 2));
$get = sub { $w->EntryGetValue };
$set = sub { $w->EntrySet($_[0], 1) };
}
diff --git a/perl-install/interactive/stdio.pm b/perl-install/interactive/stdio.pm
index 1952cc0e5..0fa6bf3d7 100644
--- a/perl-install/interactive/stdio.pm
+++ b/perl-install/interactive/stdio.pm
@@ -74,7 +74,7 @@ ask_fromW_begin:
${$e->{val}} = $i;
}
} elsif ($e->{type} =~ /list/) {
- ($e->{text} || $e->{label}) and print "=> $e->{label} $e->{text}\n";
+ $e->{text} || $e->{label} and print "=> $e->{label} $e->{text}\n";
my $n = 0; my $size = 0; my $def_n = 0;
foreach (@{$e->{list}}) {
$n++;
@@ -95,7 +95,7 @@ ask_fromW_begin:
print N("Button `%s': %s", $e->{label}, may_apply($e->{format}, ${$e->{val}})), " $e->{text}\n";
print N("Do you want to click on this button?");
my $i = readln();
- ($i && $i !~ /^n/i) and $e->{clicked_may_quit}(), $common->{callbacks}{changed}->($ind);
+ $i && $i !~ /^n/i and $e->{clicked_may_quit}(), $common->{callbacks}{changed}->($ind);
} elsif ($e->{type} eq 'label') {
my $t = $format_label->($e);
push @labels, $t;
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 2f991a988..8ac168de8 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -65,7 +65,7 @@ sub new {
$style->font(Gtk::Gdk::Font->fontset_load(N("-adobe-utopia-regular-r-*-*-25-*-*-*-p-*-iso8859-*,*-r-*")));
my $w = $style->font->string_width($::Wizard_title);
$draw1->signal_connect(expose_event => sub {
- for (my $i = 0; $i < (540/$y1); $i++) {
+ for (my $i = 0; $i < 540/$y1; $i++) {
$draw1->window->draw_pixmap($draw1->style->bg_gc('normal'),
$im_up, 0, 0, 0, $y1*$i,
$x1, $y1);
@@ -77,7 +77,7 @@ sub new {
}
});
$draw2->signal_connect(expose_event => sub {
- for (my $i = 0; $i < (300/$y2); $i++) {
+ for (my $i = 0; $i < 300/$y2; $i++) {
$draw2->window->draw_pixmap($draw2->style->bg_gc('normal'),
$im_left, 0, 0, 0, $y2*$i,
$x2, $y2);
@@ -363,7 +363,7 @@ sub ask_browse_tree_info {
0, my $l = new Gtk::HBox(0,15),
0, gtkpack(new Gtk::HBox(0,10),
my $go = gtksignal_connect(new Gtk::Button($common->{ok}), "clicked" => sub { $w->{retval} = 1; Gtk->main_quit }),
- $common->{cancel} ? (gtksignal_connect(new Gtk::Button($common->{cancel}), "clicked" => sub { $w->{retval} = 0; Gtk->main_quit })) : (),
+ $common->{cancel} ? gtksignal_connect(new Gtk::Button($common->{cancel}), "clicked" => sub { $w->{retval} = 0; Gtk->main_quit }) : (),
)
));
gtkpack__($l, my $toolbar = new Gtk::Toolbar('horizontal', 'icons'));
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 79884887a..1594aba32 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -133,12 +133,12 @@ sub write_interface_conf {
if ($hwaddr) { chomp $hwaddr; $hwaddr =~ s/.*link\/ether\s([0-9a-z:]+)\s.*/$1/ }
$hwaddr and $intf->{HWADDR} = undef;
add2hash($intf, {
- BROADCAST => join('.', mapn { int $_[0] | ~int $_[1] & 255 } \@ip, \@mask),
- NETWORK => join('.', mapn { int $_[0] & $_[1] } \@ip, \@mask),
+ BROADCAST => join('.', mapn { int($_[0]) | ((~int($_[1])) & 255) } \@ip, \@mask),
+ NETWORK => join('.', mapn { int($_[0]) & $_[1] } \@ip, \@mask),
ONBOOT => bool2yesno(!member($intf->{DEVICE}, map { $_->{device} } detect_devices::probeall())),
if_($::o->{miscellaneous}{track_network_id}, HWADDR => $hwaddr)
});
- setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT HWADDR), ($intf->{wireless_eth}) ? qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV) : ());
+ setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT HWADDR), $intf->{wireless_eth} ? qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV) : ());
}
sub add2hosts {
diff --git a/perl-install/network/smb.pm b/perl-install/network/smb.pm
index d1f2128bf..06bd70609 100644
--- a/perl-install/network/smb.pm
+++ b/perl-install/network/smb.pm
@@ -92,7 +92,7 @@ sub find_exports {
s/^\t//;
/NT_STATUS_/ and die $_;
my ($name, $type, $comment) = unpack "A15 A10 A*", $_;
- if ($name eq '---------' && $type eq '----' && $comment eq '-------' .. /^$/) {
+ if (($name eq '---------' && $type eq '----' && $comment eq '-------') .. /^$/) {
push @l, { name => $name, type => $type, comment => $comment, server => $server }
if $type eq 'Disk' && $name !~ /\$$/ && $name !~ /NETLOGON|SYSVOL/;
}
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index 88cacba9d..53dc1b5ff 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -53,8 +53,8 @@ sub ask_connect_now {
my $netc = {};
$up = connected();
}
- my $m = $up ? (N("The system is now connected to Internet.") .
- if_($::isInstall, N("For security reason, it will be disconnected now."))) :
+ my $m = $up ? N("The system is now connected to Internet.") .
+ if_($::isInstall, N("For security reason, it will be disconnected now.")) :
N("The system doesn't seem to be connected to internet.
Try to reconfigure your connection.");
if ($::isWizard) {
diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm
index 3518e6738..b5f16df87 100644
--- a/perl-install/partition_table/dos.pm
+++ b/perl-install/partition_table/dos.pm
@@ -42,7 +42,7 @@ sub CHS2rawCHS {
$h = $hd->{geom}{heads} - 1;
$s = $hd->{geom}{sectors};
}
- ($c & 0xff, $h, $s | ($c >> 2 & 0xc0));
+ ($c & 0xff, $h, $s | (($c >> 2) & 0xc0));
}
# returns (cylinder, head, sector)
diff --git a/perl-install/partition_table/mac.pm b/perl-install/partition_table/mac.pm
index 7fd442d8f..cf5ca8a37 100644
--- a/perl-install/partition_table/mac.pm
+++ b/perl-install/partition_table/mac.pm
@@ -206,7 +206,7 @@ sub write($$$;$) {
# Find the partition map.
my @partstowrite;
my $part = $pt->[0];
- (defined $part->{isMap}) or die "the first partition is not the partition map";
+ defined $part->{isMap} or die "the first partition is not the partition map";
push @partstowrite, $part;
# Now go thru the partitions, sort and fill gaps.
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 21d03a920..6f48312f1 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -743,7 +743,7 @@ sub rpmDbOpen {
if ($rebuild_needed) {
if (my $pid = fork()) {
waitpid $pid, 0;
- ($? & 0xff00) and die "rebuilding of rpm database failed";
+ $? & 0xff00 and die "rebuilding of rpm database failed";
} else {
log::l("rebuilding rpm database");
my $rebuilddb_dir = "$prefix/var/lib/rpmrebuilddb.$$";
diff --git a/perl-install/printer/cups.pm b/perl-install/printer/cups.pm
index 1de54edf2..c932f1f81 100644
--- a/perl-install/printer/cups.pm
+++ b/perl-install/printer/cups.pm
@@ -16,8 +16,8 @@ sub get_remote_queues {
while ($line = <F>) {
if ($line =~ m/^\s*device\s+for\s+([^:\s]+):\s*(\S+)\s*$/) {
my $queuename = $1;
- if (($2 =~ m!^ipp://([^/:]+)[:/]!) &&
- (!$printer->{configured}{$queuename})) {
+ if ($2 =~ m!^ipp://([^/:]+)[:/]! &&
+ !$printer->{configured}{$queuename}) {
my $server = $1;
push (@printerlist, "$queuename|$server");
}
diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm
index e26c0914a..6aa03db11 100644
--- a/perl-install/printer/detect.pm
+++ b/perl-install/printer/detect.pm
@@ -125,7 +125,7 @@ sub getIPsInLocalNetworks {
# ... for a local network (eth = ethernet,
# vmnet = VMWare,
# ethernet card connected to ISP excluded)?
- $dev_is_localnet = (($dev =~ /^eth/) || ($dev =~ /^vmnet/));
+ $dev_is_localnet = ($dev =~ /^eth/ || $dev =~ /^vmnet/);
# delete previous address
$current_bcast = "";
}
@@ -185,8 +185,8 @@ sub getSMBPrinterShares {
$insharelist = 1;
} elsif ($l =~ /^\s*Server\s+Comment\s*$/i) {
$insharelist = 0;
- } elsif (($l =~ /^\s*(\S+)\s+Printer\s*(.*)$/i) &&
- ($insharelist)) {
+ } elsif ($l =~ /^\s*(\S+)\s+Printer\s*(.*)$/i &&
+ $insharelist) {
my $name = $1;
my $description = $2;
$description =~ s/^(\s*)//;
@@ -217,8 +217,8 @@ sub getSNMPModel {
};
while (my $l = <F>) {
chomp $l;
- if (($l =~ /^\s*Manufacturer:\s*(\S.*)$/i) &&
- ($l =~ /^\s*Vendor:\s*(\S.*)$/i)) {
+ if ($l =~ /^\s*Manufacturer:\s*(\S.*)$/i &&
+ $l =~ /^\s*Vendor:\s*(\S.*)$/i) {
$manufacturer = $1;
$manufacturer =~ s/Hewlett[-\s_]Packard/HP/;
$manufacturer =~ s/HEWLETT[-\s_]PACKARD/HP/;
@@ -236,7 +236,7 @@ sub getSNMPModel {
# Was there a manufacturer and a model in the output?
# If not, get them from the description
- if (($manufacturer eq "") || ($model eq "")) {
+ if ($manufacturer eq "" || $model eq "") {
if ($description =~ /^\s*(\S*)\s+(\S.*)$/) {
$manufacturer = $1 if $manufacturer eq "";
$model = $2 if $model eq "";
@@ -272,9 +272,9 @@ sub network_running {
"/bin/sh -c \"export LC_ALL=C; /sbin/ifconfig\" |" or
die "Could not run \"ifconfig\"!";
while (my $line = <F>) {
- if (($line !~ /^lo\s+/) && # The loopback device can have been
+ if ($line !~ /^lo\s+/ && # The loopback device can have been
# started by the spooler's startup script
- ($line =~ /^(\S+)\s+/)) { # In this line starts an entry for a
+ $line =~ /^(\S+)\s+/) { # In this line starts an entry for a
# running network
close F;
return 1;
diff --git a/perl-install/printer/gimp.pm b/perl-install/printer/gimp.pm
index d9264fd81..c292e583c 100644
--- a/perl-install/printer/gimp.pm
+++ b/perl-install/printer/gimp.pm
@@ -79,7 +79,7 @@ sub addcupsremoteto {
return 1 if $#configfilenames < 0;
my @printerlist = printer::cups::get_remote_queues();
my $ppdfile = "";
- if (($printer->{SPOOLER} eq "cups") &&
+ if ($printer->{SPOOLER} eq "cups" &&
((-x "$::prefix/usr/bin/curl") || (-x "$::prefix/usr/bin/wget"))) {
foreach my $listentry (@printerlist) {
next if !($listentry =~ /^([^\|]+)\|([^\|]+)$/);
@@ -101,8 +101,7 @@ sub addcupsremoteto {
}
# Does the file exist and is it not an error message?
if ((-r "$::prefix/etc/foomatic/$queue.ppd") &&
- (cat_("$::prefix/etc/foomatic/$queue.ppd") =~
- /^\*PPD-Adobe/)) {
+ cat_("$::prefix/etc/foomatic/$queue.ppd") =~ /^\*PPD-Adobe/) {
$ppdfile = "/etc/foomatic/$queue.ppd";
} else {
unlink "$::prefix/etc/foomatic/$queue.ppd";
@@ -224,11 +223,11 @@ sub findconfigfiles {
chomp;
if (/^([^:]+):[^:]*:([^:]+):([^:]+):[^:]*:([^:]+):[^:]*$/) {
my ($username, $uid, $gid, $homedir) = ($1, $2, $3, $4);
- if ((($uid == 0) || ($uid >= 500)) && ($username ne "nobody")) {
+ if (($uid == 0 || $uid >= 500) && $username ne "nobody") {
foreach my $file (@configfilenames) {
my $dir = "$homedir/$file";
$dir =~ s,/[^/]*$,,;
- next if (-f $dir) && (! -d $dir);
+ next if (-f $dir) && ! -d $dir;
if (! -d "$::prefix$dir") {
mkdir_p("$::prefix$dir") or next;
set_permissions("$::prefix$dir", "$uid.$gid") or next;
diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm
index a6aa3e035..f9e712aa9 100644
--- a/perl-install/printer/main.pm
+++ b/perl-install/printer/main.pm
@@ -143,7 +143,7 @@ sub spooler_in_security_level {
# Was the current spooler already added to the current security level?
my ($spooler, $level) = @_;
my $sp;
- $sp = (($spooler eq "lpr") || ($spooler eq "lprng")) ? "lpd" : $spooler;
+ $sp = $spooler eq "lpr" || $spooler eq "lprng" ? "lpd" : $spooler;
my $file = "$::prefix/etc/security/msec/server.$level";
if (-f $file) {
local *F;
@@ -162,7 +162,7 @@ sub spooler_in_security_level {
sub add_spooler_to_security_level {
my ($spooler, $level) = @_;
my $sp;
- $sp = (($spooler eq "lpr") || ($spooler eq "lprng")) ? "lpd" : $spooler;
+ $sp = $spooler eq "lpr" || $spooler eq "lprng" ? "lpd" : $spooler;
my $file = "$::prefix/etc/security/msec/server.$level";
if (-f $file) {
local *F;
@@ -268,7 +268,7 @@ sub read_configured_queues($) {
for ($i = 0; $i < $N; $i++) {
$printer->{configured}{$QUEUES[$i]{queuedata}{queue}} =
$QUEUES[$i];
- if ((!$QUEUES[$i]{make}) || (!$QUEUES[$i]{model})) {
+ if (!$QUEUES[$i]{make} || !$QUEUES[$i]{model}) {
if ($printer->{SPOOLER} eq "cups") {
$printer->{OLD_QUEUE} = $QUEUES[$i]{queuedata}{queue};
my $descr = get_descr_from_ppd($printer);
@@ -323,7 +323,7 @@ sub make_menuentry {
my $spooler = $shortspooler_inv{$printer->{SPOOLER}}{short_name};
my $connect = $printer->{configured}{$queue}{queuedata}{connect};
my $localremote;
- if (($connect =~ m!^file:!) || ($connect =~ m!^ptal:/mlc:!)) {
+ if ($connect =~ m!^file:! || $connect =~ m!^ptal:/mlc:!) {
$localremote = N("Local Printers");
} else {
$localremote = N("Remote Printers");
@@ -356,13 +356,13 @@ sub make_menuentry {
$connection = N(" on LPD server \"%s\", printer \"%s\"", $2, $1);
} elsif ($connect =~ m!^socket://([^/:]+):([^/:]+)/?$!) {
$connection = N(", TCP/IP host \"%s\", port %s", $1, $2);
- } elsif (($connect =~ m!^smb://([^/\@]+)/([^/\@]+)/?$!) ||
- ($connect =~ m!^smb://.*/([^/\@]+)/([^/\@]+)/?$!) ||
- ($connect =~ m!^smb://.*\@([^/\@]+)/([^/\@]+)/?$!)) {
+ } elsif ($connect =~ m!^smb://([^/\@]+)/([^/\@]+)/?$! ||
+ $connect =~ m!^smb://.*/([^/\@]+)/([^/\@]+)/?$! ||
+ $connect =~ m!^smb://.*\@([^/\@]+)/([^/\@]+)/?$!) {
$connection = N(" on SMB/Windows server \"%s\", share \"%s\"", $1, $2);
- } elsif (($connect =~ m!^ncp://([^/\@]+)/([^/\@]+)/?$!) ||
- ($connect =~ m!^ncp://.*/([^/\@]+)/([^/\@]+)/?$!) ||
- ($connect =~ m!^ncp://.*\@([^/\@]+)/([^/\@]+)/?$!)) {
+ } elsif ($connect =~ m!^ncp://([^/\@]+)/([^/\@]+)/?$! ||
+ $connect =~ m!^ncp://.*/([^/\@]+)/([^/\@]+)/?$! ||
+ $connect =~ m!^ncp://.*\@([^/\@]+)/([^/\@]+)/?$!) {
$connection = N(" on Novell server \"%s\", printer \"%s\"", $1, $2);
} elsif ($connect =~ m!^postpipe:(.+)$!) {
$connection = N(", using command %s", $1);
@@ -490,7 +490,7 @@ sub read_printer_db(;$) {
}
#- Load CUPS driver database if CUPS is used as spooler
- if (($spooler) && ($spooler eq "cups") && ($::expert)) {
+ if ($spooler && $spooler eq "cups" && $::expert) {
#&$install('cups-drivers') unless $::testing;
#my $w;
@@ -570,7 +570,7 @@ sub read_cups_options ($) {
# Remove page size info
$comment =~ s/,\s*size:\s*[0-9\.]+x[0-9\.]+in$//;
$args[$i]{vals}[$j]{comment} = $comment;
- } elsif (($line =~ /^\s*$/) && ($#{$args[$i]{vals}} > -1)) {
+ } elsif ($line =~ /^\s*$/ && $#{$args[$i]{vals}} > -1) {
$inchoices = 0;
$inoption = 0;
}
@@ -652,8 +652,8 @@ sub read_cups_printer_list {
if ($line =~ m/^\s*device\s+for\s+([^:\s]+):\s*(\S+)\s*$/) {
my $queuename = $1;
my $comment = "";
- if (($2 =~ m!^ipp://([^/:]+)[:/]!) &&
- (!$printer->{configured}{$queuename})) {
+ if ($2 =~ m!^ipp://([^/:]+)[:/]! &&
+ !$printer->{configured}{$queuename}) {
$comment = N("(on %s)", $1);
} else {
$comment = N("(on this machine)");
@@ -679,15 +679,15 @@ sub get_cups_remote_queues {
if ($line =~ m/^\s*device\s+for\s+([^:\s]+):\s*(\S+)\s*$/) {
my $queuename = $1;
my $comment = "";
- if (($2 =~ m!^ipp://([^/:]+)[:/]!) &&
- (!$printer->{configured}{$queuename})) {
+ if ($2 =~ m!^ipp://([^/:]+)[:/]! &&
+ !$printer->{configured}{$queuename}) {
$comment = N("On CUPS server \"%s\"", $1);
my $sep = "!";
push (@printerlist,
($::expert ? N("CUPS") . $sep : "") .
N("Remote Printers") . "$sep$queuename: $comment"
. ($queuename eq $printer->{DEFAULT} ?
- N(" (Default)") : ("")));
+ N(" (Default)") : ""));
}
}
}
@@ -703,7 +703,7 @@ sub set_cups_autoconf {
my @file_content = cat_($file);
# Remove all valid "CUPS_CONFIG" lines
- (/^\s*CUPS_CONFIG/ and $_ = "") foreach @file_content;
+ /^\s*CUPS_CONFIG/ and $_ = "" foreach @file_content;
# Insert the new "CUPS_CONFIG" line
if ($autoconf) {
@@ -839,13 +839,13 @@ sub get_descr_from_ppd {
my $lang = $ppd{LanguageVersion};
# Remove manufacturer's name from the beginning of the model name
- if (($make) && ($model =~ /^$make[\s\-]+([^\s\-].*)$/)) {
+ if ($make && $model =~ /^$make[\s\-]+([^\s\-].*)$/) {
$model = $1;
}
# Put out the resulting description string
uc($make) . '|' . $model . '|' . $driver .
- ($lang && (" (" . lc(substr($lang, 0, 2)) . ")"));
+ ($lang && " (" . lc(substr($lang, 0, 2)) . ")");
}
sub poll_ppd_base {
@@ -912,9 +912,8 @@ sub configure_queue($) {
run_program::rooted($::prefix, "foomatic-configure", "-q",
"-s", $printer->{currentqueue}{spooler},
"-n", $printer->{currentqueue}{queue},
- (($printer->{currentqueue}{queue} ne
- $printer->{OLD_QUEUE}) &&
- ($printer->{configured}{$printer->{OLD_QUEUE}}) ?
+ ($printer->{currentqueue}{queue} ne $printer->{OLD_QUEUE} &&
+ $printer->{configured}{$printer->{OLD_QUEUE}} ?
("-C", $printer->{OLD_QUEUE}) : ()),
"-c", $printer->{currentqueue}{connect},
"-p", $printer->{currentqueue}{printer},
@@ -932,7 +931,7 @@ sub configure_queue($) {
# $printer->{Accepting} eq 'Yes' ? ("-E") : (),
"-E",
"-v", $printer->{currentqueue}{connect},
- ($printer->{currentqueue}{ppd} ne '1') ?
+ $printer->{currentqueue}{ppd} ne '1' ?
("-m", $printer->{currentqueue}{ppd}) : (),
$printer->{currentqueue}{desc} ?
("-D", $printer->{currentqueue}{desc}) : (),
@@ -949,9 +948,8 @@ sub configure_queue($) {
}
# Copy the old queue's PPD file to the new queue when it is renamed,
# to conserve the option settings
- if (($printer->{currentqueue}{queue} ne
- $printer->{OLD_QUEUE}) &&
- ($printer->{configured}{$printer->{OLD_QUEUE}})) {
+ if ($printer->{currentqueue}{queue} ne $printer->{OLD_QUEUE} &&
+ $printer->{configured}{$printer->{OLD_QUEUE}}) {
system("cp -f $::prefix/etc/cups/ppd/$printer->{OLD_QUEUE}.ppd $::prefix/etc/cups/ppd/$printer->{currentqueue}{queue}.ppd");
}
} else {
@@ -1058,7 +1056,7 @@ sub restart_queue($) {
last };
/lpr|lprng/ && do {
#- restart lpd.
- foreach (("/var/spool/lpd/$queue/lock", "/var/spool/lpd/lpd.lock")) {
+ foreach ("/var/spool/lpd/$queue/lock", "/var/spool/lpd/lpd.lock") {
my $pidlpd = (cat_("$::prefix$_"))[0];
kill 'TERM', $pidlpd if $pidlpd;
unlink "$::prefix$_";
@@ -1121,7 +1119,7 @@ sub help_output {
open F, ($::testing ? $::prefix : "chroot $::prefix/ ") . sprintf($spoolers{$spooler}{help}, $queue);
my $helptext = join("", <F>);
close F;
- $helptext = "Option list not available!\n" if $spooler eq 'lpq' && (!$helptext || ($helptext eq ""));
+ $helptext = "Option list not available!\n" if $spooler eq 'lpq' && (!$helptext || $helptext eq "");
return $helptext;
}
@@ -1169,13 +1167,12 @@ sub get_copiable_queues {
if (m!^\s*</queue>\s*$!) {
# entry completed
$inentry = 0;
- if (($entry->{foomatic}) &&
- ($entry->{spooler} eq $oldspooler)) {
+ if ($entry->{foomatic} && $entry->{spooler} eq $oldspooler) {
# Is the connection type supported by the new
# spooler?
- if (($newspooler eq "cups" && ($entry->{connect} =~ /^(file|ptal|lpd|socket|smb|ipp):/)) ||
- (($newspooler =~ /^(lpd|lprng)$/) && ($entry->{connect} =~ /^(file|ptal|lpd|socket|smb|ncp|postpipe):/)) ||
- ($newspooler eq "pdq" && $entry->{connect} =~ /^(file|ptal|lpd|socket):/)) {
+ if ($newspooler eq "cups" && $entry->{connect} =~ /^(file|ptal|lpd|socket|smb|ipp):/ ||
+ $newspooler =~ /^(lpd|lprng)$/ && $entry->{connect} =~ /^(file|ptal|lpd|socket|smb|ncp|postpipe):/ ||
+ $newspooler eq "pdq" && $entry->{connect} =~ /^(file|ptal|lpd|socket):/) {
push(@queuelist, $entry->{name});
}
}
@@ -1285,9 +1282,9 @@ sub configure_hpoj {
my $port = $2;
if ($device =~ /usb/) {
$bus = "usb";
- } elsif (($device =~ /par/) ||
- ($device =~ /\/dev\/lp/) ||
- ($device =~ /printers/)) {
+ } elsif ($device =~ /par/ ||
+ $device =~ /\/dev\/lp/ ||
+ $device =~ /printers/) {
$bus = "par";
$address_arg = printer::detect::parport_addr($device);
$address_arg =~ /^\s*-base\s+(\S+)/;
@@ -1311,9 +1308,9 @@ sub configure_hpoj {
# so in the case of the model name auto-detection having failed leave
# the port number or the host name as model name.
my $searchunknown = N("Unknown model");
- if (($_->{val}{MODEL}) &&
- ($_->{val}{MODEL} !~ /$searchunknown/i) &&
- ($_->{val}{MODEL} !~ /^\s*$/)) {
+ if ($_->{val}{MODEL} &&
+ $_->{val}{MODEL} !~ /$searchunknown/i &&
+ $_->{val}{MODEL} !~ /^\s*$/) {
$model = $_->{val}{MODEL};
}
$serialnumber = $_->{val}{SERIALNUMBER};
@@ -1340,9 +1337,9 @@ sub configure_hpoj {
chomp $model_long;
# If SNMP or local port auto-detection failed but HPOJ
# auto-detection succeeded, fill in model name here.
- if ((!$_->{val}{MODEL}) ||
- ($_->{val}{MODEL} =~ /$searchunknown/i) ||
- ($_->{val}{MODEL} =~ /^\s*$/)) {
+ if (!$_->{val}{MODEL} ||
+ $_->{val}{MODEL} =~ /$searchunknown/i ||
+ $_->{val}{MODEL} =~ /^\s*$/) {
if ($model_long =~ /:([^:;]+);/) {
$_->{val}{MODEL} = $1;
}
@@ -1644,7 +1641,7 @@ sub removelocalprintersfromapplications {
sub setcupslink {
my ($printer) = @_;
- return 1 if !$::isInstall || ($printer->{SPOOLER} ne "cups") || -d "/etc/cups/ppd";
+ return 1 if !$::isInstall || $printer->{SPOOLER} ne "cups" || -d "/etc/cups/ppd";
system("ln -sf $::prefix/etc/cups /etc/cups");
return 1;
}
diff --git a/perl-install/printer/office.pm b/perl-install/printer/office.pm
index f870c4dac..a933fca29 100644
--- a/perl-install/printer/office.pm
+++ b/perl-install/printer/office.pm
@@ -47,7 +47,7 @@ sub configureoffice {
# Load Star Office printer config file
my $configfilecontent = readsofficeconfigfile($configfilename);
# Update remote CUPS queues
- if (0 && ($printer->{SPOOLER} eq "cups") &&
+ if (0 && $printer->{SPOOLER} eq "cups" &&
((-x "$::prefix/usr/bin/curl") || (-x "$::prefix/usr/bin/wget"))) {
my @printerlist = printer::cups::get_remote_queues();
foreach my $listentry (@printerlist) {
@@ -113,7 +113,7 @@ sub add_cups_remote_to_office {
# Load Star Office printer config file
my $configfilecontent = readsofficeconfigfile($configfilename);
# Update remote CUPS queues
- if (($printer->{SPOOLER} eq "cups") &&
+ if ($printer->{SPOOLER} eq "cups" &&
((-x "$::prefix/usr/bin/curl") || (-x "$::prefix/usr/bin/wget"))) {
my @printerlist = printer::cups::get_remote_queues();
foreach my $listentry (@printerlist) {
@@ -136,8 +136,7 @@ sub add_cups_remote_to_office {
}
# Does the file exist and is it not an error message?
if ((-r "$::prefix/etc/foomatic/$queue.ppd") &&
- (cat_("$::prefix/etc/foomatic/$queue.ppd") =~
- /^\*PPD-Adobe/)) {
+ cat_("$::prefix/etc/foomatic/$queue.ppd") =~ /^\*PPD-Adobe/) {
$configfilecontent =
$suites{$suite}{make}($printer, $queue,
$configprefix,
@@ -225,7 +224,7 @@ sub makestarofficeprinterentry {
$configfile = addentry("$queue.PostScript.$queue",
"Level=$pslevel", $configfile);
# Set Color/BW
- my $color = ($ppd =~ /^\s*\*ColorDevice:\s*\"?([Tt]rue)\"?\s*$/m) ? "1" : "0";
+ my $color = $ppd =~ /^\s*\*ColorDevice:\s*\"?([Tt]rue)\"?\s*$/m ? "1" : "0";
$configfile = removeentry("$queue.PostScript.$queue", "BitmapColor=", $configfile);
$configfile = addentry("$queue.PostScript.$queue", "BitmapColor=$color", $configfile);
# Set the default paper size
@@ -266,8 +265,8 @@ sub makeopenofficeprinterentry {
$configfile);
# "Comment" line
$configfile = removeentry($queue, "Comment=", $configfile);
- if (($printer->{configured}{$queue}) &&
- ($printer->{configured}{$queue}{queuedata}{desc})) {
+ if ($printer->{configured}{$queue} &&
+ $printer->{configured}{$queue}{queuedata}{desc}) {
$configfile = addentry
($queue,
"Comment=$printer->{configured}{$queue}{queuedata}{desc}",
@@ -279,8 +278,8 @@ sub makeopenofficeprinterentry {
}
# "Location" line
$configfile = removeentry($queue, "Location=", $configfile);
- if (($printer->{configured}{$queue}) &&
- ($printer->{configured}{$queue}{queuedata}{loc})) {
+ if ($printer->{configured}{$queue} &&
+ $printer->{configured}{$queue}{queuedata}{loc}) {
$configfile = addentry
($queue,
"Location=$printer->{configured}{$queue}{queuedata}{loc}",
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index 5eab8b77f..65516c4e1 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -107,7 +107,7 @@ Normally, CUPS is automatically configured according to your network environment
# We have clicked "OK"
$retvalue = 1;
# Set BrowsePoll line
- if (($server ne $oldserver) || ($port ne $oldport)) {
+ if ($server ne $oldserver || $port ne $oldport) {
$server && $port and $server = "$server:$port";
if ($server) {
@cupsd_conf =
@@ -210,7 +210,7 @@ sub first_time_dialog {
# configure networking.
my $havelocalnetworks =
(check_network($printer, $in, $upNetwork, 1) &&
- (printer::detect::getIPsInLocalNetworks() != ()));
+ printer::detect::getIPsInLocalNetworks() != ());
# Finish building the dialog text
my $question = ($havelocalnetworks ?
@@ -244,8 +244,8 @@ sub wizard_welcome {
undef $printer->{AUTODETECTNETWORK};
undef $printer->{AUTODETECTSMB};
} else {
- $havelocalnetworks = ((check_network($printer, $in, $upNetwork, 1)) &&
- (printer::detect::getIPsInLocalNetworks() != ()));
+ $havelocalnetworks = (check_network($printer, $in, $upNetwork, 1) &&
+ printer::detect::getIPsInLocalNetworks() != ());
if (!$havelocalnetworks) {
undef $printer->{AUTODETECTNETWORK};
undef $printer->{AUTODETECTSMB};
@@ -319,10 +319,10 @@ If you have printer(s) connected to this machine, Please plug it/them in on this
]);
$printer->{AUTODETECTLOCAL} = $autodetectlocal ? 1 : undef;
$printer->{AUTODETECTNETWORK} = $autodetectnetwork ? 1 : undef;
- $printer->{AUTODETECTSMB} = ($autodetectsmb && ($printer->{SPOOLER} ne "pdq")) ? 1 : undef;
+ $printer->{AUTODETECTSMB} = $autodetectsmb && $printer->{SPOOLER} ne "pdq" ? 1 : undef;
}
};
- return ($@ =~ /wizcancel/) ? 0 : $ret;
+ return $@ =~ /wizcancel/ ? 0 : $ret;
}
}
@@ -345,8 +345,8 @@ sub setup_local_autoscan {
my $queue = $printer->{OLD_QUEUE};
my $expert_or_modify = ($::expert || !$printer->{NEW});
my $do_auto_detect =
- (($expert_or_modify &&
- $printer->{AUTODETECT}) ||
+ ($expert_or_modify &&
+ $printer->{AUTODETECT} ||
(!$expert_or_modify &&
($printer->{AUTODETECTLOCAL} ||
$printer->{AUTODETECTNETWORK} ||
@@ -362,9 +362,9 @@ sub setup_local_autoscan {
my $menuentries = {};
$in->set_help('setupLocal') if $::isInstall;
if ($do_auto_detect) {
- if ((!$::testing) &&
- (!$expert_or_modify) && ($printer->{AUTODETECTSMB}) &&
- (!files_exist((qw(/usr/bin/smbclient))))) {
+ if (!$::testing &&
+ !$expert_or_modify && $printer->{AUTODETECTSMB} &&
+ !files_exist((qw(/usr/bin/smbclient)))) {
$in->do_pkgs->install('samba-client');
}
my $w = $in->wait_message(N("Printer auto-detection"), N("Detecting devices..."));
@@ -468,15 +468,15 @@ sub setup_local_autoscan {
for (my $i = 0; $i <= $#prefixes; $i++) {
my $firstinlist = ($first =~ m!^$prefixes[$i]!);
my $secondinlist = ($second =~ m!^$::prefixes[$i]!);
- if (($firstinlist) && (!$secondinlist)) { return -1 };
- if (($secondinlist) && (!$firstinlist)) { return 1 };
+ if ($firstinlist && !$secondinlist) { return -1 };
+ if ($secondinlist && !$firstinlist) { return 1 };
}
return $first cmp $second;
} keys(%{$menuentries});