lit icon indicating copy to clipboard operation
lit copied to clipboard

No files timestamps in zip file

Open joerg-krause opened this issue 10 years ago • 7 comments

Unzipping the zipped release file fetched from https://lit.luvit.io/packages/luvit/lit using unzip on Linux gives a wrong timestamp:

$ unzip v2.3.1.zip -d lit-2.3.1

$ ls -l /home/joerg/lit-2.3.1/main.lua 
-rw-r--r-- 1 joerg joerg 1951 31. Dez 1979  /home/joerg/lit-2.3.1/main.lua

$ stat /home/joerg/lit-2.3.1/main.lua
Access: 1979-12-31 00:00:00.000000000 +0100
Modify: 1979-12-31 00:00:00.000000000 +0100
Change: 2015-12-23 22:15:55.132868757 +0100

I've checked the zip files, and the files have a zero timestamp now. I'm not sure, if this may cause some trouble in some systems.

EDIT: I realized that the files are not fetched from lit install, but from wget and using unzip on the fetched zip file.

joerg-krause avatar Dec 23 '15 21:12 joerg-krause

Yes, I no-longer include the timestamps because it's very hard to get the actual timestamp and I need something that doesn't change between builds.

I suppose I could walk back in history of the git tags (by decrementing the version number and seeing if such a tag exists) and seeing when the contents of a file at a certain path change. This would be a very expensive and hard to do algorithm.

creationix avatar Dec 24 '15 19:12 creationix

How about caching a release file?

joerg-krause avatar Dec 24 '15 20:12 joerg-krause

Caching could be done, but if the cache was ever cleared then the release hash would change. So this is more than just caching for optimization sake, it would need stronger guarantees.

Also is there any real problem with files not having valid timestamps?

creationix avatar Dec 27 '15 05:12 creationix

Sorry for my ignorance, but why not create a release tarball (by the author), store it on the server (like github does), and fetch it by lit?

There are some cloud data tools relying on a files timestamps, e.g. ownCloud. Maybe there are some other reasons (maybe security?) I do not know of.

joerg-krause avatar Jan 06 '16 10:01 joerg-krause

What if all files had the timestamp of the git tag for the release? Then they would be consistent and relatively accurate. I would need to add in the functionality to miniz to allow custom timestamps (currently the only options are "current time" or "no timestamp"). But this wouldn't be the first time I've added features or fixed bugs in miniz for luvi.

creationix avatar Jan 06 '16 13:01 creationix

Good idea! This way the files would have a sane timestamp.

joerg-krause avatar Jan 06 '16 13:01 joerg-krause

See https://github.com/luvit/luvi/issues/133 for progress. Then adding the functionality to lit should be easy.

creationix avatar Jan 06 '16 13:01 creationix