# This file contains all the bugs/glitches/inconsistencies shipped in # 9.0 (Dolphin) Mandrake Linux Release. # Feel free to add your entry and if possible the fixes and status of # the errata. o Drakxtools: ========== widget libraries: In both XFdrake and printerdrake pop up small, empty, gray windows when clicking in the main menu. STATUS: Not fixed. Scroll bars and widget sizes often not correct (visible primarily in the printer options step of the "Add printer" wizard of printerdrake. STATUS: Not fixed. harddrake: logdrake: IS: Send the alert mail when service is stopped but the mail is empty. SHOULD BE: incorporate a text on which service is stopped. Status: not fixed. o Drakconf: ========= IS: locale nl_NL, sl and zh_CN prevent drakconf from starting with a "cannot call set_active on undefined values" error. SHOULD BE: work well in all locales. a workaround has been comitted o Drakfont: ========= drakfont get stopped in stat64("/mnt/nt/winnt/fonts/8514oem.fon", ...) on ntfs partitions. there's a bug in ntfs.o fs module of the kernel o Install: ======== o urpmi: ====== "urpmi mplayer" shows a list of libraries it needs and asks whether to install all this, after saying "y", it says that all these packages are missing and fails (I have shown it to François and he says that is a bug with the "contribs". He had to regenerate the hdlists somehow. STATUS: Not fixed. o XFree 4.2.x: ============ Touchpad mouse on my Asus S8600 notebook. Worked out-of-the-box with Mandrake 8.2, but in 9.0 I cannot do any dragging operation with the PS/2-"Standard" mouse setting. I switched to "Glidepoint" with mousedrake and then dragging works, but the emulation of the third button by pressing both buttons not. Adding the lines Option "Emulate3Buttons" Option "Emulate3Timeout" "50" to the mouse section of /etc/X11/XF86Config-4 manually fixes the middle-button problem. STATUS: Not fixed. Sometimes, XFree86 can cause sound glitches because of intensive pci bus usage. Adding the line Option "PciRetry" "true" to the "Device" section /etc/X11/XF86Config-4 fixes these boxes. I810 driver is bogus: when Xrender extension is in use (antialiased fonts), X11 may crash upon vt switch. is fixed in devel branch of cvs o Printer drivers: ================ "Best Grayscale" mode of HP DeskJet 6xx and Apollo printers does not work. STATUS: Fixed on linuxprinting.org, needs to be packaged in "printer-drivers". o kernel: ======= Sometimes reboot stops on "illegal seek" message (having /usr on / fs fix it) Sometimes process get blocked in D-state on ntfs partitions (see drakfont) i810_audio mistakely say to modules.pm through modules.*map it handles nforces whereas it lacks some workaround nvidia and alsa uses. workaround: perl-install/patch/patch-nforce.pl snd-via686 is said to produce background noise since alsa-0.9.0rc3 workaround: switch to via82cxxx_audio (oss driver) through draksound Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/perl-install/scanner.pm
blob: 0e67eb02e6c78c694ef537d94bd247f1d7d1f518 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
package scanner;
# scanner.pm $Id$
# Yves Duret <yduret at mandrakesoft.com>
# Copyright (C) 2001 MandrakeSoft
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# pbs/TODO:
# - no scsi support
# - devfs use dev_is_devfs()
# - with 2 scanners same manufacturer -> will overwrite previous conf -> only 1 conf !!
# - lp: see printerdrake
# - install: prefix --> done

use standalone;
use common;
use detect_devices;


my $_sanedir = "$prefix/etc/sane.d";
my $_scannerDBdir = "$prefix$ENV{SHARE_PATH}/ldetect-lst";
$scannerDB = readScannerDB("$_scannerDBdir/ScannerDB");

