Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 909147 - Prefixify script shebangs for ebuilds with EAPI newer than 7
Summary: Prefixify script shebangs for ebuilds with EAPI newer than 7
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-25 07:50 UTC by Benda Xu
Modified: 2023-06-25 08:41 UTC (History)
0 users

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


Attachments
bin-install-qa-check.d-05prefix-do-not-prepend-slash.patch (0001-bin-install-qa-check.d-05prefix-do-not-prepend-slash.patch,1.15 KB, patch)
2023-06-25 07:51 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2023-06-25 07:50:50 UTC
bin/install-qa-check.d/05prefix: do not prepend slash to the path.

D after EAPI 7 has no trailing slash. Prepending a slash to fp makes
it '//' and does not match elements in PATH.

With this fix, the shebangs from ebuilds with EAPIs newer than 7 are
prefixified again.

This patch delibrately ignores EAPI <7 ebuilds.  They should get EAPIs
bumped.


Reproducible: Always
Comment 1 Benda Xu gentoo-dev 2023-06-25 07:51:12 UTC
Created attachment 864589 [details, diff]
bin-install-qa-check.d-05prefix-do-not-prepend-slash.patch
Comment 2 Fabian Groffen gentoo-dev 2023-06-25 07:56:10 UTC
how about

        local fp=${fn#${D%/}/} ; fp=/${fp%/*}

That should cover all cases?
Comment 3 Benda Xu gentoo-dev 2023-06-25 08:41:47 UTC
(In reply to Fabian Groffen from comment #2)
> how about
> 
>         local fp=${fn#${D%/}/} ; fp=/${fp%/*}
> 
> That should cover all cases?

Yes, actually

  local fp=${fn#${D%/}} ; fp=${fp%/*}

is more concise.