Skip to content

Commit

Permalink
Make sure mod time is not > install time, when installing.
Browse files Browse the repository at this point in the history
By making them always exactly equal.  This includes installs for updates.

Fixes #1723
  • Loading branch information
arantius committed Apr 25, 2013
1 parent 8876616 commit 8578882
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions modules/remoteScript.js
Expand Up @@ -332,12 +332,9 @@ RemoteScript.prototype.install = function(aOldScript, aOnlyDependencies) {
this._tempDir.moveTo(GM_util.scriptDir(), this._baseName);
this._tempDir = null;

// Since we moved the file, it's modtime changed, update the script:
this.script.setModTimeFromFile();
// Let the config know the base/file name has changed to its real value now.
GM_config._changed(this.script, 'modified', this.script.id);

this.script.fixTimestampsOnInstall();
this.script.checkConfig();
this.script._changed('modified');

// Let the user know we're all done.
GM_notification(
Expand Down
3 changes: 2 additions & 1 deletion modules/script.js
Expand Up @@ -259,8 +259,9 @@ Script.prototype.setFilename = function(aBaseName, aFileName) {
if (!this._downloadURL) this._downloadURL = this.fileURL;
};

Script.prototype.setModTimeFromFile = function() {
Script.prototype.fixTimestampsOnInstall = function() {
this._modifiedTime = this.file.lastModifiedTime;
this._installTime = this.file.lastModifiedTime;
};

Script.prototype._loadFromConfigNode = function(node) {
Expand Down

0 comments on commit 8578882

Please sign in to comment.