<?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>245231</bug_id>
          
          <creation_ts>2008-11-02 06:33 0000</creation_ts>
          <short_desc>sys-apps/portage-2.2_rc13 waits for lockfile with -fOp</short_desc>
          <delta_ts>2008-11-11 22:21:06 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 - External Interaction</component>
          <version>unspecified</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>
          
          <blocked>210077</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>vaeth@mathematik.uni-wuerzburg.de</reporter>
          <assigned_to>dev-portage@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>vaeth@mathematik.uni-wuerzburg.de</who>
            <bug_when>2008-11-02 06:33:44 0000</bug_when>
            <thetext>With sys-apps/portage-2.2_rc13, getdelta.sh waits forever, because it calls
  GENTOO_MIRRORS=&quot;&quot; emerge -fOp =category/package-version
to get the non-mirrored address which then (because it is called from emerge
via FETCHOMMAND) sees a lockfile and waits for the mother process to
finish...

This did not happen with =sys-apps/portage-2.2_rc12 or earlier versions,
and indeed it seems that there should not be a reason to wait for a lockfile.
If this is technically too hard, perhaps another command could be provided
which app-portage/getdelta could use, or - even better - the non-mirrored
address could be passed in an environment variable to FETCHOMMAND
(which would speed up gedelta quite a bit and perhaps also has other uses).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2008-11-02 07:14:30 0000</bug_when>
            <thetext>(In reply to comment #0)
&gt; This did not happen with =sys-apps/portage-2.2_rc12 or earlier versions,
&gt; and indeed it seems that there should not be a reason to wait for a lockfile.

It&apos;s only needed for cases when the pkg_nofetch() phase has to be executed (bug #241118). In this case, the locked directory is used to collect elog messages and to provide a safe working directory for bug #239560.

In order to avoid the need to lock the directory, we can use mkdtemp() to allocate a temporary directory. 

&gt; If this is technically too hard, perhaps another command could be provided
&gt; which app-portage/getdelta could use, or - even better - the non-mirrored
&gt; address could be passed in an environment variable to FETCHOMMAND
&gt; (which would speed up gedelta quite a bit and perhaps also has other uses).

I&apos;m not sure exactly what&apos;s required here. In some cases there are multiple non-mirrored URIs available, and in other cases only mirrored URIs are available.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vaeth@mathematik.uni-wuerzburg.de</who>
            <bug_when>2008-11-02 08:16:42 0000</bug_when>
            <thetext>(In reply to comment #1)
&gt; I&apos;m not sure exactly what&apos;s required here. In some cases there are multiple
&gt; non-mirrored URIs available, and in other cases only mirrored URIs are
&gt; available.

I am not an author of getdelta and can only guess what happens on the server
side. However, the script simply considers the words (space or newline
separated) output by
  GENTOO_MIRRORS=&quot;&quot; emerge -fOp =category/package-version
and uses the last of those word which is an address and contains the
filename to be fetched.

So I guess just putting the output which you would get with GENTOO_MIRRORS=&quot;&quot;
into some variable (optionally eliminating those entries which do not end
with the name for the current file to be fetched) would be sufficient for
getdelta.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2008-11-02 09:07:51 0000</bug_when>
            <thetext>Created an attachment (id=170521)
use a private temp directory instead of the main one

If this patch is saved as /tmp/fetch_tmp.patch, then it can be applied as follows:

  patch /usr/lib/portage/pym/_emerge/__init__.py /tmp/fetch_tmp.patch</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vaeth@mathematik.uni-wuerzburg.de</who>
            <bug_when>2008-11-02 18:49:05 0000</bug_when>
            <thetext>Thanks. The patch works smoothly.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zmedico@gentoo.org</who>
            <bug_when>2008-11-11 22:21:06 0000</bug_when>
            <thetext>This is fixed in 2.2_rc14.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>170521</attachid>
            <date>2008-11-02 09:07 0000</date>
            <desc>use a private temp directory instead of the main one</desc>
            <filename>fetch_tmp.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">SW5kZXg6IHB5bS9fZW1lcmdlL19faW5pdF9fLnB5Cj09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHB5bS9fZW1lcmdl
L19faW5pdF9fLnB5CShyZXZpc2lvbiAxMTc5NSkKKysrIHB5bS9fZW1lcmdlL19faW5pdF9fLnB5
CShyZXZpc2lvbiAxMTc5NikKQEAgLTE1OTAsNyArMTU5MCwyMyBAQAogCWRlZiBleGVjdXRlKHNl
bGYpOgogCQkjIFRvIHNwYXduIHBrZ19ub2ZldGNoIHJlcXVpcmVzIFBPUlRBR0VfQlVJTERESVIg
Zm9yCiAJCSMgZW5zdXJpbmcgc2FuZSAkUFdEIChidWcgIzIzOTU2MCkgYW5kIHN0b3JpbmcgZWxv
ZwotCQkjIG1lc3NhZ2VzLgorCQkjIG1lc3NhZ2VzLiBVc2UgYSBwcml2YXRlIHRlbXAgZGlyZWN0
b3J5LCBpbiBvcmRlcgorCQkjIHRvIGF2b2lkIGxvY2tpbmcgdGhlIG1haW4gb25lLgorCQlzZXR0
aW5ncyA9IHNlbGYuc2V0dGluZ3MKKwkJZ2xvYmFsX3RtcGRpciA9IHNldHRpbmdzWyJQT1JUQUdF
X1RNUERJUiJdCisJCWZyb20gdGVtcGZpbGUgaW1wb3J0IG1rZHRlbXAKKwkJcHJpdmF0ZV90bXBk
aXIgPSBta2R0ZW1wKCIiLCAiLl9wb3J0YWdlX2ZldGNoXy4iL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