<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>2723</bug_id>
          
          <creation_ts>2012-07-09 15:47:55 +0000</creation_ts>
          <short_desc>automatic ldconfig does not always work properly</short_desc>
          <delta_ts>2012-09-04 01:50:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>configuration</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Hatle">mark.hatle</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>liang.li2</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>sgw</cc>
    
    <cc>song.liu</cc>
    
    <cc>zhenfeng.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>22906</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2012-07-09 15:47:55 +0000</bug_when>
    <thetext>Two related items:

If baselib != &quot;lib&quot;, there is a check in

&gt; python package_do_shlibs() {
&gt;          import re, pipes
&gt;
&gt;          exclude_shlibs = d.getVar(&apos;EXCLUDE_FROM_SHLIBS&apos;, 0)
&gt;          if exclude_shlibs:
&gt;                  bb.note(&quot;not generating shlibs&quot;)
&gt;                  return
&gt;
&gt;          lib_re = re.compile(&quot;^.*\.so&quot;)
&gt;          libdir_re = re.compile(&quot;.*/lib$&quot;)

The check should really be (or similar):

re.compile(&quot;.*/%s$&quot; % d.getVar(&apos;baselib&apos;, True))


Then once the additional libraries are found, the ldconfig call will be automatically added..  the second issue happens when this call is made in a filesystem that does -not- contain ldconfig:


&gt; in package_do_shlibs, we see:
&gt;
&gt;                 if needs_ldconfig and use_ldconfig:
&gt;                          bb.debug(1, &apos;adding ldconfig call to postinst for %s&apos; % pkg)
&gt;                          postinst = d.getVar(&apos;pkg_postinst_%s&apos; % pkg, True) or d.getVar(&apos;pkg_postinst&apos;, Tru
&gt; e)
&gt;                          if not postinst:
&gt;                                  postinst = &apos;#!/bin/sh\n&apos;
&gt;                          postinst += d.getVar(&apos;ldconfig_postinst_fragment&apos;, True)
&gt;                          d.setVar(&apos;pkg_postinst_%s&apos; % pkg, postinst)
&gt;
&gt; I see that ldconfig_postinst_frament is:
&gt;
&gt; ldconfig_postinst_fragment() {
&gt; if [ x&quot;$D&quot; = &quot;x&quot; ]; then
&gt;          [ -x /sbin/ldconfig ] &amp;&amp; /sbin/ldconfig
&gt; fi
&gt; }

The problem is, at least in the case of RPM, the shell is run to check for non-zero return codes.  The [ -x /sbin/ldconfig ] returns non-zero, so the &amp;&amp; never runs.. but the status is also never cleared.  This leads to an install failure.

My suggestion is to replace the line with:

if [ -x /sbin/ldconfig ]; then /sbin/ldconfig ; fi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24478</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2012-08-27 03:41:28 +0000</bug_when>
    <thetext>This one had already been fixed by Amy Fong:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b1c2b57b3eaf1d96985b60746555fd4d69bbed1c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24772</commentid>
    <comment_count>2</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-09-04 01:50:42 +0000</bug_when>
    <thetext>verified.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>