Skip to content

Commit

Permalink
Support uppercase macro expansion for tags from the main preamble
Browse files Browse the repository at this point in the history
in spec files with subpackages, %VERSION refers to the main package
version while %version refers to the subpackage. Similarly for %url
and %URL. The latter is sometimes used in Source lines so we need
to be able to expand it.
  • Loading branch information
dirkmueller committed Nov 6, 2023
1 parent d3735a9 commit fb0f711
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Build/Rpm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,11 @@ sub parse {
}
}
if ($main_preamble) {
if ($line =~ /^(Name|Epoch|Version|Release|Disttag)\s*:\s*(\S+)/i) {
if ($line =~ /^(Name|Epoch|Version|Release|Disttag|Url)\s*:\s*(\S+)/i) {
$ret->{lc $1} = $2;
$macros{lc $1} = $2;
# add a separate uppercase macro for tags from the main preamble
$macros{uc $1} = $2;
} elsif ($line =~ /^ExclusiveArch\s*:\s*(.*)/i) {
$exclarch ||= [];
push @$exclarch, split(' ', $1);
Expand Down

0 comments on commit fb0f711

Please sign in to comment.