diff options
author | Robin Gareus <robin@gareus.org> | 2017-11-29 15:08:25 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-11-29 15:08:25 +0100 |
commit | a3ec1644503ef0a3e83efc030033cf5665c15a87 (patch) | |
tree | 451da82220e184116ada67f19d7438cbd92431d9 /libs | |
parent | 7b8646f340d2edc27606b1d87546191075f2c6a5 (diff) |
Set VST cache file mtime to be at least as new as the plugin
Fixes issues with timezones when installing pluins from a .zip
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/vst_info_file.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/vst_info_file.cc b/libs/ardour/vst_info_file.cc index d58b7a94a5..df28cbc02e 100644 --- a/libs/ardour/vst_info_file.cc +++ b/libs/ardour/vst_info_file.cc @@ -26,6 +26,7 @@ #include <sys/types.h> #include <fcntl.h> +#include <utime.h> #include <unistd.h> #include <errno.h> @@ -1078,6 +1079,19 @@ vstfx_get_info (const char* dllpath, enum ARDOUR::PluginType type, enum VSTScanM } else { vstfx_write_info_file (infofile, infos); fclose (infofile); + + /* In some cases the .dll may have a modification time in the future, + * (e.g. unzip a VST plugin: .zip files don't include timezones) + */ + string const fsipath = vstfx_infofile_path (dllpath); + GStatBuf dllstat; + GStatBuf fsistat; + if (g_stat (dllpath, &dllstat) == 0 && g_stat (fsipath.c_str (), &fsistat) == 0) { + struct utimbuf utb; + utb.actime = fsistat.st_atime; + utb.modtime = std::max (dllstat.st_mtime, fsistat.st_mtime); + g_utime (fsipath.c_str (), &utb); + } } return infos; } |