package printer::default; use strict; use run_program; use common; #-configuration directory of Foomatic my $FOOMATICCONFDIR = "/etc/foomatic"; #-location of the file containing the default spooler's name my $FOOMATIC_DEFAULT_SPOOLER = "$FOOMATICCONFDIR/defaultspooler"; sub set_printer { my ($printer) = $_[0]; run_program::rooted($::prefix, "foomatic-configure", "-D", "-q", "-s", $printer->{SPOOLER}, "-n", $printer->{DEFAULT}) or return 0; return 1; } sub get_printer { my $printer = $_[0]; local *F; open F, ($::testing ? $::prefix : "chroot $::prefix/ ") . "foomatic-configure -Q -q -s $printer->{SPOOLER} |" or return undef; my $line; while ($line = ) { if ($line =~ m!^\s*(.*)\s*$!) { return $1; } } return undef; } sub printer_type() { "LOCAL" } sub get_spooler () { if (-f "$::prefix$FOOMATIC_DEFAULT_SPOOLER") { my $spool = cat_("$::prefix$FOOMATIC_DEFAULT_SPOOLER"); chomp $spool; return $spool if $spool =~ /cups|lpd|lprng|pdq/; } } sub set_spooler ($) { my ($printer) = @_; # Mark the default driver in a file output_p("$::prefix$FOOMATIC_DEFAULT_SPOOLER", $printer->{SPOOLER}); } 1; value='distro/mdv2010.0'>distro/mdv2010.0 Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-03-02 18:11:24 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-03-02 18:11:24 +0000
commit221e7944db551edf85e0c0ff6062155b643a6d23 (patch)
treef294e2757f409c7662aca923efa86a28d11fe3e9 /perl-install/detect_devices.pm
parent0a6678837ce51a3086ec07bac3be9706240a8562 (diff)
downloaddrakx-221e7944db551edf85e0c0ff6062155b643a6d23.tar
drakx-221e7944db551edf85e0c0ff6062155b643a6d23.tar.gz
drakx-221e7944db551edf85e0c0ff6062155b643a6d23.tar.bz2
drakx-221e7944db551edf85e0c0ff6062155b643a6d23.tar.xz
drakx-221e7944db551edf85e0c0ff6062155b643a6d23.zip
(getCompaqSmartArray): adapt for cciss
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 238e65893..d360c55cc 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -126,17 +126,17 @@ sub getIDE() {
sub getCompaqSmartArray() {
my @idi;
- my $f;
- my $dir = "/proc/driver/array"; #- kernel 2.4 places it here
- $dir = "/proc/array" if !-d $dir; #- kernel 2.2
+ foreach ('array/ida', 'cciss/cciss') {
+ my $prefix = "/proc/driver/$_"; #- kernel 2.4 places it here
+ $prefix = "/proc/$_" if !-e "${prefix}0"; #- kernel 2.2
- -e "$dir/ida0" or return;
-
- for (my $i = 0; -r ($f = "$dir/ida$i"); $i++) {
- foreach (cat_($f)) {
- if (m|^\s*(ida/.*?):|) {
- push @idi, { device => $1, info => "Compaq RAID logical disk", type => 'hd' };
+ my ($name) = m|/(.*)|;
+ for (my $i = 0; -r ($f = "${prefix}$i"); $i++) {
+ foreach (cat_($f)) {
+ if (m|^\s*($name/.*?):|) {
+ push @idi, { device => $1, info => "Compaq RAID logical disk", type => 'hd' };
+ }
}
}
}