From af269e66df35a62d822501f66421e11e89568f87 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Thu, 13 Feb 2003 02:16:18 +0000 Subject: Improved handling and structure of scanner database - Scanners with multiple ports are supported now - Fully automatic build of the scanner database, including lines for configuration files - Fixed "SnapScan" <-> "snapscan" bug - Some HP scanners had no manufacturer field. Fixed. --- perl-install/handle_configs.pm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'perl-install/handle_configs.pm') diff --git a/perl-install/handle_configs.pm b/perl-install/handle_configs.pm index 185d45b38..df817aac0 100644 --- a/perl-install/handle_configs.pm +++ b/perl-install/handle_configs.pm @@ -129,12 +129,13 @@ sub set_directive { # Set a directive, replace the old definition or a commented definition - my ($lines_ptr, $directive) = @_; + my ($lines_ptr, $directive, $full_line) = @_; - my $searchdirective = searchstr($directive); - my $olddirective = $searchdirective; - $olddirective =~ s/^\s*(\S+)\s+.*$/$1/s; - $olddirective ||= $directive; + my $olddirective = $directive; + if (!$full_line) { + $olddirective =~ s/^\s*(\S+)\s+.*$/$1/s; + $olddirective ||= $directive; + } my $success = (replace_directive($lines_ptr, $olddirective, $directive) or @@ -152,11 +153,6 @@ sub add_directive { my ($lines_ptr, $directive) = @_; - my $searchdirective = searchstr($directive); - my $olddirective = $searchdirective; - $olddirective =~ s/^\s*(\S+)\s+.*$/$1/s; - $olddirective ||= $directive; - my $success = insert_directive($lines_ptr, $directive); if ($success) { move_directive_to_version_commented_out($lines_ptr, $directive, -- cgit v1.2.1