<?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>117440</bug_id>
          
          <creation_ts>2006-01-02 05:27 0000</creation_ts>
          <short_desc>2.1_pre2 DISTDIR symlinking breaks cvs svn fetch</short_desc>
          <delta_ts>2006-02-21 16:40:53 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Portage Development</product>
          <component>Core - Configuration</component>
          <version>2.1</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <keywords>InSVN, REGRESSION</keywords>
          <priority>P2</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>115839</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>a@gaydenko.com</reporter>
          <assigned_to>dev-portage@gentoo.org</assigned_to>
          <cc>boneyfrog@gmail.com</cc>
    
    <cc>darktama@iinet.net.au</cc>
    
    <cc>dirtyepic@gentoo.org</cc>
    
    <cc>emilbeinroth@gmx.net</cc>
    
    <cc>ferringb@gmail.com</cc>
    
    <cc>hanno@gentoo.org</cc>
    
    <cc>soul@nerdshack.com</cc>

      

      
          <long_desc isprivate="0">
            <who>a@gaydenko.com</who>
            <bug_when>2006-01-02 05:27:12 0000</bug_when>
            <thetext>Unfortunately, I can not specify which concrete syncing caused this problem. The problem is: all xxx-cvs.ebuild and xxx-svn.ebuild files fetch/update repositories to/in PORTAGE_TMPDIR instead of DISTDIR. You see, a fetching the whole repo tree discredits repo idea at all.

I have not found anything cvs/svn-src dirs specific in &apos;man make.conf&apos;. portage-2.1_pre3-r1 is in use.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>darktama@iinet.net.au</who>
            <bug_when>2006-01-02 16:46:16 0000</bug_when>
            <thetext>This appears to be an issue specific to portage-2.1_pre3-r1, if I reinstall portage-2.1_pre2 cvs ebuilds (specifically, x11-libs/evas) works correctly.  I&apos;ve worked around the issue by adding these to my make.conf:
    ECVS_TOP_DIR=&quot;/usr/portage/distfiles/cvs-src&quot;
    ESVN_STORE_DIR=&quot;/usr/portage/distfiles/svn-src&quot;

Expected behaviour (&lt;=portage-2.1_pre2):
    * Fetching CVS module e17/libs/evas into /usr/portage/distfiles/cvs-src ...

Behaviour with portage-2.1_pre3-r1:
    * Fetching CVS module e17/libs/evas into /var/tmp/portage/evas-9999/distdir/cvs-src ...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-01-02 18:36:41 0000</bug_when>
            <thetext>*** Bug 117526 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferringb@gmail.com</who>
            <bug_when>2006-01-04 13:37:33 0000</bug_when>
            <thetext>*** Bug 117784 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferringb@gmail.com</who>
            <bug_when>2006-01-04 13:38:45 0000</bug_when>
            <thetext>Suggested from ciaran is addition of another var that holds the actual distdir,
