~ubuntu-branches/ubuntu/quantal/joystick/quantal

« back to all changes in this revision

Viewing changes to debian/ident

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Kitt
  • Date: 2010-05-16 16:11:59 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100516161159-tf754mo83ojh1yqj
Tags: 20051019-11
evtest: flush standard output, thanks Florian Fainelli! Closes:
#581740.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/awk -f
 
2
 
 
3
BEGIN {
 
4
    FS = "\"";
 
5
    kernel = "";
 
6
    name = "";
 
7
    serial = "";
 
8
    vendor = "";
 
9
    product = "";
 
10
    seckernel = "";
 
11
    secname = "";
 
12
    secserial = "";
 
13
    secvendor = "";
 
14
    secproduct = "";
 
15
}
 
16
 
 
17
/KERNEL==/ {
 
18
    kernel = $2;
 
19
}
 
20
 
 
21
/KERNELS==/ {
 
22
    seckernel = $2;
 
23
}
 
24
 
 
25
/ATTRS{name}/ {
 
26
    secname = $2;
 
27
}
 
28
 
 
29
/ATTRS{serial}/ {
 
30
    secserial = $2;
 
31
}
 
32
 
 
33
/ATTRS{idVendor}/ {
 
34
    secvendor = $2;
 
35
}
 
36
 
 
37
/ATTRS{idProduct}/ {
 
38
    secproduct = $2;
 
39
}
 
40
 
 
41
/$^/ {
 
42
    # New section, check the values remembered from the previous
 
43
    # If the section defined a name, and we don't have one, and the
 
44
    # section described an input device, store the name and serial
 
45
    if (match(seckernel, "input") != 0 && secname != "" && name == "") {
 
46
        name = secname;
 
47
        serial = secserial;
 
48
    }
 
49
    # If the section defined a vendor (for USB devices), and we don't
 
50
    # have one, store the vendor and product
 
51
    if (secvendor != "" && vendor == "") {
 
52
        vendor = secvendor;
 
53
        product = secproduct;
 
54
    }
 
55
 
 
56
    # Clear all section values before processing next section
 
57
    seckernel = "";
 
58
    secname = "";
 
59
    secserial = "";
 
60
    secvendor = "";
 
61
    secproduct = "";
 
62
}
 
63
 
 
64
END {
 
65
    print "DEVICE=\"" kernel "\"";
 
66
    print "NAME=\"" name "\"";
 
67
    print "SERIAL=\"" serial "\"";
 
68
    print "VENDOR=\"" vendor "\"";
 
69
    print "PRODUCT=\"" product "\"";
 
70
}