sub confScanner {
    my ($model, $port) = @_;
    $port = detect_devices::dev_is_devfs() ? "$prefix/dev/usb/scanner0" : "$prefix/dev/scanner" if (!$port);
    my $a = $scannerDB->{$model}{server};
    #print "file:[$a]\t[$model]\t[$port]\n| ", (join "\n| ", @{$scannerDB->{$model}{lines}}),"\n";
    output("$_sanedir/$a.conf", (join "\n",@{$scannerDB->{$model}{lines}}));
    substInFile {s/\$DEVICE/$port/} "$_sanedir/$a.conf";
    add2dll($a);
}

sub add2dll {
    return if member($_[0], chomp_(cat_("$_sanedir/dll.conf")));
    local *F;
    open F, ">>$_sanedir/dll.conf" or die "can't write SANE config in $_sanedir/dll.conf: $!";
    print F $_[0];
    close F;
}

sub findScannerUsbport {
    my ($i, $elem, @res) = (0, {});
    foreach (grep { $_->{driver} =~ /scanner/ } detect_devices::usb_probe()) {
	#my ($manufacturer, $model) = split '\|', $_->{description};
	#$_->{description} =~ s/Hewlett[-\s_]Packard/HP/;
	push @res, { port => "/dev/usb/scanner$i", val => { #CLASS => 'SCANNER',
							    #MODEL => $model,
							    #MANUFACTURER => $manufacturer,
							    DESCRIPTION => $_->{description},
							    #id => $_->{id},
							    #vendor => $_->{vendor},
							  }};
	++$i;
    }
    @res;
}


sub findScannerScsi {

}

sub readScannerDB {
    my ($file) = @_;
    my ($card, %cards);

    my $F = common::openFileMaybeCompressed($file);

    my ($lineno, $cmd, $val) = 0;
    my $fs = {
        LINE => sub { push @{$card->{lines}}, $val },
	NAME => sub {
	    $cards{$card->{type}} = $card if ($card and !$card->{flags}{unsupported});
	    $card = { type => $val };
	},
	SEE => sub {
	    my $c = $cards{$val} or die "Error in database, invalid reference $val at line $lineno";

	    push @{$card->{lines}}, @{$c->{lines} || []};
	    add2hash($card->{flags}, $c->{flags});
	    add2hash($card, $c);
	},
	ASK => sub { $card->{ask} = $val; },
	SERVER => sub { $card->{server} = $val; },
	DRIVER => sub { $card->{driver} = $val; },
	UNSUPPORTED => sub { $card->{flags}{unsupported} = 1 },
	COMMENT => sub {},
    };

    local $_;
    while (<$F>) { $lineno++;
	s/\s+$//;
	/^#/ and next;
	/^$/ and next;
	/^END/ and do { $cards{$card->{type}} = $card if $card; last };
	($cmd, $val) = /(\S+)\s*(.*)/ or next; #log::l("bad line $lineno ($_)"), next;
	my $f = $fs->{$cmd};
	$f ? $f->() : log::l("unknown line $lineno ($_)");
    }
    \%cards;
}

