Correctly set date and mode fields for MANIFEST.MF
The file header returned by jar.ManifestFileContents had unset date and mode fields. The unset date field resulted in the "Last Mod Time" field in the zip file being set to 0, which OpenJDK 9's jar implementation treats as an error: java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0 Bug: 67095392 Test: zipdetails out/host/linux-x86/framework/tradefed.jar Change-Id: I0a818d57420f5e5de57e8ff57791951c1b538443
This commit is contained in:
@@ -94,6 +94,8 @@ func ManifestFileContents(src string) (*zip.FileHeader, []byte, error) {
|
|||||||
Method: zip.Store,
|
Method: zip.Store,
|
||||||
UncompressedSize64: uint64(len(b)),
|
UncompressedSize64: uint64(len(b)),
|
||||||
}
|
}
|
||||||
|
fh.SetMode(0700)
|
||||||
|
fh.SetModTime(DefaultTime)
|
||||||
|
|
||||||
return fh, b, nil
|
return fh, b, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user