Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 889487 Details for
Bug 927248
Why not prefixify all shebangs?
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for portage to prefixify all shebang in qa check
0001-Prefixify-all-scripts.patch (text/plain), 2.93 KB, created by
Yiyang Wu
on 2024-04-05 04:06:18 UTC
(
hide
)
Description:
patch for portage to prefixify all shebang in qa check
Filename:
MIME Type:
Creator:
Yiyang Wu
Created:
2024-04-05 04:06:18 UTC
Size:
2.93 KB
patch
obsolete
>From 9a7e4f6b4171c13c7463591e54c3e76cef57770d Mon Sep 17 00:00:00 2001 >From: Yiyang Wu <xgreenlandforwyy@gmail.com> >Date: Thu, 4 Apr 2024 20:44:00 +0800 >Subject: [PATCH] Prefixify all scripts > >Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> >--- > bin/install-qa-check.d/05prefix | 39 ++++++++++++++------------------- > 1 file changed, 16 insertions(+), 23 deletions(-) > >diff --git a/bin/install-qa-check.d/05prefix b/bin/install-qa-check.d/05prefix >index edbd6fab2..fcc10697d 100644 >--- a/bin/install-qa-check.d/05prefix >+++ b/bin/install-qa-check.d/05prefix >@@ -33,7 +33,7 @@ install_qa_check_prefix() { > > # check shebangs, bug #282539 > rm -f "${T}"/non-prefix-shebangs-errs >- local WHITELIST=" /usr/bin/env " >+ local WHITELIST="" > # this is hell expensive, but how else? > find "${ED}" -executable \! -type d -print0 \ > | xargs -0 grep -H -n -m1 "^#!" \ >@@ -76,29 +76,22 @@ install_qa_check_prefix() { > fi > continue > fi >- # unprefixed shebang, is the script directly in ${PATH} or an init script? >- if [[ ":${PATH}:${EPREFIX}/etc/init.d:" == *":${fp}:"* ]] ; then >- if [[ -e ${EROOT}${line[0]} || -e ${ED}${line[0]} ]] ; then >- # is it unprefixed, but we can just fix it because a >- # prefixed variant exists >- eqawarn "QA Notice: prefixing shebang of ${fn#${D}}" >- # statement is made idempotent on purpose, because >- # symlinks may point to the same target, and hence the >- # same real file may be sedded multiple times since we >- # read the shebangs in one go upfront for performance >- # reasons >- sed -i -e '1s:^#! \?'"${line[0]}"':#!'"${EPREFIX}"${line[0]}':' "${rf}" >- continue >- else >- # this is definitely wrong: script in ${PATH} and invalid shebang >- echo "${fn#${D}}:${line[0]} (script ${fn##*/} installed in PATH but interpreter ${line[0]} not found)" \ >- >> "${T}"/non-prefix-shebangs-errs >- fi >+ # unprefixed shebang, prefixify it! >+ if [[ -e ${EROOT}${line[0]} || -e ${ED}${line[0]} ]] ; then >+ # is it unprefixed, but we can just fix it because a >+ # prefixed variant exists >+ eqawarn "QA Notice: prefixing shebang of ${fn#${D}}" >+ # statement is made idempotent on purpose, because >+ # symlinks may point to the same target, and hence the >+ # same real file may be sedded multiple times since we >+ # read the shebangs in one go upfront for performance >+ # reasons >+ sed -i -e '1s:^#! \?'"${line[0]}"':#!'"${EPREFIX}"${line[0]}':' "${rf}" >+ continue > else >- # unprefixed/invalid shebang, but outside ${PATH}, this may be >- # intended (e.g. config.guess) so remain silent by default >- has stricter ${FEATURES} && \ >- eqawarn "QA Notice: invalid shebang in ${fn#${D}}: ${line[0]}" >+ # this is definitely wrong: script in ${PATH} and invalid shebang >+ echo "${fn#${D}}:${line[0]} (script ${fn##*/} installed in PATH but interpreter ${line[0]} not found)" \ >+ >> "${T}"/non-prefix-shebangs-errs > fi > done > if [[ -e "${T}"/non-prefix-shebangs-errs ]] ; then >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 927248
:
887879
|
887880
| 889487