From 5cb7aba8998da4d2ada0a470fb81a87d4f5dae2e Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Fri, 11 Oct 2024 10:36:56 +0200 Subject: [PATCH] Improve --result option heuristic Args starting with '.' can't be a package or a code. --- PBuild/Options.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PBuild/Options.pm b/PBuild/Options.pm index 085a4728..bc80a648 100644 --- a/PBuild/Options.pm +++ b/PBuild/Options.pm @@ -142,8 +142,8 @@ sub vm_type_special { my ($opts, $opt, $origopt, $args) = @_; my $arg; $arg = Build::Options::getarg($origopt, $args, 1) unless $opt eq 'zvm' || $opt eq 'lxc'; - $opts->{'vm-disk'} = $arg if defined $arg; $opts->{'vm-type'} = $opt; + $opts->{'vm-disk'} = $arg if defined $arg; } sub ccache_special { @@ -160,7 +160,7 @@ my %known_codes = map {$_ => 1} @codes; sub result_rebuild_special { my ($opts, $opt, $origopt, $args) = @_; my $arg; - $arg = Build::Options::getarg($origopt, $args, 1) if @$args && (ref($args->[0]) || $args->[0] !~ /\//); + $arg = Build::Options::getarg($origopt, $args, 1) if @$args && (ref($args->[0]) || $args->[0] !~ /^\.|\//); if (!defined($arg) || $arg eq 'all') { push @{$opts->{"$opt-code"}}, 'all'; } elsif ($known_codes{$arg}) {