1
0
forked from pool/sane-backends
OBS User unknown 2008-11-20 15:23:24 +00:00 committed by Git OBS Bridge
parent 7242be0a61
commit 83d5f769e6
2 changed files with 42 additions and 5 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Nov 18 14:51:34 CET 2008 - jsmeix@suse.de
- In /etc/hal/fdi/policy/10osvendor/70-scanner.fdi
disable entries for USB scanners which are "unsupported"
(see Novell/Suse Bugzilla bnc#444158).
-------------------------------------------------------------------
Wed Oct 29 11:34:31 CET 2008 - jsmeix@suse.de

View File

@ -25,7 +25,7 @@ Group: Hardware/Scanner
AutoReqProv: on
Summary: SANE (Scanner Access Now Easy) Scanner Drivers
Version: 1.0.19
Release: 95
Release: 96
Url: http://www.sane-project.org/
# URL for Source0: http://alioth.debian.org/frs/download.php/2318/sane-backends-1.0.19.tar.gz
Source0: sane-backends-%{version}.tar.bz2
@ -425,8 +425,10 @@ sed -i -e '/:model "SnapScan 1236u"/,/:firmware "required"/s/required//' %{build
# Modify create_scanner_database to find the description files in the BuildRoot directory
# (the usual delimiter '/' cannot be used because buildroot contains it too):
sed -i -e 's|/usr/share/sane/descriptions|%{buildroot}/usr/share/sane/descriptions|' %{SOURCE200}
# Create the scanner database (it is also needed later to disable "unsupported" model entries in libsane.rules).
# The scanner database file name "scanner.database" is used hardcoded in create_sane-backends-autoconfig.rules.
# Create the scanner database and store it because it is also needed later
# to disable "unsupported" model entries both in the udev rules file libsane.rules
# and in the HAL fdi file 70-scanner.fdi.
# The file name "scanner.database" is used hardcoded in create_sane-backends-autoconfig.rules.
bash %{SOURCE200} >scanner.database
# Run create_sane-backends-autoconfig.rules:
bash %{SOURCE201} >autoconfig.rules
@ -475,9 +477,13 @@ sed -i -e 's/^ENV{DEVTYPE}/# ENV{DEVTYPE}/' tools/udev/libsane.rules
# supported by SANE which would even cause conflicts if such a
# device is supported by whatever other software,
# see https://bugzilla.novell.com/show_bug.cgi?id=439193
# Extract a list of USB IDs for "unsupported" scanners
# and store it because it is also needed later to
# disable "unsupported" model entries in the HAL fdi file 70-scanner.fdi:
grep '||[^|]*|0x[0-9A-Fa-f][0-9A-Fa-f]*:0x[0-9A-Fa-f][0-9A-Fa-f]*|unsupported' scanner.database | cut -s -d '|' -f 7 | sort -f -u >unsupportedUSBIDs
# Ignore case when using sed to avoid possible problems
# with upper case letters in the USB IDs:
for m in $( grep '||[^|]*|0x[0-9A-Fa-f][0-9A-Fa-f]*:0x[0-9A-Fa-f][0-9A-Fa-f]*|unsupported' scanner.database | cut -s -d '|' -f 7 | sort -f -u | sed -e 's/0x/./ig' -e 's/:/.,.ATTR.idProduct.==/' )
for m in $( sed -e 's/0x/./ig' -e 's/:/.,.ATTR.idProduct.==/' unsupportedUSBIDs )
do sed -i -e "/^ATTR.idVendor.==$m/Is/^ATTR/# ATTR/" tools/udev/libsane.rules
done
# Install the udev rules file:
@ -512,6 +518,26 @@ sed -i -e '/usb_device.vendor_id.*0x04ce/I,/append key/{/usb_device.product_id.*
for ID in 0094 0099 009a 00a0 00a3 80a3 80ac 00b6
do sed -i -e "/usb_device.vendor_id.*0x05da/I,/append key/{/usb_device.product_id.*0x$ID/I,/append key/s/scanner/SCSIviaUSBscanner/g}" tools/hal/libsane.fdi
done
# Disable entries for USB scanners which are "unsupported"
# but keep the entries for models for which the support status
# is "complete", "good", "basic", "minimal", "untested"
# because the HAL fdi file is used to grant normal user access
# for scanner devices which is needed for any scanner
# (regardless to what extent it is actually supported).
# The only exception are unsupported models
# because it seems to be wrong to have "known but unsupported" devices
# listed in the HAL fdi file because it seems not to make sense
# to grant normal user access for devices which are not
# supported by SANE which would even cause conflicts if such a
# device is supported by whatever other software,
# see https://bugzilla.novell.com/show_bug.cgi?id=444158
# Currently there are no hexadecimal numbers in libsane.fdi with uppercase letters
# nevertheless to be safe the GNU sed extension to ignore case for pattern matching is used:
for ID in $( cat unsupportedUSBIDs )
do V="$( echo $ID | cut -d : -s -f 1 )"
P="$( echo $ID | cut -d : -s -f 2 )"
sed -i -e "/usb_device.vendor_id.*$V/I,/info.capabilities/{/usb_device.product_id.*$P/I,/info.capabilities/{s/<append/<!-- <append/;s/append>/append> -->/}}" tools/hal/libsane.fdi
done
# Install the HAL fdi file:
install -d %{buildroot}%{_sysconfdir}/hal/fdi/policy/10osvendor
install -m644 tools/hal/libsane.fdi %{buildroot}%{_sysconfdir}/hal/fdi/policy/10osvendor/70-scanner.fdi
@ -572,6 +598,10 @@ exit 0
%{_sysconfdir}/udev/rules.d/56-sane-backends-autoconfig.rules
%changelog
* Tue Nov 18 2008 jsmeix@suse.de
- In /etc/hal/fdi/policy/10osvendor/70-scanner.fdi
disable entries for USB scanners which are "unsupported"
(see Novell/Suse Bugzilla bnc#444158).
* Wed Oct 29 2008 jsmeix@suse.de
- Having only models in /etc/udev/rules.d/55-libsane.rules which
are in /etc/udev/rules.d/56-sane-backends-autoconfig.rules
@ -1141,7 +1171,7 @@ exit 0
- skipped parport-scanner for ppc and sparc
* Mon Nov 06 2000 freitag@suse.de
- fixed Copyright/License-Field in SpecFile
* Fri Nov 03 2000 ro@suse.de
* Thu Nov 02 2000 ro@suse.de
- fix neededforbuild for new package-names
* Thu Nov 02 2000 freitag@suse.de
- new version 1.0.3