patch-sbin_update-ca-certificates 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. - prefix absolute paths with $DESTDIR
  2. - subtract DESTDIR from the link name when linking
  3. - add DESTDIR again when catting certs together (Yay.)
  4. --- ca-certificates-20090814.orig/sbin/update-ca-certificates 2009-07-08 23:23:12.000000000 +0200
  5. +++ ca-certificates-20090814/sbin/update-ca-certificates 2009-08-22 21:10:24.210186675 +0200
  6. @@ -37,11 +37,11 @@ do
  7. shift
  8. done
  9. -CERTSCONF=/etc/ca-certificates.conf
  10. -CERTSDIR=/usr/share/ca-certificates
  11. -LOCALCERTSDIR=/usr/local/share/ca-certificates
  12. +CERTSCONF=${DESTDIR}/etc/ca-certificates.conf
  13. +CERTSDIR=${DESTDIR}/usr/share/ca-certificates
  14. +LOCALCERTSDIR=${DESTDIR}/usr/local/share/ca-certificates
  15. CERTBUNDLE=ca-certificates.crt
  16. -ETCCERTSDIR=/etc/ssl/certs
  17. +ETCCERTSDIR=${DESTDIR}/etc/ssl/certs
  18. cleanup() {
  19. rm -f "$TEMPBUNDLE"
  20. @@ -60,7 +60,7 @@ REMOVED="$(mktemp -t "ca-certificates.tm
  21. # in /etc/ssl/certs to the certificate file and its inclusion into the
  22. # bundle.
  23. add() {
  24. - CERT="$1"
  25. + CERT="${1##${DESTDIR}}"
  26. PEM="$ETCCERTSDIR/$(basename "$CERT" .crt | sed -e 's/ /_/g' \
  27. -e 's/[()]/=/g' \
  28. -e 's/,/_/g').pem"
  29. @@ -69,7 +69,7 @@ add() {
  30. ln -sf "$CERT" "$PEM"
  31. echo +$PEM >> "$ADDED"
  32. fi
  33. - cat "$CERT" >> "$TEMPBUNDLE"
  34. + cat "${DESTDIR}/$CERT" >> "$TEMPBUNDLE"
  35. }
  36. remove() {
  37. @@ -146,7 +146,7 @@ fi
  38. echo "$ADDED_CNT added, $REMOVED_CNT removed; done."
  39. -HOOKSDIR=/etc/ca-certificates/update.d
  40. +HOOKSDIR=${DESTDIR}/etc/ca-certificates/update.d
  41. echo -n "Running hooks in $HOOKSDIR...."
  42. VERBOSE_ARG=
  43. [ "$verbose" = 0 ] || VERBOSE_ARG=--verbose