[Scummvm-git-logs] scummvm-web master -> 7304245d401ffa176c910c6c4110f56e58e0f3bb

Mataniko mataniko at gmail.com
Mon Nov 19 16:41:16 CET 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
7304245d40 WEB: Calculate hash if the file is newer than the hash file


Commit: 7304245d401ffa176c910c6c4110f56e58e0f3bb
    https://github.com/scummvm/scummvm-web/commit/7304245d401ffa176c910c6c4110f56e58e0f3bb
Author: Matan Bareket (mataniko at gmail.com)
Date: 2018-11-19T10:38:38-05:00

Commit Message:
WEB: Calculate hash if the file is newer than the hash file

This allows us to update files and dailies and keep the hash current

Changed paths:
    include/Objects/File.php


diff --git a/include/Objects/File.php b/include/Objects/File.php
index 76c906a..9d440e3 100644
--- a/include/Objects/File.php
+++ b/include/Objects/File.php
@@ -64,7 +64,9 @@ class File extends BasicObject {
 				if ($ext == '.bz2' || $ext == '.gz' || $ext == '.xz' || $ext == '.7z')
 					$ext = substr($url, strrpos($url, '.', -(strlen($url) - strrpos($url, '.') + 1)));
 
-        if (is_file($fname . '.sha256') && is_readable($fname . '.sha256')) {
+        if ( (is_file($fname . '.sha256') && is_readable($fname . '.sha256'))
+             && (@filemtime($fname . '.sha256') > @filemtime($fname)) )
+        {
           $this->_extra_info['sha256'] = file_get_contents($fname . '.sha256');
         } else {
           $hash = hash_file('sha256', $fname);
@@ -90,7 +92,7 @@ class File extends BasicObject {
 				}
 			}
 		}
-	}
+  }
 
 	/* Get the category icon. */
 	public function getCategoryIcon() {





More information about the Scummvm-git-logs mailing list