and modify eclasses in question to use that directory.  Would work, although
I&apos;d like solar&apos;s input on any outstanding perm/security issues with our
existing cvs/svn handling- that and any suggestions of improvements we should
do since the opportunity exists now.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-01-04 16:30:41 0000</bug_when>
            <thetext>Perhaps for an ugly interim hack, the eclasses can be modified to use `portageq envvar DISTDIR`. :)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2006-01-05 09:54:57 0000</bug_when>
            <thetext>(In reply to comment #4)
&gt; Suggested from ciaran is addition of another var that holds the actual distdir,
&gt; and modify eclasses in question to use that directory.  Would work, although



&gt; I&apos;d like solar&apos;s input on any outstanding perm/security issues with our
&gt; existing cvs/svn handling- that and any suggestions of improvements we should
&gt; do since the opportunity exists now.

Well even with the change to making cvs/svn/live ebuilds save files to another 
dir other than $DISTDIR wont solve the real problem of any user in the 
portage group can gain uid 0 pretty easy.

The default /var/tmp/portage itself is a big apart of the risk due to the ../ 
being 2777 (pick any of the RPATH bugs for a perfect example) and users &amp; devs 
alike doing stuff like rm -rf /var/tmp/portage

Now for the DISTDIR handling in general. I&apos;m kinda opposed to distdir mangling 
as it invalidates perfectly valid existing scripts that do stuff like post merge 
distdir cleanups. Another var would solve that but then poof we just added quite 
a bit of complexity to every existing script.

So whats the real gain of DISTDIR= symlinking? Does it need to be enabled for 
every EBUILD_PHASE or was it&apos;s goal to solve a specific problem with a specific 
phase?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-01-06 10:55:41 0000</bug_when>
            <thetext>Created an attachment (id=76363)
2.1_pre3-distdir-revert.patch

If you urgently need to use the cvs/svn eclasses, this well revert the &quot;magic&quot; distdir behavior.  It backs out the relevant hunk from here: http://sources.gentoo.org/viewcvs.py/portage/main/trunk/pym/portage.py?r1=2469&amp;r2=2474</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferringb@gmail.com</who>
            <bug_when>2006-01-06 23:12:50 0000</bug_when>
            <thetext>&gt; Now for the DISTDIR handling in general. I&apos;m kinda opposed to distdir mangling 
&gt; as it invalidates perfectly valid existing scripts that do stuff like post
&gt; merge distdir cleanups. Another var would solve that but then poof we just 
&gt; added quite a bit of complexity to every existing script.
Not worried about breaking your script; design wise, your post distfile cleansing should occur in a different manner.
 
&gt; So whats the real gain of DISTDIR= symlinking? Does it need to be enabled for 
&gt; every EBUILD_PHASE or was it&apos;s goal to solve a specific problem with a
&gt; specific phase?
Gain is there is no unstated access to DISTDIR by ebuilds.  Does a number on restrict=&quot;fetch&quot; packages where devs forget to list a file in SRC_URI; does the same for normal packages, also.

It also lays the ground work for multiple distdirs, although that&apos;s minor.

Exempting cvs/svn reasons, not going to revert this change without further args against it- the QA benefit outweigh breaking some custom trickery (sorry :/ )
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2006-01-07 08:40:27 0000</bug_when>
            <thetext>Brian,
Simply saying &quot;it should occur in a different manner&quot; is not enough nor  
a good way to work with others on the team. This should remain a
REGRESSION blocking any releases till such time as an alt variable is
provided when needing to access the real DISTDIR=
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferringb@gmail.com</who>
            <bug_when>2006-01-07 15:14:50 0000</bug_when>
            <thetext>It *is* a regression, see the keywords.

No stable release till it&apos;s fixed, meanwhile the 2.1 releases are developmental releases- bugs do occur.

Not going to leave it broke, it will be fixed so just relax.  Right now the nasty var hack works, but I&apos;d rather avoid that so I&apos;m digging around for other stuff.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferringb@gmail.com</who>
            <bug_when>2006-01-07 16:15:54 0000</bug_when>
            <thetext>Created an attachment (id=76492)
fixup.patch

Apply this manually for testing please, it adds PORTAGE_ACTUAL_DISTDIR var setting to portage.

already modified the eclasses in question to use this var if available, so it should revert the regression.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>a@gaydenko.com</who>
            <bug_when>2006-01-08 08:36:34 0000</bug_when>
            <thetext>
&gt; Apply this manually for testing please, it adds PORTAGE_ACTUAL_DISTDIR var
&gt; setting to portage.

I&apos;m not portage developer. What must I test? OK, I can patch &apos;portage.py&apos; file. And ... what? Must I modify &apos;make.conf&apos;? xxx-svn/xxx-cvs ebuilds?

I&apos;m ready, but I don&apos;t know what to do :-)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robert.kruus@utoronto.ca</who>
            <bug_when>2006-01-09 08:42:03 0000</bug_when>
            <thetext>seems to work here.  just have to mke sure those svn/cvs ebuilds/eclasses now use the PORTAGE_ACTUAL_DISTDIR where required</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>harmgeerts@home.nl</who>
            <bug_when>2006-01-09 18:36:34 0000</bug_when>
            <thetext>works for me as well.

