summaryrefslogtreecommitdiffstats
path: root/patches/01_hardcode-shell-and-hide-getopt-error.patch
blob: 51f9380541d8443c2d1ac175b575000ca7cdc8dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: "P. J. McDermott" <pjm@nac.net>
Description: Hardcode shell interpreter and hide BusyBox getopt error
 When building fakeroot on a GNU system, configure sets SHELL to /bin/bash.  The
 resulting fakeroot script then can't be run on ProteanOS without manually
 executing the correct shell interpreter.
 .
 BusyBox's getopt applet doesn't recognize the "--version" option, so fakeroot
 ends up printing BusyBox's long error message.

diff -Naur src.orig/scripts/fakeroot.in src/scripts/fakeroot.in
--- src.orig/scripts/fakeroot.in	2011-11-30 23:00:36.000000000 -0500
+++ src/scripts/fakeroot.in	2013-06-03 18:25:46.040882928 -0400
@@ -1,4 +1,4 @@
-#!@SHELL@
+#!/bin/sh
 
 # This script first starts faked (the daemon), and then it will run
 # the requested program with fake root privileges.
@@ -43,7 +43,7 @@
 
 libfound=no
 
-GETOPTEST=`getopt --version`
+GETOPTEST=`getopt --version 2>/dev/null`
 case $GETOPTEST in
 getopt*) # GNU getopt
     FAKE_TEMP=`getopt -l lib: -l faked: -l unknown-is-real -l fd-base: -l version -l help -- +l:f:i:s:ub:vh "$@"`