<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>156146</bug_id>
          
          <creation_ts>2006-11-24 10:16 0000</creation_ts>
          <short_desc>app-portage/euses-2.5.2: only prints &quot;Do you Gentoo?&quot; - problems in getportdir</short_desc>
          <delta_ts>2006-11-24 14:20:01 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>2006.1</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>Martin.vGagern@gmx.net</reporter>
          <assigned_to>jer@gentoo.org</assigned_to>
          <cc>tools-portage@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>Martin.vGagern@gmx.net</who>
            <bug_when>2006-11-24 10:16:04 0000</bug_when>
            <thetext>Whenever I try to use euses to find information about some USE flag, I only get a single line saying &quot;Do you Gentoo?&quot;.

A little ltrace reveals that euses checks PORTDIR and continues with &quot;(null)&quot; as value for PORTDIR. Looking at the source, the result from getenv is unconditionally passed to snprintf, and later on only its lengh is checked to be nonzero. So a nonexistant environment variable becoms a NULL pointer returned from getenv becomes the string &quot;(null)&quot; becomes euses idea of a valid PORTDIR.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Martin.vGagern@gmx.net</who>
            <bug_when>2006-11-24 10:48:35 0000</bug_when>
            <thetext>Created an attachment (id=102671)
euses-2.5.2-getportdir.patch

This at least lets getportdir check if the environment variable is set. If so, use it, if not, check make.globales and make.conf.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jer@gentoo.org</who>
            <bug_when>2006-11-24 14:19:29 0000</bug_when>
            <thetext>Sorry, I thought I had already fixed that. Seems I didn&apos;t publish the fixed version yet. 2.5.3 is in the tree with a fix similar to your patch. Thank you very much for the bug report.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jer@gentoo.org</who>
            <bug_when>2006-11-24 14:20:01 0000</bug_when>
            <thetext>Forgot an option.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>102671</attachid>
            <date>2006-11-24 10:48 0000</date>
            <desc>euses-2.5.2-getportdir.patch</desc>
            <filename>euses-2.5.2-getportdir.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGV1c2VzLTIuNS4yL2V1c2VzLmMJMjAwNi0xMS0yNCAxOToxODowNy4wMDAwMDAwMDAgKzAx
MDAKKysrIHdvcmsvZXVzZXMuYwkyMDA2LTExLTI0IDE5OjIxOjI4LjAwMDAwMDAwMCArMDEwMApA
QCAtMTI4LDEwICsxMjgsMTMgQEAKIAlGSUxFICpmZDsKIAogCS8qIENoZWNrIGlmIFBPUlRESVIg
aXMgc2V0IGluIHRoZSBlbnZpcm9ubWVudCAqLwotCXNucHJpbnRmKHBvcnRkaXIsIEZJTEVOQU1F
X01BWCwgIiVzIiwgZ2V0ZW52KCJQT1JURElSIikpOworCWNoYXIgKmVudnBvcnRkaXIgPSBnZXRl
bnYoIlBPUlRESVIiKTsKKwlpZiAoZW52cG9ydGRpciAhPSBOVUxMKSB7CisJCXNucHJpbnRmKHBv
cnRkaXIsIEZJTEVOQU1FX01BWCwgIiVzIiwgZW52cG9ydGRpcik7CisJfQogCiAJLyogb3IgbG9h
ZCBpdCBmcm9tIG1ha2Uue2dsb2JhbHMsY29uZn0gKi8KLQlpZiAoc3RybGVuKHBvcnRkaXIpID09
IDApIHsKKwllbHNlIHsKIAkJLyogT3BlbiBhIHBpcGUgdG8gc2ggKi8KIAkJZmQgPSBwb3Blbigi
c291cmNlICIgU1lTQ09ORkRJUiAiL21ha2UuZ2xvYmFsczsiICJzb3VyY2UgIgogCQkJICAgU1lT
Q09ORkRJUiAiL21ha2UuY29uZiIgIjsiICJlY2hvIC1uICR7UE9SVERJUn0iLAo=
</data>        

          </attachment>
    </bug>

</bugzilla>