]> Cypherpunks repositories - bass.git/commitdiff
ZIP does not handle <1980, let's be friendly to it
authorSergey Matveev <stargrave@stargrave.org>
Tue, 3 Sep 2024 18:47:57 +0000 (21:47 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 3 Sep 2024 18:47:57 +0000 (21:47 +0300)
build/contrib/detpax/README
build/contrib/detpax/main.go

index 00e36802780282922ad5eaea0aaccd3cbe34050d45afe94d71f25e49c0491224..89884a5429988b67937d46e134f710c6ce7c108b63213ef7ade28a1a75ad24a3 100644 (file)
@@ -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
index c534fa8eba6b8f71bb38b1821f56635a436eedd8459323ab635942fc0cc3bf40..51f8e4b4cbe3cd4e845e9bd34c532b28868369f9e4676b1adf2208944a9011fe 100644 (file)
@@ -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)