Subject: Re: [bug#34223] Fixing timestamps in archives.

From: Ludovic Courtès <[email-masked]>
Date: Mon, 18 Feb 2019 23:24:11 +0100

Hello,

Tim Gesthuizen <[email-masked]> skribis:

>> I played a bit with this idea and, as an example, the attached file
>> allows you to traverse the list of entries in a zip file (it uses
>> ‘guile-bytestructures’).  Specifically, you can get the list of file
>> names in a zip file by running:
>>
>>   (call-with-input-file "something.zip"
>>     (lambda (port)
>>       (fold-entries cons '() port)))
>>
>> Resetting timestamps should be just as simple.
>>
>> How about taking this route?
>
> I also thought about taking this route.
> There are some problems with it though:
>
> - As Julien pointed out, the archive contents need to be uncompressed.
>   This makes the problem much more complex and keeps us from writing
>   a partial ZIP parser that replaces the timestamps in place.

True, I had overlooked that.  In that case, we should definitely unpack
and repack using the ‘zip’ package (I wasn’t suggesting to write a
complete ‘zip’ implementation; I do think it would be valuable in the
long term, but it’s a project for another time, no question here.)

In that case though, it probably doesn’t buy us much to use libarchive
in a separate C program, WDYT?  Should we just stick to the current
approach that invokes ‘unzip’ and ‘zip’?

Thanks,
Ludo’.