rpmからbashの依存関係を削除しない理由はありますか?

rpmからbashの依存関係を削除しない理由はありますか?

私のyoctoイメージには望ましくありませんが、bashいくつかの依存関係に含まれています。そのうちのほとんどを取り除くことができ、今rpm(必要なもの)だけが残りました。

追跡してみると、スクリプトが2つしかないことがわかりました。

#!/bin/bash明らかな理由なしにShebang。bbappendこれら2つのスクリプトのインタプリタラインにパッチを適用し、動作するRDEPEND有効なイメージを正常に削除するためのパッチが作成されました(rpmパッケージのインストールを含む)。bitbake

bashしかし、誰かが明示的にスクリプトを要求する理由があるかもしれないということはまだ不快に感じられます。 Shellcheck.netには十分な警告がありますが、POSIXの非互換性に関する警告はありません。

bash簡単な方法で依存関係を削除しない理由がわかりますか?

ベストアンサー1

結局、削除しなければならない依存関係がより多いことがわかりました。私の最終パッチはrecipes-devtools/rpm/files/0001-remove-bash-dependency.patch次のとおりです。

--- a/scripts/rpmdb_loadcvt
+++ b/scripts/rpmdb_loadcvt
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ac=$#
 cmd=`basename $0`
--- a/scripts/pythondeps.sh
+++ b/scripts/pythondeps.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 [ $# -ge 1 ] || {
     cat > /dev/null

--- a/scripts/pkgconfigdeps.sh
+++ b/scripts/pkgconfigdeps.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 pkgconfig=/usr/bin/pkg-config
 test -x $pkgconfig || {

--- a/scripts/mono-find-requires
+++ b/scripts/mono-find-requires
@@ -1,1 +1,1 @@
-#!/bin/bash
+#!/bin/sh
--- a/scripts/mono-find-provides
+++ b/scripts/mono-find-provides
@@ -1,1 +1,1 @@
-#!/bin/bash
+#!/bin/sh
--- a/scripts/check-rpaths-worker
+++ b/scripts/check-rpaths-worker
@@ -1,1 +1,1 @@
-#! /bin/bash
+#!/bin/sh

--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #find-debuginfo.sh - automagically generate debug info and file list
 #for inclusion in an rpm spec file.
 #
--- a/scripts/find-lang.sh
+++ b/scripts/find-lang.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #findlang - automagically generate list of language specific files
 #for inclusion in an rpm spec file.
 #This does assume that the *.mo files are under .../locale/...
--- a/scripts/fontconfig.prov
+++ b/scripts/fontconfig.prov
@@ -1,1 +1,1 @@
-#!/bin/bash
+#!/bin/sh
--- a/scripts/check-prereqs
+++ b/scripts/check-prereqs
@@ -1,1 +1,1 @@
-#!/bin/bash
+#!/bin/sh
--- a/scripts/brp-python-bytecompile
+++ b/scripts/brp-python-bytecompile
@@ -1,1 +1,1 @@
-#!/bin/bash
+#!/bin/sh

依存関係チェックだけが実際に機能に依存しているように見えますが、bashとにかくbash。それは私にとって重要ではありません。

/bin/shところでanyを使用すると主張していますが、攻撃性に満ちた別のスクリプトを見つけました...ため息をつく

おすすめ記事