Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 486214 - =x11-libs/pango-1.30.1: pkg_postinst() creates corrupted pango.modules file containing ROOT prefix
Summary: =x11-libs/pango-1.30.1: pkg_postinst() creates corrupted pango.modules file c...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-27 19:32 UTC by Dyweni
Modified: 2014-06-26 10:00 UTC (History)
2 users (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 Dyweni 2013-09-27 19:32:35 UTC
x11-libs/pango-1.30.1 includes the contents of the ROOT environment variable when it executes the pkg_postinst() function...

The ROOT environment variable is set to force portage to install x11-libs/pango-1.30.1 into an alternate root location.  That location is preserved in the auto generated pango.modules file.  This should not be happening.



Reproducible: Always

Steps to Reproduce:
ROOT=/dev/shm/tmp.mt5fasI6HQ  emerge -Kqv =x11-libs/pango-1.30.1
Actual Results:  
Pango.modules file is corrupt (notice the ROOT variable prefix in the paths):

# Pango Modules file
# Automatically generated file, do not edit
#
/dev/shm/tmp.mt5fasI6HQ/usr/lib64/pango/1.6.0/modules/pango-arabic-fc.so ArabicScriptEngineFc PangoEngineShape PangoRenderFc arabic:* nko:*
/dev/shm/tmp.mt5fasI6HQ/usr/lib64/pango/1.6.0/modules/pango-arabic-lang.so ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*




Expected Results:  
Pango.modules file should not contain the ROOT variable prefix

# Pango Modules file
# Automatically generated file, do not edit
#
/usr/lib64/pango/1.6.0/modules/pango-arabic-fc.so ArabicScriptEngineFc PangoEngineShape PangoRenderFc arabic:* nko:*
/usr/lib64/pango/1.6.0/modules/pango-arabic-lang.so ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*
Comment 1 Pacho Ramos gentoo-dev 2013-09-29 10:47:11 UTC
We need to add ${EROOT} to support prefix, I am not sure if what you are trying to do it valid :/
Comment 2 Fabian Groffen gentoo-dev 2013-10-20 19:29:09 UTC
you could strip off $ROOT again from what you store, e.g.:

--- pango-1.30.1.ebuild 30 Apr 2013 14:04:19 -0000      1.13
+++ pango-1.30.1.ebuild 20 Oct 2013 19:28:58 -0000
@@ -78,7 +78,7 @@
        if pango-querymodules --system \
                "${EROOT}"usr/$(get_libdir)/pango/1.6.0/modules/*$(get_modname) \
                        > "${tmp_file}"; then
-               cat "${tmp_file}" > "${pango_conf}" || {
+               sed "s:^${ROOT}::" "${tmp_file}" > "${pango_conf}" || {
                        rm "${tmp_file}"; die; }
        else
                ewarn "Cannot update pango.modules, file generation failed"
Comment 3 Bruno 2014-03-29 15:39:57 UTC
Still applies to =x11-libs/pango-1.36.2.

Fabian, it may be wise to make sure $ROOT is not '/'-terminated so the resulting paths are absolute (not sure if portage does any sanitizing of $ROOT).
Comment 4 Fabian Groffen gentoo-dev 2014-03-30 06:34:44 UTC
(In reply to Bruno from comment #3)
> Still applies to =x11-libs/pango-1.36.2.
> 
> Fabian, it may be wise to make sure $ROOT is not '/'-terminated so the
> resulting paths are absolute (not sure if portage does any sanitizing of
> $ROOT).

From PMS (see Chapter 11 from e.g. http://dev.gentoo.org/~ulm/pms/head/pms.html):

ROOT must be non-empty and end in a trailing slash. 

so to do what you suggested, the sed needs to be changed to

sed "s:^${ROOT}:/:" "${tmp_file}" > "${pango_conf}" || {
Comment 5 Pacho Ramos gentoo-dev 2014-06-26 10:00:52 UTC
+  26 Jun 2014; Pacho Ramos <pacho@gentoo.org> pango-1.36.5.ebuild:
+  Raise gtk-doc dependency (#503510 by headcrabextra), handle ROOT in
+  pango.modules generation (#486214 by LeeL and Fabian Groffen)
+