Upstream-Status: Pending

From 724cb153ca0f607fb38b3a8db3ebb2742601cd81 Mon Sep 17 00:00:00 2001
From: Andreas Oberritter <obi@opendreambox.org>
Date: Tue, 19 Mar 2013 17:14:33 +0100
Subject: [PATCH 2/2] update-ca-certificates: use $SYSROOT

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 sbin/update-ca-certificates |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
index c567e3d..923b68a 100755
--- a/sbin/update-ca-certificates
+++ b/sbin/update-ca-certificates
@@ -37,11 +37,11 @@ do
   shift
 done
 
-CERTSCONF=/etc/ca-certificates.conf
-CERTSDIR=/usr/share/ca-certificates
-LOCALCERTSDIR=/usr/local/share/ca-certificates
+CERTSCONF=$SYSROOT/etc/ca-certificates.conf
+CERTSDIR=$SYSROOT/usr/share/ca-certificates
+LOCALCERTSDIR=$SYSROOT/usr/local/share/ca-certificates
 CERTBUNDLE=ca-certificates.crt
-ETCCERTSDIR=/etc/ssl/certs
+ETCCERTSDIR=$SYSROOT/etc/ssl/certs
 
 cleanup() {
   rm -f "$TEMPBUNDLE"
@@ -64,9 +64,9 @@ add() {
   PEM="$ETCCERTSDIR/$(basename "$CERT" .crt | sed -e 's/ /_/g' \
                                                   -e 's/[()]/=/g' \
                                                   -e 's/,/_/g').pem"
-  if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "$CERT" ]
+  if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "${CERT##$SYSROOT}" ]
   then
-    ln -sf "$CERT" "$PEM"
+    ln -sf "${CERT##$SYSROOT}" "$PEM"
     echo +$PEM >> "$ADDED"
   fi
   cat "$CERT" >> "$TEMPBUNDLE"
@@ -148,7 +148,7 @@ mv -f "$TEMPBUNDLE" "$CERTBUNDLE"
 
 echo "$ADDED_CNT added, $REMOVED_CNT removed; done."
 
-HOOKSDIR=/etc/ca-certificates/update.d
+HOOKSDIR=$SYSROOT/etc/ca-certificates/update.d
 echo -n "Running hooks in $HOOKSDIR...."
 VERBOSE_ARG=
 [ "$verbose" = 0 ] || VERBOSE_ARG=--verbose
-- 
1.7.10.4

