summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-31 15:18:09 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-31 15:18:09 +0000
commit51039844febe1dc7c3f7ac5b3409f00e1679ab76 (patch)
tree1852183fcf4865ea2c78c5acc8a67d731f13df11
parented72bb62ca097fa7a874953b9fad9a60b04fed63 (diff)
downloaddrakx-51039844febe1dc7c3f7ac5b3409f00e1679ab76.tar
drakx-51039844febe1dc7c3f7ac5b3409f00e1679ab76.tar.gz
drakx-51039844febe1dc7c3f7ac5b3409f00e1679ab76.tar.bz2
drakx-51039844febe1dc7c3f7ac5b3409f00e1679ab76.tar.xz
drakx-51039844febe1dc7c3f7ac5b3409f00e1679ab76.zip
replace "$foo" with $foo
-rw-r--r--perl-install/any.pm2
-rw-r--r--perl-install/detect_devices.pm4
-rw-r--r--perl-install/install_any.pm4
-rw-r--r--perl-install/install_gtk.pm6
-rw-r--r--perl-install/my_gtk.pm2
-rw-r--r--perl-install/network/isdn.pm2
-rw-r--r--perl-install/network/modem.pm4
-rw-r--r--perl-install/network/network.pm2
-rw-r--r--perl-install/network/tools.pm2
-rw-r--r--perl-install/printer.pm62
10 files changed, 45 insertions, 45 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index e0dfb62d1..5500f9766 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -887,7 +887,7 @@ sub set_login_serial_console {
my ($prefix, $port, $speed) = @_;
my $line = "s$port:12345:respawn:/sbin/getty ttyS$port DT$speed ansi\n";
- substInFile { s/^s$port:.*//; $_ = "$line" if eof } "$prefix/etc/inittab";
+ substInFile { s/^s$port:.*//; $_ = $line if eof } "$prefix/etc/inittab";
}
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 3da219e8b..ff689800c 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -515,10 +515,10 @@ sub whatUsbport() {
my @res;
foreach $i (0..15) {
my $port = "/dev/usb/lp$i";
- my $realport = devices::make("$port");
+ my $realport = devices::make($port);
next if (!$realport);
next if (! -r $realport);
- open PORT, "$realport" or do next;
+ open PORT, $realport or do next;
my $idstr = "";
# Calculation of IOCTL function 0x84005001 (to get device ID
# string):
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 14565b100..8159ffe19 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -267,7 +267,7 @@ sub getAvailableSpace {
sub getAvailableSpace_mounted {
my ($prefix) = @_;
- my $dir = -d "$prefix/usr" ? "$prefix/usr" : "$prefix";
+ my $dir = -d "$prefix/usr" ? "$prefix/usr" : $prefix;
my (undef, $free) = MDK::Common::System::df($dir) or return;
log::l("getAvailableSpace_mounted $free KB");
$free * 1024 || 1;
@@ -936,7 +936,7 @@ sub guess_mount_point {
my $d = $handle->{dir};
my ($mnt) = grep { -e "$d/$l{$_}" } keys %l;
$mnt ||= (stat("$d/.bashrc"))[4] ? '/root' : '/home/user' . ++$$user if -e "$d/.bashrc";
- $mnt ||= (grep { -d $_ && (stat($_))[4] >= 500 && -e "$_/.bashrc" } glob_("$d")) ? '/home' : '';
+ $mnt ||= (grep { -d $_ && (stat($_))[4] >= 500 && -e "$_/.bashrc" } glob_($d)) ? '/home' : '';
($mnt, $handle);
}
diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm
index 712fbbcda..3ffb7991e 100644
--- a/perl-install/install_gtk.pm
+++ b/perl-install/install_gtk.pm
@@ -224,7 +224,7 @@ if (arch() =~ /^ia64/) {
require Xconfig::card;
my ($card) = Xconfig::card::probe();
Xconfig::card::add_to_card__using_Cards($card, $card->{type}) if $card && $card->{type};
- output($file, <<END);
+ output($file, sprintf(<<'END', $mouse_type, $card->{driver}));
Section "Files"
FontPath "/usr/X11R6/lib/X11/fonts:unscaled"
@@ -241,7 +241,7 @@ EndSection
Section "InputDevice"
Identifier "Mouse"
Driver "mouse"
- Option "Protocol" "$mouse_type"
+ Option "Protocol" "%s"
Option "Device" "/dev/mouse"
EndSection
@@ -253,7 +253,7 @@ EndSection
Section "Device"
Identifier "device"
- Driver "$card->{driver}"
+ Driver "%s"
EndSection
Section "Screen"
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 04aabea56..a7d67f993 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -501,7 +501,7 @@ sub get_text_coord {
$width = 0;
$idx++;
}
- $lines[$idx] = $flag ? "$_" : $lines[$idx] . $wrap_char . "$_";
+ $lines[$idx] = $flag ? $_ : $lines[$idx] . $wrap_char . $_;
$width += $l;
$flag = 0;
$l <= $max_width2 or $max_width2 = $l;
diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm
index f9c8bd409..4bdc83990 100644
--- a/perl-install/network/isdn.pm
+++ b/perl-install/network/isdn.pm
@@ -59,7 +59,7 @@ We recommand the light configuration.
my $p = pkgs::packageByName($in->{packages}, $rmpackage);
$p && $p->flag_selected and pkgs::unselectPackage($in->{packages}, $p);
}
- run_program::rooted($prefix, "rpm", "-e", "$rmpackage");
+ run_program::rooted($prefix, "rpm", "-e", $rmpackage);
$in->do_pkgs->install($instpackage, if_($isdn->{speed} =~ /128/, 'ibod'), 'isdn4k-utils');
my $light = $e =~ /light/ ? 1 : 0;
isdn_write_config_backend($isdn, $light, $netc);
diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm
index 046ebbf8d..c90725081 100644
--- a/perl-install/network/modem.pm
+++ b/perl-install/network/modem.pm
@@ -70,13 +70,13 @@ sub modem_detect_backend {
$mouse ||={};
$mouse->{device} ||= readlink "/dev/mouse";
my $serdev = arch() =~ /ppc/ ? "macserial" : "serial";
- eval { modules::load("$serdev") };
+ eval { modules::load($serdev) };
detect_devices::probeSerialDevices();
foreach ('modem', map { "ttyS$_" } (0..7)) {
next if $mouse->{device} =~ /$_/;
next unless -e "/dev/$_";
- detect_devices::hasModem("/dev/$_") and $modem->{device} = "$_", last;
+ detect_devices::hasModem("/dev/$_") and $modem->{device} = $_, last;
}
#- add an alias for macserial on PPC
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 9ae4e3f24..880b23aa6 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -153,7 +153,7 @@ sub add2hosts {
open F, ">$file" or die "cannot write $file: $!";
while (my ($ip, $v) = each %l) {
$ip or next;
- print F "$ip";
+ print F $ip;
if ($v =~ /^\s/) {
print F $v;
} else {
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index c2a1b28cd..f43406c80 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -22,7 +22,7 @@ sub write_cnx_script {
'#!/bin/bash
' . if_(!$netc->{at_boot}, 'if [ "x$1" == "x--boot_time" ]; then exit; fi
') . $netc->{internet_cnx}{$netc->{internet_cnx_choice}}{$_});
- chmod 0755, "$prefix" . $_;
+ chmod 0755, "$prefix$_";
}
}
}
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 0d24d0eb8..ce3d02d5e 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -190,7 +190,7 @@ sub stop_service ($) {
sub service_starts_on_boot ($) {
my ($service) = @_;
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"/bin/sh -c \"export LC_ALL=C; /sbin/chkconfig --list $service 2>&1\" |" ||
return 0;
while (my $line = <F>) {
@@ -274,7 +274,7 @@ sub assure_device_is_available_for_cups {
# CUPS knows the device.
my ($device) = @_;
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"/bin/sh -c \"export LC_ALL=C; /usr/sbin/lpinfo -v\" |" ||
die "Could not run \"lpinfo\"!";
while (my $line = <F>) {
@@ -291,7 +291,7 @@ sub assure_device_is_available_for_cups {
sub network_running {
# If the network is not running return 0, otherwise 1.
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"/bin/sh -c \"export LC_ALL=C; /sbin/ifconfig\" |" ||
die "Could not run \"ifconfig\"!";
while (my $line = <F>) {
@@ -374,7 +374,7 @@ sub set_alternative {
local *F;
# Read the list of executables for the given command to find the number
# of the desired executable
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"/bin/sh -c \"export LC_ALL=C; /bin/echo | update-alternatives --config $command \" |" ||
die "Could not run \"update-alternatives\"!";
my $choice = 0;
@@ -390,7 +390,7 @@ sub set_alternative {
close F;
# If the executable was found, assign the command to it
if ($choice > 0) {
- system(($::testing ? "$prefix" : "chroot $prefix/ ") .
+ system(($::testing ? $prefix : "chroot $prefix/ ") .
"/bin/sh -c \"/bin/echo $choice | update-alternatives --config $command > /dev/null 2>&1\"");
}
return 1;
@@ -449,7 +449,7 @@ sub read_configured_queues($) {
for $spooler (qw(cups pdq lprng lpd)) {
#- poll queue info
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"foomatic-configure -P -q -s $spooler |" ||
die "Could not run foomatic-configure";
eval (join('',(<F>)));
@@ -463,7 +463,7 @@ sub read_configured_queues($) {
} else {
#- Poll the queues of the current default spooler
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"foomatic-configure -P -q -s $printer->{SPOOLER} |" ||
die "Could not run foomatic-configure";
eval (join('',(<F>)));
@@ -595,7 +595,7 @@ sub read_printer_db(;$) {
# Generate the Foomatic printer/driver overview, read it from the
# appropriate file when it is already generated
if (!(-f $dbpath)) {
- open DBPATH, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open DBPATH, ($::testing ? $prefix : "chroot $prefix/ ") .
"foomatic-configure -O -q |" ||
die "Could not run foomatic-configure";
} else {
@@ -724,7 +724,7 @@ sub read_foomatic_options ($) {
# Generate the option data for the chosen printer/driver combo
my $COMBODATA;
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"foomatic-configure -P -q -p $printer->{currentqueue}{printer}" .
" -d $printer->{currentqueue}{driver}" .
($printer->{OLD_QUEUE} ?
@@ -746,10 +746,10 @@ sub read_cups_options ($) {
# reuse the dialog
local *F;
if ($queue_or_file =~ /.ppd.gz$/) { # compressed PPD file
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"gunzip -cd $queue_or_file | lphelp - |" || return 0;
} else { # PPD file not compressed or queue
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"lphelp $queue_or_file |" || return 0;
}
my $i;
@@ -831,7 +831,7 @@ sub read_cups_printer_list {
# This function reads in a list of all printers which the local CUPS
# daemon currently knows, including remote ones.
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"lpstat -v |" || return ();
my @printerlist;
my $line;
@@ -858,7 +858,7 @@ sub get_cups_remote_queues {
# CUPS daemon knows due to broadcasting of remote servers or
# "BrowsePoll" entries in the local /etc/cups/cupsd.conf/
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"lpstat -v |" || return ();
my @printerlist;
my $line;
@@ -940,7 +940,7 @@ sub set_default_printer {
sub get_default_printer {
my $printer = $_[0];
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"foomatic-configure -Q -q -s $printer->{SPOOLER} |" || return undef;
my $line;
while ($line = <F>) {
@@ -1003,7 +1003,7 @@ sub read_printers_conf {
sub get_direct_uri {
#- get the local printer to access via a Device URI.
my @direct_uri;
- local *F; open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/sbin/lpinfo -v |";
+ local *F; open F, ($::testing ? $prefix : "chroot $prefix/ ") . "/usr/sbin/lpinfo -v |";
local $_;
while (<F>) {
/^(direct|usb|serial)\s+(\S*)/ and push @direct_uri, $2;
@@ -1073,7 +1073,7 @@ sub poll_ppd_base {
start_not_running_service("cups");
my $driversthere = scalar(keys %thedb);
foreach (1..60) {
- local *PPDS; open PPDS, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/bin/poll_ppd_base -a |";
+ local *PPDS; open PPDS, ($::testing ? $prefix : "chroot $prefix/ ") . "/usr/bin/poll_ppd_base -a |";
local $_;
while (<PPDS>) {
chomp;
@@ -1298,9 +1298,9 @@ sub print_pages($@) {
# Only text and PostScript can be printed directly with all spoolers,
# images must be treated seperately
if ($page =~ /\.jpg$/) {
- system(($::testing ? "$prefix" : "chroot $prefix/ ") .
+ system(($::testing ? $prefix : "chroot $prefix/ ") .
"/usr/bin/convert $page -page 427x654+100+65 PS:- | " .
- ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ ($::testing ? $prefix : "chroot $prefix/ ") .
"$lpr -s $printer->{SPOOLER} -P $queue");
} else {
run_program::rooted($prefix, $lpr, "-s", $printer->{SPOOLER},
@@ -1310,7 +1310,7 @@ sub print_pages($@) {
sleep 5; #- allow lpr to send pages.
# Check whether the job is queued
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "$lpq -s $printer->{SPOOLER} -P $queue |";
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") . "$lpq -s $printer->{SPOOLER} -P $queue |";
my @lpq_output =
grep { !/^no entries/ && !(/^Rank\s+Owner/ .. /^\s*$/) } <F>;
close F;
@@ -1323,7 +1323,7 @@ sub lphelp_output {
my $lphelp = "/usr/bin/lphelp";
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "$lphelp $queue |";
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") . "$lphelp $queue |";
$helptext = join("", <F>);
close F;
if (!$helptext || ($helptext eq "")) {
@@ -1338,7 +1338,7 @@ sub pdqhelp_output {
my $pdq = "/usr/bin/pdq";
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "$pdq -h -P $queue 2>&1 |";
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") . "$pdq -h -P $queue 2>&1 |";
$helptext = join("", <F>);
close F;
return $helptext;
@@ -1355,9 +1355,9 @@ sub print_optionlist {
"-P", $queue, "-o", "docs",
"/etc/bashrc");
} elsif ($printer->{configured}{$queue}{queuedata}{ppd}) {
- system(($::testing ? "$prefix" : "chroot $prefix/ ") .
+ system(($::testing ? $prefix : "chroot $prefix/ ") .
"/usr/bin/lphelp $queue | " .
- ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ ($::testing ? $prefix : "chroot $prefix/ ") .
"$lpr -s $printer->{SPOOLER} -P $queue");
}
}
@@ -1376,7 +1376,7 @@ sub get_copiable_queues {
#- at least
my @queuelist; #- here we will list all Foomatic-generated queues
# Get queue list with foomatic-configure
- open QUEUEOUTPUT, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open QUEUEOUTPUT, ($::testing ? $prefix : "chroot $prefix/ ") .
"foomatic-configure -Q -q -s $oldspooler |" ||
die "Could not run foomatic-configure";
@@ -1518,20 +1518,20 @@ sub configure_hpoj {
stop_service("hpoj");
run_program::rooted($prefix,
"ptal-mlcd", "$bus:probe", "-device",
- "$device", split(' ',$address_arg));
+ $device, split(' ',$address_arg));
$device_ok = 0;
local *F;
- if (open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/bin/ptal-devid mlc:$bus:probe |") {
+ if (open F, ($::testing ? $prefix : "chroot $prefix/ ") . "/usr/bin/ptal-devid mlc:$bus:probe |") {
my $devid = join("", <F>);
close F;
if ($devid) {
$device_ok = 1;
- if (open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/bin/ptal-devid mlc:$bus:probe -long -mdl 2>/dev/null |") {
+ if (open F, ($::testing ? $prefix : "chroot $prefix/ ") . "/usr/bin/ptal-devid mlc:$bus:probe -long -mdl 2>/dev/null |") {
$model_long = join("", <F>);
close F;
chomp $model_long;
}
- if (open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/bin/ptal-devid mlc:$bus:probe -long -sern 2>/dev/null |") {
+ if (open F, ($::testing ? $prefix : "chroot $prefix/ ") . "/usr/bin/ptal-devid mlc:$bus:probe -long -sern 2>/dev/null |") {
$serialnumber_long = join("", <F>);
close F;
chomp $serialnumber_long;
@@ -1541,7 +1541,7 @@ sub configure_hpoj {
}
}
}
- if (open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "ps auxwww | grep \"ptal-mlcd $bus:probe\" | grep -v grep | ") {
+ if (open F, ($::testing ? $prefix : "chroot $prefix/ ") . "ps auxwww | grep \"ptal-mlcd $bus:probe\" | grep -v grep | ") {
my $line = <F>;
if ($line =~ /^\s*\S+\s+(\d+)\s+/) {
my $pid = $1;
@@ -2274,7 +2274,7 @@ sub removestarofficeprinterentry {
sub removeopenofficeprinterentry {
my ($printer, $queue, $configprefix, $configfile) = @_;
# Remove printer's section
- $configfile = removesection("$queue", $configfile);
+ $configfile = removesection($queue, $configfile);
# Remove Link of PPD file
run_program::rooted($prefix,
"rm", "-f",
@@ -2351,7 +2351,7 @@ sub getcupsremotequeues {
# local CUPS daemon knows due to broadcasting of remote servers or
# "BrowsePoll" entries in the local /etc/cups/cupsd.conf
local *F;
- open F, ($::testing ? "$prefix" : "chroot $prefix/ ") .
+ open F, ($::testing ? $prefix : "chroot $prefix/ ") .
"lpstat -v |" || return ();
my @printerlist;
my $line;