diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-03-23 15:31:58 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-03-23 15:31:58 +0000 |
commit | b0203771a3788760ac7f2041ed8a633de00cc0a9 (patch) | |
tree | 823a5bf0d07511099795ce3d10b131e9b202be25 | |
parent | 9f1a11f6213832fc9c7a715c0510068856f56564 (diff) | |
download | drakx-backup-do-not-use-b0203771a3788760ac7f2041ed8a633de00cc0a9.tar drakx-backup-do-not-use-b0203771a3788760ac7f2041ed8a633de00cc0a9.tar.gz drakx-backup-do-not-use-b0203771a3788760ac7f2041ed8a633de00cc0a9.tar.bz2 drakx-backup-do-not-use-b0203771a3788760ac7f2041ed8a633de00cc0a9.tar.xz drakx-backup-do-not-use-b0203771a3788760ac7f2041ed8a633de00cc0a9.zip |
enable use of gzip'ed Cards+, CardsNames and MonitorsDB
-rw-r--r-- | perl-install/Xconfigurator.pm | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 3959241b5..701ba190e 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -31,8 +31,7 @@ sub readCardsDB { my ($file) = @_; my ($card, %cards); - local *F; - open F, $file or die "file $file not found"; + my $F = common::openFileMaybeCompressed($file); my ($lineno, $cmd, $val) = 0; my $fs = { @@ -64,7 +63,7 @@ sub readCardsDB { }; local $_; - while (<F>) { $lineno++; + while (<$F>) { $lineno++; s/\s+$//; /^#/ and next; /^$/ and next; @@ -80,15 +79,12 @@ sub readCardsDB { } sub readCardsNames { my $file = "$ENV{SHARE_PATH}/ldetect-lst/CardsNames"; - local *F; open F, $file or die "can't find $file\n"; - map { (split '=>')[0] } grep { !/^#/ } <F>; + map { (split '=>')[0] } grep { !/^#/ } catMaybeCompressed($file); } sub cardName2RealName { - my $file = "$ENV{SHARE_PATH}/ldetect-lst/CardsNames"; my ($name) = @_; - local *F; open F, $file or die "can't find $file\n"; - local $_; - while (<F>) { + my $file = "$ENV{SHARE_PATH}/ldetect-lst/CardsNames"; + foreach (catMaybeCompressed($file)) { chop; next if /^#/; my ($name_, $real) = split '=>'; @@ -110,9 +106,9 @@ sub readMonitorsDB { %monitors and return; - local *F; open F, $file or die "can't open monitors database ($file): $!"; + my $F = common::openFileMaybeCompressed($file); local $_; - my $lineno = 0; while (<F>) { + my $lineno = 0; while (<$F>) { $lineno++; s/\s+$//; /^#/ and next; |