From 8150e04f7c49e5b00793c05322730053b6e357c1 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 27 Aug 2014 17:31:40 +0200 Subject: rename 'no-suggests' option as 'no-recommends' keep --no-suggests but with a warning --- urpm/args.pm | 10 +++++++--- urpm/cfg.pm | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'urpm') diff --git a/urpm/args.pm b/urpm/args.pm index 1f43cb49..c6a05e52 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -120,8 +120,12 @@ my %options_spec = ( suggests => sub { $urpm->{fatal}(1, "Use --allow-suggests instead of --suggests"); }, - 'allow-suggests' => sub { $urpm->{options}{'no-suggests'} = 0 }, - 'no-suggests' => sub { $urpm->{options}{'no-suggests'} = 1 }, + 'allow-suggests' => sub { $urpm->{options}{'no-recommends'} = 0 }, + 'no-recommends' => sub { $urpm->{options}{'no-recommends'} = 1 }, + 'no-suggests' => sub { # COMPAT + warn "WARNING: --no-suggests is deprecated. Use --no-recommends instead\n"; + $urpm->{options}{'no-recommends'} = 1; + }, 'allow-nodeps' => sub { $urpm->{options}{'allow-nodeps'} = 1 }, 'allow-force' => sub { $urpm->{options}{'allow-force'} = 1 }, 'downgrade' => sub { $urpm->{options}{downgrade} = 1 }, @@ -418,7 +422,7 @@ foreach my $k ("test!", "force", "root=s", "use-distrib=s", 'env=s', { $options_spec{urpme}{$k} = $options_spec{urpmi}{$k}; } -foreach my $k ("root=s", "nolock", "use-distrib=s", "skip=s", "prefer=s", "synthesis=s", 'no-suggests', 'allow-suggests', 'auto-orphans') +foreach my $k ("root=s", "nolock", "use-distrib=s", "skip=s", "prefer=s", "synthesis=s", 'no-recommends', 'no-suggests', 'allow-suggests', 'auto-orphans') { $options_spec{urpmq}{$k} = $options_spec{urpmi}{$k}; } diff --git a/urpm/cfg.pm b/urpm/cfg.pm index f5f292ba..f088ba04 100644 --- a/urpm/cfg.pm +++ b/urpm/cfg.pm @@ -96,7 +96,7 @@ sub expand_line { return $line; } -my $no_para_option_regexp = 'update|ignore|synthesis|noreconfigure|no-suggests|no-media-info|static|virtual|disable-certificate-check'; +my $no_para_option_regexp = 'update|ignore|synthesis|noreconfigure|no-recommends|no-suggests|no-media-info|static|virtual|disable-certificate-check'; sub load_config_raw { my ($file, $b_norewrite) = @_; @@ -164,8 +164,12 @@ sub load_config_raw { } elsif (/^(hdlist|synthesis)$/) { # ignored, kept for compatibility } elsif (/^($no_para_option_regexp)$/) { + my $opt = $1; + if ($opt =~ s/no-suggests/no-recommends/) { # COMPAT + warn "WARNING: --no-suggests is deprecated. Use --no-recommends instead\n" if s/no-suggests/no-recommends/; # COMPAT + } #- positive flags - $block->{$1} = 1; + $block->{$opt} = 1; } elsif (my ($no, $k, $v) = /^(no-)?( verify-rpm -- cgit v1.2.1