Commit 4983a7bc authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

Bug 546871: Make checksetup.pl not try to fix the permissions of

bugzilla-update.xml, to avoid warnings. r=LpSolit, a=LpSolit
parent dd9c3652
......@@ -137,7 +137,6 @@ sub FILESYSTEM {
'docs/style.css' => { perms => $ws_readable },
'docs/*/rel_notes.txt' => { perms => $ws_readable },
'docs/*/README.docs' => { perms => $owner_readable },
"$datadir/bugzilla-update.xml" => { perms => $ws_writeable },
"$datadir/params" => { perms => $ws_writeable },
"$datadir/old-params.txt" => { perms => $owner_readable },
"$extensionsdir/create.pl" => { perms => $owner_executable },
......
......@@ -34,19 +34,14 @@ sub get_notifications {
# Update the local XML file if this one doesn't exist or if
# the last modification time (stat[9]) is older than TIME_INTERVAL.
if (!-e $local_file || (time() - (stat($local_file))[9] > TIME_INTERVAL)) {
# Are we sure we didn't try to refresh this file already
# but we failed because we cannot modify its timestamp?
my $can_alter = (-e $local_file) ? utime(undef, undef, $local_file) : 1;
if ($can_alter) {
unlink $local_file; # Make sure the old copy is away.
if (-e $local_file) {
return { error => 'no_update', xml_file => $local_file };
}
my $error = _synchronize_data();
# If an error is returned, leave now.
return $error if $error;
}
else {
return {'error' => 'no_update', 'xml_file' => $local_file};
}
}
# If we cannot access the local XML file, ignore it.
return {'error' => 'no_access', 'xml_file' => $local_file} unless (-r $local_file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment