diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-03-31 13:10:53 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-03-31 13:10:53 +0000 |
commit | 61d509733ea88bfbc2651985174a91acad970075 (patch) | |
tree | da072aacb0fcf16070bc747ef3b7fa82a5423297 | |
parent | fa19e9f663d875a6e750de37bca8b502a3d8043c (diff) | |
download | urpmi-61d509733ea88bfbc2651985174a91acad970075.tar urpmi-61d509733ea88bfbc2651985174a91acad970075.tar.gz urpmi-61d509733ea88bfbc2651985174a91acad970075.tar.bz2 urpmi-61d509733ea88bfbc2651985174a91acad970075.tar.xz urpmi-61d509733ea88bfbc2651985174a91acad970075.zip |
create add_urpmf_binary_op() and add_urpmf_unary_op(),
nothing changed yet (see next commit)
-rw-r--r-- | urpm/args.pm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/urpm/args.pm b/urpm/args.pm index bff9bded..38ead349 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -205,13 +205,13 @@ my %options_spec = ( f => sub { $::full = 1 }, 'F=s' => sub { $::separator = $_[1] }, 'e=s' => sub { $::expr .= "($_[1])" }, - a => sub { $::expr .= ' && ' }, - o => sub { $::expr .= ' || ' }, + a => sub { add_urpmf_binary_op('&&') }, + o => sub { add_urpmf_binary_op('||') }, '<>' => sub { my $p = shift; if ($p =~ /^-?([!()])$/) { # This is for -! -( -) - $::expr .= $1; + add_urpmf_unary_op($1); } elsif ($p =~ /^--?(.+)/) { # unrecognized option @@ -354,6 +354,16 @@ sub add_urpmf_cmdline_tags { } } +sub add_urpmf_binary_op { + my ($op) = @_; + + $::expr .= " $op "; +} +sub add_urpmf_unary_op { + my ($op) = @_; + + $::expr .= $op; +} sub add_urpmf_parameter { my ($p) = @_; |