summaryrefslogtreecommitdiffstats
path: root/gurpmi.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-01-24 16:15:29 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-01-24 16:15:29 +0000
commit966c3455e83e8421f9e76b73502477af2d5397b2 (patch)
tree9b22efb6752d67345c049ce5befc8c980142d46c /gurpmi.pm
parent27f824577805d11bd50f5fcdefa4343c5b32b028 (diff)
downloadurpmi-966c3455e83e8421f9e76b73502477af2d5397b2.tar
urpmi-966c3455e83e8421f9e76b73502477af2d5397b2.tar.gz
urpmi-966c3455e83e8421f9e76b73502477af2d5397b2.tar.bz2
urpmi-966c3455e83e8421f9e76b73502477af2d5397b2.tar.xz
urpmi-966c3455e83e8421f9e76b73502477af2d5397b2.zip
Add support for --no-verify-rpm to gurpmi
Diffstat (limited to 'gurpmi.pm')
-rw-r--r--gurpmi.pm18
1 files changed, 17 insertions, 1 deletions
diff --git a/gurpmi.pm b/gurpmi.pm
index 410602f6..489cc8a6 100644
--- a/gurpmi.pm
+++ b/gurpmi.pm
@@ -20,7 +20,7 @@ use strict;
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw(usage fatal but quit add_button_box new_label);
+our @EXPORT = qw(fatal but quit add_button_box new_label);
sub usage () {
print STDERR <<USAGE;
@@ -34,6 +34,22 @@ USAGE
#- fatal gurpmi initialisation error (*not* fatal urpmi errors)
sub fatal { print STDERR "$_[0]\n"; exit 1 }
+#- Parse command line
+#- puts options in %gurpmi::options
+sub parse_command_line {
+ my @all_rpms;
+ our %options;
+ foreach (@ARGV) {
+ if (/^-/) {
+ $_ eq '--no-verify-rpm' and $options{'no-verify-rpm'} = 1;
+ /^--?[hv?]/ and usage();
+ fatal(N("Unknown option %s", $_));
+ }
+ push @all_rpms, $_;
+ }
+ return @all_rpms or fatal(N("No packages specified"));
+}
+
sub but ($) { " $_[0] " }
sub quit () { Gtk2->main_quit }