debian-forge-composer/internal/weldr
Ondřej Budai 454e471af8 api/weldr: bring tars back from the future
By default, go's tar archiver uses USTAR header format. Unfortunately, this
format doesn't support sub-second resolution for ModTime. Go solves this by
*rounding* the time. Sometimes, this creates an archive containing a file
with modtime from the future. When such archive is untarred by GNU tar,
the following message is produced:

tar: bf548dfd-0a90-40e6-bbf2-dcdd82fcbb4e.json: time stamp 2020-07-13
13:34:31 is 0.356223173 s in the future

We have two options here:

1) Use gnu header format that supports sub-second resolution. Unfortunately,
   it seems that not all tar archivers support this format (e.g. 7-zip).

2) The other option is to truncate the date (instead of rounding).

I went with option 2.

Also, this commit adds a test to check that the header is not from the future.
Without this fix, the test is actually failing, I verified this manually.

Fixes #854
2020-07-15 08:58:25 +01:00
..
api.go api/weldr: bring tars back from the future 2020-07-15 08:58:25 +01:00
api_test.go api/weldr: bring tars back from the future 2020-07-15 08:58:25 +01:00
compose.go weldr: use compose status for targets as well 2020-06-03 11:49:20 +02:00
json.go weldr: implement cancel route 2020-06-12 10:00:50 +02:00
upload.go weldr: use compose status for targets as well 2020-06-03 11:49:20 +02:00
util.go composer/job-queue: add scaffolding for the job queue API 2019-09-26 19:53:06 +02:00