Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 703520 - sys-apps/portage: eend implementation disagrees with PMS
Summary: sys-apps/portage: eend implementation disagrees with PMS
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 939444
Blocks: 563798
  Show dependency tree
 
Reported: 2019-12-22 08:01 UTC by Michał Górny
Modified: 2025-01-22 00:30 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
eend: Output QA notice when called without argument (0001-eend-Output-QA-notice-when-called-without-argument.patch,938 bytes, patch)
2021-09-03 16:08 UTC, Ulrich Müller
Details | Diff

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-12-22 08:01:14 UTC
PMS states:

| Indicates that the process begun with an ebegin message has completed. Takes one fixed argument, which is a numeric return code [...]

However, Portage makes that argument optional and defaults to 0.  This is very error prone, and leads to many ebuilds not passing the required argument, and in some cases, wrongly assuming eend will take $? rather than the absurd default of 0.
Comment 1 Ulrich Müller gentoo-dev 2021-09-03 16:08:48 UTC
Created attachment 737227 [details, diff]
eend: Output QA notice when called without argument

Maybe we could start with printing a QA notice. See attached patch.
Comment 2 Larry the Git Cow gentoo-dev 2021-09-27 11:19:08 UTC
The bug has been referenced in the following commit(s):

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

commit 95cd9583d415dfeb07917d7b111502f0b991413d
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2021-09-03 16:03:27 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2021-09-27 11:15:04 +0000

    eend: Output QA notice when called without argument
    
    PMS says about eend: "Takes one fixed argument, which is a numeric
    return code, and an optional message in all subsequent arguments."
    
    Bug: https://bugs.gentoo.org/703520
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 bin/isolated-functions.sh | 1 +
 1 file changed, 1 insertion(+)
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-23 09:13:28 UTC
pkgcheck detects this as https://github.com/pkgcore/pkgcheck/pull/365 (MissingEendArgument). IIRC we don't have any violators in tree now.
Comment 4 Ulrich Müller gentoo-dev 2023-05-23 11:46:48 UTC
So, do we just close this (leaving the QA warning in place), or should we make calling eend without numerical first argument an error?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-24 17:35:18 UTC
(In reply to Ulrich Müller from comment #4)
> So, do we just close this (leaving the QA warning in place), or should we
> make calling eend without numerical first argument an error?

The latter IMO.
Comment 6 Larry the Git Cow gentoo-dev 2024-12-15 07:58:03 UTC
The bug has been referenced in the following commit(s):

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

commit 9f877651bfd0940cdf271456425edbbec7fc60bd
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2024-12-14 17:31:39 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2024-12-14 22:18:53 +0000

    eend: Make missing argument an error
    
    PMS says about eend: "Takes one fixed argument, which is a numeric
    return code, and an optional message in all subsequent arguments."
    
    A QA notice was in place since commit 95cd9583d415 in 2021.
    
    Bug: https://bugs.gentoo.org/703520
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 NEWS                      | 2 ++
 bin/isolated-functions.sh | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)
Comment 7 Larry the Git Cow gentoo-dev 2025-01-22 00:30:30 UTC
The bug has been closed via the following commit(s):

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

commit 03f41049a0fe0632eabd8cddaaca898e45943201
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-01-22 00:29:50 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-01-22 00:30:02 +0000

    sys-apps/portage: add 3.0.67
    
    Closes: https://bugs.gentoo.org/703520
    Closes: https://bugs.gentoo.org/707980
    Closes: https://bugs.gentoo.org/904702
    Closes: https://bugs.gentoo.org/906044
    Closes: https://bugs.gentoo.org/923530
    Closes: https://bugs.gentoo.org/938164
    Closes: https://bugs.gentoo.org/939299
    Closes: https://bugs.gentoo.org/940120
    Closes: https://bugs.gentoo.org/942512
    Closes: https://bugs.gentoo.org/942760
    Closes: https://bugs.gentoo.org/945382
    Closes: https://bugs.gentoo.org/945861
    Closes: https://bugs.gentoo.org/946326
    Closes: https://bugs.gentoo.org/947822
    Closes: https://bugs.gentoo.org/948067
    Closes: https://bugs.gentoo.org/939444
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.67.ebuild | 231 +++++++++++++++++++++++++++++++++
 2 files changed, 232 insertions(+)