summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-10 17:35:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-10 17:35:47 +0000
commit95e623d3dd4dbf12e391a2ef1413547358e0e353 (patch)
treef7986d73ac5bc9eebc21f234e2bae99760f24824
parent89d972c118016249e9e1b40c32748a6b56fc454c (diff)
downloadurpmi-95e623d3dd4dbf12e391a2ef1413547358e0e353.tar
urpmi-95e623d3dd4dbf12e391a2ef1413547358e0e353.tar.gz
urpmi-95e623d3dd4dbf12e391a2ef1413547358e0e353.tar.bz2
urpmi-95e623d3dd4dbf12e391a2ef1413547358e0e353.tar.xz
urpmi-95e623d3dd4dbf12e391a2ef1413547358e0e353.zip
move the list of known tags out of urpm/args.pm into urpmf,
and remove duplicated list (nb: conf_files has been added to command-line, but this won't hurt afaik)
-rw-r--r--urpm/args.pm29
-rwxr-xr-xurpmf47
2 files changed, 38 insertions, 38 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index 1b76bfe2..585166f4 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -326,31 +326,10 @@ my %options_spec = (
);
# generate urpmf options callbacks
-
-foreach my $k (qw(
- arch
- buildhost
- buildtime
- conflicts
- description
- distribution
- epoch
- filename
- files
- group
- license
- obsoletes
- packager
- provides
- requires
- size
- sourcerpm
- suggests
- summary
- url
- vendor
-)) {
- $options_spec{urpmf}{$k} = add_param_closure($k);
+sub add_urpmf_cmdline_tags {
+ foreach my $k (@_) {
+ $options_spec{urpmf}{$k} ||= add_param_closure($k);
+ }
}
# common options setup
diff --git a/urpmf b/urpmf
index 35ceeb80..3893f7d5 100755
--- a/urpmf
+++ b/urpmf
@@ -87,6 +87,39 @@ usage: urpmf [options] pattern-expression
exit(1);
}
+my %tags_per_media_info = (
+
+ synthesis => [ qw(
+ arch
+ conflicts
+ epoch
+ filename
+ group
+ obsoletes
+ provides
+ requires
+ size
+ suggests
+ summary
+ ) ],
+
+ hdlist => [ qw(
+ buildhost
+ buildtime
+ conf_files
+ description
+ distribution
+ files
+ license
+ packager
+ sourcerpm
+ url
+ vendor
+ ) ],
+);
+
+urpm::args::add_urpmf_cmdline_tags(map { @$_ } values %tags_per_media_info);
+
#- default options.
our $env; # bug report directory
our $excludemedia = '';
@@ -196,19 +229,7 @@ if ($env) {
}
my $_lock = urpm::lock::urpmi_db($urpm, '', nofatal => 1, wait => $options{wait_lock});
-my $need_xml = grep { $usedtags{$_} } qw(
- buildhost
- buildtime
- conf_files
- description
- distribution
- files
- license
- packager
- sourcerpm
- url
- vendor
-);
+my $need_xml = grep { $usedtags{$_} } @{$tags_per_media_info{hdlist}};
urpm::media::configure($urpm,
nocheck_access => 1,
no_skiplist => 1,