From: Sergey Matveev Date: Tue, 3 Sep 2024 18:47:57 +0000 (+0300) Subject: ZIP does not handle <1980, let's be friendly to it X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=efbf710477da9fcdf935bb57d66d5f4b090ff4a3e90d89240772b3251b28d0cf;p=bass.git ZIP does not handle <1980, let's be friendly to it --- diff --git a/build/contrib/detpax/README b/build/contrib/detpax/README index 00e3680..89884a5 100644 --- a/build/contrib/detpax/README +++ b/build/contrib/detpax/README @@ -12,8 +12,8 @@ pax format creation leads to inclusion of precise timestamps in bsdtar. And there are no options to skip that behaviour. detpax stores only minimal set of metainformation. Directories walking -is done in a sorted way. No UIDs/GIDs or any kind of timestamps are -stored, but permissions with sticky/setuid/setgid bits. +is done in a sorted way. No UIDs/GIDs or any kind of timestamps are stored +(except for dummy mtime), but permissions with sticky/setuid/setgid bits. It also has ability to set higher precedence ordering for some directories. For example BASS packages stores their dependencies as diff --git a/build/contrib/detpax/main.go b/build/contrib/detpax/main.go index c534fa8..51f8e4b 100644 --- a/build/contrib/detpax/main.go +++ b/build/contrib/detpax/main.go @@ -26,6 +26,7 @@ import ( "sort" "strings" "syscall" + "time" ) const ( @@ -176,7 +177,10 @@ will put dir/foo/bar first, dir/foo second, others next.`) return files[i].order < files[j].order }) - hdr := tar.Header{Format: tar.FormatPAX} + hdr := tar.Header{ + Format: tar.FormatPAX, + ModTime: time.Date(1981, 1, 1, 0, 0, 0, 0, time.UTC), + } for _, info := range files { hdr.Name = info.name hdr.Mode = int64(info.mode & 0o777)