@Andrew: The cvs/svn ebuild you want to merge should contain a line similar to this:
ECVS_TOP_DIR=&quot;${DISTDIR}/cvs-src/${PN}&quot;

If it doesn&apos;t then add it yourself, then replace the DISTDIR variable like this:
ECVS_TOP_DIR=&quot;${PORTAGE_ACTUAL_DISTDIR}/cvs-src/${PN}&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferringb@gmail.com</who>
            <bug_when>2006-01-09 18:57:31 0000</bug_when>
            <thetext>ECVS_TOP_DIR=&quot;${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src/&quot;
^^^ use that instead.  ECVS_TOP_DIR doesn&apos;t specify the PN iirc, plus the var substitution I tagged in there is compatible both with older portages and with portages that have the symlinking in use.

All in all, only 4 mods in the tree for this- people shouldn&apos;t have to duplicate it themselves, but if they need to, raid from subversion.eclass and/or cvs.eclass for example of how to do it.

commited, meanwhile.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>a@gaydenko.com</who>
            <bug_when>2006-01-10 00:29:17 0000</bug_when>
            <thetext>(In reply to comment #15)
&gt; ECVS_TOP_DIR=&quot;${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src/&quot;
&gt; ^^^ use that instead.

I have tried to replace

ECVS_TOP_DIR=&quot;${DISTDIR}/cvs-src&quot;

string with this one:

ECVS_TOP_DIR=&quot;${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src/&quot;

Nevertheless, I have got:

&gt;&gt;&gt; checksums files   ;-) files/digest-pcb-cvs-0.3
&gt;&gt;&gt; Unpacking source...
 * Fetching CVS module pcb into /wrk/tmp/portage/portage/pcb-cvs-0.3/distdir/cvs-src/ ...


I have 

DISTDIR=&quot;/x/portage/distfiles&quot;
PORTAGE_TMPDIR=&quot;/wrk/tmp/portage&quot;

in my make.conf file. Have I missed something? Must I reopen the issue? Must I supply some additional info?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferringb@gmail.com</who>
            <bug_when>2006-01-10 01:46:00 0000</bug_when>
            <thetext>(In reply to comment #16)
&gt; string with this one:
&gt; ECVS_TOP_DIR=&quot;${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src/&quot;
&gt; 
&gt; Nevertheless, I have got:
&gt;  * Fetching CVS module pcb into
&gt; /wrk/tmp/portage/portage/pcb-cvs-0.3/distdir/cvs-src/ ...
Assuming you&apos;re not running with the patch ;)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>a@gaydenko.com</who>
            <bug_when>2006-01-10 02:48:17 0000</bug_when>
            <thetext>(In reply to comment #17)
&gt; Assuming you&apos;re not running with the patch ;)

You are right. I was not waked up completely :-) With the patch I was able to do a work with one of my &apos;-cvs&apos; ebuild. 

Thanks!



</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>emilbeinroth@gmx.net</who>
            <bug_when>2006-01-12 10:43:52 0000</bug_when>
            <thetext>${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}} would be the correct syntax.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>emilbeinroth@gmx.net</who>
            <bug_when>2006-01-12 14:10:07 0000</bug_when>
            <thetext>I blame solar winds for my last comment.
Sorry about that ..</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2006-02-21 16:40:53 0000</bug_when>
            <thetext>*** Bug 123644 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>76363</attachid>
            <date>2006-01-06 10:55 0000</date>
            <desc>2.1_pre3-distdir-revert.patch</desc>
            <filename>2.1_pre3-distdir-revert.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">SW5kZXg6IHBvcnRhZ2UtMi4xX3ByZTMtcjEvcHltL3Bvc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9CVUlMRERJUiJd
LCAiZGlzdGRpciIpCi0JCWlmIG9zLnBhdGguZXhpc3RzKGVkcGF0aCk6Ci0JCQl0cnk6Ci0JCQkJ
aWYgb3MucGF0aC5pc2RpcihlZHBhdGgpIGFuZCBub3Qgb3MucGF0aC5pc2xpbmsoZWRwYXRoKToK
LQkJCQkJc2h1dGlsLnJtdHJlZShlZHBhdGgpCi0JCQkJZWxzZToKLQkJCQkJb3MudW5saW5rKGVk
cGF0aCkKLQkJCWV4Y2VwdCBPU0Vycm9yOgotCQkJCXByaW50ICIhISEgRmFpbGVkIHJlc2V0aW5n
IGVidWlsZCBkaXN0ZGlyIHBhdGgsICIgKyBlZHBhdGgKLQkJCQlyYWlzZQotCQlvcy5ta2Rpcihl
ZHBhdGgpCi0JCW9zLmNob3duKGVkcGF0aCwgLTEsIHBvcnRhZ2VfZ2lkKQotCQlvcy5jaG1vZChl
ZHBhdGgsIDA3NzUpCi0JCXRyeToKLQkJCWZvciBmaWxlIGluIGFhbGlzdDoKLQkJCQlvcy5zeW1s
aW5rKG9zLnBhdGguam9pbihvcmlnX2Rpc3RkaXIsIGZpbGUpLCBvcy5wYXRoLmpvaW4oZWRwYXRo
LCBmaWxlKSkKLQkJZXhjZXB0IE9TRXJyb3I6Ci0JCQlwcmludCAiISEhIEZhaWxlZCBzeW1saW5r
aW5nIGluICclcycgdG8gZWJ1aWxkIGRpc3RkaXIiICUgZmlsZQotCQkJcmFpc2UKLQogCWlmIG15
ZG89PSJmZXRjaCIgYW5kIGxpc3Rvbmx5OgogCQlyZXR1cm4gMAogCg==
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>76492</attachid>
            <date>2006-01-07 16:15 0000</date>
            <desc>fixup.patch</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <data encoding="base64">SW5kZXg6IHBvcnRhZ2UucHkKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gcG9ydGFnZS5weQkocmV2aXNpb24gMjU0
MikKKysrIHBvcnRhZ2UucHkJKHJldmlzaW9uIDI1NDMpCkBAIC0yODA5LDcgKzI4MDksOCBAQAog
CSMgd2lsbCBiZSBleGVjdXRlZCwgZWl0aGVyIHRoYXQgb3IgZm9yY2VkIE4gZG9lYnVpbGQgY2Fs
bHMgaW5zdGVhZCBvZiBhIHNpbmdsZSBzZXQgb2YgcGhhc2UgY2FsbHMuCiAJaWYgKG15ZG8gbm90
IGluICgic2V0dXAiLCAiY2xlYW4iLCAicG9zdGluc3QiLCAicHJlaW5zdCIsICJwcmVybSIsICJm
ZXRjaCIsICJkaWdlc3QiLCAibWFuaWZlc3QiKSBhbmQgCiAJCSJub2F1dG8iIG5vdCBpbiBmZWF0
dXJlcykgb3IgbXlkbyA9PSAidW5wYWNrIjoKLQkJb3JpZ19kaXN0ZGlyID0gbXlzZXR0aW5nc1si
RElTVERJUiJdCisJCSMgcmVtb3ZlIFBPUlRBR0VfQUNUVUFMX0RJU1RESVIgb25jZSBjdnMvc3Zu
IGlzIHN1cHBvcnRlZCB2aWEgU1JDX1VSSQorCQlteXNldHRpbmdzWyJQT1JUQUdFX0FDVFVBTF9E
SVNURElSIl0gPSBvcmlnX2Rpc3RkaXIgPSBteXNldHRpbmdzWyJESVNURElSIl0KIAkJZWRwYXRo
ID0gbXlzZXR0aW5nc1siRElTVERJUiJdID0gb3MucGF0aC5qb2luKG15c2V0dGluZ3NbIlBPUlRB
R0VfQlVJTERESVIiXSwgImRpc3RkaXIiKQogCQlpZiBvcy5wYXRoLmV4aXN0cyhlZHBhdGgpOgog
CQkJdHJ5Ogo=
</data>        

          </attachment>
    </bug>

</bugzilla>