summaryrefslogtreecommitdiffstats
path: root/mgaapplet-upgrade-helper
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-04-30 08:47:42 +0000
committerThierry Vignaud <tv@mageia.org>2013-04-30 08:47:42 +0000
commit1d39b99ec43bfd0788522ab9e03ae4dbb1aa792c (patch)
tree6748b24cf018f47a854bf3f43555a32c50af114b /mgaapplet-upgrade-helper
parent227a5089a0537e17628a34329488539f3d476318 (diff)
downloadmgaonline-1d39b99ec43bfd0788522ab9e03ae4dbb1aa792c.tar
mgaonline-1d39b99ec43bfd0788522ab9e03ae4dbb1aa792c.tar.gz
mgaonline-1d39b99ec43bfd0788522ab9e03ae4dbb1aa792c.tar.bz2
mgaonline-1d39b99ec43bfd0788522ab9e03ae4dbb1aa792c.tar.xz
mgaonline-1d39b99ec43bfd0788522ab9e03ae4dbb1aa792c.zip
perl_checker cleanup
Diffstat (limited to 'mgaapplet-upgrade-helper')
-rwxr-xr-xmgaapplet-upgrade-helper8
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'");