Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 697890 - emirrordist: DeletionTask._start() wrongly assumes layout 0 will always have the file
Summary: emirrordist: DeletionTask._start() wrongly assumes layout 0 will always have ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 697734
  Show dependency tree
 
Reported: 2019-10-16 21:03 UTC by Michał Górny
Modified: 2020-01-17 22:25 UTC (History)
0 users

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 2019-10-16 21:03:47 UTC
Just a note to self: I've made a mistake of assuming that file from layout[0] will always be present.  I've generally assumed that it may be a symlink (hence the realpath()) but entirely missed the possibility that only layout[n>0] could exist.

This is not urgent but worth fixing for consistency with DeletionIterator.
Comment 2 Larry the Git Cow gentoo-dev 2019-10-21 13:38:54 UTC
The bug has been referenced in the following commit(s):

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

commit af9c77bd037694164755d06034a74456ec45e3ab
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2019-10-21 08:41:54 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2019-10-21 13:38:26 +0000

    emirrordist: Pass path from DeletionIterator to DeletionTask
    
    Since DeletionIterator needs to stat the distfile and therefore find
    one working path for it, pass it to DeletionTask instead of recomputing
    it there.  This also fixes wrongly assuming that first layout will
    always be correct.
    
    Bug: https://bugs.gentoo.org/697890
    Reviewed-by: Zac Medico <zmedico@gentoo.org>
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 lib/portage/_emirrordist/DeletionIterator.py |  2 ++
 lib/portage/_emirrordist/DeletionTask.py     | 14 +++++---------
 2 files changed, 7 insertions(+), 9 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2019-10-21 19:16:11 UTC
The bug has been referenced in the following commit(s):

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

commit ecbfeae408f1bdcfa4241a3f4001d57cf30c3405
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-10-21 19:12:06 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-10-21 19:16:01 +0000

    sys-apps/portage: Bump to version 2.3.78
    
     #697566 fetch: Use FETCHCOMMAND to fetch mirror layout.conf
     #697890 emirrordist: Fix DeletionTask layout assumptions
     #697906 emirrordist: Delete potential symlinks for all layouts
     #698046 make.globals: Change FETCHCOMMAND_RSYNC to --copy-links
    
    Bug: https://bugs.gentoo.org/697734
    Bug: https://bugs.gentoo.org/697566
    Bug: https://bugs.gentoo.org/697890
    Bug: https://bugs.gentoo.org/697906
    Bug: https://bugs.gentoo.org/698046
    Package-Manager: Portage-2.3.78, Repoman-2.3.17
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-2.3.78.ebuild | 261 +++++++++++++++++++++++++++++++++
 2 files changed, 262 insertions(+)