~ubuntu-branches/ubuntu/trusty/websockify/trusty-updates

« back to all changes in this revision

Viewing changes to debian/patches/fixes-rebind-wrapper.patch

  • Committer: Package Import Robot
  • Author(s): Thomas Goirand
  • Date: 2013-12-08 06:20:11 UTC
  • Revision ID: package-import@ubuntu.com-20131208062011-mq9lg3r7f576juhc
Tags: 0.5.1+dfsg1-3
* Fixes the shell wrapper for rebind. Thanks to Philipp Hahn
  <hahn@univention.de> for reporting and his fix (Closes: #726304).
* Cleans correctly, and allow 2 builds in a raw.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Fixes rebind wrapper
 
2
 The default upstream wrapper expects rebind.so to be next to the wrapper,
 
3
 this is not Debian policy compliant, so we're just fixing the wrapper.
 
4
Author: Philipp Hahn <hahn@univention.de>
 
5
Bug-Debian: http://bugs.debian.org/726304
 
6
Forwarded: no
 
7
Last-Update: 2013-12-08
 
8
 
 
9
--- websockify-0.5.1+dfsg1.orig/rebind
 
10
+++ websockify-0.5.1+dfsg1/rebind
 
11
@@ -1,5 +1,9 @@
 
12
 #!/usr/bin/env bash
 
13
 
 
14
+mydir="$(readlink -f "$(dirname "${0}")")"
 
15
+mylib="${mydir}/../lib/websockify/rebind.so"
 
16
+[ -e "${mylib}" ] || { echo "${mylib} not found" >&2; exit 1; }
 
17
+
 
18
 usage() {
 
19
     echo "Usage: $(basename $0) OLD_PORT NEW_PORT COMMAND_LINE"
 
20
     echo
 
21
@@ -9,10 +13,9 @@ usage() {
 
22
 }
 
23
 
 
24
 # Parameter defaults
 
25
-mydir=$(readlink -f $(dirname ${0}))
 
26
-
 
27
-export REBIND_PORT_OLD="${1}"; shift
 
28
-export REBIND_PORT_NEW="${1}"; shift
 
29
 
 
30
-LD_PRELOAD=${mydir}/rebind.so "${@}"
 
31
+export REBIND_PORT_OLD="${1}"
 
32
+export REBIND_PORT_NEW="${2}"
 
33
+shift 2
 
34
 
 
35
+LD_PRELOAD="${mylib}" exec "${@}"