Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 796812 - sys-apps/portage-3.0.20-r4 can't handle SRC_URI with a file (without url) + url for EAPI-8
Summary: sys-apps/portage-3.0.20-r4 can't handle SRC_URI with a file (without url) + u...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 785484
  Show dependency tree
 
Reported: 2021-06-20 06:38 UTC by Ionen Wolkens
Modified: 2021-06-20 19:13 UTC (History)
3 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 Ionen Wolkens gentoo-dev 2021-06-20 06:38:48 UTC
e.g.
    SRC_URI="
        ball.tar.gz
        fetch+https://example/icon.png"
    RESTRICT="fetch"

Leads to a None myuri, and so with:
    for myfile, myuri in file_uri_tuples:
        override_mirror = myuri.startswith("mirror+")

Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.9/site-packages/portage/util/_async/ForkProcess.py", line 156, in _bootstrap
    sys.exit(self._run())
  File "/usr/lib/python3.9/site-packages/_emerge/EbuildFetcher.py", line 251, in _run
    if fetch(self._uri_map, self._settings, fetchonly=self.fetchonly,
  File "/usr/lib/python3.9/site-packages/portage/package/ebuild/fetch.py", line 910, in fetch
    override_mirror = myuri.startswith("mirror+")
AttributeError: 'NoneType' object has no attribute 'startswith'
Comment 1 Nikolay Kichukov 2021-06-20 16:02:27 UTC
This also affects me. I've tried with EAPIs 5,6 and 7. Unfortunately, I cannot try EAPI 8, as I use eutils which is banned on 8.

Any workaround/fix for this?
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-20 16:04:11 UTC
(In reply to Nikolay Kichukov from comment #1)
> This also affects me. I've tried with EAPIs 5,6 and 7. Unfortunately, I
> cannot try EAPI 8, as I use eutils which is banned on 8.
> 
> Any workaround/fix for this?

... you shouldn't need to use eutils at all on EAPI 8. The split eclasses (like desktop.eclass) or built-ins should replace it (sometimes exactly)?
Comment 3 Nikolay Kichukov 2021-06-20 16:06:06 UTC
For now I have downgraded portage to 3.0.18 which solves the problem.

off-topic:
Re eutils, do you mean I just need to remove the 'inherit eutils' completely and it should work out of the box?
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-20 16:07:06 UTC
(In reply to Nikolay Kichukov from comment #3)
> For now I have downgraded portage to 3.0.18 which solves the problem.
> 
> off-topic:
> Re eutils, do you mean I just need to remove the 'inherit eutils' completely
> and it should work out of the box?

Yes, but if it doesn't, come to #gentoo-dev-help. Obviously, ideally, you'd audit the functions you think are from eutils/you don't recognise and check them. You may need to replace the inherit with something like 'inherit desktop'.
Comment 5 Larry the Git Cow gentoo-dev 2021-06-20 18:54:48 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=2ce11f06e48290efb2d4b6743c8edf01c176b0fc

commit 2ce11f06e48290efb2d4b6743c8edf01c176b0fc
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2021-06-20 17:53:02 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-20 18:54:21 +0000

    fetch: Fix AttributeError when no URL specified
    
    Closes: https://github.com/gentoo/portage/pull/732
    Bug: https://bugs.gentoo.org/796812
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/package/ebuild/fetch.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 6 Larry the Git Cow gentoo-dev 2021-06-20 19:13:00 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f486914f2296b591c37bdc210e090945ad1e664

commit 7f486914f2296b591c37bdc210e090945ad1e664
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-20 19:08:16 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-20 19:11:43 +0000

    sys-apps/portage: 3.0.20-r5 revbump for EAPI 8 fix
    
     #796812 fetch: Fix AttributeError when no URL specified
    
    Bug: https://bugs.gentoo.org/785484
    Closes: https://bugs.gentoo.org/796812
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest                                           | 1 +
 .../portage/{portage-3.0.20-r4.ebuild => portage-3.0.20-r5.ebuild}  | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)