pristine-lfs-20190910.0/0000755000000000000000000000000013535751144014504 5ustar rootroot00000000000000pristine-lfs-20190910.0/.gitignore0000644000000000000000000000130413520272715016466 0ustar rootroot00000000000000# Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ pip-wheel-metadata/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ .pytest_cache/ # Translations *.mo *.pot # Sphinx documentation docs/_build/ # pyenv .python-version # Environments .env .venv env/ venv/ # mypy .mypy_cache/ .dmypy.json dmypy.json # Pyre type checker .pyre/ pristine-lfs-20190910.0/.gitlab-ci.yml0000644000000000000000000000056613520547147017147 0ustar rootroot00000000000000image: debian:testing cache: paths: - build - '*.egg-info' before_script: - apt update - apt install -y --no-install-recommends ca-certificates python3-sh python3-docutils python3-setuptools python3-all git build: stage: build script: - ./setup.py build - ./setup.py sdist artifacts: paths: - dist/* test: script: - ./setup.py test pristine-lfs-20190910.0/CONTRIBUTORS0000644000000000000000000000024413464236341016362 0ustar rootroot00000000000000 * Andrej Shadura 2019 The manual page is based on the original manual page for pristine-tar by: * Joey Hess pristine-lfs-20190910.0/COPYING0000644000000000000000000004325413314144460015537 0ustar rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. pristine-lfs-20190910.0/PKG-INFO0000644000000000000000000000535013535751144015604 0ustar rootroot00000000000000Metadata-Version: 1.1 Name: pristine-lfs Version: 20190910.0 Summary: a pristine-tar replacement that works with Git LFS Home-page: https://salsa.debian.org/pristine-lfs-team/pristine-lfs Author: Andrej Shadura Author-email: andrew.shadura@collabora.co.uk License: GPL-2+ Description: ============ pristine-lfs ============ About ----- **pristine-lfs** is a tool to replace *pristine-tar* by the means of using Git LFS to store tarballs. The original *pristine-tar* tool is a way to store binary tarballs in Git by regenerating them using only a small binary delta file and a checkout of the upstream branch. Installation ------------ *pristine-lfs* assumes you have Python 3.6 or later installed as ``/usr/bin/python3``. *pristine-lfs* ships with a setup.py installer based on setuptools. To install *pristine-lfs*, simply type:: ./setup.py install This will install *pristine-lfs* itself, its manpage and this README file into their proper locations. Alternatively, to install via ``pip``, run:: pip install pristine-lfs License ------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 text for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Authors ------- For the list of contributors, see CONTRIBUTORS. Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: Software Development :: Version Control :: Git pristine-lfs-20190910.0/README.rst0000644000000000000000000000277313520272170016173 0ustar rootroot00000000000000============ pristine-lfs ============ About ----- **pristine-lfs** is a tool to replace *pristine-tar* by the means of using Git LFS to store tarballs. The original *pristine-tar* tool is a way to store binary tarballs in Git by regenerating them using only a small binary delta file and a checkout of the upstream branch. Installation ------------ *pristine-lfs* assumes you have Python 3.6 or later installed as ``/usr/bin/python3``. *pristine-lfs* ships with a setup.py installer based on setuptools. To install *pristine-lfs*, simply type:: ./setup.py install This will install *pristine-lfs* itself, its manpage and this README file into their proper locations. Alternatively, to install via ``pip``, run:: pip install pristine-lfs License ------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 text for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Authors ------- For the list of contributors, see CONTRIBUTORS. pristine-lfs-20190910.0/pristine-lfs.10000644000000000000000000000767313520311536017211 0ustar rootroot00000000000000.\" Man page generated from reStructuredText. . .TH PRISTINE-LFS 1 "2019-06-26" "20190626.0" "Git" .SH NAME pristine-lfs \- store pristine tarballs in Git LFS . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp \fBpristine\-lfs\fP [\-h] .sp \fBpristine\-lfs\fP [OPTIONS] \fBcommit\fP [OPTIONS] \fItarball\fP [\fIupstream\fP] .sp \fBpristine\-lfs\fP [OPTIONS] \fBcheckout\fP \fItarball\fP [\fIoutdir\fP] .sp \fBpristine\-lfs\fP [OPTIONS] \fBlist\fP \fItarball\fP .SH DESCRIPTION .sp pristine\-lfs can store pristine upstream tarballs in Git leveraging Git LFS. Instead of storing the potentially large tarballs within the Git repository as blobs, Git LFS only stores specially prepared metadata in the repository, while storing the actual file contents out of band on a Git LFS server. .sp Using pristine\-lfs allows Debian packages to be built entirely using sources in version control, without the need to keep copies of upstream tarballs. .sp pristine\-lfs supports tarballs compressed with gzip, bzip2, lzma and xz. .sp Tarball signatures (any files ending with \fI\&.asc\fP) are committed as they are, without utilising the Git LFS mechanisms. .SH COMMANDS .INDENT 0.0 .TP .B \fBpristine\-lfs commit\fP [\-b \fIBRANCH\fP] [\-m \fIMESSAGE\fP] \fItarball\fP [\fIupstream\fP] \fBpristine\-lfs commit\fP stores the specified \fItarball\fP using Git LFS, and commits its metadata to version control. The \fBpristine\-lfs checkout\fP command can later be used to recreate the original tarball based on the information stored in Git LFS. The data are not submitted to the server until \fBgit push\fP command is issued. .sp The \fIupstream\fP parameter is ignored and is supported for compatibility with \fBpristine\-tar\fP\&. .sp If tarball already exists previously, it will only be overwritten if it does not match a hash of the tarball that has been committed to version control. .TP .B \fBpristine\-lfs import\-dsc\fP [\-b \fIBRANCH\fP] [\-m \fIMESSAGE\fP] \fIpath\-to\-dsc\fP Import tarballs and their signatures from a \fI\&.dsc\fP file of a Debian source package. .TP .B \fBpristine\-lfs checkout\fP [\-b \fIBRANCH\fP] \fItarball\fP [\fIoutdir\fP] This regenerates a copy of the specified tarball using information previously saved in version control by \fBpristine\-lfs commit\fP\&. .sp By default, the tarball is placed in the current directory. If \fIoutdir\fP is specified, the file is created in that directory. .TP .B \fBpristine\-lfs list\fP [\-b \fIBRANCH\fP] This lists tarballs that pristine\-lfs is able to checkout from version control. .UNINDENT .SH OPTIONS .INDENT 0.0 .TP .BI \-m \ MESSAGE\fP,\fB \ \-\-message\fB= MESSAGE Use the given \fIMESSAGE\fP as the commit message for the metadate commits. Applies to \fBcommit\fP and \fBimport\-dsc\fP commands. \fI%s\fP in the commit message is replaced by a comma\-separated list of files committed. .TP .BI \-b \ BRANCH\fP,\fB \ \-\-branch \ BRANCH Branch to store Git LFS metadata on. .TP .B \-v\fP,\fB \-\-verbose Be more verbose. .TP .B \-\-debug Show all sorts of debugging information. Implies \fB\-\-verbose\fP\&. .TP .B \-h Show this help message and exit. .UNINDENT .SH ENVIRONMENT .INDENT 0.0 .TP .B \fBTMPDIR\fP Specifies a location to place temporary files, other than the default. .UNINDENT .SH SEE ALSO .sp \fBgit\-lfs\fP(1), \fBpristine\-tar\fP(1) .SH AUTHOR Andrej Shadura .\" Generated by docutils manpage writer. . pristine-lfs-20190910.0/pristine-lfs.rst0000644000000000000000000000736413535751106017665 0ustar rootroot00000000000000============ pristine-lfs ============ ---------------------------------- store pristine tarballs in Git LFS ---------------------------------- :Author: Andrej Shadura :Date: 2019-06-26 :Version: 20190626.0 :Manual section: 1 :Manual group: Git SYNOPSIS ======== **pristine-lfs** [-h] **pristine-lfs** [OPTIONS] **commit** [OPTIONS] (--auto | `tarball`) [`upstream`] **pristine-lfs** [OPTIONS] **import-dsc** [OPTIONS] `dsc` **pristine-lfs** [OPTIONS] **checkout** `tarball` [`outdir`] **pristine-lfs** [OPTIONS] **list** `tarball` DESCRIPTION =========== pristine-lfs can store pristine upstream tarballs in Git leveraging Git LFS. Instead of storing the potentially large tarballs within the Git repository as blobs, Git LFS only stores specially prepared metadata in the repository, while storing the actual file contents out of band on a Git LFS server. Using pristine-lfs allows Debian packages to be built entirely using sources in version control, without the need to keep copies of upstream tarballs. pristine-lfs supports tarballs compressed with gzip, bzip2, lzma and xz. Tarball signatures (any files ending with `.asc`) are committed as they are, without utilising the Git LFS mechanisms. COMMANDS ======== **pristine-lfs commit** [-b `BRANCH`] [-m `MESSAGE`] [--force-overwrite] `tarball` [`upstream`] **pristine-lfs commit** stores the specified `tarball` using Git LFS, and commits its metadata to version control. The **pristine-lfs checkout** command can later be used to recreate the original tarball based on the information stored in Git LFS. The data are not submitted to the server until **git push** command is issued. The `upstream` parameter is ignored and is supported for compatibility with **pristine-tar**. If tarball with a different hash has already been committed, it will only be overwritten if `--force-overwrite` is specified. **pristine-lfs import-dsc** [-b `BRANCH`] [-m `MESSAGE`] [--force-overwrite] [--full] `path-to-dsc` Import tarballs and their signatures from a `.dsc` file of a Debian source package. If `--full` is specified, also imports the Debian packaging and the `.dsc` file itself. If tarball with a different hash has already been committed, it will only be overwritten if `--force-overwrite` is specified. **pristine-lfs checkout** [-b `BRANCH`] [-o `outdir`] (--auto | [--full] `tarball`) This regenerates a copy of the specified tarball using information previously saved in version control by **pristine-lfs commit**. By default, the tarball is placed in the current directory. If `outdir` is specified, the file is created in that directory. If `--auto` is specified, pristine-lfs will consult a file named `debian/changelog`, and if it exists, will check out all tarballs associated with the latest version the changelog mentions. If `--full` is specified and a `.dsc` file is requested, also checks the Debian packaging and the `.dsc` file itself. **pristine-lfs list** [-b `BRANCH`] This lists tarballs that pristine-lfs is able to checkout from version control. OPTIONS ======= -m MESSAGE, --message=MESSAGE Use the given `MESSAGE` as the commit message for the metadate commits. Applies to **commit** and **import-dsc** commands. `%s` in the commit message is replaced by a comma-separated list of files committed. -b BRANCH, --branch BRANCH Branch to store Git LFS metadata on. -v, --verbose Be more verbose. --debug Show all sorts of debugging information. Implies ``--verbose``. -h Show this help message and exit. ENVIRONMENT =========== **TMPDIR** Specifies a location to place temporary files, other than the default. SEE ALSO ======== **git-lfs**\(1), **pristine-tar**\(1) pristine-lfs-20190910.0/pristine_lfs/0000755000000000000000000000000013535751144017205 5ustar rootroot00000000000000pristine-lfs-20190910.0/pristine_lfs/__init__.py0000644000000000000000000000000013462606663021310 0ustar rootroot00000000000000pristine-lfs-20190910.0/pristine_lfs/main.py0000644000000000000000000002165713535744637020527 0ustar rootroot00000000000000############################################################################# # pristine-lfs # # store pristine tarballs in Git LFS # # Copyright (C) 2019 Collabora Ltd # Andrej Shadura # This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later # version. # This program is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the GNU General Public License version 2 # text for more details. # You should have received a copy of the GNU General Public # License along with this package; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA ############################################################################# from gettext import gettext as _ import os import sys from . import util from .util import * import logging import argparse import sh from fnmatch import fnmatch from pathlib import Path from debian import deb822 from debian.changelog import Version, Changelog from typing import Optional, List def find_branch(branch: str) -> str: if check_branch(branch) is None: remote_branches = find_remote_branches(branch) if remote_branches: commit, branch = remote_branches[0] else: raise util.Abort(_('No branch {branch} found, not even among remote branches').format(branch=branch)) return branch def do_commit(args: argparse.Namespace): if check_branch(args.branch) is None: if find_remote_branches(args.branch): track_remote_branch(args.branch) commit_lfs_file(args.tarball, args.branch, args.message, overwrite=args.force_overwrite) def do_checkout(args: argparse.Namespace): branch = find_branch(args.branch) os.makedirs(args.outdir, exist_ok=True) if args.auto: changelog = Path("debian/changelog") if not changelog.is_file(): raise util.Abort(_('file %s not found ') % changelog) with changelog.open() as f: ch = Changelog(f, max_blocks=1) package, version = ch.package, ch.version if args.full: if not args.auto: dsc_file = args.tarball else: fver = Version(ch.version) fver.epoch = None dsc_file = f'{package}_{fver}.dsc' logging.info(_("Checking out file {} in {}").format(dsc_file, args.outdir)) checkout_lfs_file(branch, dsc_file, args.outdir) if dsc_file.endswith('.dsc'): with (Path(args.outdir) / dsc_file).open('r') as dsc: d = deb822.Dsc(dsc) package = d['Source'] version = Version(d['Version']) files = [f["name"] for f in d["Files"]] checkout_package(package, version, branch, args.outdir, files) else: if not args.auto: logging.info(_("Checking out file {} in {}").format(args.tarball, args.outdir)) checkout_lfs_file(branch, args.tarball, args.outdir) else: checkout_package(package, version, branch, args.outdir) def checkout_package(package: str, version: Version, branch: str, outdir: str, requested: Optional[Sequence[str]] = None): logging.info(_("Checking out files for {package} version {version} to {outdir}:").format(package=package, version=version, outdir=outdir)) tarball_glob = f'{package}_{version.upstream_version}.orig.tar.*' component_tarball_glob = f'{package}_{version.upstream_version}.orig-*.tar.*' files = list_git_files(branch) if requested: # TODO: handle missing files tarballs = [f for f in files if f in requested] else: tarballs = [f for f in files if fnmatch(f, tarball_glob) or fnmatch(f, component_tarball_glob)] os.makedirs(outdir, exist_ok=True) for f in tarballs: logging.info(" ... {}".format(f)) checkout_lfs_file(branch, f, outdir) logging.info(_("Done.")) def do_list(args: argparse.Namespace): branch = find_branch(args.branch) for f in list_git_files(branch): if f != '.gitattributes': print(f) def do_import(args: argparse.Namespace): d = deb822.Dsc(args.dsc) package = d['Source'] version = Version(d['Version']) tarball_glob = f'{package}_{version.upstream_version}.orig.tar.*' component_tarball_glob = f'{package}_{version.upstream_version}.orig-*.tar.*' dsc_dir = os.path.dirname(args.dsc.name) if check_branch(args.branch) is None: if find_remote_branches(args.branch): track_remote_branch(args.branch) tarballs = [os.path.join(dsc_dir, f['name']) for f in d['Files'] if args.full or fnmatch(f['name'], tarball_glob) or fnmatch(f['name'], component_tarball_glob)] if args.full: tarballs += [args.dsc.name] if tarballs: logging.info("Importing: %s" % " ".join(tarballs)) commit_lfs_files([open(tarball, 'rb') for tarball in tarballs], args.branch, args.message, overwrite=args.force_overwrite) def main(): prog = os.path.basename(sys.argv[0]) parser = argparse.ArgumentParser(description=_('store pristine tarballs in Git LFS'), prog=prog) parser.add_argument('-v', '--verbose', action='count', help=_('be more verbose')) parser.add_argument('--debug', action='store_const', const=2, dest='verbose', help=_('be debuggingly verbose')) parser.set_defaults(verbose=0, func=lambda x: parser.print_usage(file=sys.stderr)) subparsers = parser.add_subparsers(required=False) parser_commit = subparsers.add_parser('commit', help=_('commit a tarball')) parser_commit.add_argument('--force-overwrite', action='store_true', help=_('overwrite already stored files')) parser_commit.add_argument('-m', '--message', default=None, help=_('commit message')) parser_commit.add_argument('-b', '--branch', default='pristine-lfs', help=_('branch to store metadata on')) parser_commit.add_argument('tarball', type=argparse.FileType('rb'), help=_('tarball to commit')) parser_commit.add_argument('upstream', nargs='?', default=None, help=_('ignored')) parser_commit.set_defaults(func=do_commit) # we have to do some trickery since argparse doesn’t support this syntax natively parser_checkout = subparsers.add_parser('checkout', help=_('checkout a tarball')) parser_checkout.add_argument('-b', '--branch', default='pristine-lfs', help=_('branch to store metadata on')) parser_checkout.add_argument('--full', default=False, action='store_true', help=_('also check out all related files of the Debian package')) parser_checkout.add_argument('-o', '--outdir', default='.', help=_('output directory for the tarball')) checkout_group = parser_checkout.add_mutually_exclusive_group(required=True) checkout_group.add_argument('--auto', default=False, action='store_true', help=_('check out all tarballs required by the currently checked out Debian package')) checkout_group.add_argument('tarball', nargs='?', default=None, help=_('tarball to check out')) parser_checkout.set_defaults(func=do_checkout) parser_list = subparsers.add_parser('list', help=_('list tarballs stored in the repository')) parser_list.add_argument('-b', '--branch', default='pristine-lfs', help=_('branch to store metadata on')) parser_list.set_defaults(func=do_list) parser_import = subparsers.add_parser('import-dsc', help=_('import tarballs and their signatures from a .dsc')) parser_import.add_argument('dsc', type=argparse.FileType('r'), help='.dsc file to use') parser_import.add_argument('--force-overwrite', action='store_true', help=_('overwrite already stored files')) parser_import.add_argument('--full', default=False, action='store_true', help=_('also import all related files of the Debian package')) parser_import.add_argument('-m', '--message', default=None, help=_('commit message')) parser_import.add_argument('-b', '--branch', default='pristine-lfs', help=_('branch to store metadata on')) parser_import.set_defaults(func=do_import) args = parser.parse_args() logging.basicConfig(format='{levelname[0]}: {message!s}', style='{', level=(logging.WARNING - 10 * args.verbose)) # sh is printing debug on the info channel logging.getLogger(sh.__name__).setLevel(logging.WARNING - 10 * (args.verbose - 1)) try: args.func(args) except sh.ErrorReturnCode as e: print(_('Failed to run %s:') % e.full_cmd, file=sys.stderr) print(e.stderr.decode(sh.DEFAULT_ENCODING, "replace"), file=sys.stderr) sys.exit(e.exit_code) except KeyboardInterrupt as e: print(file=sys.stderr) print(_('about: Interrupted by user'), file=sys.stderr) sys.exit(1) except util.Abort as e: print(_("abort: %s\n") % e, file=sys.stderr) sys.exit(1) pristine-lfs-20190910.0/pristine_lfs/util.py0000644000000000000000000002242113535744702020537 0ustar rootroot00000000000000############################################################################# # pristine-lfs # # Git and Git LFS routines # This requires Git and git-lfs to be installed. # # Copyright (C) 2019 Collabora Ltd # Andrej Shadura # This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later # version. # This program is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the GNU General Public License version 2 # text for more details. # You should have received a copy of the GNU General Public # License along with this package; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA ############################################################################# from gettext import gettext as _ import logging import sh import sh.contrib import os from pathlib import Path from fnmatch import fnmatchcase from contextlib import contextmanager from typing import Optional, Tuple, List, Sequence, IO, Any, Union, Mapping gitattributes = """*.tar.* filter=lfs diff=lfs merge=lfs -text *.tar.*.asc -filter -diff merge=binary -text *.dsc -filter !diff merge=binary !text """ pre_push_hook = """#!/bin/sh -e case "$GIT_LFS_SKIP_PUSH" in true | on | 1) exit 0 ;; *) git lfs pre-push "$@" ;; esac """ def git(*args, index: Optional[Path] = None, **kwargs): e = os.environ if index: e["GIT_INDEX_FILE"] = str(index) return sh.contrib.git(*args, **kwargs, _env=e) git.lfs = sh.contrib.git.lfs @contextmanager def open_index(name: str) -> Path: index = Path(git_dir()) / f"index-{name}" if index.exists(): index.unlink() try: yield index finally: if index.exists(): index.unlink() AttributeValue = Union[str, bool, None] def parse_attr(attr: str) -> Tuple[str, AttributeValue]: """ Parse a git attribute into its value: >>> parse_attr('attr') ('attr', True) >>> parse_attr('-attr') ('attr', False) >>> parse_attr('!attr') ('attr', None) >>> parse_attr('attr=text') ('attr', 'text') """ if attr.startswith('!'): return attr[1:], None if attr.startswith('-'): return attr[1:], False if '=' not in attr: return attr, True return tuple(attr.split('=')) def parse_git_attributes(s: str) -> List[Tuple[str, Mapping[str, AttributeValue]]]: lines = [l.strip() for l in s.splitlines()] lines = [l.split() for l in lines if len(l) and not l.startswith('#')] return [(l[0], {k: v for k, v in [parse_attr(a) for a in l[1:]]}) for l in lines if len(l)] default_gitattributes = parse_git_attributes(gitattributes) class Abort(Exception): pass def check_branch(name: str) -> Optional[str]: """ Check a branch exists, return the hash it points at, if it does. None if there’s no such branch """ try: return git('show-ref', '--heads', '--hash', '--', name) except sh.ErrorReturnCode: return None def git_dir() -> str: return git('rev-parse', '--git-dir').strip('\n') def git_head() -> str: return git('rev-parse', '-q', '--verify', '--symbolic-full-name', 'HEAD', _ok_code=[0, 1]).strip('\n') def find_remote_branches(name: str) -> List[Tuple[str, str]]: try: branches = [l.split(' ') for l in git('show-ref', '--', name).splitlines()] return [(b[0], b[1]) for b in branches if b[1].startswith('refs/remotes/')] except sh.ErrorReturnCode: return [] def track_remote_branch(name: str): remote_branches = find_remote_branches(name) if len(remote_branches) == 0: raise RuntimeError('remote branch expected but not found') commit, branch = remote_branches[0] git('branch', '--track', name, branch) def store_lfs_object(io: Any) -> str: return str(git.lfs.clean(io.name, _in=io)) def store_git_object(io: Any) -> str: return git('hash-object', '-w', '--stdin', _in=io).strip('\n') def stage_file(filename: Union[str, bytes], io: Any, index: Path = None): blob = store_git_object(io) if isinstance(filename, bytes): filename = filename.decode() git('update-index', '--add', '--replace', '--cacheinfo', "100644,%s,%s" % (blob, filename), index=index) def create_commit(branch: str, message: str, index: Path = None) -> str: tree = git('write-tree', index=index).strip('\n') if not len(tree): raise RuntimeError('write-tree failed') if check_branch(branch) is not None: commit = git('commit-tree', tree, '-p', branch, _in=message).strip('\n') else: commit = git('commit-tree', tree, _in=message).strip('\n') if not len(commit): raise RuntimeError('commit-tree failed') git('update-ref', 'refs/heads/%s' % branch, commit) return commit def parse_diff_entry(entry: str) -> Mapping[str, str]: treediff, names = entry.split('\t', maxsplit=1) srcmode, dstmode, srchash, dsthash, status = treediff.lstrip(':').split(' ') srcname, _, dstname = names.partition('\t') return { 'srcmode': srcmode, 'dstmode': dstmode, 'srchash': srchash, 'dsthash': dsthash, 'srcname': srcname, 'dstname': dstname, 'status': status, } def commit_lfs_file(io: IO[bytes], branch: str, template: str = None, overwrite: bool = False): """ Store the file in the LFS storage and commit it to a branch. """ commit_lfs_files([io], branch) def commit_lfs_files(ios: Sequence[IO[bytes]], branch: str, template: str = None, overwrite: bool = False): """ Store the files in the LFS storage and commit them to a branch. """ # make sure the pre-push hook has been set up hook_path = Path(git_dir()) / 'hooks' / 'pre-push' if not hook_path.is_file(): try: hook_path.parent.mkdir(exist_ok=True) hook_path.write_text(pre_push_hook) hook_path.chmod(0o755) except IOError as e: logging.warning(_('Failed to set up pre-push hook: %s') % e.strerror) with open_index("pristine-lfs") as index: # make sure we include all previously committed files if check_branch(branch) is not None: git(git('ls-tree', '-r', '--full-name', branch), 'update-index', '--index-info', index=index) # make sure .gitattributes is present stage_file('.gitattributes', gitattributes, index=index) for io in ios: filename = os.path.basename(io.name) if not is_lfs_managed(os.path.basename(filename), default_gitattributes): stage_file(filename, io, index=index) else: metadata = store_lfs_object(io) stage_file(filename, metadata, index=index) if check_branch(branch) is not None: diff = git('diff-index', '--cached', branch).strip().splitlines() if not diff: logging.info(_("Nothing to commit")) return parsed_diff = [parse_diff_entry(d) for d in diff] overwritten = [d['srcname'] for d in parsed_diff if d['srchash'] != ('0' * 40) and d['srcname'] != '.gitattributes'] if any(overwritten) and not overwrite: raise Abort(_('would overwrite files: %s') % ', '.join(overwritten)) if not template: template = "pristine-lfs data for %s" message = template % ', '.join([os.path.basename(io.name) for io in ios]) commit = create_commit(branch, message, index=index) # if the branch is currently checked out, reset it if git_head() == f'refs/heads/{branch}': git('reset', '--hard') def list_lfs_files(branch: str) -> List[str]: return git.lfs('ls-files', '--name-only', branch).splitlines() def parse_entry(entry: str) -> Tuple[str, ...]: info, name = entry.split('\t') mode, type, hash = info.split(' ') return mode, type, hash, name def list_git_files(branch: str) -> Mapping[str, str]: entries = [parse_entry(l) for l in git('ls-tree', '-r', '--full-name', branch).splitlines()] return {e[3]: e[2] for e in entries if e[1] == 'blob'} def is_lfs_managed(filename: str, attributes: List[Tuple[str, Mapping[str, AttributeValue]]]): lfs_managed = False for pattern, attrs in attributes: if fnmatchcase(filename, pattern): if 'filter' in attrs: lfs_managed = attrs['filter'] == 'lfs' return lfs_managed def checkout_lfs_file(branch: str, filename: str, outdir: str = '.'): files = list_git_files(branch) if '.gitattributes' in files: attributes = parse_git_attributes(git('cat-file', 'blob', files['.gitattributes'])) else: attributes = [] if filename not in files: raise Abort(_('%s not found on branch %s') % (filename, branch)) with (Path(outdir) / filename).open(mode='wb') as tarball: if is_lfs_managed(filename, attributes): metadata = git('cat-file', 'blob', files[filename]) git.lfs.smudge(filename, _out=tarball, _in=metadata) else: git('cat-file', 'blob', files[filename], _out=tarball) pristine-lfs-20190910.0/pristine_lfs.egg-info/0000755000000000000000000000000013535751144020677 5ustar rootroot00000000000000pristine-lfs-20190910.0/pristine_lfs.egg-info/PKG-INFO0000644000000000000000000000535013535751144021777 0ustar rootroot00000000000000Metadata-Version: 1.1 Name: pristine-lfs Version: 20190910.0 Summary: a pristine-tar replacement that works with Git LFS Home-page: https://salsa.debian.org/pristine-lfs-team/pristine-lfs Author: Andrej Shadura Author-email: andrew.shadura@collabora.co.uk License: GPL-2+ Description: ============ pristine-lfs ============ About ----- **pristine-lfs** is a tool to replace *pristine-tar* by the means of using Git LFS to store tarballs. The original *pristine-tar* tool is a way to store binary tarballs in Git by regenerating them using only a small binary delta file and a checkout of the upstream branch. Installation ------------ *pristine-lfs* assumes you have Python 3.6 or later installed as ``/usr/bin/python3``. *pristine-lfs* ships with a setup.py installer based on setuptools. To install *pristine-lfs*, simply type:: ./setup.py install This will install *pristine-lfs* itself, its manpage and this README file into their proper locations. Alternatively, to install via ``pip``, run:: pip install pristine-lfs License ------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 text for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Authors ------- For the list of contributors, see CONTRIBUTORS. Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: Software Development :: Version Control :: Git pristine-lfs-20190910.0/pristine_lfs.egg-info/SOURCES.txt0000644000000000000000000000057713535751144022574 0ustar rootroot00000000000000.gitignore .gitlab-ci.yml CONTRIBUTORS COPYING README.rst pristine-lfs.1 pristine-lfs.rst setup.py pristine_lfs/__init__.py pristine_lfs/main.py pristine_lfs/util.py pristine_lfs.egg-info/PKG-INFO pristine_lfs.egg-info/SOURCES.txt pristine_lfs.egg-info/dependency_links.txt pristine_lfs.egg-info/entry_points.txt pristine_lfs.egg-info/requires.txt pristine_lfs.egg-info/top_level.txtpristine-lfs-20190910.0/pristine_lfs.egg-info/dependency_links.txt0000644000000000000000000000000113535751144024745 0ustar rootroot00000000000000 pristine-lfs-20190910.0/pristine_lfs.egg-info/entry_points.txt0000644000000000000000000000007113535751144024173 0ustar rootroot00000000000000[console_scripts] pristine-lfs = pristine_lfs.main:main pristine-lfs-20190910.0/pristine_lfs.egg-info/requires.txt0000644000000000000000000000002113535751144023270 0ustar rootroot00000000000000python-debian sh pristine-lfs-20190910.0/pristine_lfs.egg-info/top_level.txt0000644000000000000000000000001513535751144023425 0ustar rootroot00000000000000pristine_lfs pristine-lfs-20190910.0/setup.cfg0000644000000000000000000000004613535751144016325 0ustar rootroot00000000000000[egg_info] tag_build = tag_date = 0 pristine-lfs-20190910.0/setup.py0000755000000000000000000000601613535747261016231 0ustar rootroot00000000000000#!/usr/bin/python3 import os import fnmatch from distutils import log from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() def glob(fname): return fnmatch.filter(os.listdir(os.path.abspath(os.path.dirname(__file__))), fname) def generate_manpage(src, dst): import docutils.core log.info("generating a manpage from %s to %s", src, dst) docutils.core.publish_file(source_path=src, destination_path=dst, writer_name='manpage') def man_name(fname): import re matches = re.compile(r'^:Manual section: *([0-9]*)', re.MULTILINE).search(read(fname)) if matches: section = matches.groups()[0] else: section = '7' base = os.path.splitext(fname)[0] manfname = base + '.' + section return manfname def man_path(fname): category = fname.rsplit('.', 1)[1] return os.path.join('share', 'man', 'man' + category), [fname] def man_files(pattern): return list(map(man_path, map(man_name, glob(pattern)))) # monkey patch setuptools to use distutils owner/group functionality from setuptools.command import sdist sdist_org = sdist.sdist class sdist_new(sdist_org): def initialize_options(self): sdist_org.initialize_options(self) self.owner = self.group = 'root' sdist.sdist = sdist_new __manpages__ = 'pristine-lfs.rst' from setuptools.command import build_py build_py_org = build_py.build_py class build_py_new(build_py_org): def run(self): build_py_org.run(self) if not self.dry_run: for page in glob(__manpages__): generate_manpage(page, man_name(page)) build_py.build_py = build_py_new __name__ = "pristine-lfs" setup( name = __name__, version = "20190910.0", author = 'Andrej Shadura', author_email = 'andrew.shadura@collabora.co.uk', url = 'https://salsa.debian.org/pristine-lfs-team/pristine-lfs', description = 'a pristine-tar replacement that works with Git LFS', long_description = read('README.rst'), license = 'GPL-2+', packages = find_packages(), install_requires = ['sh', 'python-debian'], setup_requires = ['docutils>=0.12'], classifiers = [ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Topic :: Software Development :: Build Tools', 'Topic :: Software Development :: Version Control :: Git', ], include_package_data = True, data_files = [ (os.path.join('share', 'doc', __name__), glob('*.rst')), (os.path.join('share', 'doc', __name__), ['CONTRIBUTORS', 'COPYING']) ] + man_files(__manpages__), entry_points = { 'console_scripts': [ 'pristine-lfs = pristine_lfs.main:main' ] } )