~ubuntu-branches/ubuntu/vivid/roger-router/vivid

« back to all changes in this revision

Viewing changes to debian/patches/fix-cups-quoting.diff

  • Committer: Package Import Robot
  • Author(s): Rolf Leggewie
  • Date: 2014-10-15 22:22:22 UTC
  • Revision ID: package-import@ubuntu.com-20141015222222-dxxoqi5w1ue1j5m9
Tags: 1.8.9-2
* copyright: add copyright information for win32/printer/ghostpdf.ppd
* rules: don't abort compilation on deprecated declarations
  GTK3 3.14 deprecated a number of functions which resulted in FTBFS
  after October 10.  These issues will need to be addressed with upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Fix quoting errors.
 
2
# Add basic error handling.
 
3
--- a/share/roger-cups
 
4
+++ b/share/roger-cups
 
5
@@ -1,20 +1,21 @@
 
6
-#!/bin/bash
 
7
+#!/bin/sh
 
8
 
 
9
-if [ $# == 0 ] ; then
 
10
-       echo  "file roger-cups:/ \"Unknown\" \"Tabos.org Roger Router Fax Printer\""
 
11
-       exit 0
 
12
+if [ $# -eq 0 ] ; then
 
13
+       # Device Discovery
 
14
+       echo "file roger-cups:/ \"Unknown\" \"Tabos.org Roger Router Fax Printer\""
 
15
+       exit 0 # CUPS_BACKEND_OK
 
16
 fi
 
17
 
 
18
-RNAME=$2-Fax-ID$1
 
19
-SPOOL_DIR=/var/spool/roger/
 
20
+RNAME="$2-Fax-ID$1"
 
21
+SPOOL_DIR="/var/spool/roger"
 
22
 
 
23
 if [ $# -eq 6 ]; then
 
24
-       cp $6 $SPOOL_DIR/$RNAME.tmp
 
25
+       cp "$6" "$SPOOL_DIR/$RNAME.tmp" || exit 1 # CUPS_BACKEND_FAILED
 
26
 else
 
27
-       cat > $SPOOL_DIR/$RNAME.tmp
 
28
+       cat > "$SPOOL_DIR/$RNAME.tmp" || exit 1 # CUPS_BACKEND_FAILED
 
29
 fi
 
30
 
 
31
-chmod 660 $SPOOL_DIR/$RNAME.tmp
 
32
-mv $SPOOL_DIR/$RNAME.tmp $SPOOL_DIR/$RNAME
 
33
+chmod 660 "$SPOOL_DIR/$RNAME.tmp"
 
34
+mv "$SPOOL_DIR/$RNAME.tmp" "$SPOOL_DIR/$RNAME"
 
35
 
 
36
-exit 0
 
37
+exit 0 # CUPS_BACKEND_OK