Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 381937 - app-misc/ca-certificates-20110502-r2 installs broken symlinks
Summary: app-misc/ca-certificates-20110502-r2 installs broken symlinks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-05 13:02 UTC by MATSUI Tetsushi
Modified: 2013-05-29 23:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MATSUI Tetsushi 2011-09-05 13:02:22 UTC
The portage warns about broken symlinks when emerged app-misc/ca-certificates-20110504-r2,
and in fact the symlinks point files in a wrong directory. For example:

$ cd $EPREFIX
$ ls -l etc/ssl/certs/t*
lrwxrwxrwx 1 tetsushi staff 61 Sep  5 10:22 etc/ssl/certs/thawte_Primary_Root_CA.pem -> /usr/share/ca-certificates/mozilla/thawte_Primary_Root_CA.crt
lrwxrwxrwx 1 tetsushi staff 66 Sep  5 10:22 etc/ssl/certs/thawte_Primary_Root_CA_-_G2.pem -> /usr/share/ca-certificates/mozilla/thawte_Primary_Root_CA_-_G2.crt
lrwxrwxrwx 1 tetsushi staff 66 Sep  5 10:22 etc/ssl/certs/thawte_Primary_Root_CA_-_G3.pem -> /usr/share/ca-certificates/mozilla/thawte_Primary_Root_CA_-_G3.crt

The link /usr/share/... should be $EPREFIX/usr/share/...


I don't exactly know how to solve the issue, but I guess it is caused by stripping $ROOT from $CERT in function add of update-ca-certificates script.
Comment 1 Fabian Groffen gentoo-dev 2011-09-05 17:45:17 UTC
update-ca-certificates is broken after the migration to gx86

--root support isn't enough for prefix support
Comment 2 Fabian Groffen gentoo-dev 2011-09-05 18:07:35 UTC
@base-system: to solve this mess, I need the following changes:

diff -u -r1.3 ca-certificates-20110502-r2.ebuild
--- ca-certificates-20110502-r2.ebuild  3 Sep 2011 17:33:45 -0000       1.3
+++ ca-certificates-20110502-r2.ebuild  5 Sep 2011 18:03:45 -0000
@@ -31,13 +31,21 @@
 }
 
 src_unpack() {
+       if [[ -n ${EPREFIX} ]] ; then
+               # need to perform everything in the offset, #381937
+               mkdir -p "./${EPREFIX}"
+               cd "./${EPREFIX}" || die
+       fi
        unpack ${A}
        unpack ./data.tar.gz
        rm -f control.tar.gz data.tar.gz debian-binary
 }
 
 src_prepare() {
+       cd "./${EPREFIX}" || die
        epatch "${FILESDIR}"/${PN}-20090709-root.patch
+       sed -i -e '/="$ROOT/s:ROOT/:ROOT'"${EPREFIX}"'/:' \
+               usr/sbin/update-ca-certificates || die
 }
 
 src_compile() {
@@ -45,17 +53,15 @@
        echo "# Automatically generated by ${CATEGORY}/${PF}"
        echo "# $(date -u)"
        echo "# Do not edit."
-       cd "${S}"/usr/share/ca-certificates
+       cd "${S}${EPREFIX}"/usr/share/ca-certificates
        find * -name '*.crt' | LC_ALL=C sort
-       ) > "${S}"/etc/ca-certificates.conf
+       ) > "${S}${EPREFIX}"/etc/ca-certificates.conf
 
-       sed -i "/^ROOT=""/s:=.*:='${EPREFIX}':" "${S}"/usr/sbin/update-ca-certificates || die
-       "${S}"/usr/sbin/update-ca-certificates --root "${S}"
+       "${S}${EPREFIX}"/usr/sbin/update-ca-certificates --root "${S}"
 }
 
 src_install() {
-       mkdir -p "${ED}"
-       cp -pPR * "${ED}"/ || die
+       cp -pPR * "${D}"/ || die
 
        mv "${ED}"/usr/share/doc/{ca-certificates,${PF}} || die
        prepalldocs
cvs diff: Diffing files
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-09-05 19:06:20 UTC
grobian:
+1 for you to commit it w/ a revbump
Comment 4 Fabian Groffen gentoo-dev 2011-09-05 19:56:55 UTC
(In reply to comment #3)
> +1 for you to commit it w/ a revbump

obviously, thanks!
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-09-06 14:09:14 UTC
Oops, did not fully complete testing when I committed the first version. Sorry for the trouble(s). =/