blob: 6a5d6da676f43a416058db88c2c860592ccd0e3a (
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
Upstream-Status: Pending
update-ca-certificates: find SYSROOT relative to its own location
This makes the script relocatable.
Index: git/sbin/update-ca-certificates
===================================================================
--- git.orig/sbin/update-ca-certificates
+++ git/sbin/update-ca-certificates
@@ -37,6 +37,39 @@ do
shift
done
+
+if [ -z "$SYSROOT" ]; then
+ local_which () {
+ if [ $# -lt 1 ]; then
+ return 1
+ fi
+
+ (
+ IFS=:
+ for entry in $PATH; do
+ if [ -x "$entry/$1" ]; then
+ echo "$entry/$1"
+ exit 0
+ fi
+ done
+ exit 1
+ )
+ }
+
+ case "$0" in
+ */*)
+ sbindir=$(cd ${0%/*} && pwd)
+ ;;
+ *)
+ sbindir=$(cd $(dirname $(local_which $0)) && pwd)
+ ;;
+ esac
+ prefix=${sbindir%/*}
+ SYSROOT=${prefix%/*}
+ if [ ! -d "$SYSROOT/usr/share/ca-certificates" ]; then
+ SYSROOT=
+ fi
+fi
CERTSCONF=$SYSROOT/etc/ca-certificates.conf
CERTSDIR=$SYSROOT/usr/share/ca-certificates
LOCALCERTSDIR=$SYSROOT/usr/local/share/ca-certificates
|