summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-16 13:29:19 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-16 13:29:19 +0000
commit2ff8d37f7c51c03e37638c37e030e060d2c34669 (patch)
treec72f5c3597f86bd98cde9765692820dc4af7b89e
parente78fb4780e2059e155ec011dbefe71dd665cf7be (diff)
downloaddrakx-2ff8d37f7c51c03e37638c37e030e060d2c34669.tar
drakx-2ff8d37f7c51c03e37638c37e030e060d2c34669.tar.gz
drakx-2ff8d37f7c51c03e37638c37e030e060d2c34669.tar.bz2
drakx-2ff8d37f7c51c03e37638c37e030e060d2c34669.tar.xz
drakx-2ff8d37f7c51c03e37638c37e030e060d2c34669.zip
replace occurences of "$foo ? $foo : $bar" with "$foo || $bar"
-rw-r--r--perl-install/detect_devices.pm2
-rw-r--r--perl-install/network/netconnect.pm4
-rw-r--r--perl-install/network/network.pm2
-rw-r--r--perl-install/network/tools.pm2
-rw-r--r--perl-install/security/level.pm4
-rwxr-xr-xperl-install/standalone/drakconnect4
-rwxr-xr-xperl-install/standalone/drakperm2
-rwxr-xr-xperl-install/standalone/net_monitor6
8 files changed, 13 insertions, 13 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index c891bca71..1aa420d79 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -510,7 +510,7 @@ sub matching_desc {
sub stringlist {
map {
sprintf("%-16s: %s%s%s",
- $_->{driver} ? $_->{driver} : 'unknown',
+ $_->{driver} || 'unknown',
$_->{description} eq '(null)' ? sprintf("Vendor=0x%04x Device=0x%04x", $_->{vendor}, $_->{id}) : $_->{description},
$_->{media_type} ? sprintf(" [%s]", $_->{media_type}) : '',
$_->{subid} && $_->{subid} != 0xffff ? sprintf(" SubVendor=0x%04x SubDevice=0x%04x", $_->{subvendor}, $_->{subid}) : '',
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index e33096aac..b02c5b05e 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -351,7 +351,7 @@ ADSLLogin=$adsl->{login}
"DOMAINNAME2=$netc->{DOMAINNAME2}" if $conf{adsl};
output_with_perm("$prefix/etc/sysconfig/network-scripts/drakconnect_conf", 0600, $str);
- my $a = $netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default";
+ my $a = $netcnx->{PROFILE} || "default";
cp_af("$prefix/etc/sysconfig/network-scripts/drakconnect_conf", "$prefix/etc/sysconfig/network-scripts/drakconnect_conf." . $a);
chmod 0600, "$prefix/etc/sysconfig/network-scripts/drakconnect_conf";
chmod 0600, "$prefix/etc/sysconfig/network-scripts/drakconnect_conf." . $a;
@@ -407,7 +407,7 @@ sub add_profile {
my ($netcnx, $profile) = @_;
$profile or return;
$profile eq "default" and return;
- my $cmd1 = "$prefix/etc/sysconfig/network-scripts/drakconnect_conf." . ($netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default");
+ my $cmd1 = "$prefix/etc/sysconfig/network-scripts/drakconnect_conf." . ($netcnx->{PROFILE} || "default");
my $cmd2 = "$prefix/etc/sysconfig/network-scripts/drakconnect_conf." . $profile;
cp_af($cmd1, $cmd2);
}
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 49d32a2bb..870f5f7e6 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -476,7 +476,7 @@ sub configureNetwork2 {
add2hosts("$etc/hosts", $netc->{HOSTNAME}, map { $_->{IPADDR} } values %$intf);
if (any { $_->{BOOTPROTO} =~ /^(dhcp)$/ } values %$intf) {
- $in->do_pkgs->install($netc->{dhcp_client} ? $netc->{dhcp_client} : 'dhcp-client');
+ $in->do_pkgs->install($netc->{dhcp_client} || 'dhcp-client');
}
if (any { $_->{BOOTPROTO} =~ /^(pump|bootp)$/ } values %$intf) {
$in->do_pkgs->install('pump');
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index 489e0d966..3d75a3073 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -36,7 +36,7 @@ sub write_secret_backend {
sub unquotify {
my ($word) = @_;
my ($a, $b, $c) = $$word =~ /"(.*)"|'(.*)'|(.*)/;
- $$word = $a ? $a : $b ? $b : $c;
+ $$word = $a || $b || $c;
}
sub read_secret_backend {
diff --git a/perl-install/security/level.pm b/perl-install/security/level.pm
index e6ac8876c..1b2ef136d 100644
--- a/perl-install/security/level.pm
+++ b/perl-install/security/level.pm
@@ -39,9 +39,9 @@ sub set {
my %sec_levels = reverse %level_list;
my $run_level = $sec_levels{$_[0]};
print "set level: $_[0] -> $run_level\n";
- print $::prefix, "/usr/sbin/msec ", $run_level ? $run_level : 3, "\n";
+ print $::prefix, "/usr/sbin/msec ", $run_level || 3, "\n";
require run_program;
- run_program::rooted($::prefix, "/usr/sbin/msec", $run_level ? $run_level : 3);
+ run_program::rooted($::prefix, "/usr/sbin/msec", $run_level || 3);
}
sub level_choose {
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index afea1894f..504bf7add 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -85,7 +85,7 @@ $hbox1->pack_start(new Gtk2::Label(N("Profile: ")),0,0,0);
my $combo1 = new Gtk2::Combo;
$combo1->set_popdown_strings(network::netconnect::get_profiles());
my $old_profile = $netcnx->{PROFILE};
-$combo1->entry->set_text($netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default");
+$combo1->entry->set_text($netcnx->{PROFILE} || "default");
$combo1->entry->set_editable(0);
$hbox1->pack_start($combo1,0,0,0);
my $button_del = new Gtk2::Button(N("Del profile..."));
@@ -339,7 +339,7 @@ sub build_list {
}
sub apply {
- $old_profile = $netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default";
+ $old_profile = $netcnx->{PROFILE} || "default";
network::netconnect::save_conf($netcnx, $netc, $intf);
$netcnx->{type} eq 'modem' and network::modem::ppp_configure($in, $netcnx->{$netcnx->{type}}, '');
diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm
index f2b79be3e..8d33efd33 100755
--- a/perl-install/standalone/drakperm
+++ b/perl-install/standalone/drakperm
@@ -335,7 +335,7 @@ sub row_setting_dialog {
#$group = ($group_read->get_active ? 4 : 0)+($group_write->get_active ? 2 : 0)+($group_execute->get_active ? 1 : 0);
#$other = ($other_read->get_active ? 4 : 0)+($other_write->get_active ? 2 : 0)+($other_execute->get_active ? 1 : 0);
my $s = ($sticky->get_active ? 1 : 0) + ($suid->get_active ? 4 : 0) + ($gid->get_active ? 2 : 0);
- $Perm_list->set_text($row,3, ($s ? $s : '') . $user . $group . $other);
+ $Perm_list->set_text($row,3, ($s || '') . $user . $group . $other);
$dlg->destroy;
$modified++;
});
diff --git a/perl-install/standalone/net_monitor b/perl-install/standalone/net_monitor
index beead5730..bd3a9ea9e 100755
--- a/perl-install/standalone/net_monitor
+++ b/perl-install/standalone/net_monitor
@@ -73,7 +73,7 @@ network::netconnect::load_conf($netcnx, $netc, $intf);
network::netconnect::read_net_conf('', $netcnx, $netc);
my $combo1 = new Gtk::Combo;
$combo1->set_popdown_strings(network::netconnect::get_profiles());
-$combo1->entry->set_text($netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default");
+$combo1->entry->set_text($netcnx->{PROFILE} || "default");
$combo1->entry->set_editable(0);
MDK::Common::Globals::init(
in => $in,
@@ -358,8 +358,8 @@ sub update {
};
my @intfs = get_val(); # get values from /proc file system
- if ($combo1->entry->get_text ne ($netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default")) {
- $combo1->entry->set_text($netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default");
+ if ($combo1->entry->get_text ne ($netcnx->{PROFILE} || "default")) {
+ $combo1->entry->set_text($netcnx->{PROFILE} || "default");
}
foreach (@intfs) {
my $intf = $_;