summaryrefslogtreecommitdiffstats
path: root/urpm/args.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-31 13:10:53 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-31 13:10:53 +0000
commit61d509733ea88bfbc2651985174a91acad970075 (patch)
treeda072aacb0fcf16070bc747ef3b7fa82a5423297 /urpm/args.pm
parentfa19e9f663d875a6e750de37bca8b502a3d8043c (diff)
downloadurpmi-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)
Diffstat (limited to 'urpm/args.pm')
-rw-r--r--urpm/args.pm16
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) = @_;