Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create "revised-on" if we already have the "new" file #20

Closed
probonopd opened this issue Nov 10, 2019 · 5 comments
Closed

Do not create "revised-on" if we already have the "new" file #20

probonopd opened this issue Nov 10, 2019 · 5 comments

Comments

@probonopd
Copy link
Contributor

probonopd commented Nov 10, 2019

Please do not create "revised-on" if we already have the "new" file, and it is the exact same file (as per its hash) as the "revised-on" one.

Example:

# This is what I already have locally
me@host:~/test$ ls
AppImageUpdater-7420c48-x86_64.AppImage  AppImageUpdater-9b4000e-x86_64.AppImage

# This is the command. Note that I am trying to update the older AppImage (9b4000e) despite that I already have the currently latest version (7420c48):
me@host:~/test$ ./AppImageUpdater-7420c48-x86_64.AppImage -n -d ./AppImageUpdater-9b4000e-x86

# This is the result
me@host:~/test$ ls
AppImageUpdater-7420c48-x86_64.AppImage
AppImageUpdater-7420c48-x86_64-revised-on-2019-11-10T13-33-00.AppImage
AppImageUpdater-9b4000e-x86_64.AppImage

#  The two files are identical:
me@host:~/test$ diff *7420c48*
me@host:~/test$ 

In this case, I do not need a second copy of what I already have. Only the mtime of AppImageUpdater-7420c48-x86_64.AppImage should maybe be updated to reflect that we had worked on this version, although this is debatable.

@luzpaz
Copy link

luzpaz commented Jul 12, 2020

Related: #17

@antony-jr
Copy link
Owner

I think this can be fixed if we hash the existing file with the same target file name. But that would be expensive if the file is too large. I'm doing a rewrite so I think I can fix this some time along the way.

@probonopd
Copy link
Contributor Author

Would need to check the checksum of the "old" file to make sure that it is really the same as the "new" file.

@antony-jr
Copy link
Owner

Would need to check the checksum of the "old" file to make sure that it is really the same as the "new" file.

So the old file must only be touched(changing the mod time) and no update should be done. No rename or anything?

@probonopd
Copy link
Contributor Author

Yes, I'd say that is the desirable user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants