summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2004-02-09 18:26:19 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2004-02-09 18:26:19 +0000
commit16d5d1698725933ae852e0be92c7f4a8823c301a (patch)
tree326a78b914c64abd0f88f59b8793ad7d5473cf83
parent3189f5d5f56c38e7daa24fcb8ec2d0c858f1acc9 (diff)
downloadurpmi-16d5d1698725933ae852e0be92c7f4a8823c301a.tar
urpmi-16d5d1698725933ae852e0be92c7f4a8823c301a.tar.gz
urpmi-16d5d1698725933ae852e0be92c7f4a8823c301a.tar.bz2
urpmi-16d5d1698725933ae852e0be92c7f4a8823c301a.tar.xz
urpmi-16d5d1698725933ae852e0be92c7f4a8823c301a.zip
in binary mode, allow to install file or save it
-rwxr-xr-xurpmi23
1 files changed, 14 insertions, 9 deletions
diff --git a/urpmi b/urpmi
index 6419a793..247bb331 100755
--- a/urpmi
+++ b/urpmi
@@ -147,6 +147,15 @@ sub gmessage {
$msg = to_utf8($msg);
`gmessage -default "$ok" -buttons "$buttons" "$msg"`;
}
+sub save_file {
+ my ($orig) = @_;
+ my $msg = N("Choose location to save file");
+ my $location = `gfilechooser "$msg"`;
+ if (!$? && $location) {
+ exec 'mv', '-f', $orig, $location;
+ }
+ exit(1);
+}
#- parse arguments list.
my @nextargv;
@@ -272,24 +281,20 @@ What would you like to do?", $src_files[0]),
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;
- }
- exit(1);
+ save_file($src_files[0]);
}
}
-#- 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(
N("You are about to install the following software package on your computer:
%s
-Is it ok to continue?", $files[0]));
- $? and exit(1);
+You may prefer to just save it. What is your choice?", $files[0]),
+ ok => N("Install it"),
+ cancel => N("Save file"));
+ $? and save_file($files[0]);
}
#- prepare bug report.