summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gurpmi15
-rw-r--r--gurpmi.pm18
-rwxr-xr-xgurpmi212
3 files changed, 21 insertions, 24 deletions
diff --git a/gurpmi b/gurpmi
index 0dcabcbb..96c1c25d 100644
--- a/gurpmi
+++ b/gurpmi
@@ -16,20 +16,9 @@ use Gtk2;
use MDK::Common::Func qw(partition);
#- globals
-my (@all_rpms, $srpms, $rpms);
+my ($srpms, $rpms);
my ($mainw, $mainbox);
-
-#- Gtk2 helper functions
-
-#- Parse command line
-foreach (@ARGV) {
- if (/^-/) {
- /^--?[hv?]/ and usage();
- fatal(N("Unknown option %s", $_));
- }
- push @all_rpms, $_;
-}
-@all_rpms or fatal(N("No packages specified"));
+my @all_rpms = gurpmi::parse_command_line();
#- Now, the graphical stuff.
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 }
diff --git a/gurpmi2 b/gurpmi2
index 4c0375f2..8aca07f2 100755
--- a/gurpmi2
+++ b/gurpmi2
@@ -41,16 +41,7 @@ sub wait_label {
sync();
}
-#- Parse command line
-my (@all_rpms);
-foreach (@ARGV) {
- if (/^-/) {
- /^--?[hv?]/ and usage();
- fatal(N("Unknown option %s", $_));
- }
- push @all_rpms, $_;
-}
-@all_rpms or fatal(N("No packages specified"));
+my @all_rpms = gurpmi::parse_command_line();
$> and fatal(N("Must be root"));
@@ -107,6 +98,7 @@ sub configure_urpm {
$urpm->exlock_rpm_db;
$urpm->shlock_urpmi_db;
$urpm->configure;
+ $urpm->{options}{'verify-rpm'} = 0 if $gurpmi::options{'no-verify-rpm'};
#- default options values
exists $urpm->{options}{$_} or $urpm->{options}{$_} = 1 foreach qw(post-clean verify-rpm split-length);
$urpm->{options}{'split-level'} = 20 unless exists $urpm->{options}{'split-level'};