]> git.pld-linux.org Git - packages/ca-certificates.git/blob - ca-certificates-etc-certs.patch
- allow placing ca certs in /etc/certs (I'm fed up with messing in /usr)
[packages/ca-certificates.git] / ca-certificates-etc-certs.patch
1 --- ca-certificates/sbin/update-ca-certificates 2008-11-01 18:39:19.000000000 +0100
2 +++ ca-certificates/sbin/update-ca-certificates-local   2008-11-01 19:17:39.138384960 +0100
3 @@ -37,6 +37,7 @@
4  
5  CERTSCONF=/etc/ca-certificates.conf
6  CERTSDIR=/usr/share/ca-certificates
7 +LOCALCERTSDIR=/etc/certs
8  CERTBUNDLE=/etc/openssl/ca-certificates.crt
9  ETCCERTSDIR=/etc/openssl/certs
10  cd $ETCCERTSDIR
11 @@ -46,6 +47,7 @@
12    do
13       case $(readlink $symlink) in
14       $CERTSDIR*) rm -f $symlink;;
15 +     $LOCALCERTSDIR*) rm -f $symlink;;
16       esac
17    done
18    find . -type l -print | while read symlink
19 @@ -60,7 +62,7 @@
20  removed="$(sed -ne 's/^!//p' $CERTSCONF | while read crt
21  do
22   if test "$crt" = ""; then continue; fi
23 - pem=$(basename "$crt" .crt).pem
24 + pem=$(basename "$crt" | sed 's/.crt$/.pem/')
25   if test -e "$pem"; then
26    rm -f "$pem"
27    echo "-$ETCCERTSDIR/$pem"
28 @@ -70,11 +72,16 @@
29  added="$(sed -e '/^#/d' -e '/^!/d' $CERTSCONF | while read crt
30  do
31   if test "$crt" = ""; then continue; fi
32 - if ! test -f "$CERTSDIR/$crt"; then continue; fi
33 - pem=$(basename "$crt" .crt).pem
34 + if ! test -f "$CERTSDIR/$crt" && ! test -f "$LOCALCERTSDIR/$crt" ; then continue; fi
35 + pem=$(basename "$crt" | sed 's/.crt$/.pem/')
36   if ! test -e "$pem"; then echo "+$ETCCERTSDIR/$pem"; fi
37 - ln -sf "$CERTSDIR/$crt" "$pem"
38 - cat "$CERTSDIR/$crt" >> "$bundletmp"
39 + if test -f "$CERTSDIR/$crt" ; then
40 +  ln -sf "$CERTSDIR/$crt" "$pem"
41 +  cat "$CERTSDIR/$crt" >> "$bundletmp"
42 + elif test -f "$LOCALCERTSDIR/$crt" ; then
43 +  ln -sf "$LOCALCERTSDIR/$crt" "$pem"
44 +  cat "$LOCALCERTSDIR/$crt" >> "$bundletmp"
45 + fi
46  done)"
47  chmod 0644 "$bundletmp"
48  mv -f "$bundletmp" "$CERTBUNDLE"
This page took 0.032422 seconds and 3 git commands to generate.