rezip 0.5.2
Repack ZIP archives
License: MIT
Requires Python: >=3.6


Rezip - Repack ZIP Archives
***************************

Repack ZIP archives with the possibility to update metadata, e.g.,
Unix access right bits. Rezip can be used to fix Windows generated ZIP
archives (e.g., Python wheel packages) so that the archives members
have suitable access rights for usage on Linux.

GitLab page: `https://gitlab.com/dfritzsche/python-rezip <https://gitlab.com/dfritzsche/python-rezip>`_


Using rezip
===========

Usage:

::

   rezip [--inplace]
         [--glob|-g]
         [--normalize-access-rights] [--date-time DATETIME]
         [--output|-o OUTPUT]
         INPUT [INPUT]...

``--inplace``

   Repack in place. This is done by writing to a temporary file and
   then replace the original input file with the temporary output
   file. On Posix systems an atomic move is used for the replacement
   of the original input file by the temporary output file.

   More than one ``INPUT`` file can be specified if ``--inplace`` is
   used.

   Note: The ``--inplace`` option is mutual exclusive with the
   ``--output`` option.

``--glob | -g``

   Treat the input file names as shell glob patterns.

``--normalize-access-rights``

   Normalize the Unix access right bits. Access rights of regular
   non-executable files are modified to ``0o644``. Access rights of
   executable files are modified to be ``0o755``. Rezip considers
   files that already have any executable bit set and files that are
   identified as ELF programs or ELF dynamic libraries as executable.

   Identification as an ELF file is done by looking if the file starts
   with the ELF magic bytes ``b"\x7fELF"`` and then reading the
   *e_type* field of the ELF header. As this is in the end only a
   heuristic, wrong executable-identifcations may happen.

``--date-time DATETIME``

   Set the date time of all files in the ZIP archive to
   ``DATETIME``. The date time ``DATETIME`` must be a Unix timestamp
   or a date time in ISO format that is understood by
   `fromisoformat() <https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat>`_.

``INPUT``

   The ZIP archive to read

   More than one ``INPUT`` file can be specified if ``--inplace`` is
   used. Otherwise, only one ``INPUT`` file is allowed.

``--output | -o``

   The ZIP archive to create and write to.

   Note: The ``--output`` option is mutual exclusive with the
   ``--inplace`` option.


Changelog history
*****************


v0.5.1 (2019-06-21)
===================

* Use `sphinx-rst-builder <https://github.com/davidfritzsche/sphinx-rst-builder>`_ to create
  README.rst and CHANGELOG.rst. This way the full Sphinx markup can be
  used in the source files under ``docs/`` while creating rst files
  that can be previewd by online services like GitLab, Github and
  PyPI.


v0.5.0 (2019-05-26)
===================

* Set `create_system <https://docs.python.org/3/library/zipfile.html#zipfile.ZipInfo.create_system>`_ (PKZIP 4.4.2 *version
  made by*) to *3* (Unix) when modifying
  `external_attr <https://docs.python.org/3/library/zipfile.html#zipfile.ZipInfo.external_attr>`_ to set Unix permissions.
  Unix permissions stored in `external_attr <https://docs.python.org/3/library/zipfile.html#zipfile.ZipInfo.external_attr>`_
  are not correctly restored by `zipfile <https://docs.python.org/3/library/zipfile.html#module-zipfile>`_ or Info-ZIP if
  `create_system <https://docs.python.org/3/library/zipfile.html#zipfile.ZipInfo.create_system>`_ is *0* (FAT).


v0.4.1 (2019-05-21)
===================

* Updated README.


v0.4.0 (2019-05-21)
===================

* New ``--glob`` (or ``-g``) option to treat input file names as shell
  glob patterns.

* Allow multiple input files when using ``--inplace``.

* New ``--output`` (or ``-o``) option to specify the output file.


v0.3.2 (2019-05-19)
===================

* Documentation improvements


v0.3.0 (2019-05-19)
===================

* New ``--date-time`` option to set file date time in the ZIP file


v0.2.2 (2019-05-14)
===================

* Include LICENSE file in sdist


v0.2.1 (2019-05-13)
===================

* Packaging improvements


v0.2.0 (2019-05-13)
===================

* Updated documentation


v0.1.0 (2019-05-13)
===================

* Initial public release

License
=======

MIT License

Copyright (c) 2019 David Fritzsche

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.