Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 849815 - sys-apps/portage-9999: `ebuild ... manifest` wrongly removes old distfiles from Manifest
Summary: sys-apps/portage-9999: `ebuild ... manifest` wrongly removes old distfiles fr...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2022-06-05 14:45 UTC by Michał Górny
Modified: 2022-06-06 04:29 UTC (History)
1 user (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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-06-05 14:45:27 UTC
This seems to be regression since 3.0.30.

To reproduce, ensure that you don't have mysql-connector-python's distfiles in DISTDIR, then:

  cd dev-python/mysql-connector-python
  cp mysql-connector-python-8.0.27.ebuild mysql-connector-python-8.0.29.ebuild
  ebuild mysql-connector-python-8.0.29.ebuild manifest

Portage will fetch the distfile for 8.0.29 but remove the Manifest entry for 8.0.27.  Running the command for the second time causes the other distfile to be fetched and checksum to be restored.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-06-05 14:56:20 UTC
Apparently it's caused by one of the following commits:

64d84ce2d (refs/bisect/new) Miscellaneous refactors and cleanups
5ac2a8f08 (refs/bisect/skip-5ac2a8f08101501d0416ad9d79e277c363cea85e) Enhance the update hash methods for simplification
bf66319d5 (refs/bisect/skip-bf66319d572fbe00bea0c65001da57ee5f9c154a) Replace obscure lambdas with closures for clarity
579092cb0 (refs/bisect/skip-579092cb02fc15a7047c3c3c2c28d6aae6ea2aeb) Inline key-value insertions as dict expressions with key-value pa
irs
eeaeb2770 (refs/bisect/skip-eeaeb27707890e3f96baaf13493f95e6368f5f13) Simplify by inlining a single use method
a387219c4 (refs/bisect/skip-a387219c4bdc1510e7958193203fcd29acf6c173) Return boolean expressions instead of branching
9e24d0143 (refs/bisect/skip-9e24d0143450628f334cdb62e579efafd1bfd2ba) Simplify with declarative programming


These with 'skip' on them cause the following error:

  !!! File b'/tmp/dist/mysql-connector-python-8.0.27.tar.gz' doesn't exist, can't update Manifest

Apparently 64d84ce2d "fixes" this error by removing the Manifest entry instead.
Comment 2 Zac Medico gentoo-dev 2022-06-05 20:18:41 UTC
The problem with 9e24d0143 is that there's a missing comma in the ("size",) tuple on this line:

required_hash_types = set(itertools.chain(self.required_hashes, ("size",)))
Comment 3 Larry the Git Cow gentoo-dev 2022-06-05 20:25:13 UTC
The bug has been referenced in the following commit(s):

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

commit 2feeb57c0a260d308b55c8be943c73fc1fa44910
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2022-06-05 20:20:18 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2022-06-05 20:24:49 +0000

    Manifest: Fix ("size",) tuple
    
    Fixes: 9e24d0143450 ("Simplify with declarative programming")
    Bug: https://bugs.gentoo.org/849815
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/manifest.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-06-06 04:29:05 UTC
Thanks.  It seems to work now.  Since this hasn't made it into a release, I guess we can close the bug.