tests: adjust internal patch to apply cleanly

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Denys Vlasenko 2023-05-08 11:28:24 +02:00
parent f46d3e8522
commit efa36b601a

View File

@ -16,8 +16,8 @@ cp ../../modalias.prov modalias.prov
patch -p1 <<"EOF" patch -p1 <<"EOF"
--- a/modalias.prov --- a/modalias.prov
+++ b/modalias.prov +++ b/modalias.prov
@@ -86,6 +86,17 @@ combine_modaliases() { @@ -105,6 +105,17 @@ combine_modaliases() {
print_modaliases "$class" "$variants" "$pos" print_modaliases "$prev" "$variants" "$pos"
} }
+if [ "$#" = 2 ] && [ "$1" = "-t" ]; then +if [ "$#" = 2 ] && [ "$1" = "-t" ]; then
@ -32,8 +32,8 @@ patch -p1 <<"EOF"
+fi +fi
+ +
for module in $(grep -E '/lib/modules/.+\.ko(\.gz|\.bz2|\.xz|\.zst)?$') "$@"; do for module in $(grep -E '/lib/modules/.+\.ko(\.gz|\.bz2|\.xz|\.zst)?$') "$@"; do
# | head -n1 because some modules have *two* version tags. *cough*b44*cough* modver=$(/sbin/modinfo -F version "$module")
modver=$(/sbin/modinfo -F version "$module"| head -n1) # delete possible extra lines because some modules have *two* version tags. *cough*b44*cough*
EOF EOF
find | grep '\.ko.*\.modalias$' | xargs -n1 ./modalias.prov -t find | grep '\.ko.*\.modalias$' | xargs -n1 ./modalias.prov -t