diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-03-26 17:17:48 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-03-26 17:36:07 +0000 |
commit | 70e58881128ed8170821840138ab08fc5cdd3c11 (patch) | |
tree | 1bf0d3d977878df5b58493ea02b2e6c79df3ba22 /pkgs/servers/zoneminder/0001-Don-t-use-file-timestamp-in-cache-filename.patch | |
parent | a9847c36e6aa003998c1ef5518e5710658ca5770 (diff) | |
parent | 90dcc3360327e250536eeeca7fe9d887c9f7a817 (diff) | |
download | nixpkgs-70e58881128ed8170821840138ab08fc5cdd3c11.tar nixpkgs-70e58881128ed8170821840138ab08fc5cdd3c11.tar.gz nixpkgs-70e58881128ed8170821840138ab08fc5cdd3c11.tar.bz2 nixpkgs-70e58881128ed8170821840138ab08fc5cdd3c11.tar.lz nixpkgs-70e58881128ed8170821840138ab08fc5cdd3c11.tar.xz nixpkgs-70e58881128ed8170821840138ab08fc5cdd3c11.tar.zst nixpkgs-70e58881128ed8170821840138ab08fc5cdd3c11.zip |
Merge remote-tracking branch 'nixpkgs/master' into master
Diffstat (limited to 'pkgs/servers/zoneminder/0001-Don-t-use-file-timestamp-in-cache-filename.patch')
-rw-r--r-- | pkgs/servers/zoneminder/0001-Don-t-use-file-timestamp-in-cache-filename.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/servers/zoneminder/0001-Don-t-use-file-timestamp-in-cache-filename.patch b/pkgs/servers/zoneminder/0001-Don-t-use-file-timestamp-in-cache-filename.patch new file mode 100644 index 00000000000..6ca55a14768 --- /dev/null +++ b/pkgs/servers/zoneminder/0001-Don-t-use-file-timestamp-in-cache-filename.patch @@ -0,0 +1,32 @@ +From db38a11228eceea10dc97ecc87023b4919caa918 Mon Sep 17 00:00:00 2001 +From: Daniel Fullmer <danielrf12@gmail.com> +Date: Fri, 21 Feb 2020 21:52:00 -0500 +Subject: [PATCH] Don't use file timestamp in cache filename + +Every file in the nix store has a timestamp of "1", meaning that the +filename would remain constant even when changing zoneminder versions. +This would mean that newer versions would use the existing symlink to an +older version of the source file. We replace SRC_HASH in nix with a +hash of the source used to build zoneminder to ensure this filename is +unique. +--- + web/includes/functions.php | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/web/includes/functions.php b/web/includes/functions.php +index 19567a5c1..0242c09bc 100644 +--- a/web/includes/functions.php ++++ b/web/includes/functions.php +@@ -2223,7 +2223,8 @@ function cache_bust($file) { + $parts = pathinfo($file); + global $css; + $dirname = preg_replace('/\//', '_', $parts['dirname']); +- $cacheFile = $dirname.'_'.$parts['filename'].'-'.$css.'-'.filemtime($file).'.'.$parts['extension']; ++ $srcHash = '@srcHash@'; ++ $cacheFile = $dirname.'_'.$parts['filename'].'-'.$css.'-'.$srcHash.'.'.$parts['extension']; + if ( file_exists(ZM_DIR_CACHE.'/'.$cacheFile) or symlink(ZM_PATH_WEB.'/'.$file, ZM_DIR_CACHE.'/'.$cacheFile) ) { + return 'cache/'.$cacheFile; + } else { +-- +2.25.1 + |