Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-misc/ca-certificates/files: ca-certificates-20090709-root.patch
Date: Fri, 02 Sep 2011 17:47:28
Message-Id: 20110902174717.E17632004C@flycatcher.gentoo.org
1 vapier 11/09/02 17:47:17
2
3 Added: ca-certificates-20090709-root.patch
4 Log:
5 Move the config file generation to src_compile for most people to make binpkgs easier to deploy.
6
7 (Portage version: 2.2.0_alpha51/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-misc/ca-certificates/files/ca-certificates-20090709-root.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/ca-certificates/files/ca-certificates-20090709-root.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-misc/ca-certificates/files/ca-certificates-20090709-root.patch?rev=1.1&content-type=text/plain
14
15 Index: ca-certificates-20090709-root.patch
16 ===================================================================
17 --- a/usr/sbin/update-ca-certificates
18 +++ b/usr/sbin/update-ca-certificates
19 @@ -23,6 +23,7 @@
20
21 verbose=0
22 fresh=0
23 +ROOT=""
24 while [ $# -gt 0 ];
25 do
26 case $1 in
27 @@ -30,6 +31,9 @@
28 verbose=1;;
29 --fresh|-f)
30 fresh=1;;
31 + --root|-r)
32 + ROOT=$(readlink -f "$2")
33 + shift;;
34 --help|-h|*)
35 - echo "$0: [--verbose] [--fresh]"
36 + echo "$0: [--verbose] [--fresh] [--root <dir>]"
37 exit;;
38 @@ -37,11 +41,11 @@
39 shift
40 done
41
42 -CERTSCONF=/etc/ca-certificates.conf
43 -CERTSDIR=/usr/share/ca-certificates
44 -LOCALCERTSDIR=/usr/local/share/ca-certificates
45 +CERTSCONF="$ROOT/etc/ca-certificates.conf"
46 +CERTSDIR="$ROOT/usr/share/ca-certificates"
47 +LOCALCERTSDIR="$ROOT/usr/local/share/ca-certificates"
48 CERTBUNDLE=ca-certificates.crt
49 -ETCCERTSDIR=/etc/ssl/certs
50 +ETCCERTSDIR="$ROOT/etc/ssl/certs"
51
52 cleanup() {
53 rm -f "$TEMPBUNDLE"
54 @@ -66,7 +70,7 @@
55 -e 's/,/_/g').pem"
56 if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "$CERT" ]
57 then
58 - ln -sf "$CERT" "$PEM"
59 + ln -sf "${CERT#$ROOT}" "$PEM"
60 echo +$PEM >> "$ADDED"
61 fi
62 cat "$CERT" >> "$TEMPBUNDLE"
63 @@ -78,22 +82,22 @@
64 if test -L "$PEM"
65 then
66 rm -f "$PEM"
67 - echo -$PEM >> "$REMOVED"
68 + echo "-$PEM" >> "$REMOVED"
69 fi
70 }
71
72 -cd $ETCCERTSDIR
73 +cd "$ETCCERTSDIR"
74 if [ "$fresh" = 1 ]; then
75 echo -n "Clearing symlinks in $ETCCERTSDIR..."
76 find . -type l -print | while read symlink
77 do
78 - case $(readlink $symlink) in
79 - $CERTSDIR*) rm -f $symlink;;
80 + case $(readlink "$symlink") in
81 + "$CERTSDIR"*) rm -f "$symlink";;
82 esac
83 done
84 find . -type l -print | while read symlink
85 do
86 - test -f $symlink || rm -f $symlink
87 + test -f "$symlink" || rm -f "$symlink"
88 done
89 echo "done."
90 fi
91 @@ -102,12 +106,12 @@
92
93 # Handle certificates that should be removed. This is an explicit act
94 # by prefixing lines in the configuration files with exclamation marks (!).
95 -sed -n -e '/^$/d' -e 's/^!//p' $CERTSCONF | while read crt
96 +sed -n -e '/^$/d' -e 's/^!//p' "$CERTSCONF" | while read crt
97 do
98 remove "$CERTSDIR/$crt"
99 done
100
101 -sed -e '/^$/d' -e '/^#/d' -e '/^!/d' $CERTSCONF | while read crt
102 +sed -e '/^$/d' -e '/^#/d' -e '/^!/d' "$CERTSCONF" | while read crt
103 do
104 if ! test -f "$CERTSDIR/$crt"
105 then
106 @@ -146,14 +150,14 @@
107
108 echo "$ADDED_CNT added, $REMOVED_CNT removed; done."
109
110 -HOOKSDIR=/etc/ca-certificates/update.d
111 +HOOKSDIR="$ROOT/etc/ca-certificates/update.d"
112 echo -n "Running hooks in $HOOKSDIR...."
113 VERBOSE_ARG=
114 [ "$verbose" = 0 ] || VERBOSE_ARG=--verbose
115 -eval run-parts $VERBOSE_ARG --test -- $HOOKSDIR | while read hook
116 +eval run-parts $VERBOSE_ARG --test -- \""$HOOKSDIR"\" | while read hook
117 do
118 ( cat $ADDED
119 - cat $REMOVED ) | $hook || echo E: $hook exited with code $?.
120 + cat $REMOVED ) | "$hook" || echo E: "$hook" exited with code $?.
121 done
122 echo "done."