summaryrefslogtreecommitdiffstats
path: root/mgaapplet
diff options
context:
space:
mode:
Diffstat (limited to 'mgaapplet')
-rwxr-xr-xmgaapplet9
1 files changed, 3 insertions, 6 deletions
diff --git a/mgaapplet b/mgaapplet
index 1a7a9ef6..b639759c 100755
--- a/mgaapplet
+++ b/mgaapplet
@@ -399,9 +399,8 @@ sub confirm_upgrade() {
Gtk2::FileChooserButton->new(N("Browse"), 'select-folder'),
'current-folder-changed' => sub {
$temp_dir = $_[0]->get_current_folder;
- my $ok = 1;
- require urpm;
- urpm::check_dir({ fatal => sub { $ok = 0 } }, $temp_dir);
+ stat($temp_dir)[4]
+ my $ok = -d $temp_dir && ! -l $temp_dir && (stat($temp_dir)[4] == 0);
$ok or ask_warn(N("Error"), N("You must choose a directory owned by the super administrator!"));
});
$browse->set_current_folder($download_dir);
@@ -434,9 +433,7 @@ sub confirm_upgrade() {
setVar('DO_NOT_ASK_FOR_DISTRO_UPGRADE', bool2text($warn_me));
$local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE} = bool2text($warn_me);
if ($res) {
- require urpm;
- my $ok = 1;
- urpm::check_dir({ fatal => sub { $ok = 0 } }, $temp_dir);
+ my $ok = -d $temp_dir && ! -l $temp_dir && (stat($temp_dir)[4] == 0);
$ok or goto &confirm_upgrade;
$download_dir = $temp_dir;
really_confirm_upgrade();