Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 772386 - sys-apps/portage-3.0.15 in ebuild/fetch.py: UnboundLocalError: local variable 'myfile' referenced before assignment
Summary: sys-apps/portage-3.0.15 in ebuild/fetch.py: UnboundLocalError: local variable...
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, REGRESSION
: 772890 (view as bug list)
Depends on:
Blocks: 766117
  Show dependency tree
 
Reported: 2021-02-24 14:22 UTC by Ionen Wolkens
Modified: 2021-02-25 12:10 UTC (History)
4 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-02-24 14:22:40 UTC
Regression introduced by [1] that changed myuri to myfile:

 for myuri in myuris:
 	if urlparse(myuri).scheme:
-		file_uri_tuples.append((os.path.basename(myuri), myuri))
+		file_uri_tuples.append(
+			(DistfileName(myfile, digests=mydigests.get(myfile)), myuri)
+		)
 	else:
-			file_uri_tuples.append((os.path.basename(myuri), None))
+		file_uri_tuples.append(
+			(DistfileName(myfile, digests=mydigests.get(myfile)), None)
+		)


Notably cause issues in repoman when it attempts to download a new metadata.xsd:
[...]
  File "/usr/lib/python3.9/site-packages/portage/package/ebuild/fetch.py", line 901, in fetch
    (DistfileName(myfile, digests=mydigests.get(myfile)), myuri)
UnboundLocalError: local variable 'myfile' referenced before assignment

[1] https://gitweb.gentoo.org/proj/portage.git/commit/?id=b9ef191c74982b0e8d837aa7dd256dc3c52f7d2c
Comment 1 Larry the Git Cow gentoo-dev 2021-02-24 15:14:04 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=3e5ef19d5d6b26fde08da463d730ff90edf6eb29

commit 3e5ef19d5d6b26fde08da463d730ff90edf6eb29
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-02-24 15:08:30 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-02-24 15:12:40 +0000

    fetch.py: fix UnboundLocalError: local variable 'myfile'
    
    Reported-by: Ionen Wolkens <sudinave@gmail.com>
    Bug: https://bugs.gentoo.org/772386
    Fixes: b9ef191c7498 ("MirrorLayoutConfig: content digest support (bug 756778)")
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/package/ebuild/fetch.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 2 Larry the Git Cow gentoo-dev 2021-02-24 15:26:32 UTC
The bug has been closed via the following commit(s):

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

commit a22edc87b44ed8020dfe4e10b208c62bd5e5f9be
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-02-24 15:21:25 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-02-24 15:23:01 +0000

    sys-apps/portage: 3.0.15-r1 revbump for bug 772386
    
     #772386 fetch.py: UnboundLocalError: local variable 'myfile'
    
    Bug: https://bugs.gentoo.org/766117
    Closes: https://bugs.gentoo.org/772386
    Package-Manager: Portage-3.0.15, Repoman-3.0.2
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest                                          | 1 +
 .../portage/{portage-3.0.15.ebuild => portage-3.0.15-r1.ebuild}    | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
Comment 3 Zac Medico gentoo-dev 2021-02-24 15:26:53 UTC
Thanks!
Comment 4 Ionen Wolkens gentoo-dev 2021-02-25 03:37:43 UTC
Appears still broken, still a reference to myfile

 File "/usr/lib/python3.9/site-packages/portage/package/ebuild/fetch.py", line 901, in fetch
    (DistfileName(myfile, digests=mydigests.get(os.path.basename(myuri))), myuri)
UnboundLocalError: local variable 'myfile' referenced before assignment
Comment 5 Larry the Git Cow gentoo-dev 2021-02-25 09:33:28 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=48226b2df1408cf1944cb7c6128c73710c740dd3

commit 48226b2df1408cf1944cb7c6128c73710c740dd3
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-02-25 09:26:49 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-02-25 09:31:01 +0000

    fetch.py: fix UnboundLocalError: local variable 'myfile'
    
    Reported-by: Ionen Wolkens <sudinave@gmail.com>
    Bug: https://bugs.gentoo.org/772386
    Fixes: 3e5ef19d5d6b ("fetch.py: fix UnboundLocalError: local variable 'myfile'")
    Fixes: b9ef191c7498 ("MirrorLayoutConfig: content digest support (bug 756778)")
    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-02-25 09:49:44 UTC
The bug has been closed via the following commit(s):

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

commit e9fd34bc095c2da33de8fc10113be787f89832cb
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-02-25 09:35:07 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-02-25 09:49:41 +0000

    sys-apps/portage: 3.0.15-r2 revbump for bug 772386
    
     #772386 fetch.py: UnboundLocalError: local variable 'myfile'
    
    Bug: https://bugs.gentoo.org/766117
    Closes: https://bugs.gentoo.org/772386
    Package-Manager: Portage-3.0.15, Repoman-3.0.2
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest                                             | 1 +
 .../portage/{portage-3.0.15-r1.ebuild => portage-3.0.15-r2.ebuild}    | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
Comment 7 Andrey Grozin gentoo-dev 2021-02-25 12:10:49 UTC
*** Bug 772890 has been marked as a duplicate of this bug. ***