~ubuntu-branches/ubuntu/quantal/usb-modeswitch/quantal

« back to all changes in this revision

Viewing changes to debian/patches/03_filter_undesired_rules.patch

  • Committer: Bazaar Package Importer
  • Author(s): Didier Raboud
  • Date: 2010-05-03 11:37:08 UTC
  • mfrom: (1.2.1 upstream) (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100503113708-y9s2bbgvr264bmmb
Tags: 1.1.2-2
Add 03_filter_undesired_rules.patch to filter out undesired files
(Closes: #579981)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Avoids to glob .dpkg-old files by specifically globbing what we
 
2
 want (this allows to filter out other undesired files).
 
3
Bugs: http://bugs.debian.org/579981
 
4
Origin: vendor
 
5
Forwarded: yes
 
6
Author: Didier Raboud <didier@raboud.com>
 
7
Last-Update: 2010-05-03
 
8
 
 
9
Index: usb-modeswitch.git/usb_modeswitch.tcl
 
10
===================================================================
 
11
--- usb-modeswitch.git.orig/usb_modeswitch.tcl  2010-05-03 09:04:22.000000000 +0200
 
12
+++ usb-modeswitch.git/usb_modeswitch.tcl       2010-05-03 10:57:21.000000000 +0200
 
13
@@ -164,7 +164,9 @@
 
14
 # which would point to a possible ambiguity. If so, check if
 
15
 # SCSI values are needed
 
16
 
 
17
-set configList [glob -nocomplain $dbdir/$usb(idVendor):$usb(idProduct)*]
 
18
+# The glob matches $idVendor:$idProduct without postfix and with :spec=value postfixes
 
19
+# This allows to filter out .dpkg-old files
 
20
+set configList [glob -nocomplain $dbdir/$usb(idVendor):$usb(idProduct){,\[:a-Z0-9=\]*}]
 
21
 if {[llength $configList] == 0} {
 
22
        Log "Aargh! Config file missing for $usb(idVendor):$usb(idProduct)! Exiting"
 
23
        SafeExit
 
24
@@ -279,7 +281,9 @@
 
25
 # end and provide a fallback
 
26
 
 
27
 set report {}
 
28
-set configList [glob -nocomplain $dbdir/$usb(idVendor):$usb(idProduct)*]
 
29
+# The glob matches $idVendor:$idProduct without postfix and with :spec=value postfixes
 
30
+# This allows to filter out .dpkg-old files
 
31
+set configList [glob -nocomplain $dbdir/$usb(idVendor):$usb(idProduct){,\[:a-Z0-9=\]*}]
 
32
 foreach configuration [lsort -decreasing $configList] {
 
33
        Log "checking config: $configuration"
 
34
        if [MatchDevice $configuration] {