pkggzip.py revision 3339
461N/A# The contents of this file are subject to the terms of the 461N/A# Common Development and Distribution License (the "License"). 461N/A# You may not use this file except in compliance with the License. 461N/A# See the License for the specific language governing permissions 461N/A# and limitations under the License. 461N/A# When distributing Covered Code, include this CDDL HEADER in each 461N/A# If applicable, add the following below this CDDL HEADER, with the 461N/A# fields enclosed by brackets "[]" replaced with your own identifying 461N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3339N/A# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. 461N/A#ident "%Z%%M% %I% %E% SMI" 461N/A """This is a version of GzipFile that does not include a file 461N/A pathname or timestamp in the gzip header. This allows us to get 461N/A deterministic gzip files on compression, so that we can reliably 542N/A use a cryptographic hash on the compressed content.""" 542N/A # This is a gzip header conforming to RFC1952. The first two bytes 542N/A # (\037,\213) are the gzip magic number. The third byte is the 542N/A # compression method (8, deflate). The fourth byte is the flag byte 542N/A # (0), which indicates that no FNAME, FCOMMENT or other extended data 542N/A # is present. Bytes 5-8 are the MTIME field, zeroed in this case. 542N/A # Byte 9 is the XFL (Extra Flags) field, set to 2 (compressor used 542N/A # max compression). The final bit is the OS type, set to 255 (for