Fix handling of double-percent in cgmanifest check (#616)

This commit is contained in:
Thomas Crain 2021-02-09 18:42:24 -06:00 committed by GitHub
parent edebc07c3e
commit 6eddfe439e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -58,11 +58,11 @@ do
version=$(rpmspec --srpm --define "with_check 0" --qf "%{VERSION}" -q $spec 2>/dev/null )
# Some source files have been renamed, look for a comment and also try that (while manually substituting the name/version)
source0alt=$(grep "^#[[:blank:]]*Source0:" $spec | awk '{print $NF}' | sed "s/%{name}/$name/g" | sed "s/%{version}/$version/g" )
source0alt=$(grep "^#[[:blank:]]*Source0:" $spec | awk '{print $NF}' | sed "s/%\?%{name}/$name/g" | sed "s/%\?%{version}/$version/g" )
# Some packages define a %url as well
# Use ' ' as delimiter to avoid conflict with URL characters
specurl=$(rpmspec --srpm --define "with_check 0" --qf "%{URL}" -q $spec 2>/dev/null )
[[ -z specurl ]] || source0alt=$(echo $source0alt | sed "s %{url} $specurl g" )
[[ -z specurl ]] || source0alt=$(echo $source0alt | sed "s %\?%{url} $specurl g" )
# Pull the current registration from the cgmanifest file. Every registration should have a url, so if we don't find one
# that implies the registration is missing.