sub updateScannerDBfromUsbtable {
    substInFile {s/END//} "ScannerDB";
    local *F;
    open F, ">>ScannerDB" or die "can't write ScannerDB config in ScannerDB: $!";
    print F "# generated from usbtable by scannerdrake\n";
    foreach (cat_("$ENV{SHARE_PATH}/ldetect-lst/usbtable")) {
	my ($vendor_id, $product_id, $mod, $name) = chomp_(split /\s/,$_,4);
	next unless ($mod eq "\"scanner\"");
	$name =~ s/\"(.*)\"$/$1/;
	if (member($name, keys %$scanner::scannerDB)) {
	    print "#[$name] already in ScannerDB!\n";
	    next;
	}
	print F "NAME $name\nDRIVER usb\nCOMMENT usb $vendor_id $product_id\nUNSUPPORTED\n\n";
    }
    print F "END\n";
    close F;
}

sub updateScannerDBfromSane {
    my ($_sanesrcdir) = @_;
    substInFile {s/END//} "ScannerDB";

    local *Y;
    open Y, ">>ScannerDB" or die "can't write ScannerDB config in ScannerDB: $!";
    print Y "# generated from Sane by scannerdrake\n";
    # for compat with our usbtable
    my $sane2DB = { 
		   "Acer" => "Acer Peripherals Inc.",
		   "AGFA" => "AGFA-Gevaert NV",
		   "Agfa" => "AGFA-Gevaert NV",
		   "Epson" => "Seiko Epson Corp.",
		   "Fujitsu Computer Products of America" => "Fujitsu",
		   "HP" => sub {$_[0] =~ s/HP\s/Hewlett-Packard|/; $_[0] =~ s/HP4200/Hewlett-Packard|ScanJet 4200C/; $_[0];},
		   "Hewlett-Packard" => sub {$_[0] =~ s/HP 3200 C/Hewlett-Packard|ScanJet 3200C/; $_[0];},
		   "Kodak" => "Kodak Co.",
		   "Mustek" => "Mustek Systems Inc.",
		   "NEC" => "NEC Systems",
		   "Nikon" => "Nikon Corp.",
		   "Plustek" => "Plustek, Inc.",
		   "Primax" => "Primax Electronics",
		   "Siemens" => "Siemens Information and Communication Products",
		   "Trust" => "Trust Technologies",
		   "UMAX" => "Umax",
		   "Vobis/Highscreen" => "Vobis",
		  };
    
    opendir YREP, $_sanesrcdir or die "can't open $_sanesrcdir: $!";
    @files = grep /.*desc$/, readdir YREP;
    closedir YREP;
    foreach $i (@files) {
	my $F = common::openFileMaybeCompressed("$_sanesrcdir/$i");
	print Y "\n# from $i";
	my ($lineno, $cmd, $val) = 0;
	my ($name, $intf, $comment,$mfg);
	my $fs = {
		  backend => sub {$backend = $val;},
		  mfg => sub {$mfg = $val; $name=undef;},#bug when a new mfg comes. should called $fs->{$name}(); but ??
		  model => sub {
		      unless ($name) {$name = $val; next;}
		      $name = (member($mfg, keys %$sane2DB))
			? (ref $sane2DB->{$mfg}) ? $sane2DB->{$mfg}($name) : "$sane2DB->{$mfg}|$name" : "$mfg|$name";
		      if (member($name, keys %$scanner::scannerDB)) {
			  print "#[$name] already in ScannerDB!\n";
		      } else {
			  print Y "\nNAME $name\nSERVER $backend\nDRIVER $intf\n";
			  print Y "COMMENT $comment\n" if ($comment);
			  $comment = undef; 
		      }
		      $name = $val;
		  },
		  interface => sub {$intf = $val;},
		  comment => sub {$comment = $val;},
		 };
	local $_;
	while (<$F>) { $lineno++;
		       s/\s+$//;
		       /^\;/ and next;
		       ($cmd, $val) = /:(\S+)\s*\"([^\;]*)\"/ or next; #log::l("bad line $lineno ($_)"), next;
		       my $f = $fs->{$cmd};
		       $f ? $f->() : log::l("unknown line $lineno ($_)");
		   }
	$fs->{model}(); # the last one
    }
    print Y "\nEND\n";
    close Y;
}

#-######################################################################################
#- Wonderful perl :(
#-######################################################################################
1; #

#-----------------------------------------------
# $Log$
# Revision 1.7  2002/07/08 08:34:51  tvignaud
# this doesn't need either "#!/usr/bin/perl" nor "use lib qw(/usr/lib/libDrakX);"
#
# Revision 1.6  2002/03/10 15:26:00  yduret
# added ASK support for more interactiveness during configuration
#
# Revision 1.5  2002/02/18 17:34:31  yduret
# update
#
# Revision 1.4  2002/02/18 16:16:13  yduret
# scsi parport preliminary support
# no more show unsupported scanner
# common output for ScannerDB update from sane *.desc files and from usbtable
#
# Revision 1.3  2001/11/12 15:18:02  yduret
# update, sync with cvs
#