diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2004-02-09 18:14:39 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2004-02-09 18:14:39 +0000 |
commit | 0130f5d402e27dc0c91390065aaba3baf6c5d151 (patch) | |
tree | 238e664c2b0ac6ec727f7f94df92d86b4b5e0585 | |
parent | 3eea4cf47d64c4edd12e7fcd1b9c1b9fd8b4ff44 (diff) | |
download | urpmi-0130f5d402e27dc0c91390065aaba3baf6c5d151.tar urpmi-0130f5d402e27dc0c91390065aaba3baf6c5d151.tar.gz urpmi-0130f5d402e27dc0c91390065aaba3baf6c5d151.tar.bz2 urpmi-0130f5d402e27dc0c91390065aaba3baf6c5d151.tar.xz urpmi-0130f5d402e27dc0c91390065aaba3baf6c5d151.zip |
gurpmi: handle case where user clicked on a src.rpm, suggest
user is misleaded, allow to do nothing, really install, or
save on disk
-rwxr-xr-x | urpmi | 32 | ||||
-rw-r--r-- | urpmi.spec | 6 |
2 files changed, 34 insertions, 4 deletions
@@ -140,9 +140,10 @@ usage: sub to_utf8 { Locale::gettext::iconv($_[0], undef, "UTF-8") } sub gmessage { my ($msg, %params) = @_; - my $ok = to_utf8(N("Ok")); - my $cancel = to_utf8(N("Cancel")); - my $buttons = ($params{ok_only} ? "$ok:0" : "$ok:0,$cancel:2") . $params{add_buttons}; + my $ok = to_utf8($params{ok} || N("Ok")); + my $cancel = to_utf8($params{cancel} || N("Cancel")); + my $buttons = $params{ok_only} ? "$ok:0" : "$ok:0,$cancel:2"; + $params{add_buttons} and $buttons .= ",$params{add_buttons}"; $msg = to_utf8($msg); `gmessage -default "$ok" -buttons "$buttons" "$msg"`; } @@ -254,6 +255,31 @@ if ($install_src) { @names = (); } +if ($X && @src_files == 1 && @files == 0 && @names == 0 && @src_names == 0 && !$force) { + gmessage( +N("You have selected a source package: + +%s + +You probably didn't want to install it on your computer (installing it +would allow you to make modifications to its sourcecode then compile it). + +What would you like to do?", $src_files[0]), + ok => N("Do nothing"), + cancel => N("Yes\\, really install it"), + add_buttons => N("Save file") . ':1'); + my $rc = $? >> 8; + if ($rc == 0) { + exit(1); + } elsif ($rc == 1) { + my $msg = N("Choose location to save file"); + my $location = `gfilechooser "$msg"`; + if (!$? && $msg) { + exec 'mv', '-f', $src_files[0], $location; + } + } +} + #- question to describe what user who clicked on a rpm in file explorer is really doing if ($X && @files == 1 && @names == 0 && $verbose >= 0) { gmessage( @@ -44,7 +44,7 @@ You can compare rpm vs. urpmi with insmod vs. modprobe %package -n gurpmi Summary: User mode rpm GUI install Group: %{group} -Requires: urpmi >= %{version}-%{release} drakxtools > 10-0.4mdk gchooser gmessage usermode menu +Requires: urpmi >= %{version}-%{release} drakxtools > 10-0.4mdk gtkdialogs >= 2.1 usermode menu Obsoletes: grpmi %description -n gurpmi @@ -236,11 +236,15 @@ $urpm->update_media(nolock => 1, nopubkey => 1); %{compat_perl_vendorlib}/urpm/parallel_ssh.pm %changelog + - fix bug #7472: progressbar forced to be thicker than default (gc) - gurpmi: when cancel button is destroyed forever from within rpmdrake (after all downloads completed) ask gtk to recompute size of toplevel window to not end up with an ugly void space (gc) - gurpmi: add application/x-urpmi mimetype (gc) +- gurpmi: handle case where user clicked on a src.rpm, suggest + user is misleaded, allow to do nothing, really install, or + save on disk (gc) * Tue Feb 3 2004 François Pons <fpons@mandrakesoft.com> 4.4.5-3mdk - fixed bug of reference of ../ in hdlists file. |