Code sync
[external/hplip.git] / debian / patches / ubuntu-hp-mkuri-notification-text.dpatch
1 #! /bin/sh -e
2 ## ubuntu-hp-mkuri-notification-text.dpatch by  <till.kamppeter@gmail.com>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Ubuntu-only!
6
7 [ "`lsb_release -is 2>/dev/null`" = "Ubuntu" ] || { echo -n '(ignored)' >&2; exit 0; }
8 . /usr/share/dpatch/dpatch-run
9
10 @DPATCH@
11 diff -urNad hplip-3.10.2~/io/hpmud/hp-mkuri.c hplip-3.10.2/io/hpmud/hp-mkuri.c
12 --- hplip-3.10.2~/io/hpmud/hp-mkuri.c   2010-03-17 22:56:18.000737637 +0100
13 +++ hplip-3.10.2/io/hpmud/hp-mkuri.c    2010-03-17 23:00:11.610781053 +0100
14 @@ -355,6 +355,8 @@
15     if (hpmud_get_key_value(datfile, model, "fax-type", value, sizeof(value)) != HPMUD_R_OK)
16        goto bugout;
17     fax = strtol(value, NULL, 10);
18 +   if (hpmud_get_key_value(datfile, model, "model1", m, sizeof(m)) != HPMUD_R_OK)
19 +      goto bugout;
20  
21     /* See if device is supported by hplip. */
22     if (support == HPMUD_SUPPORT_TYPE_NONE)
23 @@ -372,12 +374,12 @@
24        switch (plugin)
25        {
26           case HPMUD_PLUGIN_TYPE_REQUIRED:
27 -            BUG("%s requires a proprietary plugin\n", pm);
28 -            notify(pm, "requires a proprietary plugin, run hp-setup", 30000);
29 +            BUG("%s requires a proprietary plugin\n", m);
30 +            notify(m, "requires a proprietary plugin, downloading and installing the plugin ...", 30000);
31              break;
32           case HPMUD_PLUGIN_TYPE_OPTIONAL:
33 -            BUG("%s has a optional proprietary plugin\n", pm);
34 -            notify(pm, "has a optional proprietary plugin, run hp-setup", 30000);
35 +            BUG("%s has an optional proprietary plugin\n", m);
36 +            notify(m, "has an optional proprietary plugin, run hp-plugin-ubuntu", 30000);
37              break;
38           default:
39              break;