[opensuse-kernel] [PATCH] rpm/find-requires: only do KMP dependency generation if there are KMPs
If *-kmp-modules does not exist, shortcut the dependency generation, and avoid spamming the buildlog. --- rpm/find-requires | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rpm/find-requires b/rpm/find-requires index a656f2b4d0..2d6ac6166f 100644 --- a/rpm/find-requires +++ b/rpm/find-requires @@ -10,6 +10,14 @@ package_name=$1 version_release=$2 builddir=$3 +shopt -s nullglob + +kmpmodules="$builddir"/*-kmp-modules +if test -z $kmpmodules; then + cat | /usr/lib/rpm/find-requires "$package_name" + exit $? +fi + trap 'rm -f "$filelist"' EXIT filelist=$(mktemp -t ${0##*/}.XXXXXXXXXX) cat >"$filelist" -- 2.11.0 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
Am 28.01.2017 um 01:12 schrieb Stefan Brüns:
If *-kmp-modules does not exist, shortcut the dependency generation, and avoid spamming the buildlog. --- rpm/find-requires | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/rpm/find-requires b/rpm/find-requires index a656f2b4d0..2d6ac6166f 100644 --- a/rpm/find-requires +++ b/rpm/find-requires @@ -10,6 +10,14 @@ package_name=$1 version_release=$2 builddir=$3
+shopt -s nullglob + +kmpmodules="$builddir"/*-kmp-modules +if test -z $kmpmodules; then
I don't think $kmpmodules will ever be empty in this code flow. -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
Am 28.01.2017 um 09:46 schrieb Stefan Seyfried:
I don't think $kmpmodules will ever be empty in this code flow.
I just read up on nullglob and it will indeed be empty, so disregard the previous comment. -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On 2017-01-28 09:48, Stefan Seyfried wrote:
Am 28.01.2017 um 09:46 schrieb Stefan Seyfried:
I don't think $kmpmodules will ever be empty in this code flow.
I just read up on nullglob and it will indeed be empty, so disregard the previous comment.
It will be empty in the no-kmps case, but it can expand to several words in the kmps case, resulting in a syntax error. A more robust check is to have a function with a loop like check_kmps() { for f in "$builddir"/*-kmp-modules; do if test -e "$f"; then return fi done ... shortcut ... } Also, the "cat |" is unnecessary. Michal -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
participants (3)
-
Michal Marek
-
Stefan Brüns
-
Stefan Seyfried