perlcritic: Don't conditionally declare variables

This commit is contained in:
Graham Christensen
2021-09-07 21:35:01 -04:00
parent 21e1ff0da1
commit c603ae35f0
3 changed files with 8 additions and 4 deletions

View File

@ -122,7 +122,8 @@ sub fetchInputBuild {
my $versionRE = "(?:[A-Za-z0-9\.\-]+)";
my $relName = ($prevBuild->releasename or $prevBuild->nixname);
my $version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/;
my $version;
$version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/;
my $mainOutput = getMainOutput($prevBuild);
@ -167,7 +168,8 @@ sub fetchInputSystemBuild {
my $versionRE = "(?:[A-Za-z0-9\.\-]+)";
my $relName = ($prevBuild->releasename or $prevBuild->nixname);
my $version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/;
my $version;
$version = $2 if $relName =~ /^($pkgNameRE)-($versionRE)$/;
my $input =
{ storePath => getMainOutput($prevBuild)->path