diff options
Diffstat (limited to 'mgaapplet-upgrade-helper')
-rwxr-xr-x | mgaapplet-upgrade-helper | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mgaapplet-upgrade-helper b/mgaapplet-upgrade-helper index d5c32a71..f06dade4 100755 --- a/mgaapplet-upgrade-helper +++ b/mgaapplet-upgrade-helper @@ -77,7 +77,7 @@ if (!$new_distro) { if ($new_distro->{needs_preparation}) { my $statefile = "$root/var/lib/mageia-prepare-upgrade/state"; - my $prepared = (cat_($statefile) =~ /ready/) if ( -f $statefile ); + my $prepared = -f $statefile && cat_($statefile) =~ /ready/; if (!$prepared) { ugtk2::ask_yesorno(N("Preparation Required"), N("In order to upgrade, your current installation needs to be prepared.\n\nDo you wish to do this preparation now?")) or exit(0); @@ -87,11 +87,11 @@ if ($new_distro->{needs_preparation}) { $do_pkgs->ensure_is_installed("mageia-prepare-upgrade") or exit(0); # Check to see if installation alone is enough to ensure things are in the right state? - $prepared = (cat_($statefile) =~ /ready/) if ( -f $statefile ); + $prepared = -f $statefile && cat_($statefile) =~ /ready/; if (!$prepared) { my $infofile = "$root/usr/share/doc/mageia-prepare-upgrade/README.prepare"; - my $info = ugtk2::escape_text_for_TextView_markup_format(join '', cat_($infofile)) if ( -f $infofile ); - $info = N("Further action is required before you can continue.\n\nPlease see %s for more information.", $new_distro->{url}) if !$info; + my $info = -f $infofile && ugtk2::escape_text_for_TextView_markup_format(join('', cat_($infofile))); + $info ||= N("Further action is required before you can continue.\n\nPlease see %s for more information.", $new_distro->{url}); ugtk2::ask_warn(N("Next Steps"), $info); exit(0) if !$::testing; log::l("I would validate /var/lib/mageia-prepare-upgrade/state == 'ready'"); |