diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-12 14:59:20 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-12 14:59:20 +0000 |
commit | 9241b7b29ce5a79026e7805969754c0c772d129e (patch) | |
tree | 464dbf172357e0dd3b2cd47e4d831d2f01fc232e | |
parent | 14a0e609bc2dc9a68882acabf0209cdab202f441 (diff) | |
download | urpmi-9241b7b29ce5a79026e7805969754c0c772d129e.tar urpmi-9241b7b29ce5a79026e7805969754c0c772d129e.tar.gz urpmi-9241b7b29ce5a79026e7805969754c0c772d129e.tar.bz2 urpmi-9241b7b29ce5a79026e7805969754c0c772d129e.tar.xz urpmi-9241b7b29ce5a79026e7805969754c0c772d129e.zip |
Forbid urpmq --use-distrib when non root
-rw-r--r-- | man/C/urpmq.8 | 3 | ||||
-rw-r--r-- | urpm.pm | 18 | ||||
-rw-r--r-- | urpm/args.pm | 8 |
3 files changed, 27 insertions, 2 deletions
diff --git a/man/C/urpmq.8 b/man/C/urpmq.8 index ac2205ac..c6e7b957 100644 --- a/man/C/urpmq.8 +++ b/man/C/urpmq.8 @@ -90,6 +90,9 @@ Use specified HTTP proxy. Use specified user and password to use for proxy authentication. Specifying \fB\--proxy-user=ask\fP will cause urpmq to prompt for a username and a password. +.IP "\fB\--use-distrib\fP \fIdirectory\fP" +Configure urpmq on the fly from a distrib tree. You must be root to use this +option. .IP "\fB\--env\fP \fIdirectory\fP" Use a different environment directly from a bug report to replay a bug, the argument is the same argument given to \fB--bug\fP option. @@ -415,7 +415,23 @@ sub write_config { delete $urpm->{modified}; } -#- read urpmi.cfg file as well as synthesis file needed. +#- read urpmi.cfg file as well as necessary synthesis files +#- options : +#- callback +#- call_back_only_once +#- excludemedia +#- hdlist +#- media +#- nodepslist +#- noinstalling +#- noskipping +#- parallel +#- root +#- searchmedia +#- skip +#- sortmedia +#- update +#- usedistrib sub configure { my ($urpm, %options) = @_; diff --git a/urpm/args.pm b/urpm/args.pm index b9e60087..6f632e4f 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -212,7 +212,13 @@ my %options_spec = ( force => \$options{force}, 'skip=s' => \$options{skip}, 'root=s' => sub { require File::Spec; $options{root} = File::Spec->rel2abs($_[1]) }, - 'use-distrib=s' => \$options{usedistrib}, + 'use-distrib=s' => sub { + if ($< != 0) { + print STDERR N("You need to be root to use --use-distrib"), "\n"; + exit 1; + } + $options{usedistrib} = $_[1]; + }, 'parallel=s' => \$options{parallel}, 'env=s' => \$options{env}, 'nolock' => \$options{nolock}, |