--- /dev/null
+ 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.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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.
+
+ <signature of Ty Coon>, 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.
--- /dev/null
+Running the Tests
+-----------------
+The tests are run via
+
+ make
+
+To also run the component tests, you need to initialize the git submodules once
+via:
+
+ git submodule update --init --recursive
+
+This will fetch the necessary binary data for the DEB and RPM component tests,
+and the tests are from now on included within each regular test run.
+
+Some tests reach out to the network. To run these in addition to all
+other tests use:
+
+ make all+net
+
+You can run the tests in a `debian:sid` docker container by using
+
+ packaging/run-in-docker
+
+The python tests use `python-nose` so you can use all it's options. To run a
+single test e.g.
+
+ nosetests3 tests/component/deb/test_push.py:TestPush.test_push_failure
+
+If you want to keep any temporary repos around for inspection use
+`GBP_TESTS_NOCLEAN`:
+
+ GBP_TESTS_NOCLEAN=1 nosetests3 tests/component/deb/test_push.py:TestPush.test_push_failure
+
+Building the API Docs
+---------------------
+You can build the API docs using
+
+ make apidocs
+
+
+Contributing Patches
+--------------------
+Make sure the tests pass before sending in patch. You can either send it to the
+mailing list or add it to a bug report against git-buildpackage on
+
+ http://bugs.debian.org/src:git-buildpackage
+
+If you fix a regression or add a new feature please make sure this is covered
+by either a unittest (tests/*.py) or a component test that exercises one of the
+scripts (tests/component/{deb,rpm}/*.py.
+
+Layout
+------
+
+ gbp/scripts/*.py - the actual gbp commands (buildpackage, dch, …)
+ gbp/scripts/common/ - code shared between Debian and RPM commands
+ gbp/deb/ - Debian package handling (control, dsc, …)
+ gbp/rpm/ - RPM package handling (spec files, …)
+ gbp/git/ - Git repository interaction
+ tests/*.py - unit tests
+ tests/doctests - doctests that also serve as examples
+ tests/component/ - component tests that invoke actual commands
+
+Interfaces
+----------
+A gbp command in gbp/scripts/<commmand>.py must provide these interfaces:
+
+When one invokes `gbp <command>` gbp/scripts/<commmand>.py is imported by
+
+ gbp/scripts/supercommand.py
+
+which then invokes it's *main* function with all given command line arguments.
+It is expected to return with the exit status that should be passed back to the
+shell.
+
+When one invokes `gbp config <command>` gbp/scripts/<commmand>.py is imported by
+
+ gbp/scripts/config.py
+
+which then invokes it's *build_parser* function with the command name as argument.
+It is expected to return a GbpConfigParser with all config files parsed.
--- /dev/null
+PY_EXAMPLES=$(shell grep -l /usr/bin/python examples/*)
+FLAKE_OPTS=$(shell test -w /dev/shm || echo '-j1')
+NOSE_OPTS=--with-xcoverage
+TEST_LOCALE?=C.UTF-8
+
+all: syntax-check test
+
+all+net:
+ GBP_NETWORK_TESTS=1 $(MAKE) all
+
+test:
+ export HOME=/nonexisting; \
+ export GIT_AUTHOR_NAME="Gbp Tests"; \
+ export GIT_AUTHOR_EMAIL=tests@example.com; \
+ export GIT_COMMITTER_NAME=$$GIT_AUTHOR_NAME; \
+ export GIT_COMMITTER_EMAIL=$$GIT_AUTHOR_EMAIL; \
+ export DEBEMAIL=$$GIT_AUTHOR_EMAIL; \
+ PYTHONPATH=. \
+ LC_ALL=$(TEST_LOCALE) python3 setup.py nosetests $(NOSE_OPTS)
+
+syntax-check:
+ flake8 $(FLAKE_OPTS)
+ flake8 $(FLAKE_OPTS) $(PY_EXAMPLES)
+
+type-check:
+ mypy gbp
+
+docs:
+ $(MAKE) -C docs
+ $(MAKE) apidocs
+
+apidocs:
+ mkdir -p build
+ pydoctor -v gbp tests/doctests/
+
+.PHONY: docs
+++ /dev/null
-Git-buildpackage
-----------------
-This is a bunch of scripts to ease the development of Debian packages with git.
-For more documentation on howto use these tools see the manual
-online at:
-
- http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.html
-
-On Debian systems this can be found in
-/usr/share/doc/git-buildpackage/manual-html.
-
-The API documentation of the gbp module can be found at:
-
- http://honk.sigxcpu.org/projects/git-buildpackage/apidocs/
-
-
-The limited documentation available for the RPM support can be found at
-
- http://marquiz.github.com/git-buildpackage-rpm/
-
-Unfortunately, the manpages for RPM tools are still missing. Refer to
---help option of the commands, for the most detailed description of different
-options.
--- /dev/null
+Git-buildpackage
+----------------
+Tools to ease the development of Debian and (partially) RPM packages in git
+repositories. For documentation see the manual online at:
+
+ https://gbp.sigxcpu.org/manual/
+
+On Debian systems, the documentation can be found in
+/usr/share/doc/git-buildpackage/manual-html.
+
+The API documentation of the gbp module can be found at:
+
+ https://gbp.sigxcpu.org/apidocs/
+
+The mailing list is at:
+
+ * https://lists.sigxcpu.org/mailman/listinfo/git-buildpackage
+ * git-buildpackage at lists.sigxcpu.org
+
+See the HACKING document for details on contributing to gbp development. The
+package is also available on Pypi at:
+
+ https://pypi.python.org/pypi/gbp/
+
+
+
+[](https://travis-ci.org/agx/git-buildpackage)
+[](https://bestpractices.coreinfrastructure.org/projects/1311)
See https://honk.sigxcpu.org/piki/projects/git-buildpackage/
-
-RPM-related things:
-- unit tests:
- - add unit tests for the rpm command line tools
-- manpages for rpm tools
- - git-buildpackage-rpm
- - git-import-srpm
- - git-import-orig-rpm
- - gbp-pq-rpm
-- better html-documentation for rpm support
-- write a tool for automatic changelog creation/updating
-- bare-repo support
- - buildpackage-rpm
- - import-orig
- - import-srpm
- - pristine-tar
- - gbp-pq (very limited, if any)
--- /dev/null
+#!/bin/sh
+#
+# Helper to invoke mock from 'gbp buildpackage-rpm'
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+#
+# Copyright (C) 2015 Tzafrir Cohen
+# (C) 2015 Guido Gunther
+
+set -e
+
+# There must be a saner way to do that or a reason why this is not required
+fix_arch() {
+ GBP_BUILDER_MOCK_ARCH=${GBP_BUILDER_MOCK_ARCH:-`uname -m`}
+ case "$ARCH" in
+ amd64) ARCH='x86_64';;
+ esac
+}
+
+
+usage() {
+ EXIT=${1:-1}
+ echo >&2 "$0: Must be run via 'gbp buildpackage-rpm', see manpage for details"
+ exit $EXIT
+}
+
+while [ $# != 0 ]; do
+ case "$1" in
+ --help|-h|-\?) usage 0;;
+ *.spec) SPEC="$1";;
+ esac
+ shift
+done
+
+# Make sure we have the necessary tools.
+if [ ! -x /usr/bin/mock ]; then
+ echo "mock not found; you need to install the mock package" >&2
+ exit 1
+fi
+
+gbp_builder_mock() {
+ if [ -z "$GBP_BUILDER_MOCK_DIST" ]; then
+ usage
+ fi
+ local root=${GBP_BUILDER_MOCK_ROOT:-${GBP_BUILDER_MOCK_DIST}-${GBP_BUILDER_MOCK_ARCH}}
+ if [ ! -d "$GBP_BUILDER_MOCK_EXPORT_DIR" ]; then
+ echo >&2 "$0: Missing output directory (GBP_BUILDER_MOCK_EXPORT_DIR). Aborting."
+ usage
+ fi
+ if [ -z "$SPEC" ]; then
+ echo >&2 "$0: No specfile given."
+ exit 1
+ fi
+ export_dir="$PWD"
+ spec="$export_dir/SPECS/$SPEC"
+ sources="$export_dir/SOURCES"
+ srpms="$export_dir/SRPMS"
+ pat="${GBP_BUILDER_MOCK_RESULTS_PAT-results/{{dist\}\}/{{target_arch\}\}/}"
+ local resultdir="$export_dir/$pat"
+ local mock="mock -r $root --sources=$sources ${GBP_BUILDER_MOCK_OPTIONS}"
+
+ $mock --resultdir=$srpms --spec=$spec --buildsrpm
+ # Assuming that nothing was built in this directory since the previous command:
+ local srpm=`ls -t $PWD/SRPMS/*.src.rpm 2>/dev/null| head -n1`
+ if [ -z $srpm ]; then
+ echo >&2 "$0: failed to create srpm"
+ exit 1
+ fi
+ $mock --no-cleanup-after --resultdir $resultdir --rebuild "$srpm"
+}
+
+
+fix_arch
+gbp_builder_mock
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.clone import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.create_remote_repo import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.pq import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.pq_rpm import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.pull import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.buildpackage import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.buildpackage_rpm import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.dch import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.import_dsc import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.import_dscs import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.import_orig import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.import_orig_rpm import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-#! /usr/bin/python333 -u
-import sys
-from gbp.scripts.import_srpm import main
-
-sys.exit(main(sys.argv))
#!/bin/bash
-# $Id: git-pbuilder,v 1.33 2014/08/28 21:39:15 eagle Exp $
+# $Id: git-pbuilder,v 1.48 2017/04/30 18:27:48 eagle Exp $
#
-# git-pbuilder -- Wrapper around pbuilder for git-buildpackage
+# Wrapper around pbuilder for gbp buildpackage
#
# Note that this script requires bash, not a POSIX shell, because it uses bash
-# arrays to handle GIT_PBUILDER_OPTIONS. It's otherwise quite difficult to
-# get the contents of that environment variable to undergo the correct amount
-# of shell expansion.
+# arrays to handle GIT_PBUILDER_OPTIONS and GIT_PBUILDER_PDEBUILDOPTIONS.
+# It's otherwise quite difficult to get the contents of that environment
+# variable to undergo the correct amount of shell expansion.
#
# Written by Russ Allbery <eagle@eyrie.org>
# Based on the example in the git-buildpackage documentation
-# Copyright 2014 Russ Allbery <eagle@eyrie.org>
+# Copyright 2014, 2015, 2016 Russ Allbery <eagle@eyrie.org>
# Copyright 2008, 2009, 2010, 2011, 2012, 2013
# The Board of Trustees of the Leland Stanford Junior University
#
echo "$1" | sed -e "s/'/'\"'\"'/g" -e "1 s/^/'/" -e "\$ s/\$/'/"
}
+# unset variables we inherited from the environment ourselfes
+# Names like DIST are very generic and can trip up other build systems
+# so unset these and set some prefixed ones instead so they can e.g.
+# be used in .pbuilderrc.
+update_env() {
+ [ -z "$DIST" -o -n "$GBP_DIST" ] || export GBP_DIST=$DIST
+ [ -z "$BUILDER" -o -n "$GBP_BUILDER" ] || export GBP_BUILDER=$BUILDER
+ [ -z "$ARCH" -o -n "$GBP_ARCH" ] || export GBP_ARCH=$ARCH
+ export -n DIST BUILDER ARCH
+}
+
+case $1 in
+ -h|--help|-\?)
+ cat <<EOF
+git-pbuilder - Wrapper around cowbuilder/qemubuilder for gbp buildpackage
+
+Usage
+
+ DIST=distribution ARCH=architecture [BUILDER=(pbuilder|qemubuilder)] \
+ git-pbuilder debbuild-options
+
+ DIST=distribution ARCH=architecture [BUILDER=(pbuilder|qemubuilder)] \
+ git-pbuilder (update | create | login) cowbuilder-options
+
+See git-pbuilder(1) for details.
+EOF
+ exit 0
+ ;;
+esac
+
# Set default BUILDER, DIST, and ARCH based on the name we were invoked as.
# This allows people to create symlinks like git-pbuilder-squeeze and
# git-qemubuilder-squeeze-amd64 pointing to git-pbuilder and auto-detecting
# -backports. Backports was incorporated into the main mirrors as of
# wheezy.
case $DIST in
- squeeze|oldstable)
+ squeeze)
BACKPORTS='http://backports.debian.org/debian-backports'
;;
*)
BACKPORTS='http://ftp.debian.org/debian'
;;
esac
+elif expr "$DIST" : '.*-lts$' >/dev/null; then
+ DIST=${DIST%-lts}
+ EXT="-lts"
+
+ # The URL to the Debian LTS repository to add to the chroot
+ # configuration when created via this script for a distribution ending in
+ # -lts.
+ LTS='http://ftp.debian.org/debian'
else
EXT=
fi
fi
# Default options come from the environment. Use eval to parse
-# GIT_PBUILDER_OPTIONS into an array since some arguments may have quoting.
+# GIT_PBUILDER_OPTIONS and GIT_PBUILDER_PDEBUILDOPTIONS into arrays, since
+# some arguments may have quoting.
eval "OPTIONS=( $GIT_PBUILDER_OPTIONS )"
+eval "PDEBUILDOPTS=( $GIT_PBUILDER_PDEBUILDOPTIONS )"
OUTPUT_DIR="${GIT_PBUILDER_OUTPUT_DIR:-../}"
# How we handle options depends on what type of builder we're using. Ignore
# options if $GIT_PBUILDER_AUTOCONF is set to no.
-if [ no != "$GIT_PBUILDER_AUTOCONF" ] ; then
+if [ no != "$GIT_PBUILDER_AUTOCONF" ]; then
case $BUILDER in
pbuilder)
- # The root directory where different pbuilder --basepath
- # directories are found. git-pbuilder expects them to be named
- # base-<dist>.tgz.
+ # The root directory where different pbuilder --basetgz files are
+ # found. git-pbuilder expects them to be named base-<dist>.tgz.
: ${PBUILDER_BASE:=/var/cache/pbuilder}
# If DIST is set, use base-$DIST.tgz. If DIST is not set, the sid
BASE="$PBUILDER_BASE/base-$DIST$EXT-$ARCH.tgz"
OPTIONS+=( --architecture "$ARCH" )
elif [ "$DIST" = 'sid' ] ; then
- if [ -f "$PBUILDER_BASE/base-sid.tgz" ] ; then
+ if [ -f "$PBUILDER_BASE/base-sid.tgz" ]; then
BASE="$PBUILDER_BASE/base-sid.tgz"
else
BASE="$PBUILDER_BASE/base.tgz"
# Set --debian-etch-workaround if DIST is etch. Assume that
# everything else is new enough that it will be fine.
- if [ "$DIST" = 'etch' ] || [ "$DIST" = 'ebo' ] ; then
+ if [ "$DIST" = 'etch' ] || [ "$DIST" = 'ebo' ]; then
OPTIONS+=( --debian-etch-workaround )
fi
;;
# directories are found. git-pbuilder expects them to be named
# base-<dist>.cow.
: ${COWBUILDER_BASE:=/var/cache/pbuilder}
-
- # If DIST is set, use base-$DIST.cow. If DIST is not set, the sid
+
+ # If --basepath is specified on the command line we need to use
+ # that and that alone, since if it's specified more than once,
+ # cowbuilder will fail.
+ bp_found=""
+ for opt in "$@" "${OPTIONS[@]}"; do
+ case $opt in
+ --basepath|--basepath=*) bp_found="yes" ;;
+ esac
+ done
+
+ # If --basepath wasn't already provided, we need to set it. If
+ # DIST is set, use base-$DIST.cow. If DIST is not set, the sid
# chroot may be either base.cow or base-sid.cow. Try both. If
# ARCH is set, use base-$DIST-$ARCH.cow.
- : ${DIST:=sid}
- if [ -n "$ARCH" ] ; then
- BASE="$COWBUILDER_BASE/base-$DIST$EXT-$ARCH.cow"
- OPTIONS+=( --architecture "$ARCH" )
- elif [ "$DIST" = 'sid' ] ; then
- if [ -d "$COWBUILDER_BASE/base-sid.cow" ] ; then
- BASE="$COWBUILDER_BASE/base-sid.cow"
+ if [ -z "$bp_found" ]; then
+ : ${DIST:=sid}
+ if [ -n "$ARCH" ]; then
+ BASE="$COWBUILDER_BASE/base-$DIST$EXT-$ARCH.cow"
+ OPTIONS+=( --architecture "$ARCH" )
+ elif [ "$DIST" = 'sid' ]; then
+ if [ -d "$COWBUILDER_BASE/base-sid.cow" ] ; then
+ BASE="$COWBUILDER_BASE/base-sid.cow"
+ else
+ BASE="$COWBUILDER_BASE/base.cow"
+ fi
else
- BASE="$COWBUILDER_BASE/base.cow"
+ BASE="$COWBUILDER_BASE/base-$DIST$EXT.cow"
fi
- else
- BASE="$COWBUILDER_BASE/base-$DIST$EXT.cow"
- fi
- OPTIONS+=( --basepath "$BASE" )
+ OPTIONS+=( --basepath "$BASE" )
- # Make sure the base directory exists.
- if [ ! -d "$BASE" ] && [ "$1" != "create" ]; then
- echo "Base directory $BASE does not exist" >&2
- exit 1
+ # Make sure the base directory exists.
+ if [ ! -d "$BASE" ] && [ "$1" != "create" ]; then
+ echo "Base directory $BASE does not exist" >&2
+ exit 1
+ fi
fi
# Set --debian-etch-workaround if DIST is etch. Assume that
# everything else is new enough that it will be fine.
- if [ "$DIST" = 'etch' ] || [ "$DIST" = 'ebo' ] ; then
+ if [ "$DIST" = 'etch' ] || [ "$DIST" = 'ebo' ]; then
OPTIONS+=( --debian-etch-workaround )
fi
;;
# There has to be a configuration file matching our distribution
# and architecture.
QEMUCONFIG="/var/cache/pbuilder/$BUILDER-$ARCH-$DIST$EXT.conf"
- if [ ! -r "$CONFIG" ]; then
+ if [ ! -r "$QEMUCONFIG" ]; then
echo "Cannot read configuration file $QEMUCONFIG" >&2
exit 1
fi
esac
fi
-# If the first argument to the script is update, create, or login, run the
-# builder with the corresponding option under sudo rather than proceeding.
+# If the first argument to the script is update, create, or login (or
+# --update, --create, or --login), set the $action.
case $1 in
update|create|login)
+ action="--$1"
+ shift
+ ;;
+--update|--create|--login)
action="$1"
shift
+ ;;
+*)
+ action=""
+ ;;
+esac
+# If $action is set, run the builder for $action under sudo rather than
+# proceeding.
+if [ -n "$action" ]; then
# Since we're running the builder under sudo, $HOME will change to root's
# home directory and the user's .pbuilderrc won't be run. sudo -E would
# fix this, but that requires special configuration in sudoers to allow
OPTIONS+=( --configfile "$HOME/.pbuilderrc" )
fi
+ # Check that sudo is installed and try to provide a useful error if it
+ # is not.
+ if ! which sudo >/dev/null 2>&1; then
+ cat >&2 <<EOE
+git-pbuilder: sudo not found in $PATH
+
+sudo was not found in your path. You need to install the sudo package and
+allow the current user to invoke the builder via sudo.
+EOE
+ exit 1
+ fi
+
# Run the builder.
if [ no = "$GIT_PBUILDER_AUTOCONF" ] ; then
- sudo "$BUILDER" --"$action" "${OPTIONS[@]}" "$@"
+ [ ! "$GIT_PBUILDER_DEBUG" ] || set -x
+ sudo "$BUILDER" "$action" "${OPTIONS[@]}" "$@"
else
if [ "$EXT" = '-backports' ] ; then
OTHERMIRROR="deb $BACKPORTS $DIST$EXT main"
- sudo "$BUILDER" --"$action" --distribution "$DIST" \
+ [ ! "$GIT_PBUILDER_DEBUG" ] || set -x
+ sudo "$BUILDER" "$action" --distribution "$DIST" \
+ --othermirror "$OTHERMIRROR" "${OPTIONS[@]}" "$@"
+ elif [ "$EXT" = '-lts' ] ; then
+ OTHERMIRROR="deb $LTS $DIST$EXT main"
+ [ ! "$GIT_PBUILDER_DEBUG" ] || set -x
+ sudo "$BUILDER" "$action" --distribution "$DIST" \
--othermirror "$OTHERMIRROR" "${OPTIONS[@]}" "$@"
else
- sudo "$BUILDER" --"$action" --distribution "$DIST" "${OPTIONS[@]}" "$@"
+ [ ! "$GIT_PBUILDER_DEBUG" ] || set -x
+ sudo "$BUILDER" "$action" --distribution "$DIST" \
+ "${OPTIONS[@]}" "$@"
fi
fi
- exit $?
- ;;
-*)
- if [ -z "$GBP_BUILD_DIR" ]; then
- echo "Warning: git-pbuilder should be run via git-buildpackage" >&2
- fi
- ;;
-esac
+ { set +x; } 2>/dev/null
+ exit 0
+fi
+
+# Build package: not (update | create | login)
+if [ -z "$GBP_BUILD_DIR" ]; then
+ echo "Warning: git-pbuilder should be run via 'gbp buildpackage'" >&2
+fi
# Print out some information about what we're doing.
building="Building with $BUILDER"
# Add all of the additional arguments we got on the command line, but quote
# them from the shell since they'll undergo another round of shell expansion
# when the pbuilder runs debbuild.
-source_only=false
for arg in "$@" ; do
- if [ x'-S' = x"$arg" ] ; then
- source_only=true
- fi
DEBBUILDOPTS+=" $(shell_quote "$arg")"
done
# Now we can finally run pdebuild. The quoting here is tricky, but this
# seems to pass everything through properly.
+update_env
if [ no = "$GIT_PBUILDER_AUTOCONF" ] ; then
+ set -e
+ [ ! "$GIT_PBUILDER_DEBUG" ] || set -x
pdebuild --pbuilder "$BUILDER" --debbuildopts "$DEBBUILDOPTS" \
- -- "${OPTIONS[@]}"
+ "${PDEBUILDOPTS[@]}" -- "${OPTIONS[@]}"
+ { set +x; } 2>/dev/null; set +e
else
+ set -e
+ [ ! "$GIT_PBUILDER_DEBUG" ] || set -x
pdebuild --buildresult "$OUTPUT_DIR" --pbuilder "$BUILDER" \
- --debbuildopts "$DEBBUILDOPTS" -- "${OPTIONS[@]}"
-fi
-status="$?"
-if [ -n "`ls ../*_source.changes`" ] && [ true != "$source_only" ] ; then
- rm ../*_source.changes
+ --debbuildopts "$DEBBUILDOPTS" "${PDEBUILDOPTS[@]}" -- "${OPTIONS[@]}"
+ { set +x; } 2>/dev/null; set +e
fi
-exit "$status"
+exit 0
# Documentation. Use a hack to hide this from the shell. Because of the
# above exit line, this should never be executed.
=head1 NAME
-git-pbuilder - Wrapper around cowbuilder/qemubuilder for git-buildpackage
+git-pbuilder - Wrapper around cowbuilder/qemubuilder for gbp buildpackage
=head1 SYNOPSIS
=head1 DESCRIPTION
B<git-pbuilder> is a wrapper around B<pdebuild> intended for use by
-B<git-buildpackage>. It configures B<pdebuild> to use B<cowbuilder> by
+B<gbp buildpackage>. It configures B<pdebuild> to use B<cowbuilder> by
default, passes appropriate options to B<debbuild>, and sets the base path
for B<cowbuilder> based on the environment variable DIST and, if set, the
environment variable ARCH. B<qemubuilder> can be selected instead by
distribution of C<squeeze>, or C<git-qemubuilder-sid-armel> to use
B<qemubuilder> to build for the C<armel> architecture and the C<sid>
distribution. Explicit settings of BUILDER, DIST, or ARCH always override
-any guesses from the command name.
+any guesses from the command name. (But note that B<gbp buildpackage>
+does not pass on environment variables when run with B<--git-pbuilder>;
+see below.)
Any arguments are passed as-is to B<dpkg-buildpackage> via the
B<--debbuildopts> option to B<pdebuild>. To pass arguments to the builder
settings in .pbuilderrc, set GIT_PBUILDER_AUTOCONF to C<no>.
Normally, one does not run this script directly. Instead, it's used as
-the builder script for B<git-buildpackage>. To configure
-B<git-buildpackage> to use it, add a stanza like:
-
- [DEFAULT]
- builder = /path/to/git-pbuilder
-
-in your F<gbp.conf> file (which can be F<.gbp.conf> in your home directory
-or at the top level of the repository, or F<gbp.conf> in the F<.git>
-directory). DIST and ARCH are read as an environment variable so that you
-can set it before running B<git-buildpackage> without having to worry
-about passing parameters through B<git-buildpackage>.
+the builder script for B<gbp buildpackage> via the B<--git-pbuilder>
+command-line option. When run this way, you should use the B<--git-dist>,
+B<--git-arch>, B<--git-qemubuilder>, B<--git-pbuilder-autoconf>, and
+B<--git-pbuilder-options> flags instead of setting the DIST, ARCH, BUILDER,
+GIT_PBUILDER_AUTOCONF, and GIT_PBUILDER_OPTIONS environment variables. See
+L<gbp-buildpackage(1)> for more information.
Alternately, B<git-pbuilder> may be called with an argument of C<update>,
C<create>, or C<login>. In this case, it calls B<cowbuilder> (or the
deb http://backports.debian.org/debian-backports $DIST main
The first will be used for most distributions, and the second for
-C<squeeze-backports> or C<oldstable-backports>.
+C<squeeze-backports>. If the distribution ends in C<-lts>, the following will
+be added as an B<--othermirror> parameter to the builder:
+
+ deb http://ftp.debian.org/debian $DIST main
+
+to support building for Long Term Support releases.
Any additional arguments to B<git-pbuilder> are passed along to the
builder. Due to how B<sudo> works, invoking the builder with an action
B<git-pbuilder> will add an explicit B<--configfile> option pointing to
the user's F<.pbuilderrc> if it exists.
+If you use B<git-pbuilder> with one of these arguments, you must have
+the C<sudo> package installed, and you must configure B<sudo> to let the
+current user run the appropriate builder command.
+
=head1 ENVIRONMENT
=over 4
to the builder. Instead, just run the configured builder and assume its
configuration is handled elsewhere (such as in F<.pbuilderrc>). This also
suppresses setting B<--buildresult>, so the user will need to ensure that
-the configuration still puts packages where B<git-buildpackage> expects
+the configuration still puts packages where B<gbp buildpackage> expects
them.
+=item GIT_PBUILDER_DEBUG
+
+Set this environment variable to get additional debugging output like how
+cowbuilder is invoked.
+
=item GIT_PBUILDER_OPTIONS
Add additional options for the builder. These options are passed as-is to
directory). This setting is ignored if GIT_PBUILDER_AUTOCONF is set to
C<no>.
+=item GIT_PBUILDER_PDEBUILDOPTIONS
+
+Add additional options for B<pdebuild> itself (such as
+B<--use-pdebuild-internal>). The contents of this variable will undergo
+shell expansion, so any arguments containing shell metacharacters or
+whitespace need to be quoted in the value of the environment variable.
+
=item PBUILDER_BASE
-Set this environment variable to change the defualt location for the
+Set this environment variable to change the default location for the
pbuilder tgz files (F</var/cache/pbuilder>) when BUILDER is set to
C<pbuilder>.
=head1 SEE ALSO
-cowbuilder(8), dpkg-buildpackage(1), git-buildpackage(1), pbuilder(8),
+cowbuilder(8), dpkg-buildpackage(1), gbp-buildpackage(1), pbuilder(8),
pdebuild(1), qemubuilder(8), sudo(8)
The latest version of this script is available from
+++ /dev/null
-#! /usr/bin/python3 -u
-import sys
-from gbp.scripts.rpm_ch import main
-
-sys.exit(main(sys.argv))
+++ /dev/null
-git-buildpackage (0.6.9) unstable; urgency=medium
-
- This version changes the default of the cleaner options from 'debuild clean'
- to a noop ('/bin/true'). If you want to retain the old behaviour you can still
- configure it via gbp.conf. For more details see #670624.
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 05 Jan 2014 15:52:39 +0100
-
-git-buildpackage (0.6.0) unstable; urgency=low
-
- In order to provide a more consistent and git like interface a new gbp super
- command was added as a front end to all git-* and gbp-* commands. So what was
- either git-<command> or gbp-<command> is now
-
- gbp <command>
-
- The old commands are still provided for backward compatibility but will be
- removed in a future release so please update any scripts and tools relying on
- it.
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 26 Jun 2013 13:38:16 +0200
-
-git-buildpackage (0.4.61) unstable; urgency=low
-
- In order to not override dpkg-buildpackge's defaults for 3.0 source packages
- the default builder command is now "debuild -i -I" instead of "debuild
- -i\.git/ -I.git". If you want to retain the old behaviour please adjust your
- gbp.conf accordingly.
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 22 Nov 2009 17:07:52 +0100
-
-git-buildpackage (0.4.57) unstable; urgency=low
-
- git-import-orig dosn't generate changelog entries by default anymore. This
- means you can safely remove --no-dch from all your scripts and config files.
-
- If you want git-import-orig to behave as before add:
- postimport = dch -v%(version)s New Upstream Version
- to your gbp.conf. If you want to invoke git-dch instead, you can use:
- postimport = git-dch -N%(version)s -S -a
- The later is recommended since it creates git-dch compatible changelog
- entries.
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 23 Aug 2009 17:21:50 +0200
-
-git-buildpackage (0.3.3) unstable; urgency=low
-
- As of this version git-buildpackage doesn't pass hardcoded '-i\.git -I.git'
- to the build command specified via --git-builder (or via the builder config
- file options). So if you're not using the default build command (which is
- now 'debuild -i\.git -I.git' instead of just plain 'debuild') you'll have to
- add these options to your build command in order to exclude git metadata
- from your diffs and source tarballs.
- This was done to make the invocation of the build command more flexible, we
- don't rely on debuild behaviour from now on.
- Again: if you didn't change the default build command, you don't have to
- change anything.
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 20 Aug 2007 18:08:37 +0200
-
-git-buildpackage (0.2.25) unstable; urgency=low
-
- Generated tags are now by default put into debian/ and upstream/ namespaces.
- This doesn't have any effect on already existing tags.
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 2 Feb 2007 15:56:12 +0100
+++ /dev/null
-When reporting issues regarding git-buildpackage please run the failing command
-with --git-verbose (gbp buildpackage) or --verbose (all other commands) and
-provide the full output.
+++ /dev/null
-git-buildpackage (0.9.28-tizen20231130) unstable; urgency=medium
-
- * Fix git-buildpackage issue to adapt the librpm-tizen 4.14 version.
-
- -- Xu Huayong <huayong.xu@samsung.com> Thu, 30 Nov 2023 14::32 +0800
-
-git-buildpackage (0.9.27-tizen20231101) unstable; urgency=medium
-
- * Port code from python2.x to python3.x.
- * Support Ubuntu22.04 build.
- * Fix some defects during runtime.
-
- -- Biao Wang <biao716.wang@samsung.com> Wed, 01 Nov 2023 16:50:00 +0800
-
-git-buildpackage (0.9.26-tizen20221104) unstable; urgency=medium
-
- * update submodule url.
- * Adapt Ubuntu 22.04 to upgrade the version.
-
- -- Biao Wang <biao716.wang@samsung.com> Fri, 14 May 2021 16:50:00 +0800
-
-git-buildpackage (0.9.21-tizen20210514) unstable; urgency=medium
-
- * Fix export submodule source code error.
-
- -- Biao Wang <biao716.wang@samsung.com> Fri, 14 May 2021 16:50:00 +0800
-
-git-buildpackage (0.9.20-tizen20200522) unstable; urgency=medium
-
- * Adapt Ubuntu 20.04 to upgrade the version.
-
- -- Yan Meng <yan11.meng@samsung.com> Fri, 22 May 2020 16:50:00 +0800
-
-git-buildpackage (0.9.9-tizen20180912) unstable; urgency=medium
-
- * Adapt Ubuntu 18.04 to upgrade the version.
-
- -- Biao Wang <biao716.wang@samsung.com> Wed, 12 Sep 2018 16:50:00 +0800
-
-git-buildpackage (0.7.5-tizen20161231) unstable; urgency=medium
-
- * Fix diff_status() for renames and copies
- * Adapt git-merge option when git version greater then 2.9
- * Disable test_pristine_tar unittest case
-
- -- SoonKyu Park <sk7.park@samsung.com> Sat, 31 Dec 2016 19:30:00 +0800
-
-git-buildpackage (0.7.4-tizen20160514) unstable; urgency=medium
-
- * Keep same version number with upstream source code ,version 0.7.4
-
- -- Jun Wang <junbill.wangx@samsung.com> Sat, 14 May 2016 17:12:00 +0800
-
-git-buildpackage (0.6.27-tizen20160302) unstable; urgency=medium
-
- * Fix error logs when __import__ faild,like "No handlers could be found fo logger"
- * Fix build problem on Debian 8
-
- -- Jun Wang <junbill.wangx@samsung.com> Wed, 02 Mar 2016 07:47:21 +0100
-
-git-buildpackage (0.6.22-tizen20150206) unstable; urgency=low
-
- * Rebase on top of upstream version 0.6.22
- * Experimental support for BitBake
- - Introduce import-bb tool.
- This is the first tool in an effort of enabling gbp in the BitBake build
- environment. Gbp-import-bb is a tool for importing packages from a
- BitBake-based "combined" distro repository into individual per-package
- Git repositories.
- - Introduce pq-bb tool.
- This is a tool for managing patch-queues for packages maintained in the
- BitBake packaging format (.bb recipes).
- - Introduce buildpackage-bb tool.
- Initial version of the tool for building BitBake packages from Git.
- NOTE: The buildpackage-bb tool itself is able to operate even without an
- initialized BitBake build environment although the build likely fails in
- this case. However, this makes it possible to export the packaging meta
- data, for example.
- - Introcude clone-bb tool.
- This is a new tool for helping to clone remote per-package Git
- repositories when working in BitBake-based "full distro" build
- environment. This is useful in the case that individual packages are
- actually maintained in per-package Git repositories (like Tizen). That
- is, the full distro repository that the developer operates in is
- composed of the packaging meta data from the individual per-package
- repositories. When willing to contribute to a package the developer
- would use clone-bb to clone the correct per-package repository and make
- his changes there.
- NOTE: clone-bb uses GBP_PACKAGING_REPO variable to determine the remote
- repository URI. This variable should be defined in the package recipes
- in order to make clone-bb usable.
- - Introduce submit-bb tool.
- This is a Tizen-specific tool for creating and pushing special submit
- tags.
- * pq-rpm: better error message
- * buildpackage-rpm: look for remote upstream branches.
- Consider remote branches, too, while looking for the upstream branch
- when trying to guess if a package is native or not.
- * rpm packaging changes
- - enable CentOS 7.
- - include python egg-info in -common.
- * rpm: suppress stderr when unpacking src.rpm
- * UpstreamSource: suppress stderr from tar in _determine_prefix()
- * patchseries: strip numbering when guessing subject from filename
- * Changes in logging
- - don't propagate to ancestor loggers
- - don't initialize handlers in GbpLogger init.
- Better compatibility with 3rd party modules that have their own logging
- initializations.
- * Features/fixes in GitRepository
- - GitRepository/__git_inout: correctly handle input error
- - GitRepository.create_tag: add 'annotate' argument.
- For forcing the creation of annotated tags. Causes the an editor to be
- spawned if no message is given.
-
- -- Markus Lehtonen <markus.lehtonen@linux.intel.com> Fri, 06 Feb 2015 10:36:26 +0200
-
- * Upgrade version to 0.6.25
-
- -- Rong Jinhui <jinhui.rong@samsung.com> Thu, 04 Aug 2015 08:53:30 +0800
-
-git-buildpackage (0.6.15-tizen20140828) unstable; urgency=low
-
- [ Markus Lehtonen ]
- * Rebase on top of upstream version 0.6.15
- * Changes in buildpackage-rpm
- - new 'commitish' keyword for spec vcs tag
- - notify: catch RuntimeError when importing pynotify
- - fix exit code in case of GitRepositoryError
- - always create tarball for native packages
- - check submodules from the exported treeish
- - fix crash when running prebuild hook
- - always run cleaner hook
- - add --git-no-build option
- - don't crash on invalid vcs format strings
- - add '--git-native' option
- - remove some outdated/unnecessary exception handling
- - get rid of prepare_export_dir()
- - handle invalid keys in orig prefix
- - internal refactoring and fixes
- * Changes in rpm-ch
- - implement --commit option
- - implement --commit-msg option
- - rpm-ch: implement --meta-bts option
- - rpm.policy: don't allow leading whitespace in bts meta tags
- * docs: manpages for the rpm tools
- * Misc. fixes and features
- - buildpackage: refactor tarball compression
- - gbp-dch: fix handling of the '--meta' option
- - import-orig-rpm: download tarball into parent directory
- - GitRepository/has_submodules: add treeish argument
- - tristate: implement __nonzero__() method
- * Logging:
- - don't automatically setup gbp-specific logger
- - fix auto colorizing for custom streams
- * Tests
- - multiple fixes and additions in ComponentTestBase class
- - testutils: add directories arg to ls_* functions
- - add unit tests for buildpackage-rpm
- * Packaging
- - rpm-packaging: recommend/require unzip
- - recommend/require zipmerge
- - depend/recommend rpmbuild
-
- [ Junchun Guan ]
- * Add PKGBUILD to support arch linux
-
- [ Li Jinjing ]
- * rpm packaging: use macro for python binary
-
- -- Markus Lehtonen <markus.lehtonen@linux.intel.com> Thu, 28 Aug 2014 11:40:05 +0300
-git-buildpackage (0.6.22) unstable; urgency=medium
-
- * [3d8939d] git.vfs: fix close method. Preventing a infinite recursion
- which can be triggered by gbp pq export --commit.
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 29 Oct 2014 07:47:21 +0100
-
-git-buildpackage (0.6.21) unstable; urgency=medium
-
- * [81dab4b] pq: Don't fail commit if the series file is empty on the source
- branch
- * [740e431] man: fix option argument for --git-pbuilder-options
- * [22a6987] Improve change reporting a bit
- * [e08d64d] Complete setup.py for pypi
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 17 Oct 2014 18:41:14 +0200
-
-git-buildpackage (0.6.20) unstable; urgency=medium
-
- * [ee44479] Allow to always drop pq branch after export (Closes: #761160)
- * [51ac0a5] pq: document --drop
- * [90b283f] meta-closes: Move help text to GbpOptionParser.help
- * [0afcd3d] pq: Add "pq export --commit" option. This commits the changes
- in the pq right away. This options is currently experimental and subject
- to change.
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 12 Oct 2014 11:42:27 +0200
-
-git-buildpackage (0.6.19) unstable; urgency=medium
-
- * [5d4cb92] Update to git-pbuilder 1.33
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 07 Sep 2014 09:25:48 +0200
-
-git-buildpackage (0.6.18) unstable; urgency=medium
-
- * Upload to unstable
- * [6edd836] Don't delete *_source.changes on source only builds
- (Closes: #758726)
- * [a37832e] Mention --no-merge (Closes: #760091)
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 06 Sep 2014 13:41:05 +0200
-
-git-buildpackage (0.6.17) experimental; urgency=medium
-
- [ Guido Günther ]
- * [692e5da] Make sure we fixup the changelog trailer with newer devscripts.
- We don't change any mainttrailer options already given.
- Thanks to James McCoy for the detailed explanation (Closes: #740566)
- * [ae5805e] Improve error messages on formatting errors to
- make it easier for the user to detect misformated replacement strings in
- config files and command line options.
- * [5f82f44] gbp: add --version option (Closes: #758909)
- * [04aa92f] Allow to list all available gbp subcommands
- * [68c053f] Unify doc strings a bit since they now show up with --list-cmds
- * [6d510ce] bash completion: make command list dynamic.
- Use "gbp --list-cmds" so we don't have to hardcode the available
- commands and get support for the RPM ones as they show up.
-
- [ Kamal Mostafa ]
- * [6823e51] buildpackage: Make debian-tag message configurable via
- --git-debian-tag-msg.
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 24 Aug 2014 11:31:28 +0200
-
-git-buildpackage (0.6.16) experimental; urgency=medium
-
- [ Markus Lehtonen ]
- * Doc cleanups and reformatting
- * [736b9d8] Introduce git-import-srpm tool.
- * [ed228a2] import-srpm: add 'vendor' config option.
- Intended to represent the distribution vendor (e.g. 'Debian').
- Currently, this can be used in tag format strings.
-
- [ Guido Günther ]
- * [0b1fc0d] buildpackage: Also print tag name when tagging the Debian
- release. Based on a patch by Kamal Mostafa
- * [2bf944f] Pass --no-pristine-tar to SRPM compnent tests
- to avoid pristine-tar showing up in the matched branches
- * [23090c9] Introduce git-buildpackage-rpm. Currently only including "gbp
- import-srpm".
- * Remove newly introducted spurious log outputs from tests
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 28 Jul 2014 15:57:49 +0200
-
-git-buildpackage (0.6.15) unstable; urgency=medium
-
- * [5cde49a] Revert "Determine build_dir upfront"
- This reverts commit b2549fac19f2d666552291a4fcf2020ca0570834.
- Closes: #749104
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 24 May 2014 18:40:44 +0200
-
-git-buildpackage (0.6.14) unstable; urgency=medium
-
- * [949ce84] Slightly improve usage output
- * [045e607] gbp pq: document --force
- * [817976e] Handle version format errors more gracefully.
- * [b0390d1] Fix comitter vs committer typos.
- Thanks to Sandro Tosi (Closes: #748339)
- * [dc231f2] Document that the patches must apply without fuzz
- * [de77df7] pq: Print proper error message if we fail to apply the tree
- * [54e4542] pq: Try harder to cleanup after a failed patch.
- Thanks to Marco d'Itri for the repo to debug this
- * [b2549fa] Determine build_dir upfront
- * [a050942] Improve error reporting on failed commands.
- (Closes: #748248)
- * [030ff96] Improve error reporting on hooks.
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 22 May 2014 22:47:37 +0200
-
-git-buildpackage (0.6.13) unstable; urgency=medium
-
- [ Guido Günther ]
- * [14f6ded] Test option parser fallbacks more thoroughly
- revealing another bug where we overwrote parsed values with defaults
- (Closes: #733759)
- * [03ada72] .gitignore: ignore editor backup files
- * [4c6b067] Add minimal 'config' command. This only allows to print single
- config values so far. (Closes: #733470)
- * [b393080] Import command not module. This matches the function name.
- * [459d9bf] config: add decorator to add_option_* functions.
- This allows us to build an internal list of valid options and print
- these.
-
- [ Markus Lehtonen ]
- * [a8cfd88] Revert "GitRepository/add_remote_repo: fix the 'tags' argument"
- Which caused an unwanted behavior of not fetching refs/heads at all --
- only tags were fetched.
- This reverts commit 5dd598fb8f2a9109189fad6cf631811f12ce2130
- * [4131b90] docs: re-enable missing manpage
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 03 Apr 2014 21:31:38 +0200
-
-git-buildpackage (0.6.12-tizen20140521) unstable; urgency=low
-
- [ Markus Lehtonen ]
- * Rebase on top of upstream version 0.6.12
- * Changes in rpm-ch
- - add --message cmdline option
- For giving the text for new changelog entry/entries, skipping git commit
- messages entirely.
- - implement '--all' option
- If defined, git-rpm-ch uses all commits in the Git history. Also,
- '--since' option is omitted.
- - implement --color-scheme option
- - use name (string) as the entry author
- - internal refactoring
- - fix crash in guessing the start commit
- * Changes in pq-rpm
- - implement --retain-history option
- With this option defined gbp tries to preserve the history when
- converting. That is, for each commit in the old branch create one
- corresponding commit in the new orphan packaging branch. This works by
- dumping packaging files and updating patches for each commit. However,
- empty commits are not generated - these are caused e.g. by changes in
- files that are ignored by patch-generation.
- NOTE! Only valid for the 'convert' action.
- - convert: don't try to commit empty set of patches
- - make sure we always get a sane author
- - slight unification of log messages
- - decrease (default) verbosity a bit
- - don't create pq branch when switching
- * Changes in buildpackage-rpm
- - buildpackage-rpm: fix desktop notifications
- - buildpackage-rpm: remove --purge option
- - guess/parse spec as early as possible
- * Documentation
- - Include man pages in RPM packages
- - Add -doc subpackage to RPM packaging
- - Build deb and rpm html docs in one docbook
- - A multitude of small cosmetic fixes
- * Other misc. internal changes
- - GitRepository: implement create_tree() method
- - rpm: suppress some verbosity when updating patches in spec file
-
- [ Li Jinjing ]
- * Fix missing return value in get_current_branch method
-
- -- Markus Lehtonen <markus.lehtonen@linux.intel.com> Wed, 21 May 2014 16:32:46 +0300
-
-git-buildpackage (0.6.12) unstable; urgency=medium
-
- * [89f3005] Use a much simpler version to fix the command name in --help
- mostly reverting e1780f0. (Closes: #742907)
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 29 Mar 2014 00:17:59 +0100
-
-git-buildpackage (0.6.11) unstable; urgency=medium
-
- [ Guido Günther ]
- * [38cfa6c] Request verbose output on bug reports
- * [d000b0c] Remove incorrect docs about multiple filter options
- (Closes: #718536)
- * [fd440e2] Use a temporary directory. This avoids file name collisions and
- weired files in the working copy.
- * [e1780f0] Fix command output.
- The first line lacked the subcommand like:
- $ gbp pull --help
- Usage: gbp [options] - safely update a repository from remote
- instead of
- $ gbp pull --help
- Usage: gbp pull [options] - safely update a repository from remote
- ^^^^
-
- [ Mario Lang ]
- * [077dc35] Fix config file name
-
- [ Markus Lehtonen ]
- * [3808523] docs: add some missing sgml closing tags
- * [d8f55da] GitRepository/get_commit_info: correctly handle file
- renames/copies. Use the '--no-renames' git command line option in order
- to prevent two filenames per entry.
- * [5dd598f] GitRepository/add_remote_repo: fix the 'tags' argument.
- Explicitly use --tags in git arguments - otherwise tags might not be
- fetched.
- * [15d87fb] tests: more robust check for the default urgency level of dch.
- The dch tool might not report it's version if it is incorrectly compiled.
- Create a dummy changelog and parse it "manually" to determine the default
- urgency level.
- * [7774375] pq: minor log message typo fix
- * [bbf21bf] ComponentTestBase: use regex matching in log checking
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 27 Mar 2014 22:27:38 +0100
-
-git-buildpackage (0.6.10) unstable; urgency=medium
-
- * [f1bc542,1b0b17c] config: Don't pull in config defaults twice.
- This would otherwise overwrite values set in the legacy config sections.
- (Closes: #733759)
- * [7e26f91] Remove cover-min-percentage. It makes running single tests
- harder than necessary since it requires the percentage also when using
- "nose <testname>".
- * [d533e0f] import_dsc: Create missing debian branch with
- --create-missing-branches (Closes: #739888)
- * [df32264] git-import-dsc: Document --create-missing-branches
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 23 Feb 2014 17:56:47 +0100
-
-git-buildpackage (0.6.9) unstable; urgency=medium
-
- [ Guido Günther ]
- * [78f3673] Depend on newer devscripts.
- These contain a uscan that handles repackaging at the right level and
- won't let us pick up the wrong tarball name.
- Thanks to gregor herrmann and all others involved (Closes: #635920)
- * [7c64575] Avoid backtrace on config file parse errors
- "gbp buildpackage" did this already but others didn't (Closes: #733759)
- * [7b1eadd] Make parsing config file sections symmetric.
- Always read the legacy command's config file section prior to the
- subcommand's config file section.
- Until now 'gbp <subcommand>' would read '[subcommand]' as well as
- '[gbp-<subcommand>]' sections while 'gbp-<subcommand>' would only read
- '[gbp-<subcommand>]' sections. (Closes: #733759)
- * [49f0e44] Change the default of cleaner to /bin/true.
- Running a clean command within version control by default nowadays
- causes more trouble than it helps. It's unnecessary with
- pbuilder/cowbuilder/sbuild and with export-dir. So change the default
- from 'debuild clean' to a noop ('/bin/true'). (Closes: #670624)
- * [d93c89f] import_orig: test error paths of find_source
- * [daf249f] docs: improve docs on using upstream's git repo.
- The documentation on using upstream's git directly instead of tarballs
- was very terse. Add a step by step guide on how to get started and
- how to update to new upstream versions.
-
- [ Markus Lehtonen ]
- * [e876beb] tests: adapt dch tests for older devscripts.
- Determine the default urgency level by determining the version number of
- the dch tool from command line.
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 15 Feb 2014 11:45:00 +0100
-
-git-buildpackage (0.6.8-tizen20140306) unstable; urgency=low
-
- [ Markus Lehtonen ]
- * Rebase on top of upstream version 0.6.8
- * Introduce git-rpm-ch tool.
- Initial version of the git-rpm-ch tool which is intended for maintaining
- RPM changelogs. Supports both spec files and separate "OBS style"
- changelog files.
- Implement '--tag' command line option (and other related options for
- signing) for creating and tagging a release. These correspond the
- tagging options in git-buildpackage-rpm.
- The git-buildpackage-rpm tool does not commit anything to git. However,
- in rpm-ch the '--tag' option causes the changelog modifications (and,
- all other staged changes) to be committed to git before creating the
- tag. This makes it possible to create a release and document the
- packaging/release tag name in the rpm changelog.
- * Changes to gbp-pq-rpm:
- - implement 'convert' subcommand.
- The new subcommand is intended to be a one-time-callable command for
- converting a package to use the "orphan-packaging" development model and
- git layout (where packaging files are maintained in a separate branch
- and code development in another branch).
- - implement '--import-files' command line option.
- For defining the packaging file(s) that will be imported into the
- development/patch-queue branch.
- By default, the local gbp conf files are imported (so that gbp sees the
- same settings on the development/pq branc as on the packaging branch).
- Files defined with this option will appear as one monolithic commit in
- the development/patch-queue branch.
- - implement --new-packaging-dir cmdline option.
- Used for setting the packaging directory to be used in the new orphan
- packaging branch. Defaults to --packaging-dir so that the gbp.conf files
- are more likely to work without modification.
- - fail gracefully on invalid config files
- - support '%(upstreamversion)s' as a replacable string in the pq branch
- name.
- * Changes to git-buildpackage-rpm
- - patch-export from development branch.
- Adds git-buildpackage-rpm --patch-export support for the 'orphan
- packaging' development model (where packaging files and development sources are kept in separate
- branches).
- New functionality:
- 1. If patch-export is enabled and gbp detects that the current branch
- has a development/patch-queue branch it exports the patches from there,
- instead of the tip of the packaging branch.
- 2. If gbp detects that the current (or exported) branch is a
- development/patch-queue branch it automatically enables patch-export
- and exports packaging files from the base branch (instead of the
- development/patch-queue branch.
- Also, add a new '--git-patch-export-rev' command line option with which
- the user can explicitly set the treeish from which patches are generated
- (i.e. HEAD..<patch-export-rev>)
- - fix spec file vcs update when doing git-tag-only
- - change default export directory.
- So that the git working directory is not dirtied, by default.
- * Changes ti git-import-orig-rpm:
- - disable --merge by default.
- Merging upstream to packaging does not usually make sense with rpm
- packages. Merely, it can create confusion cause unapplicable patches to
- be generated.
- - implement --create-missing-branches option.
- - implement automatic downloading.
- Automatically try to download the archive if the archive filename points
- to a remote location.
- - get archive from spec file.
- Try to get archive path/filename from spec file if no file name is given
- on the command line. This should make version bumps more
- straightforward: just update version number in the spec file and run
- 'git-import-orig-rpm'.
- * git-import-orig: implement --create-missing-branches option.
- * Fixes and new features in GitRepository class
- - GitRepository/get_commit_info: correctly handle file renames/copies.
- - GitRepository.create_branch: add 'force' option
- - GitRepository.archive: add 'paths' option
- - GitRepository/git_command: strip stderr output in case of error.
- - GitRepository/add_remote_repo: fix the 'tags' argument.
- - GitRepository: allow interactive commands.
- - GitRepository: fix the 'edit' mode in commit methods.
- - GitRepository.commit_files: add committer_info and edit arguments.
- - GitRepository.commit_all: add committer_info argument.
- * Fixes and new features in internal rpm/spec support
- - rpm.SpecFile: add 'specpath' attribute
- - rpm: correctly handle 'NoSource' and 'NoPatch' tags in spec.
- - rpm: Implement spec_from_repo() helper function
- - rpm: track all "section" directives in spec file.
- - rpm: add gbp.rpm.changelog module.
- This new module contains basic containers and functionality for parsing
- and updating rpm changelogs. It is coupled with the rpm packaging policy
- class which now has definitions for rpm changelog formatting.
- - rpm: support for getting/setting changelog in spec.
- SpecFile objects now support reading and writing of the %changelog
- section.
- - rpm: store full path of spec file sources
-
- [ Łukasz Stelmach ]
- * Fix detection of prefix directory in tarballs
- gbs import failed to import tarball properly if paths in the archive
- were prefixed with "./".
-
- -- Markus Lehtonen <markus.lehtonen@linux.intel.com> Thu, 27 Feb 2014 11:30:59 +0200
-
-git-buildpackage (0.6.8) unstable; urgency=medium
-
- * [f5718b8] No need to document --verbose. Properly document --help
- instead.
- Thanks to Olivier Berger for pointing this out (Closes: #731149)
- * [e746d5f] Adjust test cases to newer devscripts (Closes: #732384)
- * [ca93ccb] Run nosetest on executables too.
- They're all well behaved and this allows us to use doctests in them
- * [eec8ce3] Determine changes file name based on dpkg-buildpackage options
- (Closes: #732678)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 20 Dec 2013 17:21:20 +0100
-
-git-buildpackage (0.6.7) unstable; urgency=low
-
- * [ab5a708] import-dsc; Merge upstream version by tag
- instead of simply using the upstream branch name. THis makes sure
- we also merge upstream versions that were imported previously with
- e.g. "gbp import-orig". (Closes: #698222)
- * [2042144] log: add error and warning aliases since I tend to use them
- instead of err and warn. (Closes: #728896)
- * [bc5ce39] Fix description of backports branches
- * [00d830c] Use --distribution instead of --dist (Closes: #730788)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 29 Nov 2013 20:52:03 +0100
-
-git-buildpackage (0.6.6-tizen20131202) unstable; urgency=low
-
- * Rebase on top of upstream version 0.6.6
- * UpstreamSource: fix archive prefix guessing
- * pq-rpm: create diff up to the last merge commit
- Before, merge commits broke patch generation, or, (most probably) caused
- the generated patches to be unapplicable (similar to how
- git-format-patch behaves).
- Now, changes up to the last merge commit are squashed into one diff if
- merge commits are found in the revision list from which patches are to
- be generated. Individual patches (one per commit) are generated from the
- last merge commit up to the exported revision.
- * pq-rpm: magic word HEAD for patch-squashing
- When given as the squash-point, 'HEAD' translates to the end-commit.
- This allows one to configure gbp to always squash all commits into one
- monolithic diff.
-
- -- Markus Lehtonen <markus.lehtonen@linux.intel.com> Mon, 02 Dec 2013 12:55:14 +0200
-
-git-buildpackage (0.6.6) unstable; urgency=low
-
- [ Guan Junchun ]
- * [284eea5] gbp-clone: support repo URLs like "host:repo.git" Previously,
- gbp didn't correctly parse this kind of URL and clone failed.
- * [d52abf3] gbp-clone: support cloning to a specific directory
- (Closes: #725666)
-
- [ Guido Günther ]
- * [3092623] Add missing bash completion for gbp import-dscs
- (Closes: #727749)
- * [fc5b485] import-dsc: allow to skip Debian tag creation
- (Closes: #636368)
- * [6f0c8f9] Update to git-pbuilder 1.30 that resyncs with what we shipped in
- gbp.
- * [3e09958] Disable html coverage generation until python-nose is fixed.
-
- [ Markus Lehtonen ]
- * [c661c71] pq: rewrite patch export functionality.
- Use our own function for constructing the patch files instead of using
- the format-patch command of git. This way, we get the desired output
- format directly, without the need for the error-prone "format-patch,
- parse patch files, mangle and re-write patch files" cycle.
- Also, fix patch naming in patch generation when '--no-patch-numbers' is
- used. Previously, multiple commits with the same subject resulted in
- multiple patches having the same filename. This lead into broken series
- with missing patches as patch files were overwritten by the topmost
- commit.
- * [017fac3] pq.format_patch: support file path filtering.
- Implements a filter option that allows filtering out changes to certain
- files/paths in the patch-generation. A commit is totally ignored if all
- files would be filtered out. The path filter is given as a Python
- regexp.
- * [a0d6eb7] pq: properly generate non-ascii patch files.
- Encode non-ascii email headers properly. Also, set MIME headers
- correctly for the message body if the commit message body contains
- non-ascii characters.
- The reason for constructing the message in a little bit "clumsy" way is
- the intention is to match the output of git-format-patch as closely as
- possible.
- * [91fbdc1] pq: support patch-export commands.
- Support giving commands to pq as a meta tag in commit message. The
- format is "Gbp: <command> [args]".
- Currently, only one command is supported. namely 'ignore'. That is, one
- can use 'Gbp: Ignore' in the commit message for ignoring the commit in
- patch-generation.
- * [3dccca6] pq: add format_diff() function.
- For generating a patch file from a diff between two arbitrary commits.
- * [34e85f7] pq: listen to 'Gbp-Pq:' commands, too
- * [99c6995] pq: support 'Topic' patch-export command.
- Topic can be defined with either 'Gbp: Topic <topic>' or 'Gbp-Pq: Topic
- <topic>' in the commit message.
- This is to replace the "gbp-pq-topic: <topic>" command.
- * [0c0086b] docs: update pq manpages regarding pq command meta tags
-
- [ Felipe Sateler ]
- * [babbc5e] Add zsh completion.
- (Closes: #717002)
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 06 Nov 2013 08:21:55 +0100
-
-git-buildpackage (0.6.5) unstable; urgency=low
-
- [ Etienne Millon ]
- * [ba4f778] doc: Fix git-pbuilder example (Closes: #725875)
-
- [ Guido Günther ]
- * [3be2947] Be more robust about git status output changes by using
- --porcelain. Heavily based on a patch by rian m. carlson
- (Closes: #726260)
- * [ae460e1] Bump standards version
-
- [ Andrew Starr-Bochicchio ]
- * [4368694] Don't export DEB_VENDOR="Debian"
- Tests now take Ubuntu versions into consideration. (Closes: #723756)
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 16 Oct 2013 10:29:58 +0200
-
-git-buildpackage (0.6.4) unstable; urgency=low
-
- [ Guido Günther ]
- * [0385dc5] docs: having an upstream branch is a recommendation rather than
- a hard requirement, we can use any treeish to build the upstream tarball
- from.
- * [e398469] Remove unused import
- * [f738be3] Add link to online docs
- * [ec7bd94] pq: print which patch failed to apply
- * [820100d] pq: Only print number or tries if we try more than once
- * [a86ccb7] Update to git-pbuilder 1.29
- * [b494801] Backports got integrated into the main archive. From wheezy on
- we can use the main archive
-
- [ Markus Lehtonen ]
- * [4030c19] docs: minor sgml syntax fix
- * [e72a1e2] config: restore mangled env in doctests.
- * [0eeafba] GitRepository/diff: add 'stat' and 'summary' options.
- * [8cdc06f] ComponentTestBase: more verbose output in case of branch mismatch
- * [af2034c] ComponentTestBase: fix env restore in teardown
- * [54099f5] import-orig: import readline in the common module.
- * [6c478a6] ComponentTestBase: keep tmpdir if GBP_TESTS_NOCLEAN is in env
- * [bc40956] GitRepository: Add clean() method
- * [e48f0a0] GitRepository.diff: add 'text' option. for generating textual
- diffs.
- * [3c0a022] GitRepository.diff: prevent usage of external diff. External
- diff might break patch generation, for example.
- * [6f3d63a] ComponentTestBase: use eq_() ok_() from nose.tools for better
- assert messages.
- * [e54289e] common/buildpackage: fix handling of empty tarball prefix as
- needed for rpm builds
- * [39f581e] GitRepository.diff: add 'ignore_submodules' option
- * [b9b9eea] GitRepository.list_tree: add 'paths' option.
- * [3eb401d] git: new class and method for remote repositories.
- * [28fdf4c] GitRepository.has_remote_repo: use get_remotes method.
- * [b4e5b73] GitRepository: deprecate the get_remote_repos method.
- * [c222197] tests: add test for archiving without git submodules
- * [92f29be] tests: use eq_ and ok_ from nose tools in submodule tests.
- For consistency and better assert error messages.
- * [f858f87] tests: add some docstrings to git submodule tests.
- * [1d92bfe] tests: upper case global variables in submodule tests.
- * [6b8037e] tests: remove unused import in submodule tests.
-
- [ Lingchaox Xin ]
- * [07b3054] GitRepository.has_treeish: minor pylint fix
- * [eca5a33] GitRepository.describe: add 'tags' and 'extra-match' options
- * [1320de2] GitRepository.fetch: Add 'refspec' option
- * [171579f] GitRepository.fetch: Add 'all_remotes' option
- * [68baa9a] GitRepository.push: Add 'force' option
- * [d28c7cc] GitRepository.push: Add 'tags' option
- * [db79c5d] GitRepository.pull: Add 'all_remotes' option.
- Also changes the method to utilize the GitArgs class.
-
- [ Osamu Aoki ]
- * [8441bba] typo s/bei/be/ (Closes: #722359)
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 06 Oct 2013 17:35:14 +0200
-
-git-buildpackage (0.6.3-tizen20131017) unstable; urgency=low
-
- [ Lingchaox Xin ]
- * Fix `fatal: fetch --all does not take a repository argument`
-
- [ Markus Lehtonen ]
- * UpstreamSource.guess_version: don't check for directories
- * UpstreamSource: move version guessing logic to PkgPolicy
- * rpm: UpstreamSource: move version guessing logic to PkgPolicy
- * UpstreamSource: store the absolute path
- * UpstreamSource: check that the sources exist
- * UpstreamSource: implement prefix guessing
- * rpm: UpstreamSource: implement prefix guessing
- * UpstreamSource.pack: reuse unpacked dir if no filter is used
- * UpstreamSource.unpack: return UpstreamSource instance
- * import orig: import readline in the common module
- * rpm: import orig: import readline in the common module
- * buildpackage: fix handling of empty tarball prefix
- * import-orig: new function for filtering/re-packing sources
- * import-orig: rework sourcecode preparation and filtering
- * tests.testutils: add ls_zip() helper
- * rpm tests: test --filter option of git-import-srpm
- * ComponentTestBase: more verbose output in case of branch mismatch
- * import-orig-rpm: don't crash on invalid gbp.conf
- * import-orig-rpm: remove unneeded try-except
- * config: restore mangled env in doctests
- * ComponentTestBase: fix env restore in teardown
- * ComponentTestBase: keep tmpdir if GBP_TESTS_NOCLEAN is in env
- * tests: add tests for git-import-orig-rpm
- * ComponentTestBase: use eq_() ok_() from nose.tools
- * rpm tests: slight modificatin of import-srpm tests
- * Version bump, rebase on top of 0.6.3
- * docs: minor sgml syntax fix
- * Disable cover-min-percentage setting of nose
- * debian packaging: change to 1.0 source package format
- * git: new class and method for remote repositories
- * GitRepository.has_remote_repo: use get_remotes method
- * GitRepository: deprecate the get_remote_repos method
- * pq-rpm: drop unused 'tries' option
- * common/pq: support more flexible pq-branch naming
- * GitRepository.list_tree: add 'paths' option
- * rpm: change guess_spec() to return SpecFile object
- * rpm: minor docstring fixes
- * rpm.SpecFile: support parsing spec as raw text data
- * rpm: support guessing spec file from git treeish
- * pq: don't overwrite patches in the same series
- * pq-rpm: don't overwrite patches in the same series
- * tests: use sanitize some submodule tests
- * tests: use eq_ and ok_ from nose tools in submodule tests
- * tests: add some docstrings to git submodule tests
- * tests: upper case global variables in submodule tests
- * tests: remove unused import in submodule tests
- * buildpackage: refactor prefix handling
- * common/pq: fix length of patch filenames
- * pq: fix generation of series file
- * pq.write_patch_file: drop unused argument
- * pq: pass commit_info to format_patch()
- * SpecFile.set_tag: change the default place for new tags
- * buildpackage: support 'commit' variable for VCS tags
-
- [ Zhang Qiang ]
- * remove 'repo' param to adapt to changes of write_patch_file
-
- [ Guan Junchun ]
- * Fix gbs clone failure if repo url is like host:repo.git
- * Clone a repository to a specific directory
-
- -- Markus Lehtonen <markus.lehtonen@linux.intel.com> Thu, 17 Oct 2013 13:45:10 +0300
-
-git-buildpackage (0.6.3) unstable; urgency=low
-
- * [60ffe95] --git-hooks doesn't take an argument
- * [7a29e42] Move MockedChangelog to testutils and allow to specify the
- content so we can reuse it for other dch tests.
- * [938e4cd] dch: make automatic adding of new sections more robust.
- The code that determined if we found a snapshot header was obfuscated by
- the code that determines the commits to add. Split those and better
- document their purpose. Also always return the commit to start from so we
- don't need to repeat the logic in the upper levels.
- * [d0fb6d8] Minor docstring updates
- * [388cfb8] docs: Add recommended branch layout.
- It'd be nice to have similar branch layouts among packages so recommend
- one that worked well so far.
- * [34b2079] GitRepository: allow to use '..' instead of '...'
- The symmetric difference isn't always useful since it includes changes
- from both branches. See #680705.
- * [f793ed0] pq: exclude patches from Debian packaging branch.
- When regenerating the patch queue including patches from the Debian
- branch is not useful. Addresses parts of #680705.
- Thanks to Benjamin Cama for the detailed analysis.
- * [283c847] docs: Refert to gbp in the introduction since this wraps all
- commands now.
- Thanks to Ross Boylan for pointing out that the current wording is
- confusing.
- * [8f073eb] docs: remove superfluous at
- * [c9d3d93] Use open() instead of file() since the later doesn't exist in
- python3
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 28 Aug 2013 19:35:34 +0200
-
-git-buildpackage (0.6.2) unstable; urgency=low
-
- * [194d396] Document gbp's help option
- * [56068e5] Git.Repository.__git_inout: properly set stdin.
- We should set stdin to subprocess.PIPE when piping input according
- to the subprocess docs.
- * [585439e] Git.Repository.__git_inout: Close all other file descriptors.
- No need to leak fds to the child.
- * [9af1868] gbp.git.Repository.get_branch(): use _git_command
- instead of the deprecated _git_inout and clarify the return codes and
- exceptions raised.
- * [a2ce387] gbp.git.GitRepository.has_branch(): use _git_command instead of
- the deprecated _git_getoutput
- * [2145c58] Test succesful import too and make sure we don't spew to stderr
- during this test
- * [8d2ceba] Make sure we keep our test coverage
- * [00a4162] Switch to debhelper level 9 which is available in Wheezy
- * [55ba9b8] Update Vcs-Browser URL
- * [e829dc5] Add symlinks to the manpages for the deprecated commands and
- make lintian happy (Closes: #714489)
- * [fc74aa2] Fix broken xrefs
- * [2a233a7] Add examples for importing upstream sources
- * [cef5bae] Add gbp buildpackage example showing git-pbuilder invocation
- * [1b38d90] Remove duplicate config files section in the "gbp buildpackage"
- man page
- * [a22eee2] GitRepository.set_upstream_branch: Newer git wants a valid
- remote repo entry so set one in the tests before trying to set the
- upstream branch. Found with git 1.8.3.2
- * [7762b17] GitRepository.set_upstream_branch: don't try to set upstream
- twice. Move setting of the upstream branch out of the loop. This worked
- by accident so far.
- * [b615db5] GitRepository.set_upstream_branch: Catch errors to set upstream
- branch
- * [b8e921e] GitRepository.set_upstream_branch: use --set-upstream-to if
- available since --set-upstream is deprecated.
-
- -- Guido Günther <agx@sigxcpu.org> Tue, 09 Jul 2013 21:46:00 +0200
-
-git-buildpackage (0.6.1) unstable; urgency=low
-
- * [42769e3] Split {Build-,}Deps per line
- and sort alphabetically
- * [747a273] Depend on python-pkg-resources (Closes: #714238)
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 27 Jun 2013 11:23:03 +0200
-
-git-buildpackage (0.6.0) unstable; urgency=low
-
- [ Guido Günther ]
- * Introduce gbp supercommand to get rid of the git-<command> vs.
- gbp-<command> inconsistencies:
- * [12dce5f] Add wrapper for all gbp commands. So like git you can now
- use gbp <command> instead of git-<command> or gbp-<command>. The
- manpages and docs aren't adjusted yet.
- * [416f690] Bash complete on "gbp <command>" too
- * [5684b18] Add gbp manpage
- * [6b1b41f] docs: Use gbp <command> instead of {git,gbp}-<command>
- * [daccfa0] manpages: Changes references from git- to gbp-
- * [1d90e73] docs: Rename the entities from &git-<command>; to
- &gbp-<command>;
- * [1eea5d5] gbp.conf: Use command names instead of {git,gbp}-
- * [c365f7c] Rename the sgml files from git- to gbp-
- * [55fded7] NEWS: add a note about the new gbp super command
- * [b47b7e8] Update package description
- * [fe9f925] GbpOptionParser: Make sure we parse the old config sections.
- For backward compatibility between {gbp,git}-<command> and "gbp
- <command>" make sure we parse the former sections if using the later.
- * [375014d] gbp: support --help
- * [a5aff11] Consistently call gbp the supercommand and robustify against
- invalid modules names.
- * [e09ef94] gbp-import-dscs: invoke gbp import-dsc instead of
- git-import-dsc
- * [38d43b4] config: Don't fill in the parser with all defaults.
- * [4d6eecb] GitRepository.get_subject: use get_commit_info.
- This kills another _git_getoutput. Also deprecate the method since we
- don't need to special case the subject.
- * [caff99c] GbpOptionParser: Make sure we access the GbpOptionParser*'s
- default dict and not the one from the OptionParser. The instance's default
- dict this gets reset to empty when invoking OptionParser.__init__.
- * [1158503] GbpOptionParser: add test for 'filter' option handling
- * [ed63276] Git-Ignore generated gbp.conf.5 too
- * [3966076] Remove unused imports
- * [b59818d] import-dsc: print filename instead of object name
-
- [ Markus Lehtonen ]
- * [fa414e5] gitmodifier: make the datetime object always have timezone. To
- be consistent with the date property and for easier compatibility with git
- dates.
- * [f717975] GitRepository/get_commit_info: add patchname to info.
- Add a new 'patchname' field to the information returned by
- get_commit_info. That is, the subject in a sanitized format, similar to
- what git-format-patch uses.
- * [74d956f] import-orig: keep working copy in sync with branch HEAD.
- Update working copy and index (to branch HEAD) if we modify the
- currently checked-out branch. Otherwise the repository is left in
- unclean state when the current branch is upstream or pristine-tar and
- the '--no-merge' option is used.
- * [a30f9e7] buildpackage: use get_commit_info() instead of get_subject()
- Utilize the get_commit_info() method of GitRepository instead of the
- deprecated get_subject().
- * [75cbd9a] GitRepository/diff: allow single object.
- Allow diffing a single object, e.g. getting diff from single commit.
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 26 Jun 2013 16:36:41 +0200
-
-git-buildpackage (0.6.0git20130530-tizen20130822) unstable; urgency=low
-
- [ Markus Lehtonen ]
- * GitRepository/add_files: consistently update all tracked files
- * rpm: enhance spec parsing error messages
- * rpm: simplify SpecFile._parse_filtered_spec()
- * rpm: implement a wrapper module for rpm lib
- * rpm: print a warning if importing gbp-specific librpm fails
- * rpm: Improve logging in case of rpmlib error
-
- [ Lingchaox Xin ]
- * GitRepository: Add force option to push method
- * GitRepository: Add all option to pull method
- * GitRepository: Add refspec option to fetch method
- * Fix pylint warnings, follow Markus' sugesstion
- * Add tags option in git push command
- * Add all_remotes option in git fetch command
- * Add clean method to GitRepository class
-
- -- Markus Lehtonen <markus.lehtonen@linux.intel.com> Thu, 22 Aug 2013 09:47:51 +0300
-
-git-buildpackage (0.6.0~git20130530) unstable; urgency=low
-
- [ Guido Günther ]
- * [f4acd7a] GitRepository: Use LC_ALL=C when checking features.
- This fixes the doctest and also makes sure we use an up to date manpage.
- Thanks to Daniel Dehennin for the report.
- * [9c5bd03] Add Jenkins Scratchbuilder example.
- It's a simple script that can be used to build Debian packages via gbp
- and Jenkins.
-
- [ Gaudenz Steinlin ]
- * [47f2dea] git-buildpackage: Unbreak overlay mode (Closes: #708636)
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 30 May 2013 15:24:05 +0200
-
-git-buildpackage (0.6.0~git20130506) unstable; urgency=low
-
- [ Guido Günther ]
- * Get rid of lots of spurious output to stderr, only report it in error
- cases. This makes the tools and the testsuite less chatty.
- * [4abfa6a] gbp-pull: Fix typo in help output
- * [90ffae8] manpages: Document gbp-pull's --ignore-branch option
-
- [ Markus Lehtonen ]
- * [9e3267a] DebianSource: raise DebianSourceError if reading changelog fails
- * [a36dc64] buildpackage: catch and handle DebianSourceError gracefully
- * tests: fixes for older dch
- * [36341dd] GitRepository: add describe() method.
- * [ae63dba] DebianSource: fix is_native()
- Determine from changelog if debian/source/format does not provide any type
- (1.0 format).
- * [f880910] tests: Fix tests for Ubuntu.
- * [f9722f6] buildpackage: implement --[no-]hooks option.
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 06 May 2013 19:18:49 +0200
-
-git-buildpackage (0.6.0~git20130414) unstable; urgency=low
-
- * [e948bd3] Don't try access source before it's filled
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 13 Apr 2013 19:36:57 +0200
-
-git-buildpackage (0.6.0~git20130413) unstable; urgency=low
-
- [ Daniel Dehennin ]
- * [a9bf9cf] Move debian/changelog manipulation to gbp.deb.changelog.ChangeLog.
- (Closes: #672954)
- * [ae4a368] Add option to manage distribution fields for non snapshot mode.
- The snapshot mode fails to merge two "debian/changelog" entries if the
- distribution is not "UNRELEASED".
- (Closes: #646684)
- * [920053e] Add urgency management.
-
- [ Guido Günther ]
- * [62d3b99] Move DebianPkgPolicy to separate module
- * [7335735] Move DscFile to separate module
- * [e5d9816] Generate coverage xml for cobertura style coverage information
- that can be picked up by e.g. Jenkins
- * [6eb2ddc] Use _git_inout for git.show
- so we don't spew the error message on stdout for nonexistent objects
- * [d510f2a] Honor debian/source/format when checking if a package is a
- native package (Closes: #669267)
-
- [ Markus Lehtonen ]
- * [54679eb] Add .coveragerc.
- To get correct report if coverage is invoked directly (not through
- nose/disttools) in order to get an xml report, for example.
-
- [ Thomas Koch ]
- * [3d6b68a] tests: Use tempfile.mkdtemp to create temp dirs for tests.
- This puts test dirs below /tmp which often is a tmpfs.
- All tests include the context module which consolidates tmpdir creation
- and cleanup, undoes a chdir in teardown and silences log messages.
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 13 Apr 2013 14:27:06 +0200
-
-git-buildpackage (0.6.0~git20130329) unstable; urgency=low
-
- [ Guido Günther ]
- * [703da99] Remove unused imports
- * [db66286] Return boolean types from is_ methods instead of a match object
- or None
- * [db3505f] Better document how one derives from PkgTypes
- * [eb999f7] Allow for upper case characters in the upstream version
- (Closes: #703694)
- * [fc9d019] Purging of the build dir should be configurable via a config file
- so introduce --git[-no]-purge which is consistent with the other
- boolean options and deprecate --git-dont-purge. (Closes: #702200)
- * [5925499] Split out building a debian version from an upstream commit
- based on a patch by Daniel Dehennin
- Needed for #672954, #646684, #669171
- * [dafb5a3] Fix docstring
-
- [ Markus Lehtonen ]
- * [8b80e38] ComponentTestBase: close streamhandler when stopping log capture
- * [5ef9e77] gbp-pull: update tags, too.
- To make sure that the tags are in sync with the remote.
- * [6fc1c08] tests/component: pylint fixes.
- Add module docstring and wrap one overlong line.
- * [7709f21] tests: skip test_Changelog if 'dch' tool is not available
- * [dcf7467] setup: possibility to skip nosetest requirements.
- Makes it possible to not require test requirements by defining
- WITHOUT_NOSETESTS environment variable when running setup.
- * [3d80b2f] GitRepository/_cmd_has_feature: more intelligent parsing.
- More intelligent parsing of the git output (man page). Try to
- parse optional options like '--[no-]standard-notes' of git-show
- correctly. In this example both 'no-standard-notes' and 'standard-notes'
- would be available.
- * [57bbd0a] GitArgs: utilize the add() method in other add_X methods.
- Only use the add() method for updating the argument list. This makes the
- code more robust and makes all add method variant types support the same
- argument types.
- * [3b873f7] ComponentTestBase: capability to check files of repo.
- Makes it possible to check that the correct files are present in
- the working copy of the repo.
- * [64ed77c] tests.test_GitRepository: import and setup gbp.log.
- In order to initialize gbp logging properly. Fixes false positives when
- the GitRepository tests are run alone.
-
- [ Zhang Qiang ]
- * [6703edc] packaging: Add man as dependency.
- Required by GitRepository._cmd_has_feature() method.
-
- [ Daniel Kahn Gillmor ]
- * [4323cc8] Include the name of the package being built in the debian tag
- message. (Closes: #704018)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 29 Mar 2013 12:34:07 +0100
-
-git-buildpackage (0.6.0~git20130314) unstable; urgency=low
-
- [ Guido Günther ]
- * [4a5fa0d] Ignore rope project files as generated by ropemacs
- * [c6b7bc2] gbp-pq: Improve patch header write out. Avoid trailing new
- lines in the patch header when reexporing patches. to avoid diffs when
- nothing changed.
- * [2fa7cac] gbp.log: lowercase the levelname too match the output before the
- switch to Python's logging module
- * [00ed38f] gbp.log: Improve error message on broken color lists
- * [744f85b] gbp-create-remote-repo: Set HEAD in remote repo
- to debian branch (Closes: #692006)
- * [3591792] git-dch: Allow to create changelogs when not on a branch.
- This makes snapshot changelog generation e.g. within jenkins builds
- simpler since jenkins by defaults checkouts out the commit without
- creating a branch.
- * [5176d2a] Check the sha1 doesn't exceed 40 bytes
- * [c097397] Document --git-pristine-tar-commit
- * [9e30bf2] Add component test initialization very heavily based on code by
- Markus Lehtonen
- * [3820adc] Add test data submodule
- * [9ec98c5] Move over import dsc test from external test suite. Move over
- the first test from our external (shell based) test suite to the component
- tests.
- * [80b5c64] Add missing --git- (LP: #1112831)
- * [b678c6a] Fix typo.
- Thanks to Andreas Beckmann (Closes: #700443)
- * [4ef1081] examples: fix logging.
- Thanks to Carsten Schoenert
-
- [ Markus Lehtonen ]
- * [83c2c3f] log: rewrite the module to use Python logging module. Replaces
- the Logger with a new one, derived from the Logger class of the Python
- standard library. Colorized output is handled by a separate handler class.
- * [48c48c9] log: add support for setting the color scheme. Implements
- changeable color schemes in the gbp.log module. Color scheme is given as a
- colon-separated list, with one color for each log level:
- '<debug_color>:<info_color>:<warning_colro>:<error_color>'. Colors can be
- given as an integer number (ANSI terminal color code) or color name (.e.g
- 'red'). Missing or empty fields are interpreted as using the default color
- for that log level.
- * [ebbe635] New configuration option for setting the output color scheme.
- Adds a new command line and config file option 'color-scheme' for
- selecting the colors used in log output.
- * [ec2b74c] GitRepository/strip_sha1: fix length checking.
- Accept longer sha1 than what was asked for. The length option given to
- git is merely a "wish to get a sha1 of this length". Git may also return
- longer sha1 if truncating to given length would give
- ambiguous/non-unique sha1.
- * [c9011f7] Tristate: allow to init from another Tristate object
- * [4b719cd] Tristate: drop broken and unused is_valid_state() method
- * [4bdfe2a] log: make color setting a tristate on/off/auto.
- Makes it possible to force color=on e.g. when piping output. Also, moves
- all 'auto' logic to one single place, i.e. the streamhandler.
- * [ab7a732] pq: do author guessing outside the apply_patch functions.
- Call the author parsing/guessing function outside the apply patch
- functions. This way, the caller can decide when to do the guessing, and
- with which parameters. Now the apply_patch functions do what their name
- suggests.
- * [9c80f14] buildpackage: add 'force' option to write_wc()
- To select whether to include file that would otherwise be ignored by
- gitignore (.gitignore or .git/info/exclude).
- * [5e6f163] tests.testutils: baseclass for testing commandline tools.
- Introduce a new baseclass to be utilized in testing the git-buildpackage
- command line tools.
- * [af0ee43] pq/apply_and_commit_patch: fix date parsing.
- GitModifier doesn't support dates in the format used in git format-patch
- emails.
- * [97cd5bd] gbp-clone: fix return value in case of GitRepositoryError
- * [377de2d] gbp-pull: fix --depth cmdline option
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 14 Mar 2013 07:16:49 +0100
-
-git-buildpackage (0.6.0~git20121124) unstable; urgency=low
-
- [ Guido Günther ]
- * [c3c2778] Add minimal debian/source/format parser
- * [3878867] PEP-8 and pyflakes cleanups
- * [30c1821] Add support dch's --security option
- * [4970b42] gbp-pq: Print number of import tries left
- * [cf48b03] Allow to remove the orig tarball symlink that's used make
- pristine-tar see the correct orig tarball name.
- (Closes: #692401)
- * [09ba538] GbpError accepts an error message so no need to print it
- separately.
- * [a488695] Minor git-import-orig manpage improvements
- * [4c9bb9f] Add missing git- prefix to --color and --notify options.
- Thanks to Filippo Rusconi (Closes: #693978)
- * [9478bad] testutils: create missing directories when adding a file
- * [691856d] Use an absolute path when parsing the control file so we can't
- accidentally parse a file from another dir.
- * [d248720] Test apply_and_commit_patch
- * [3952091] gbp-pq: Allow to pass in custom function to fetch authorship
- information so the RPM based tools don't need to rely on a control file
- but can e.g. look at the spec file.
- * [7f2c9c1] gbp-pq: Test if setting a topic works
- * [f4d493d] Add sha1 stripping in a single place so we can easily sanity
- check the result.
- * [95ec21a] Output test results in xunit format too to make it more useful
- in Jenkins CI builds
- * [24fdd97] Test gbp.pq.common.write_patch
- * [824e83e] gbp-pq: don't use plural form when there's only one try left
- * [8b01d37] git-import-dscs: Properly catch import errors
- (Closes: #694113)
-
- [ Dmitrijs Ledkovs ]
- * [323bdcf] Fix testsuite failure if DEB_VENDOR != Debian.
- (Closes: #692289)
-
- [ Markus Lehtonen ]
- * [f4d2e21] GitRepository: implement _cmd_has_feature() method to allow
- compatibility with older git versions.
- * [dfbedfe] GitRepository: fix merge() for older git versions using
- _cmd_has_feature() in GitRepository.merge().
- * [ba854d8] GitRepository/diff: add 'paths' argument to makes the diff
- function more versatile
- * [b7cdef5] GitRepository/diff: catch git error.
- * [fe1e120] command_wrappers: suppress some pylint warnings
- * [4ed1b43] notifications.py: remove unused import
- * [0a9bf99] tests: make tests a Python module to make it possible to reuse
- code between various tests.
- * [932b1c0] pq: fix "no authorship" warning messages.
- * [1da7e0d] import-orig: remove dead if statement.
- * [3678906] import-orig: remove dead GbpNothingImported exception
- * [8bc7921] GitRepository/get_commits: more flexible revision ranges.
- * [36d13cb] GitRepository/get_submodules: use correct path.
- * [3362147] GitRepository/get_commit_info: support tags.
- * [03cdea0] GitRepository/has_submodules: use correct .gitmodules file.
-
- [ Ed Bartosh ]
- * [8bb62f5] GitRepository.find_tag: change deprecated _git_getoutput to
- _git_inout
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 24 Nov 2012 14:55:24 +0100
-
-git-buildpackage (0.6.0~git20120822) unstable; urgency=low
-
- [ Guido Günther ]
- * [e05bfb9] dch: Fix error reporting on parsing errors
- * [f4162be] manpage: Fix typo in git-dch's multimain-merge option
- (Closes: #684322)
- * [e8d175a] manpages: correct manual section and remove duplicate entry
-
- [ Zhang Qiang ]
- * [0af1e72] GitRepository/branch_contains: remove prefix '*' in branch name.
-
- [ Markus Lehtonen ]
- * [678f85f] docs: fix cross-referencing in manpages.
- * [f0d4b0d] docs: make refentry ids of manpages more consistent
- * [dc3b3b6] GitArgs/add: support iterable and non-string args.
-
- [ Ed Bartosh ]
- * [7524bbb] GitRepository: Implement set_upstream_branch and
- get_upstream_branch methods
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 22 Aug 2012 10:58:07 +0200
-
-git-buildpackage (0.6.0~git20120803) unstable; urgency=low
-
- [ Guido Günther ]
- * [6287b0d] gbp.conf: Make config option printing more consistent
- * [9430ee1] Make TestDir testcase use a newly created directory neeeded for
- the upcoming packagename/version parsing support
- * [e9d239b] UpstreamSource: automatically detect package name and versions
- from directories of the form packagename-<version>
- * [41482a3] tests: test GitRepository.get_commit_info()
- * [dd593a0] GitRepository: return GitModifier object instead of separate
- fields this make sure the number of return values doesn't stays sane when
- also returning timestamps and committer information.
- * [92a744e] GitRepository: Add test that covers remote branches in
- has_branch()
- * [e6e0150] Make exception syntax consistent
- * [d3ee4b0] GitRepository: Make rev_parse's short option an int everywhere
- * [891ea2b] git.repository.GitRepository.add_remote_repo: use GitArgs
- * [036db95] gbp.git.GitRepository: Add remove_remote
- * [4db02e5] Fix variable renaming
- * [f4da964] GitModifier: More flexible date handling.
- Allow to pass in the date as datetime object, timestamp or git raw date.
- and allow to retrieve these values. This make constructing GitModifiers
- from python simpler.
- * [cd829c9] GitRepository: raise GitRepositoryError on git errors.
- Raise GitRepositoryError in cases where CommandExecFailed (from
- GitCommand) was previously silently passed forward.
- Heavily based on a patch by Markus Lehtonen.
- * [7a9f947] GitModifier: use __getitem__ to fetch date
- instead of accessing __dict__ directly which only has _date.
- * [c4524f8] GitModifier: add tests for dict interface
- * [c47deff] Remove multiple spaces
- * [56a8672] Skip tests requiring devscripts if dch is not there
- so tests don't fail on rpm based systems.
- * [5961a4d] Test help output by importing the modules
- so we get correct coverage information for the scripts
- * [68efed1] gbp.command_wrappers: Reformat to 80 chars line length
- * [aa2ba85] Add tests for gbp.deb.{DpkgCompareVersions,DscFile}
- * [83577af] Move uscan to separate class
- * [776cbb7] Improve error reporting from uscan
- by parsing out the warnings and error fields from the dehs output.
-
- [ Markus Lehtonen ]
- * [9b68e37] import-orig: move is_link_target() to common module.
- This change makes is_link_target() re-usable in the upcoming RPM-tools.
- * [36e0986] common/pq: use strip in apply_and_commit_patch()
- Use the strip information of the patch when applying patches. Also,
- changes GitRepository.apply_patch() to accept integer values as 'strip'
- argument.
- * [cc1ebfd] PristineTar: move Debian-specific stuff to DebianPristineTar.
- Continuation to the PristineTar refactoring, makes the "common"
- PristineTar independent of DebianPkgPolicy. This commit moves the
- Debian-specific has_commit() and checkout() methods to DebianPristineTar
- class and replaces them with more generic functions in the base class.
- Also, drops the Debian-specific get_commit() method completely, as it
- was not used outside the PristineTar class itself.
- * [18fc698] GitRepository: fix process cwd in _git_inout()
- * [1e85978] GitRepository: make get_commit_info() more robust.
- Now uses git-show instead of git-log. This is needed for further
- enhancements (namely to get name-status for merge commits). Also, use
- null-character as the field separator which makes parsing more reliable.
- The method now returns 'body' of the commit message as is, without
- stripping or splitting to lines.
- In addition, get_commit_info() now uses GitArgs and _git_inout() instead
- of the deprecated _git_getoutput().
- * [2c668bf] GitRepository/get_commit_info: check return value of git command
- correctly
- * [4d56ab6] GitRepository/rev_parse: add new argument 'short'
- Adds a new argument to get abbreviated SHA1.
- Also, modifies rev_parse() to use GitArgs class.
- * [ba55f9e] GitRepository/get_author_info: return user.name as name.
- Return users full name (user.name) instead of email (user.email) as the
- 'name' of the author when taking the value from git config.
- * [21ac2d8] GitRepository: option to ignore untracked in is_clean()
- Add an option to ignore untracked files when checking if the repository
- is clean.
- * [7f9776f] GitRepository/get_commit_info: add author timestamp.
- Add author timestamps to the info returned by get_commit_info() method.
- * [32f725f] GitRepository/get_commit_info: add committer info.
- Add committer to the info returned by get_commit_info() method. Returns
- committer name, email and timestamp as a GitModifier object.
- * [6e4138f] GitRepository/get_commit_info: add file status.
- Add file status and name to the info returned by the get_commit_info()
- method.
-
- [ Ed Bartosh ]
- * [9c54298] deb.git: Fixed typo in method name
- the double underscore prefix was dropped ages ago.
-
- [ Daniel Dehennin ]
- * [b970ca0] Test behavior of gbp.scripts.dch.main().
- * tests/11_test_dch_main.py: Test common cases with "--release" and
- "--snapshot". Try 2 consecutive snapshots to check for merged entries.
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 03 Aug 2012 19:26:48 +0200
-
-git-buildpackage (0.6.0~git20120601) unstable; urgency=low
-
- * Upload to unstable
- * [a5f0d87] git-import-dsc: add --allow-unauthenticated
- (Closes: #670623)
- * [a116edd] Refactor deb helpers: move PristineTar class based on a patch
- by Markus Lehtonen. This refactor is preparation to the upcoming rpm
- support.
- * [f52a417] git-buildpackage: add missing import so move_old_export works
- again
- * [16f0309] git-buildpackage overlay-mode: don't fail on files named like
- the tarball. Instead of moving individual files around simply rename the
- directories. This is faster and independent of the tarballs content.
- (Closes: #675412)
- * [7f580d9] git-buildpackage: allow to build packages from detached HEAD
- state with --git-ignore-branch.
- (Closes: #661598)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 01 Jun 2012 23:44:17 +0200
-
-git-buildpackage (0.6.0~git20120524) experimental; urgency=low
-
- [ Markus Lehtonen ]
- * [3308868] Refactor deb helpers: introduce PkgPolicy class. Create a new
- 'pkg' basemodule, intended to be re-used by the upcoming rpm package
- helpers. Move some deb functionality to a new pkg.PkgPolicy class, to be
- used as a base for different package types. Introduces Deb-specific
- deb.DebianPkgPolicy.
- * [082679d] Refactor deb helpers: move build_tarball_name() from
- UpstreamSource class to DebianPkgPolicy.
- * [f495df9] Refactor deb helpers: move UpstreamSource class to pkg base
- module. This refactor is preparation to the upcoming rpm support.
-
- [ Guido Günther ]
- * [83165aa] GitRepository.format_patches: allow to set threading format
- and disable it by default.
- * [5de6410] docs: complete git-dch synopsis
- * [1eeb298] Add gbp.deb.ChangeLogSection to parse package and version out of
- a changelog section
- * [1ea487e] Don't explicitly refer to lenny-backports.
- Thanks to Salvatore Bonaccorso
- * [9d1459b] gbp.deb.changelog: Split parsing into a separate function
- this will allow us to reparse the changelog after manipulation with dch.
- * [2ecf9e3] gbp.deb.ChangeLog: Add filename property
-
- [ Jérémy Lal ]
- * [ae850da] --ignore-branch config help fix
-
- [ Daniel Dehennin ]
- * [c57d4af] gbp.git.repository: Add a "git merge-base" wrapper
- (Closes: #672642)
- * [edc6483] Provide minimalist debian/control object
- (Closes: #673473)
-
- [ Salvatore Bonaccorso ]
- * [bb32e94] git-dch: Add support for --team switch for Team uploads
- (Closes: #673368)
- * [016bf21] Document --bpo, --nmu and --qa in git-dch's manpage
- (Closes: #673422)
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 24 May 2012 14:05:47 +0200
-
-git-buildpackage (0.6.0~git20120419) experimental; urgency=low
-
- [ Guido Günther ]
- * [3b34b26] Make building with DEB_BUILD_OPTIONS=nocheck skip all tests
- heavily based on a patch by Matthijs Kooijman (Closes: #669149)
-
- [ Matthijs Kooijman ]
- * [a43e9b9] Git-Dch: Full in commit messages.
- This new tag makes git-dch use the full commit message when generating
- the Debian changelog file, even when --full is not given. (Closes: #669159)
- * [b72702f] Bug#669145: Add git-dch --commit and --commit-msg options
- (Closes: #669145)
-
- [ Markus Lehtonen ]
- * [19b6e24] docs: add some missing tags to sgml files
- * [9c4f34c] Refactor gbp-pq as preparation for rpm support.
- Separate some functions of gbp-pq into a basemodule, intended to be
- re-used by the upcoming rpm variant of the tool.
- Also, introduces a new python subpackage gbp.scripts.common to be used
- for the re-usable parts of the scripts in the refactoring work.
- * [c8e4807] Refactor git-buildpackage as preparation for rpm support.
- Separate some functions of git-buildpackage into a basemodule, intended
- to be re-used by the upcoming rpm variant of the tool.
- * [27c35b1] import-orig: refactor args of ask_package_* functions.
- Makes ask_package_name() and ask_package_version() more generic and
- re-usable in the upcoming RPM-tools.
- * [5826e9c] Refactor git-import-orig as preparation for rpm support.
- Separate some functions of git-import-orig into a baselib, intended to
- be re-used by the upcoming rpm variant of the tool.
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 19 Apr 2012 00:24:03 +0200
-
-git-buildpackage (0.6.0~git20120415) unstable; urgency=low
-
- [ Guido Günther ]
- * [1e68f6e] gbp.git.repository: don't append a second .git when mirroring a
- repository
- * [b7797f9] ALlow to set the output directory via GIT_PBUILDER_OUTPUT_DIR.
- Helps with #657277
- * [407dfa1] Make the upstream version check match policy
- (Closes: #668554)
- * [d1ed77a] Ignore locale when checking for a clean repository
- (Closes: #668896)
-
- [ Jö Fahlke ]
- * [43e3a60] docs: correct --git-builder default value
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 15 Apr 2012 19:05:32 +0200
-
-git-buildpackage (0.6.0~git20120404) unstable; urgency=low
-
- * [f4529a4] docs: add --git-upstream-tag to git-buildpackage's manpage
- * [96332cc] Start documenting useful options when upstream uses git. This is
- quiet terse yet so follow up bugs are welcome. (Closes: #664771)
- * [eae4e4a] gbp-posttag-push: Tighten branch regexp so we don't push to
- branches ending with the same name accidentally.
- * [169a924] gbp-add-patch: Fix typo
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 04 Apr 2012 18:50:19 +0200
-
-git-buildpackage (0.6.0~git20120324) experimental; urgency=low
-
- * [8fd6162] gbp-create-remote-repo: Use DebianGitRepository (Closes: #664283)
- * [ddaa653] gbp-create-remote-repo: don't expect a terminal so you can do
- 'echo y | gbp-create-remote-repo'
- * [92cc7ba] gbp-create-remote-repo: allow to use local file transport too
- * [6d4b4ff] gbp create-remote-repo: allow to pass template directory to git
- init so it's possible to set up remote hooks.
- * [b9d03af] gbp-create-remote-repo: add --remote-config. This specifies an
- additional config file section that can be used to preconfigure different
- remote locations.
- * [d6e0e8d] git-import-orig: Allow to pass in an upstream vcs tag. This
- allows to link the import-orig commit with the corresponding upstream vcs
- tag. See #664771 for a discussion.
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 23 Mar 2012 23:58:42 +0100
-
-git-buildpackage (0.6.0~git20120315) unstable; urgency=low
-
- * [3cac77f] docs: Fix path to gbp-configure-unpatched-source. Thanks to
- Tobias Frost (Closes: #664063)
- * [2f08cbd] Parse author and comitter from changelog for native package too
- (Closes: #662993)
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 15 Mar 2012 22:39:00 +0100
-
-git-buildpackage (0.6.0~git20120311) unstable; urgency=low
-
- * [83dcb28] Move gbp.conf manpage to section 5 and add references from the
- other manpages
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 11 Mar 2012 19:23:35 +0100
-
-git-buildpackage (0.6.0~git20120227) unstable; urgency=low
-
- * Upload to unstable
- * [45d7dc8] import_dsc: Create debian branch for native packages too
- (Closes: #663001)
- * [80cf6d4] Add manual page for gbp.conf.
- Thanks to Jari Alto for the POD version (Closes: #661748)
- * [a8b8536] Build-require a git version that supports --no-edit
- (Closes: #663103)
- * [b4cfcab] Remove build/ directory during clean so we don't step on any
- epydoc leftovers
- * [b6a4387] Bump standards version to 3.9.3
- * [6f2f554] GbpOptionParser: allow to modify list of parsed conf files
- by setting the GBP_CONF_FILES environment variable.
- * [38870d5] git-import-dscs: allow to ignore gbp.conf files stored in the
- repository (Closes: #660898)
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 08 Mar 2012 18:56:42 +0100
-
-git-buildpackage (0.6.0~git20120226) experimental; urgency=low
-
- [ Markus Lehtonen ]
- * [bca9f76] Refactor config.py as preparation for rpm support.
- * [38afb27] docs: add missing tags to sgml files
- * [2081900] gbp-pq: refactor args of write_patch()
- Allows defining the formerly hardcoded patch_dir. This makes write_patch()
- re-usable in the upcoming RPM-tools.
-
- [ Guido Günther ]
- * Upload to experimental so the current version in sid can move to testing
- first.
- * [7726bca] Make sure we test the built modules not the system ones
- * [1018809] copy_from: remove, not used anymore
- * [09e4080] docs: make version pattern match the code (Closes: #650465)
- Thanks: Leo 'costela' Antunes
- * [970fbaa] config.py: Add default value print out to all options
- * [f3aa87f] GitRepository.merge: add edit option defaulting to False
- (Closes: #659239)
- * [67c8513] Depend on git >= 1:1.7.9.1-1~ for a working "git merge
- --no-edit". Thanks to Jonathan Nieder
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 26 Feb 2012 12:09:23 +0100
-
-git-buildpackage (0.6.0~git20120218) unstable; urgency=low
-
- [ Markus Lehtonen ]
- * [24e7725] Make pristine_tar testcases pass with older git versions that
- don't support user-defined output formats (tar filters) in git-archive.
-
- [ Guido Günther ]
- * [14d36c0] Depend on git instead of git-core (Closes: #659661)
- * [f25fa9b] Lower dependencies on python-nose and python-coverage the
- versions in Squeeze are recent enough.
- * [7e41626] Require git 1.7 which is already in Squeeze and Lenny Backports
- * [63411b7] gbp-pq: Properly print patch name when guessing authorship
- information
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 18 Feb 2012 16:16:48 +0100
-
-git-buildpackage (0.6.0~git20120210) unstable; urgency=low
-
- * [d279757] PristineTar: fix links in testcases
- * [44814b7] Include missing doctests in generated API docs
- * [3875d5d] gbp-pull: Use a DebianGitRepository (Closes: #659290)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 10 Feb 2012 09:30:47 +0100
-
-git-buildpackage (0.6.0~git20120209) unstable; urgency=low
-
- * Upload to unstable
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 09 Feb 2012 14:08:43 +0100
-
-git-buildpackage (0.6.0~git20120207) experimental; urgency=low
-
- * Upload to unstable
- * [1e51936] git-import-orig: Properly detect .tgz and other abbreviated file
- extensions (Closes: #658777)
-
- -- Guido Günther <agx@sigxcpu.org> Tue, 07 Feb 2012 23:24:48 +0100
-
-git-buildpackage (0.6.0~git20120124) experimental; urgency=low
-
- [ Markus Lehtonen ]
- * [b7d7016] gbp-pq: don't crash in get_maintainer_from_control() even if
- debian/control is missing.
-
- [ Guido Günther ]
- * [c5eee2b] PristineTar: add missing import for debug output
- * [3ca0a98] PristineTar: fix match when not passing in a compression type
- * [45ab61b] Depend on pristine-tar for the tests
- * [041dbf2] GitRepository: allow to capture stderr in __git_inout
- stderr was always None.
- * [e6fd2ce] GitRepository: Use _git_inout() in __init__()
- to avoid misleading error message
-
- -- Guido Günther <agx@sigxcpu.org> Tue, 31 Jan 2012 10:22:13 +0100
-
-git-buildpackage (0.6.0~git20120123) experimental; urgency=low
-
- [ Guido Günther ]
- * [90fb9b2] Add "gbp-pq switch" to bash completion
- * [8328c32] Allow to specify the upstream tree via --upstream-tree without
- the indirection to --upstream-branch.
- * [3d4adca] gbp-posttag-push: Allow to push the upstream tag too via the -u
- option.
- * [2d84986] gbp-post-tag-push: Add --verbose option to ease debugging
- * [cd41023] git-buildpackage: Allow to pass pbuilder options via commandline
- or gbp.conf
- * [a31c95b] Update to git-pbuilder 1.27. This adds support for creating
- backport build environments. Thanks to Russ Allbery
- * [338ee68] git-buildpackage: Add --pristine-tar-commit option. This option
- allows to auto commit a generated tarball to the pristine-tar branch to
- simplify building non-dfsg clean packages and to make it easier to track
- uptream git without having to commit the generated tarball manually.
-
- [ Markus Lehtonen ]
- * [0c47432] Add git-depth option to gbp-clone and gbp-pull. Allows creating
- and deepening shallow clones. This is sometimes useful for e.g. saving
- bandwidth when cloning.
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 23 Jan 2012 22:13:38 +0100
-
-git-buildpackage (0.6.0~git20111229) experimental; urgency=low
-
- * [686f29c] scripts/pq: handle patches without filename extension. Don't
- fail if patches don't have a proper patch header and filename extensions
- (like in the heimdal package)
- * [248b550] Update git-pbuilder to 1.25.
- Thanks to Russ Allbery (Closes: #635061, #642355)
- * [58978c5] Add --[no-]-pbuilder-autoconf to pass GIT_PBUILDER_AUTOCONF=no
- to git-pbuilder.
- * [01a2689] gbp-pq: add "switch" action to quickly switch between
- patch-queue and base branch.
- * [8f41ffb] docs: add missing dependency to manpage generation
- * [6bfc8e5] Fix typo in clean target override
- * [747c05d] dch: Honor epoch when guessing new upstream version.
- Thanks to a lot to Daniel Dehennin for the testcase (Closes: #652366)
- * [ed4e523] import_dsc: remove debian/ dir from upstream source after
- importing it. This gives us the orig tarball on upstream but the debian
- branch looks the same as with dpkg-source -x. (Closes: #653472)
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 29 Dec 2011 14:52:29 +0100
-
-git-buildpackage (0.6.0~git20111217) experimental; urgency=low
-
- * [baeee74] docs: fix version string
- * [2ff6119] pq: add --force option to fore recreation of pq branch so one
- doesn't have to drop the old one first.
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 17 Dec 2011 13:28:12 +0100
-
-git-buildpackage (0.6.0~git20111202) experimental; urgency=low
-
- [ Guido Günther ]
- * [3a3539a] Document that gbp-create-repo is noninteractive
- (Closes: #643752)
- * [bf397fc] gbp-pq: Properly check for start of signature (Closes: #646400)
- * [718f0c3] gbp-pq: Strip .patch and .diff when importing patches without a
- subject
- * [3fcf009] command_wrappers.Command: Don't print several error lines
- * [37e8310] Allow to import upstream tarballs into bare repositories
- (Closes: #582775)
- * [abf90ab] Allow to import Debian packages into bare repositories
- * [8c22803] gbp-pull: massive speedup by just updating the ref to the
- remote's SHA1 instead of checking out the branch and doing a fast-forward
- merge.
- * [af07c40] gbp-pq: Instead of looking for the signature don't let git
- generate it. Thanks to Robert Luberda
- * [69d348c] Support postexport hooks. Heavily based on a patch by Jan Čapek
- (Closes: #640982)
- * [030744d] Parse the changelog of the exported tree instead of the working
- copy when using --export. This reduces the number of options needed when
- using an export dir since the correct tarball is now being created without
- additional options. (Closes: #564791)
- * GitRepository: Lots of api, documentation and test updates replacing Git*
- classes by GitRepository methods. Check the apidocs for details.
- * [7168735] Switch to dh
-
- [ Jan Čapek ]
- * [d2c1033] Documentation update for --git-postexport, --git-postbuild typo
- fix
- * [f7a6b07] Additional documentation for postexport hook in the manual - the
- documentation now provides sample postexport script and gbp.conf
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 02 Dec 2011 19:19:51 +0100
-
-git-buildpackage (0.5.32) unstable; urgency=low
-
- * [efe9220] Use known_compressions in guess_upstream_version too
- (Closes: #645477)
- * [e984baf] git-import-orig: fix --filter
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 17 Oct 2011 10:15:22 +0200
-
-git-buildpackage (0.5.31) unstable; urgency=low
-
- [ Guido Günther ]
- * [3588d88] Fix pristine-tar error message
- * [8da98da] gbp-pq: don't fail on missing series file but create an empty
- branch instead
-
- [ Salvatore Bonaccorso ]
- * [b33cf74] Fix URL to cl2vcs service.
- Refer to https://honk.sigxcpu.org/cl2vcs instead of
- https://honk.sigxcpu.org/cl2vcs for the cl2vcs service. (Closes: #640141)
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 28 Sep 2011 20:21:34 +0200
-
-git-buildpackage (0.5.30) unstable; urgency=low
-
- * [37f16cc] Document meta tags. Thanks to Raphaël Hertzog for the
- suggestion (Closes: #636088)
- * [f2efdaf] Add known_compressions() to UpstreamSource so we can use it for
- the DscFile parsing. This fixes the import of xz compressed upstream
- tarballs.
- * [2da9e9e] Leave compression type detection to tar by default
- * [a878947] Ignore comments and empty lines in series files.
- (Closes: #637224)
- * [b3931e0] Fix missing branch name in error message
- * [4e2f7de] gbp-pq: Use latest patches with --time-machine. When going back
- in history to find the point where the patches in debian/patches still
- apply make sure we use the latest ones not the one currently in the tree.
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 10 Aug 2011 22:25:11 +0200
-
-git-buildpackage (0.5.29) unstable; urgency=low
-
- * [00c2b8e] Move GbpPatchQueue and GbpPatch into gbp.pq
- * [2fbac77] Build epydoc API documents by default
- * [42a13a1] gbp-pq: add --time-mache=N option to find the last commit the
- patch-queue applies to.
- * [d052ba2] Document --time-machine option
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 30 Jul 2011 15:07:41 +0200
-
-git-buildpackage (0.5.28) unstable; urgency=low
-
- * [3c72dfa] git-import-orig: Clarify missing argument error message
- * [d34e82e] Be less picky about empty filters. (Closes: #635641)
- * [a692745] Report errors reading the patch file instead of throwing an
- exception. (Closes: #635872)
- * [9bbbc77] Better document --git-upstream-tree. (Closes: #635883)
- * [3fb7fd6] Add strip option to GitRepository.apply
- * [dbe68fb] Split out GbpPatchQueue and GbpPatch to handle "-p<num>" without
- munging the code further (Closes: #635873)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 29 Jul 2011 19:00:25 +0200
-
-git-buildpackage (0.5.27) unstable; urgency=low
-
- [ Guido Günther ]
- * [8ce3500] Add autocompletion for --git-dist= based on the available
- cowbuilder images
- * [7fc837a] git-import-orig: Better support uscan for non tar.gz tarballs
- (Closes: #629538)
- * [2d4034d] Drop suggests of git-load-dirs. It's not in the archive anymore
- * [41a5d0d] Switch to dh_python2
- * [305e871] Re-enable pychecker checks
- * [7360496] Support importing zip archives. This can be extended to support
- other formats.
- * [00e1d97] Remove fastimport code since it didn't support filters, etc.
- * [8d0143a] git-import-orig: support filters for all input formats
- (Closes: #628645)
- * [e05e985] Add tests for UpstreamSource
- * [f0ba62c] Drop unpack_orig and tar_toplevel
- * [5bd3ff2] git-dch: add formatter that wraps the changelog entry
- (Closes: #626439)
- * [0ecd9f7] git-buildpackage: Add upstream-tree option to specify where the
- upstream tarball should be created from. The default is to create the it
- from the exact tag and fail otherwise.
- Based on a patch by Ricardo Salveti de Araujo
-
- -- Guido Günther <agx@sigxcpu.org> Tue, 26 Jul 2011 22:18:29 +0200
-
-git-buildpackage (0.5.26) unstable; urgency=low
-
- [ Guido Günther ]
- * [d841899] git-pbuilder: Add git-pbuilder 1.22.
- Thanks to a lot Russ Allbery (Closes: #623117)
- * [43e11c7] Bump standards version. No changes necessary.
- * [f5344c6] gbp-create-remote-repo: switch to git.debian.org.
- Thanks to Ritesh Raj Sarraf (Closes: #632897)
-
- [ Courtney Bane ]
- * [3a68566] gbp-create-remote-repo: Improve url handling.
- Support user name expansion and different ssh ports.
- Closes: #630832
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 06 Jul 2011 23:09:21 +0200
-
-git-buildpackage (0.5.25) unstable; urgency=low
-
- * [f07c1fc] Make qemubuilder really a boolean option.
- Thanks to Gregor Herrmann <gregoa@debian.org> for tracking this down
- (Closes: #627541)
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 21 May 2011 22:14:30 +0200
-
-git-buildpackage (0.5.24) unstable; urgency=low
-
- [ Guido Günther ]
- * [033f359] git-pbuilder: Distinguish 1.0 and 3.0 source format and set
- exclude patterns for the 1.0 format. Otherwise the build fails since
- dpkg-source tries to include .git.
- * [09bf9f1] Add git-pbuilder 0.21. Thanks to Russ Albery.
- (Closes: #601045, #601298)
- * [7e022fb] Add support for qemubuilder (Closes: #601298)
- * [e66c9e8] git-pbuilder: remove single quotes from '$BASE' to fix "cannot
- canonicalize filename '/var/cache/pbuilder/base-sid.cow', does not exist"
- failure
-
- [ Jon Dowland ]
- * [a645073] Spelling corrections (Closes: #627378)
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 21 May 2011 13:51:29 +0200
-
-git-buildpackage (0.5.23) unstable; urgency=low
-
- [ Guido Günther ]
- * [6710462] git-pbuilder: Drop diffignore and tarignore patterns
- (Closes: #606412, #610662)
- * [5b63e3f] tests: add doctests for gbp.deb.orig_file()
- * [9f3030b] git-dch: improve formatting of commit subject by taking into
- account idlength and the prefix added by git-dch itself.
-
- [ Peter Eisentraut ]
- * [0958897] Correct option name in git-buildpackage man page
- * [3e1fd70] Fix various typos in man pages
- * [e5dd444] gbp-clone: check out the debian branch after the clone is
- complete.
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 07 May 2011 14:38:58 +0200
-
-git-buildpackage (0.5.22) unstable; urgency=low
-
- [ Guido Günther ]
- * [61513e6] git.rev_parse: unconditionally use --quiet to avoid the
- confusing "fatal: Needed a single revision" error message
- * [c7bb3f1] Add aliases for gz and bz2 compression types
- * [dc39596] gbp: Handle whitespace in submodule names (Closes: #622103)
- * [f5db59d] Disable submodule processing by default.
-
- [ Loïc Minier ]
- * [2d620e4] Ignore .noseids from nosetests
- * [8189cc9] Add tests for orig autodetection
- * [85c5d8e] Detect compression from orig tarball (Closes: #621701)
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 11 Apr 2011 09:42:50 +0200
-
-git-buildpackage (0.5.21) unstable; urgency=low
-
- [ Guido Günther ]
- * [d8142c7] git-import-dsc: don't silently drop the epoch in tags
- (Closes: #620950)
- * [ebc19c7] docs: Document Gbp-Pq-Topic: tag
- * [82e5f4d] git-buildpackage: Call gbp.update_submodules before exporting a
- tarball or creating a separate build tree. We invoke git-submodule with
- --no-fetch to not break offline operation.
- * [dff62f2] Make submodule support conditional
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 06 Apr 2011 20:35:37 +0200
-
-git-buildpackage (0.5.20) experimental; urgency=low
-
- [ Guido Günther ]
- * [a618bdc] git-buildpackage: Make the desktop notification transient so
- they timeout and don't clutter the notification area.
- * [3b0f296] Add gbp-configure-unpatched-source example to ignore .pc and
- tell dpkg-source to unpatch the source. See #591858.
- * [258743a] gbp-pull: make sure git interprets arguments as revisions in
- is_fast_forward so it prints a clearer error message on configuration
- errors in .git/config.
- * [40f4709] gbp-pq: Allow to specify subdirs for patches via the
- "Gbp-Pq-Tag: <subdir>" directive in the patch header. This also gets rid
- sed callouts. Add "apply" action to apply single patches.
- * [fadcfcb] gbp: Add git.archive() and git.{has,get,update,add}_submodules()
- and testcases.
- Heavily based on work by Sean Finney and Chow Loong Jin
- * [2353ab7] git-buildpackage: submodule support for dump_tree.
- Heavily based on work by Sean Finney and Chow Loong Jin
- * [97c32c7] git-buildpackage: submodule support for git_archive.
- Heavily based on work by Sean Finney and Chow Loong Jin (Closes: #588752)
- * [3b0ebe9] gbp: Don't fail on paths without extensions in get_compression()
- and add doctests for that. (Closes: #618893)
- * [1021f84] git-buildpackage: special case non-submodule tarfile generation.
- Tarfile generation with submodules is slower since we need to
- concatenate several tarfiles and compress afterwards. So special case
- the common non submodule case and add a testcase to check the tarfiles
- content.
- * [80048e9,dcc2562,0827a33,93b4ab7,adc50a3,431075b] improve our testsuite
-
- [ Sean Finney ]
- * [ddf5ea3] gbp: Allow to pass cwd to git.__get_output()
-
- [ Charles Plessy ]
- * [c9f1e1e] docs: Added markup to the example for creating upstream branch.
- * [0095808] docs: Easier to remember commands to create orphan upstream branch.
- Closes: #619084
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 21 Mar 2011 21:09:32 +0100
-
-git-buildpackage (0.5.19) unstable; urgency=low
-
- [ Jonathan Nieder ]
- * [7f00d39] git-import-dsc: improve error message when upstream branch is
- missing
-
- [ Guido Günther ]
- * [b9acbf9] logging: don't use color inside Emacs's comint shell
- (Closes: #612384)
- * [14fdbce] gbp-clone: reparse the configuration after cloning the
- repository (Closes: #607936)
- * [d21506e] git-import-dscs: really use git-import-dsc from the same
- location as git-import-dscs
- * [b92b88f] git-import-dsc: auto create upstream branch if it's missing.
- This allows to mass import old history of packages that were native and
- switched to non-native later.
- * [0363f47] git-import-dsc: better explain missing upstream branch.
- Thanks to Jonathan Nieder for the suggestion. (Closes: #610379)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 11 Feb 2011 18:20:36 +0100
-
-git-buildpackage (0.5.18) experimental; urgency=low
-
- [ Guido Günther ]
- * [0b2b869] git-buildpackage: fix fallback to auto detection for unknown
- compression types
- * [b7136f3] gbp-pull: Adjust incorrect logging level
- * [d8d2347] git-import-dscs: Ignore debsnap download errors to cope with
- binNMUs. Based on a patch from Jonathan Nieder. (Closes: #610376)
- * [e1661bd] git-buildpackage: print the "Looking for tarball..." message at
- debug level. There's no need to print two messages in the default logging
- level.
- * [9054ae1] git.force_head: quiet git reset so we don't see pointless 'HEAD
- is now at ...' messages during imports.
- * [d36077c] Add --author-is-comitter and --author-date-is-comitter-date
- commandline options (Closes: #610381)
-
- [ Jonathan Nieder ]
- * [f2f03b7] git-import-dscs: Fix --debsnap doc and option error handling
- (Closes: #610368)
- * [2984d27] git-import-dsc doc updates for new options --author-is-committer
- and --author-date-is-committer-date
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 23 Jan 2011 14:52:25 +0100
-
-git-buildpackage (0.5.17) experimental; urgency=low
-
- * [244c1d2] gbp-create-remote-repo: allow for repository names without
- substitutions
- * [ebc67f3] gbp-create-remote-repo: get repository name from
- debian/changelog if possible
- * [eb9c0e6] git-create-remote-repo: don't hardcode 'origin' as remote. This
- makes it possible to create different remote repos from within the same
- repository.
- * [b383c96] Document --remote-name
- * [8d5f78a] Use the latest commit instead of the earliest one
- when guessing the compression type for pristine-tar.
- Thanks to Andreas Rottmann for the detailed report (Closes: #609980)
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 15 Jan 2011 13:46:36 +0100
-
-git-buildpackage (0.5.16) experimental; urgency=low
-
- * [b9aae05] git-import-orig: Make --[no-]merge a proper option so it can be
- configured via gbp.conf.
- * [05d9ecb] gbp-create-remote-repo: allow to set up remote branch tracking
- * [03f3d75] Make gbp-create-remote-repo a first class citizen. Add manpage,
- move into path, add bash completion
- * [5ca57cd] git-import-dsc: also set the commit date to the changelog date
- when importing old history. This makes sure we get proper sorting with
- e.g. gitk.
- Thanks to Rob Browning for the hint and explanation
-
- -- Guido Günther <agx@sigxcpu.org> Tue, 11 Jan 2011 07:48:02 +0100
-
-git-buildpackage (0.5.15) experimental; urgency=low
-
- * [b770493] git-buildpackage: Add support for sending notifications via
- libnotify after the build finished.
- * [bfb233a] git-dch: don't add empty changelog entries with "Git-Dch: Ignore"
- * [ab06072] Require python 2.6 since we use a context manager
- * [79ed2e0] Use tristate option for --color=value this allows true and false
- as alias for on and off.
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 08 Jan 2011 19:09:41 +0100
-
-git-buildpackage (0.5.14) experimental; urgency=low
-
- [ Guido Günther ]
- * [2a5df0a] docs/gbp-clone: better document --all
- * [c3c76ac] docs/gbp-pull: Better document --force and --redo-pq
- * [b23f05b] docs/git-import-dscs: document --debsnap to fetch from
- snapshots.debian.org
- * [8040433] docs/gbp-pq: fix typo in manpage.
- Thanks to Emilio Pozuelo (Closes: #609166)
- * [8cabb0e] Add gbp-{pull,clone,pq} examples to gbp.conf
- * [eac621a] Add generated files to .gitignore
- * [91b0aa8] pychecker warning cleanups (mostly unused variables and imports)
- * [63d9624] Change dirs declaration to avoid false positives from pychecker.
- See #608153
- * [bd2ac3a] Enable pychecker warnings
- * [67bdb1f] git-import-dscs: Remove duplicate log message
- * [d523065] command_wrappers: Use logging functions
- * [9411f76] bash completion: parse short options too
- * [7374d00] bash completion: also complete on tags
- * [25677d0] bash completion: add completion for gbp-{pq,pull,clone}
- * [3f05eba] bash completion: add support for tristate options like --color
- * [d9ed286] bash completion: avoid space after options taking an argument.
- This makes branch and tag completion more useful.
-
- [ Yaroslav Halchenko ]
- * [2558ea7] git-import-dscs: Use git-import-dsc from the same location as
- git-import-dscs. With hardcoded path it is impossible to use
- git-import-dscs directly from the repository while developing both tools
- * [31b4854] Spit out debug message in __git_inout
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 07 Jan 2011 09:58:39 +0100
-
-git-buildpackage (0.5.13) experimental; urgency=low
-
- * [7e697a9] Update the repo after the first import so master matches the
- debian branch. Thanks to Rob Browning for the testcase
- * [83b9235] Initialize Logger.get_color{,off} so we can print errors before
- the option parsing finished. (Closes: #608004)
- * [b1f081a] Rewrite gbp-pq in python so we get consistent logging and
- debugging options.
- * [5a312db] Allow to drop numbers from patch names via --no-patch-numbers
- so patch names remain constant when interim patches are dropped.
- (Closes: #592129)
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 27 Dec 2010 00:05:30 +0100
-
-git-buildpackage (0.5.12) experimental; urgency=low
-
- [ Guido Günther ]
- * [3e0d663] Also allow for 'issue' as bugnumber prefix as used in Grml.
- * [4323487] Fix off by one error by not counting. Thanks to Olivier Aubert
- for pointing this out
- * [5ace5eb] Better wrap thanks and closes (Closes: #529332)
- * [cf98258] Move Debian tag with --ignore-same-version
- so the import doesn't fail. (Closes: #606204)
- * [29feba8] Change --ignore-same-version to --allow-same-version
- and properly document it. This matches the defaults we had since ages.
- * [3b858a9] Fix debug string formatting (Closes: #606771)
- * [8a46f74] Favor ARCH environment variable over dpkg's architecture
- based on a patch by Jacob Helwig. (Closes: #607318)
- * [2c94f9d] Add option to open editor (Closes: #565553)
-
- [ Rob Browning ]
- * [98b034c] Remove unused commit_msg variable from git-dch.
- * [5b7b0f1] Use "log -n1" instead of "show" to retrieve commit log
- information.
- * [e875704] Add "*.pyc" to .gitignore.
- * [3640569] Add git-dch --customizations FILE to allow changelog entry
- customization:
- Add support for git-dch --customizations FILE. FILE must be Python code,
- and for now, the only useful thing it can do is define a
- format_changelog_entry() function which will override
- kgbp.dch.format_changelog_entry().
- Add a new customization option group for --customizations. Create a
- gbp.dch module and move the changelog entry formatting functions there.
- Create separate procedures to handle extracting metadata from the git log,
- and use them in the default format_changelog_entry(). These functions are
- also available for use by custom formatters: extract_git_dch_cmds(),
- filter_ignore_rx_matches(), extract_bts_cmds(), extract_thanks_info(), etc.
- Add a GitRepository.get_commit_info() method, and use it in git-dch
- parse_commit(). (Closes: #536719)
- * [d12a32f] Add --multimaint support to git-dch
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 20 Dec 2010 16:31:12 +0100
-
-git-buildpackage (0.5.11) unstable; urgency=low
-
- [ Matthijs Kooijman ]
- * [083834b] git-import-orig: Ask the user for the package name and version
- if needed. If there is no debian/changelog to find the source package
- name, and/or the upstream version was not given on the commandline, ask
- the user for them. The values guessed from the original tarball name are
- offered as defaults to the user. Previously, this guessed version was used
- without confirmation. (Closes: #479172)
- * [ee0e9ff] Let git-import-orig find the changelog when not on the
- debian-branch. When no changelog file is available in the checkout, look
- for the changelog in the repository.
-
- [ Guido Günther ]
- * [beaee6e] git-import-orig: Add --[no]-interactive to avoid prompts on
- import.
- * [223b97a] Fall back to source only changes file if the architecture one
- doesn't exist. (Closes: #593598)
- * [a6f2974] Makes uscan options explicit - thanks to Chris Butler.
- (Closes: #596003)
- * [ea9a656] Don't put generated gbp/gbp_version.py into the source package.
- * [c385e76] Fix download location - thanks to Rob Browning.
- * [7e79bcd] Add logging functions. This allows us to color and prefix the
- output. Coloring can be disanbled via the --color option.
- (Closes: #544332)
-
- [ Yaroslav Halchenko ]
- * [d62fadd] Document --git-overlay. (Closes: #598530)
-
- [ Benoît Knecht ]
- * [dfe9104] Expand environment variables and '~' in gbp.conf paths.
- Options that expect a path in gbp.conf can now be given as
- '~/path/to/dir' or '$HOME/path/to/dir' (or any other environment
- variable for that matter). (Closes: #545692)
-
- -- Guido Günther <agx@sigxcpu.org> Tue, 16 Nov 2010 13:27:41 +0100
-
-git-buildpackage (0.5.10) unstable; urgency=low
-
- * [4b23f2d] Warn if not invoked by git-buildpackage git-pbuilder is
- supposed to be invoked by git-buildpackage. Otherwise things like
- export-dir aren't respected. (Closes: #596625)
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 27 Sep 2010 09:46:52 +0200
-
-git-buildpackage (0.5.9) experimental; urgency=low
-
- * [6a200ad] Resync with git-pbuilder 0.16 (Closes: #595055)
- * [ed97b84] Add --git-arch option
- * [257a3e1] Switch to debian branch before forcing the HEAD update
- otherwise we might forward the current branch to another branch's
- ref - thanks to Rolf Leggewie for the testcase
- * [af97781] Avoid unnecessary branch switch when fixing the previous
- issues. (LP: #637286)
- * [70c5b22] Improve compression format detection by checking if a
- version is already on the pristine-tar branch and use it's
- compression type if found. (LP: #615212)
- * [02b1a03] Don't fail on missing debian/rules. (LP: #638371)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 17 Sep 2010 10:42:32 +0200
-
-git-buildpackage (0.5.8) experimental; urgency=low
-
- [ Guido Günther ]
- * [a09cce7] gbp-svn-tag: Simple helper to tag a version if using git-svn
- * [3262621] gbp-pull: Properly handle local only changes as no update needed
- * [b1bd417] git-import-dsc: Remove file and commit ambiguity
- * [65bf135] git-dch: Fix exception name so we don't fail on repos without
- tags.
-
- [ Svend Sorensen ]
- * [39b1a07] Fix --git-cleaner option name in git-buildpackage man page
- (Closes: #594612)
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 01 Sep 2010 10:56:34 +0200
-
-git-buildpackage (0.5.7) experimental; urgency=low
-
- * [07c11d5] git-pbuilder: Only output dist if set.
- * [3d97dfe] git-pbuilder: Check for cowbuilder. The cowbuilder package
- depends on pbuilder so this is enough.
- * [7f07ed6] Recommend cowbuilder
- * [0a081d4] Update copyright file
- * [af3dc21] Don't fail on gbp_version import errors. This makes it easier to
- test from the source tree without starting a build first.
- * [c0dad1a] git-import-dsc: Catch KeyboardInterrupt
- * [cc557e7] git-dch: Check for greater not unequal when looking for a new
- upstream version
- * [74aa351] git-buildpackage: Use --pretty=format: instead of --format= to
- support the git version in Lenny.
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 18 Aug 2010 18:18:35 +0200
-
-git-buildpackage (0.5.6) experimental; urgency=low
-
- * [1d06128] git-pbuilder: When creating a new base image don't fail if it's
- not there already.
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 14 Aug 2010 01:26:42 +0200
-
-git-buildpackage (0.5.5) experimental; urgency=low
-
- * [36edd3c] git-dch: Support --nmu, --bpo and --qa. (Closes: #561535)
- * [7200035] git-dch: Pass dch_options to all calls of spawn_dch. This fixes
- the problem of an empty [maintainer] at the end of the changelog section.
- - thanks to Michael Prokop
- * [8d33c92] git-dch: Guess changelog version number from upstream version
- * [595d6d8] git-buildpackage: Add --git-pbuilder and --git-dist=<dist>
- options
- * [b193936] docs: Use git-pbuilder in the pbuilder chapter
- * [61e0c3c] docs: Simplify example using --download
- * [76b16df] docs: Build and install git-pbuilder manpage
- * [67287d0] Add git-pbuilder (Closes: #583078) - thanks to Russ Allbery
- * [bc52725] Deprecate our own pbuilder helpers
- * [3c6bbd0] Better version number replacement (Closes: #534494)
- * [55fdbc6] Check for legacy tags where necessary.
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 12 Aug 2010 23:35:30 +0200
-
-git-buildpackage (0.5.4) unstable; urgency=low
-
- * [88afa61] git-dch: Pass --multimaint-merge on to dch (Closes: #586165)
- * [e8b6b49] gbp-pq: Use the maintainer of the Debian package as fallback
- patch author
- * [f63c4ed] git-import-dsc: Don't add superfluous parents to imports on the
- Debian branch. Only set a parent on the first import per upstream version.
- * [af2a435] gbp-pull: Don't update already up to date branches
- * [407b614] docs: Drop git_load_dirs reference we're not using it anymore.
- * [dbc7fe3] docs: We don't only support .gz tarballs
- * [34d6d84] Bump standards version
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 06 Aug 2010 17:07:47 -0400
-
-git-buildpackage (0.5.3) unstable; urgency=low
-
- * [2808207] git-dch: Terminate the patch description with a dot in case of
- multiline commits where the second line starts with a uppercase letter.
- Heavily based on a patch by Jonathan Nieder.
- * [47463da] Better document the default config file.
- * [57b2abf] git-dch: Set author information from git on --release when using
- --git-author - thanks to Boleslaw Tokarski for his feedback.
- * [ad2416e] examples/zeitgeist-git: Adjust for zeitgeist 0.4.0.
- * [8676193] examples/gbp-create-remote-repos: Simple helper to create remote
- repos based on dom-new-git-repo from the OCaml maintainers as well as
- aa-create-repo. (Closes: #540185)
- * [3ed1a5c] git-import-dscs: Fetch all snapshots from snapshots.debian.org
- using debsnap and import them (Closes: #591218)
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 02 Aug 2010 22:10:18 +0200
-
-git-buildpackage (0.5.2) unstable; urgency=low
-
- * Upload to unstable
-
- -- Guido Günther <agx@sigxcpu.org> Tue, 20 Jul 2010 22:13:57 +0200
-
-git-buildpackage (0.5.1) experimental; urgency=low
-
- [ Jonathan Nieder ]
- * [a650ce3] Add prebuild hook Can be used to add an upstream changelog
- generated from the git repository to the build dir. (Closes: #587652)
-
- [ Guido Günther ]
- * [9b8bc60] Bump standards version
-
- -- Guido Günther <agx@sigxcpu.org> Tue, 20 Jul 2010 21:31:30 +0200
-
-git-buildpackage (0.5.0) experimental; urgency=low
-
- [ Guido Günther ]
- * [bd1ad03] Drop dependency on python-dev since it's not needed for arch all
- packages. Depend on python instead.
- * [077bdb0] git-buildpackage: Add compression=auto to guess compression type
- of upstream tarball from pristine-tar branch. This is now the default.
- (Closes: #566993)
- * [3bcb1ef] Abort if upstream tarball contains git metadata
- (Closes: #571717)
- * [24410e9] docs: Mention patch-queue branches
- * [877166c] docs: Don't document Git-Dch: twice. Thanks to Matthijs Kooijman
- (Closes: #587456)
- * [719f1ae] git-import-dsc: Use commit_dir to write directly commit the
- content of the unpacked orig tarball and the patched Debian tree instead
- of using replace_tree. Thanks to Roger Leigh for his nice explantion on
- howto do this.
- (Closes: #506211, #588061)
- * [fc270b5] git-import-dsc: Drop --no-merge We don't invoke 'git merge'
- anymore.
- * [d35ee45] git-import-orig: Use commit_dir instead of replace_tree
- (Closes: #526022, #569031)
-
- [ Torsten Werner ]
- * [d3c0901] fix typo in gbp-pq
- (Closes: #587673)
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 05 Jul 2010 21:58:14 +0200
-
-git-buildpackage (0.4.68) unstable; urgency=low
-
- [ Guido Günther ]
- * [88c2d6d] gbp-pq export: Instead of failing switch branch if on a
- patch-queue branch.
- * [65ea70f] gbp-pq: Use run_git to catch git errors
- * [488f16c] No need to assign repo
- * [7f0b81f] Strip traling slashes from repo path (Closes: #584775)
- * [a831329] Add 'ignore-branch' option This disables the 'current branch' ==
- 'debian-branch' check.
- * [5988e20] Add 'ignore-branch' option This disables the 'current branch' ==
- 'debian-branch' check.
-
- [ Christian Kastner ]
- * [2173157] Add option --git-force-create to force tarball creation
- (Closes: #519297)
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 19 Jun 2010 16:07:05 +0200
-
-git-buildpackage (0.4.67) unstable; urgency=low
-
- * [6427e2a] git-import-dsc: Add --download option. This allows to directly
- import source packages either via git-import-dsc --download <pkg> or
- git-import-dsc --download <url-to-dsc> The former uses "apt-get soure" the
- later "dget". (Closes: #510036)
- * [823f49f] gbp-pull: Document exit codes
- * [9fb419f] git-import-orig: Document --uscan
- * [3473689] git-buildpackage: Document --git-compression and
- --git-compression-level
- * [f31c82d] git-dch: Document 'Git-Dch: Ignore' and 'Git-Dch: Short'
- * [65b9e0d] gbp-pq: Improve manpage and help output
- * [33e56ca] git-import-dsc: Document --download
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 15 May 2010 14:01:03 +0200
-
-git-buildpackage (0.4.66) unstable; urgency=low
-
- [ Paul Menzel ]
- * [1072473] docs/manpages/git-dch.sgml: Consistency fixes and typo.
- • Start sentences with capital letter and end them with a full stop.
- • s/enty/entry/
-
- [ David Paleino ]
- * [49e31b1] Add --uscan command-line option Launch uscan and use the
- tarball, if there's a new upstream version. (Closes: #577394)
-
- [ Guido Günther ]
- * [0826409] Bump standards version
- * [6646d63] Depend on git | git-core (Closes: #577731)
- * [f7a085a] Make --uscan more robust by not throwing exceptions onto the
- console and catching download errors.
- * [9521e6c] Fix typo - thanks to Paul Menzel
- * [a2dd58d] gbp-pull: Requests for non fast-forward updates should exit with
- a non-zero result (Closes: #579997)
- * [b0100b6] Add simple Zeitgist data provider
- * [5aefe29] Add 'Git-Dch: Short' tag to changelog parser This omits
- the long description of the commit from the changelog.
-
- -- Guido Günther <agx@sigxcpu.org> Tue, 04 May 2010 09:08:40 +0200
-
-git-buildpackage (0.4.65) unstable; urgency=low
-
- [ Guido Günther ]
- * [07d54ef] gbp-add-patch: Strip path from patchname and handle missing
- files gracefully.
- * [a7fe7c4] Add basic bash completion for git-buildpackage (Closes: #567313)
- - thanks to Siegfried-Angel Gevatter
- * [aec185f] Add gbp-{clone,pull,pq} to description
- * [24ac91c] bash-completion: Add git-dch, git-import-{orig,dsc} and tab
- completion for branch names.
- * [cbc0577] Add GitRepository.get_remotes() to easily query remote branches
- * [4654425] gbp-clone: Add --all to track all remote branches
-
- [ Matthijs Kooijman ]
- * [2874c23] Make the commit message for upstream imports configurable.
- This adds the import-msg commandline and configuration file option
- to change the commit message. (Closes: #474457)
-
- [ Jon Bernard ]
- * [ad9b7f5] Prevent git-add-patch from being gzip'd
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 13 Feb 2010 12:37:41 +0100
-
-git-buildpackage (0.4.64) unstable; urgency=low
-
- * [ab40623] Add gbp-add-patch to easily commit patches from debian/patches
- * [34c1c43] Allow to skip imports of same version Based on a patch by
- Christoph Göhre.
- * [ea6311e] DscFile: Parse name of debian.tar.gz
- * [237a547] Import version 3 source format (Closes: #552771)
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 25 Jan 2010 22:08:26 +0100
-
-git-buildpackage (0.4.63) unstable; urgency=low
-
- [ Guido Günther ]
- * [a0c7a91] docs: fix git-init call - thanks to Pietro Battiston
- * [02ab603] docs: Drop superfluous upstream branch creation
- * [e339c70] gbp: Make sure we drop the generated custom index file
- (Closes: #561454)
- * [d436612] git-dch: Add body regex filter (Closes: #544238)
- * [cf45595] gbp-{pull,clone}: Don't hardcode pristine-tar branch
- * [0eb4580] gbp: Allow to set compression type (Closes: #554520)
- * [7ad35fb] tests: Add other gbp-* commands
- * [f1f3d8e] tests: Add unpack test
-
- [ Matthijs Kooijman ]
- * [725b9d3] git-dch: Add support for a Git-Dch: Ignore metaheader.
- (Closes: #561346)
- * [e54b7bf] git-dch: There was a second use of parse_commit. Both uses of
- parse_commit now support the None return value. The shortlog_to_dch
- function is now superfluous and was removed.
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 26 Dec 2009 18:17:39 +0100
-
-git-buildpackage (0.4.62) unstable; urgency=low
-
- * [dce995d] Improve error handling on broken dsc files. (Closes: #560689)
- * [bcdd6b5] Improve error message when trying to import 3.0 source format
- packages until we properly support them.
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 14 Dec 2009 09:15:49 +0100
-
-git-buildpackage (0.4.61) unstable; urgency=low
-
- * [fc96f75] switch to 3.0 (native) source format
- * [bf258de] use git;// instead of http://
- * [043c75a] Make gbp-clone, gbp-pull and gbp-pq first class citizens
- by moving them from examples/ to /usr/bin/
- * [c5e4148] Add documentation for gbp-{pg,pull.clone}
- * [06059df] Make the default build command 3.x source format safe Instead of
- passing "-i\.git/ -I.git" to debuild use "-i -I". This makes sure we use
- the default behaviour of dpkg-source. (Closes: #553079)
- * [ecec4d5] gbp-pull: Don't fail if no tracking branch exists.
- * [5539417] cleanup symlinks
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 26 Nov 2009 19:05:53 +0100
-
-git-buildpackage (0.4.60) unstable; urgency=low
-
- [ Guido Günther ]
- * gbp-pull:
- * [9960f24] check for clean repo
- * [9d190a5] add --redo-pq so a "gbp-pull --redo-pq" also refreshes the
- patch-queue branch
- * gbp-pq:
- * [526fc0c] add option to drop patch-queue branch
- * [3bf8288] Don't fail when series file is missing. Create an empty
- patch-queue branch instead.
- * git-import-orig:
- * [eef5eca] Use "imported" instead of "merged". This way we don't claim
- we merged something but we possibly didn't. (Closes: #545908)
- * debian/rules:
- * [5372050] Don't compress the example scripts
- * docs:
- * [4da84c0] document --git-retag
-
- [ Charles Plessy ]
- * [509c1c3] Stefano Zacchiroli’s workaround for creating empty
- upstream branches. (See ‘http://bugs.debian.org/cgi-
- bin/bugreport.cgi?bug=471560’)
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 07 Nov 2009 15:30:49 +0100
-
-git-buildpackage (0.4.59) unstable; urgency=low
-
- * new tools:
- * [9ccbcd2] add examples/gbp-pull. Addresses another part of #540185.
- * git-buildpackage:
- * [38fcab2] add --git-retag (Closes: #521329)
- * git-import-orig:
- * [ee3209c] Drop superfluous argument. Fixes TypeError on merge failures.
- (Closes: #549885)
- * examples/gbp-clone:
- * [1d8fb9d] gbp-clone: import Command too. Fixes "--verbose".
- * gbp module:
- * [db7cbab] add GitFetch
- * [6f03267] add GitRepository.get_merge_branch()
- * [b543f67] add GitRepository.is_fast_forward()
- * [5bf8201] move FastImport into gbp/git.py
- * docs:
- * [189ff52] fix link to "homepage"
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 24 Oct 2009 21:31:08 +0200
-
-git-buildpackage (0.4.58) unstable; urgency=low
-
- * [78bcf5e] catch config file parse errors (Closes: #545690)
- * [8a9b813] docs: mention pristine-tar branch and pristine-tar
- * [260afa1] docs: add missing --git- prefix
- * [af4265e] git-dch: export GBP_BRANCH to postimport hook so we can pass the
- current branch to git-dch
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 05 Oct 2009 18:16:10 +0200
-
-git-buildpackage (0.4.57) unstable; urgency=low
-
- * new tools:
- * [13316be] Add gbp-clone to examples. Using this to clone
- repositories will automatically track the remote branches used by
- gbp. Addresses parts of #540185.
- * git-dch:
- * [d42ed40] Trim commit display.
- * [a335e04] Catch gbp.deb.NoChangelogError.
- * [98a9b88] Add changelog section if current topmost version is already
- tagged. This makes sure we add a new changelog section after a
- release. This was broken due to 016318.
- * git-import-orig:
- * [dcbe091] Use option groups for nicer --help output
- * [ee6c238] Add postimport hook for git-import-orig Allows to run git-
- dch after import. Drop the dch invocation and warn when --no-dch gets
- passed on the commandline. (Closes: #520355)
- * [aecb9b4] NEWS: --no-dch is no more (Closes: #540750)
- * git-import-dsc:
- * [dcbe091] Use option groups for nicer --help output
- * packaging:
- * [4f82dfb] Honor DEB_BUILD_OPTIONS=nocheck
- * [29cacc0] Run doctests with nose
- * [1f8abec] Bump standards version
- * [c84fd78] TODO list maintained in the wiki
- * gbp module:
- * [715d42a] Drop superfluous _utils from module names
- * [46d6c1b] Make sanitize_version a private function
- * [75eedb8] Add doctest for __sanitize_version() and build_tag()
- * [4cd72bc] Add doctest for Command.__call__()
- * [a4fd8eb] Add doctest for Command.call() and fix error in exception
- handling revealed by the test.
- * [edfe670] Add GitClone
- * [2663f23] Make GitBranch remote branch aware
- * [838b3f4] Make has_branch aware of remote branches
- * tests:
- * [6cbbddf] Add unit test for --help
- * [52d9b5a] Fix testcase name
- * [e4abaad] document changes so far
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 05 Sep 2009 16:06:11 +0200
-
-git-buildpackage (0.4.56) unstable; urgency=low
-
- * [d6dae62] depend on devscripts >= 2.10.49 for --no-force-save-on-release
- in dch. (Closes: #541420)
- * [080b1eb] make parameters for GitRepository.commits() optional
- * [016318e] git-dch: use the last commit in which debian/changelog was
- touched as starting point if no snapshot header was found. This can still
- be overriden by using --since. Based on a patch by Felipe Sateler.
- (Closes: #511269)
-
- -- Guido Günther <agx@sigxcpu.org> Sat, 15 Aug 2009 19:24:23 +0200
-
-git-buildpackage (0.4.55) unstable; urgency=low
-
- [ Guido Günther ]
- * [651f723] fix release
- * [e1bdfdb] update Homepage:
- * [8ea4747] add gbp-pq to examples (Closes: #537212)
- * [bedacee] check for correct overlay usage
- * [849c801] bump standards version
- * [f636022] add --no-force-save-on-release so dch saves the changlog
- even when there are no changes so we don't end up with UNRELEASED
- when passing -R.
-
- [ أحمد المحمودي ]
- * [14915d9] make tar_toplevel safer
- * [b86ddcc] add --git-overlay option (Closes: #411206)
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 30 Jul 2009 11:27:17 +0200
-
-git-buildpackage (0.4.54) unstable; urgency=low
-
- [ Damyan Ivanov ]
- * [b577f01] Unconfuse git-dch when commit message starts with "--"
- (Closes: #531985)
-
- [ Guido Günther ]
- * [55a89e1] allow for uppercase characters in the version pattern and
- in the package name if it's not a debian source package's name. Also
- allow for ':' and '~' which are allowed accoring to Debian Policy.
- Based on a patch by Felipe Sateler. (Closes: #531819)
- * [882f971] check for snapshot mode when checking if we need to add a
- new section. (Closes: #532583) - thanks to Ove Kaaven for sorting
- this out
- * [f80ee2e] fix one digit version numbers
- * [5edecd9] + is a valid character in version numbers
-
- [ Mehdi Dogguy ]
- * [7de9f12] add filter-pristine-tar to filter upstream tarball before
- passing it to pristine-tar (Closes: #520722)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 03 Jul 2009 16:16:41 +0200
-
-git-buildpackage (0.4.53) unstable; urgency=low
-
- * [b772300] pass --pretty=medium to git show (Closes: #525969)
- * [5ed3078] add commit argument to GitTag
- * [129b3c4] add get_author_email that parses git config and
- environment
- * [9ed19e7] add --fast-import. This uses git-fast-import to import the
- upstream tarball, speeds up imports of upstream tarballs by a
- factor of two. This options is experimental and will become the
- default once it got more testing. (Closes: #449075)
-
- -- Guido Günther <agx@sigxcpu.org> Sun, 03 May 2009 18:35:52 +0200
-
-git-buildpackage (0.4.52) unstable; urgency=low
-
- * [a2e42cd] move to section vcs
- * [2892e7f] document postbuild hook
- * [66f1027] promote pristine-tar to Recommends:
- * [54b9da0] fix missing argument in error message
- * [3e4b08e] restore default signal handlers before subprocess.call, python
- changes them to SIG_IGN. (Closes: #525411)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 24 Apr 2009 17:35:44 +0200
-
-git-buildpackage (0.4.51) unstable; urgency=low
-
- * [74a0954] git-import-dsc: don't ignore --debian-branch on import into non
- empty archives
- * [abe7de4] store version without epoch and simplify version parsing
- * [8d2c6bd] add get_arch returns dpkg's notion of the architecture
- * [e4db34b] add postbuild hook can be used to e.g. run lintian.
- (Closes: #521358)
- * [829db7c] pass GBP_BUILD_DIR to the build command this allows hooks
- to figure out where to copy back the build result. Adjust the
- cowbuilder example accordingly.
- * [eaacadf] bump standards version
- * [d113a3b] let the version detection patter match debian policy
- (Closes: #522888)
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 16 Apr 2009 11:47:27 +0200
-
-git-buildpackage (0.4.50) unstable; urgency=low
-
- * [eceac16] be less strict on the spelling of boolean config file
- options any capitalization of 'true' or 'false' as well as '0' and
- '1' are allowed. (Closes: #517376)
- * [94084b0] Skip all comments before looking for clean_msg (Closes: #518008)
- * [e56c9f5] add git-builder cowbuilder example
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 05 Mar 2009 21:08:24 +0100
-
-git-buildpackage (0.4.49) unstable; urgency=low
-
- * [4ddcd5c] gbp-posttag-push: fix for remote repos containing '.'
- * [1e62d1a] Pass "-d" to debuild when run as cleaner. This way build-
- deps don't have to be fulfilled in the source tree but only in the
- build tree. (Closes: #516876)
- * [660acbe] better document 'Closes:' tag (Closes: #516877)
- * [e3b7610] simplify boolean option handling
- * [1e1a1ca] add --no-pristine-tar (Closes: #517024)
- * [600a16d] add --git-no-ignore-new
- * [2fa0cc8] make --[no-]full a config file option
- * [6ccd482] make --export a config file option
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 26 Feb 2009 13:48:50 +0100
-
-git-buildpackage (0.4.48) unstable; urgency=low
-
- * [ae575e3] Add --export=WC to export the working copy into export-
- dir. (Closes: #509138)
- * [9f42e53] run git-cleaner with --git-ignore-new Makes running with
- and without --git-ignore-new more consistent.
- * [b8a35b4] docs: add --git-export=INDEX to the manual
- * [47c8a38] docs: add --git-dont-purge to the manual
- * [616bff3] docs: fix typo
- * [15042e3] rename git-pbuilder to gbp-pbuilder
- * [ffbb38a] add gbp-posttag-push example to examples/
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 23 Feb 2009 18:24:12 +0100
-
-git-buildpackage (0.4.47) unstable; urgency=low
-
- * [b5a3215] export sha1, branch and tagname into the commit hooks
- environment this makes it possible to push out that specific tag only
- * [2be813e] document exported env vars and add example posttag hook
- * [a498bdf] add GitRepository.rev_parse
- * [28973fb] fix VCS-Browser URL
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 19 Feb 2009 20:37:49 +0100
-
-git-buildpackage (0.4.46) unstable; urgency=low
-
- [ Guido Günther ]
- * [746d63b] fix typos (Closes: #510479) - thanks to Jonathan Wiltshire
- * [07ceb2c] add Vcs-Browser
-
- [ Dietmar Winkler ]
- * [a92c398] documentation typo
-
- [ Jonathan Wiltshire ]
- * [a748f52] typo in docs/manpages/git-dch.sgml (Closes: 511096)
-
- [ Guido Günther ]
- * [5c8de27] handle dpkg-parsechangelog errors (Closes: #512765)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 23 Jan 2009 18:32:27 +0100
-
-git-buildpackage (0.4.45) unstable; urgency=low
-
- [ Robie Basak ]
- * [6f4af4a] Use name and email from git (Closes: #509867)
-
- [ Guido Günther ]
- * [b097286] document --no-sign-tags
- * [6fe5985] add --no-git-author
- * [7c2034c] add --no-sign-tags to git-import-{dsc,orig} too
- (Closes: #508889)
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 01 Jan 2009 20:11:16 +0100
-
-git-buildpackage (0.4.44) unstable; urgency=low
-
- * [c54e6dc] help option cleanup (Closes: #505787)
- * [45541fe] don't require bugnumbers to start with '#' - use the regex
- from Debian policy instead
- * [77a875c] move common help messages into config.py
- * [9223997] allow to import into empty repositories this makes git-
- import-dsc's behaviour finally consistent with git-import-orig
- (Closes: #500458, #504075)
- * [aacd04a] require python 2.5
- * [54b9a3e] better descriptions
- * [e806326] add --no-sign-tags (Closes: #508889)
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 29 Dec 2008 00:29:43 +0100
-
-git-buildpackage (0.4.43) unstable; urgency=low
-
- * [8b8c137] gather all invocations of dch in one function - fixes dch
- failures due to missing quotes introduced by [7f24b98]
- * [a328fa2] fix off by one introduced by not counting first_commit
- when creating a new header in [7f24b98]
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 14 Nov 2008 14:12:04 +0100
-
-git-buildpackage (0.4.42) unstable; urgency=low
-
- [ Guido Günther ]
- * [b5e8691] debian/control: fix maintainer
- * [ee9e51d] doc: mention cl2vcs
- * [a0c03e1] doc: fix typo
- * [0314acc] git-buildpacakge: use option groups
- * [2d44dad] git-dch: merge sha and snapshot parameter
-
- [ Felipe Sateler ]
- * [7f24b98] git-dch: Don't include first UNRELEASED line - There's not much
- point in keeping this line when either doing a release or when having a
- snapshot header (nor does it help much if one invokes git-dch without
- options). (Closes: #505400)
-
- [ Guido Günther ]
- * [a6f5472] git-import-orig: Don't fail on symlink creation (Closes: #502565)
- * [b7f8efd] git-dch: add missing call to escape_commit
-
- -- Guido Günther <agx@sigxcpu.org> Thu, 13 Nov 2008 17:08:52 +0100
-
-git-buildpackage (0.4.41) unstable; urgency=low
-
- * [8b15994] allow for another config file $REPO/debian/gbp.conf
- (Closes: #502253)
- * [1ef4e04] add repo.set_branch() to switch branches
- * [d4d4580] use repo.set_branch()
- * [245d5f1] add GbpNothingImported exception
- * [c410c0b] switch back to original branch on empty imports
- (Closes: #504029, #504072)
-
- -- Guido Günther <agx@sigxcpu.org> Fri, 31 Oct 2008 10:28:47 +0100
-
-git-buildpackage (0.4.40) unstable; urgency=low
-
- [ Guido Guenther ]
- * [d87e2ab] fix typo (Closes: #500167) - thanks to Aleksej R. Serdyukov
- * [632c9b4] gbp.git_utils.GitRepository: make indentation more consistent
- * [b1a2847] adjust is_clean for git 1.6 (Closes: #500238)
- * [3332982] gbp.deb_utils.symlink_orig: remove superflous printout
- * [fb6187f] silence parse_dsc and move sanity checks into DscFile
-
- [ Kurt B. Kaiser ]
- * [bbd9946] Force tarball symlink on second export to build-area
- (Closes: #500498)
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 02 Oct 2008 12:26:56 +0200
-
-git-buildpackage (0.4.39) unstable; urgency=low
-
- [ Kurt B. Kaiser ]
- * [ac30b9b] Don't buffer stdout; let git-bp messages print in-line
- (Closes: #479846)
-
- [ Guido Guenther ]
- * [4da9954] git-import-dscs: likewise
- * [2162ead] git-dch: demangle adding commits and sections
- * [af70d4d] git-dch: improve wording
- * [bbf5020] git-dch: more option grouping
- * [3931f70] git-import-orig: print version number on failed imports
- * [745fbf6] git-import-dsc: merge by default when importing into an existing archive
- (Closes: #475571)
- * [631c347] git-import-dsc.sgml: document --no-merge
- * [2f46ba4] gbp: Don't honor .gitignore during replace_source_tree
- (Closes: #467504)
- * [624bdc9] gbp: move replace_source_tree into GitRepository
- * [519901e] gbp: add find_tag(branch)
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 22 Sep 2008 20:55:07 +0200
-
-git-buildpackage (0.4.38) unstable; urgency=low
-
- * [1623560] "git-commond" vs. "git command" cleanup (Closes: #497335)
- * [0a34c3b] add --new-version
- * [2a17687] document --new-version
- * [fc67ac2] document short options and snapshot mode
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 08 Sep 2008 18:48:58 +0200
-
-git-buildpackage (0.4.37) unstable; urgency=low
-
- * [d1ea39d] allow setting the bug-closing meta tag to look for this
- way we can generate bug-closing entries for different BTSs such as
- Debian or Launchpad.
- * [0376265] document meta-closes
- * [4da3586] fix commit order of GitRepository.commits() - we request
- since..until but got until..since. This makes the order of changelog
- entries generated by git-dch the same order as if git-dch would be
- called individually for each commit.
-
- -- Guido Guenther <agx@sigxcpu.org> Sat, 30 Aug 2008 14:20:11 +0200
-
-git-buildpackage (0.4.36) unstable; urgency=low
-
- * [64808df] Warn if we can't parse the changelog - without a changelog we
- can't parse the package name. Without that we might end up with wrong
- names on the pristine tar branch and with missing symlinks in tarball-dir.
- Since this might be intentional we issue a warning only.
- * [32b2e89] detect flat tar archives in git-import-dsc too
- * [277581c] don't fail import on non rfc822 adressess in the dsc file
- (Closes: #494753)
-
- -- Guido Guenther <agx@sigxcpu.org> Tue, 12 Aug 2008 19:31:26 +0200
-
-git-buildpackage (0.4.35) unstable; urgency=low
-
- * [e012d8b] add epoch parsing to DscFile (Closes: #493214)
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 01 Aug 2008 19:32:01 +0200
-
-git-buildpackage (0.4.34) unstable; urgency=low
-
- * [4ac0aa8] git-buildpackage: always symlink orig.tar.gz from tarball dir
- (Closes: 490706)
- * [fb94fea] git-buildpackage: print default export-dir on --help
- * [ffeb40e] git-dch: escape backticks (`) (Closes: 491104)
- * [4e398cc] git-dch: --auto and --since are incompatible
- * [3537f24] git-dch: use option groups
- * [18d8405] git-dch: split git-log options into a list (Closes: #479267)
- * [044083f] docs: readd list import line (Closes: #488120)
-
- -- Guido Guenther <agx@sigxcpu.org> Tue, 22 Jul 2008 00:29:49 -0230
-
-git-buildpackage (0.4.33) unstable; urgency=low
-
- [ Adeodato Simó ]
- * [35c92a4] git-import-orig: merge upstream by tag name instead of by
- branch name.
- * [f1ca044] command_wrappers.py: add a GitMerge wrapper class.
-
- [ Guido Guenther ]
- * [9bbd5d2] make symlink_orig's error message more helpful
- * [26c0310] make no-dch configurable via gbp.conf
- * [e6ce2df] bump standards version
- * [45b060e] mention git-import-dscs
- * [721068a] add "meta" to sample config file
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 26 Jun 2008 16:47:55 +0200
-
-git-buildpackage (0.4.32) unstable; urgency=low
-
- * [217263e] Don't set the version number twice - makes sure git-import-dsc
- doesn't use the Version: line from the message instead of the signature on
- old PGP signatures (Closes: #486397)
- * [063fab5] escape $s in commit messages so variable names like
- $remote_fs don't get dropped silently. (Closes: #486447)
- * [6008c37] don't try to cleanup in case of tag_only (Closes: #486398)
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 16 Jun 2008 17:54:09 +0200
-
-git-buildpackage (0.4.31) unstable; urgency=low
-
- * [bf8738f] add --git-tag-only (Closes: #485114)
- * [b06bcf0] document git-import-dscs
- * [c1deeb2] add epoch to dch call (Closes: #483718)
- * [6640ac7] Fix typo (Closes: #484243)
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 12 Jun 2008 16:53:45 +0200
-
-git-buildpackage (0.4.30) unstable; urgency=low
-
- * [cc9c42a] Try harder to find/build the upstream tarball (Closes:
- #482786)
- * [e6dd31e] Help pristine-tar to find the branch name (Closes:
- #481806)
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 29 May 2008 13:24:51 +0200
-
-git-buildpackage (0.4.29) unstable; urgency=low
-
- * [ce152d4] git-dch: include the commit id in the changelog entry
- * [ad6ff99] git-dch: print default value of --meta
- * [2c1c265] git-dch: avoid extra space before "(Closes: )"
- * [6ddf168] add git-import-dscs (Closes: #471580)
- * [2cfbf05] move dsc handling into deb_utils
-
- -- Guido Guenther <agx@sigxcpu.org> Sat, 17 May 2008 22:01:49 +0200
-
-git-buildpackage (0.4.28) unstable; urgency=low
-
- * git-buildpackage: add --git-dont-purge to leave the exported build dir
- intact (Closes: #479848) - thanks to Kurt B. Kaiser for the patch
- * git-dch: make --meta a config file option
- * git-import-orig: fix symlink creation
- * docs: missing EOF (Closes: #479726) - thanks to Sedat Dilek
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 12 May 2008 18:03:47 +0200
-
-git-buildpackage (0.4.27) unstable; urgency=low
-
- * make author parsing more robust (Closes: #479263)
- * fix --git-export (Closes: #479147)
-
- -- Guido Guenther <agx@sigxcpu.org> Sun, 04 May 2008 16:43:43 +0200
-
-git-buildpackage (0.4.26) unstable; urgency=low
-
- * git-export=INDEX exports the index into git-export-dir
- (Closes: #471568)
- * make ignore-new a config file option (Closes: #466900)
- * build-depend on python-dateutil (Closes: #477959)
- * git-dch:
- * use --no-auto-nmu
- * error handling fixes
- * depend on devscripts that has dch --no-auto-nmu
- * gbp/config.py: make boolean options parsing more robust
- * add a link to the online version of the manual
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 28 Apr 2008 16:36:44 +0200
-
-git-buildpackage (0.4.25) unstable; urgency=low
-
- * create a symlink archive -> <package>_<version>.orig.tar.gz this makes
- sure pristine_tar uses the correct filename for the orig.tar.gz. (Closes:
- #475316)
- * fix unpack_orig error reporting by adding the missing imports
- * fix "pristine-tar missing" error message
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 18 Apr 2008 11:33:46 +0200
-
-git-buildpackage (0.4.24) unstable; urgency=low
-
- [ Adeodato Simó ]
- * Make commits from git-import-dsc get author and date from
- debian/changelog.
-
- [ Guido Guenther ]
- * add rfc822_date_to_git() this function converts a date in RFC822
- format to a string 'seconds_since_epoch tz' that can be used for eg.
- GIT_AUTHOR_DATE.
- * better handle broken dsc files
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 14 Apr 2008 14:39:37 +0200
-
-git-buildpackage (0.4.23) unstable; urgency=low
-
- [ Frank S. Thomas ]
- * docs/manpages/*.sgml: Use the citerefentry for references to other
- manpages.
- * Do not list the --upstream-version option twice in the synopsis
- section of git-import-orig's manpage. (Closes: #472496)
-
- [ Guido Guenther ]
- * don't pass nonexisting branches to pristine-tar (Closes: #475554)
- * doc cleanups (Closes: 473610):
- * mention the html manual in the manpages
- * reference pristine-tar
- * filter uses glob
- * move conffiles section into separate sgml file
- * fix doc-base section
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 11 Apr 2008 19:18:08 +0200
-
-git-buildpackage (0.4.22) unstable; urgency=low
-
- * git-dch: don't skip meta tags without --force
- * gbp: git-core 1.5.3.4 doesn't support -q so use --quiet instead
- * fix typos in documentation (Closes: #471582) - thanks to Michael
- Biebl
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 19 Mar 2008 18:03:20 +0100
-
-git-buildpackage (0.4.21) unstable; urgency=low
-
- * allow meta tags in the commit logs
- * add --full and --meta options --full (Closes: #468118)
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 14 Mar 2008 20:42:53 +0100
-
-git-buildpackage (0.4.20) unstable; urgency=low
-
- * add missing pngs (Closes: #469403)
- * be more verbose on pbuilder (Closes: #469138)
- * explain howto push tags and mention linda and lintian (Closes: #469436)
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 06 Mar 2008 08:48:02 +0100
-
-git-buildpackage (0.4.19) unstable; urgency=low
-
- * don't fail of the pristine-tar branch doesn't exist
- (Closes: #468675)
-
- -- Guido Guenther <agx@sigxcpu.org> Sat, 01 Mar 2008 14:22:20 +0100
-
-git-buildpackage (0.4.18) unstable; urgency=low
-
- * update documentation about git-import-dsc and --filter
- * gbp/command_wrappers.py: make error messages more consistent
- * git-import-dsc: don't throw a python exception on tag failures or non
- existant branches
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 29 Feb 2008 18:05:40 +0100
-
-git-buildpackage (0.4.17) unstable; urgency=low
-
- * make dsc import repeatable (Closes: #468120, #432082)
- * drop now (due to git-apply) unneeded code
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 29 Feb 2008 16:09:47 +0100
-
-git-buildpackage (0.4.16) unstable; urgency=low
-
- [ Guido Guenther ]
- * speed up git-import-dsc by using git-apply (addresses parts of
- #449075)
- * update docs and gbp.conf with --filter and filter = [ ... ]
-
- [ Harald Braumann ]
- * allow multiple file filters for git-import-{orig,dsc} (Closes: #464653)
-
- -- Guido Guenther <agx@sigxcpu.org> Sun, 24 Feb 2008 14:56:47 +0100
-
-git-buildpackage (0.4.15) unstable; urgency=low
-
- * add (for now experimental) pristine-tar support based on a patch from
- Julian Andres Klode (Closes: #463580)
- * document pristine-tar options
- * suggest pristine-tar
- * don't use the deprecated git-* command versions
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 21 Feb 2008 16:25:33 +0100
-
-git-buildpackage (0.4.14) unstable; urgency=low
-
- * correct several typos in the manual (Closes: #464582, #464583,
- #464617)
- * better dpkg-parsechangelog error reporting (Closes: #460195)
- * document default tag formats (Closes: #464100)
- * git-import-orig: detect flat tar archives (Closes: #463822)
- * git-import-orig: add --no-dch options
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 08 Feb 2008 17:38:29 +0100
-
-git-buildpackage (0.4.13) unstable; urgency=low
-
- * git-import-orig: don't fail when importing into empty git archives
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 28 Dec 2007 23:01:29 +0100
-
-git-buildpackage (0.4.12) unstable; urgency=low
-
- * remove unused debian/dirs
- * bump standards version
- * add a homepage field
- * add doc-base file (Closes: #457495)
- * git-import-orig: fix doc url (Closes: #456535)
- * use export-dir instead of build-area in gbp.conf because git-
- buildpackage has no --git-build-area option - thanks to Frank S. Thomas
- for the patch.
-
- -- Guido Guenther <agx@sigxcpu.org> Sun, 23 Dec 2007 20:35:45 +0100
-
-git-buildpackage (0.4.11) unstable; urgency=low
-
- * --export-dir and --export are actually --git-export-dir and --git-
- export (Closes: #456384) - thanks to Frank S. Thomas for the patch.
- * don't start a new changelog section if we found a snapshot header
- even when distribution != UNRELEASED
-
- -- Guido Guenther <agx@sigxcpu.org> Sat, 15 Dec 2007 17:16:34 +0100
-
-git-buildpackage (0.4.10) unstable; urgency=low
-
- * git-ls-files: separate filenames by '\0', based on a patch from Uwe
- Kleine-König <Uwe.Kleine-Koenig@digi.com> (Closes: #454470)
- * git-import-dsc: return non null on failure
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 07 Dec 2007 23:19:39 +0100
-
-git-buildpackage (0.4.9) unstable; urgency=low
-
- * fix "gpb gets confused by color enabled on branches..." - thanks to
- Niv Sardi for the patch (Closes: #452921)
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 26 Nov 2007 17:22:48 +0100
-
-git-buildpackage (0.4.8) unstable; urgency=low
-
- * git-buildpacakge: make sure we don't switch directories during build
- (Closes: #451550)
- * debian/control: use the now official Vcs-Git
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 19 Nov 2007 18:50:08 +0100
-
-git-buildpackage (0.4.7) unstable; urgency=low
-
- * add tarball-dir option losely based on patch from Sjoerd Simons
- (Closes: #448357)
- * don't print a commit summary when importing into empty repos
- (addresses parts of #449075)
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 05 Nov 2007 20:09:15 +0100
-
-git-buildpackage (0.4.6) unstable; urgency=low
-
- * fix url (Closes: #448350)
- * call gzip with "-n" (Closes: #449094) - thanks to Romain Francoise
- * add .gitignore
-
- -- Guido Guenther <agx@sigxcpu.org> Sun, 04 Nov 2007 16:20:36 +0100
-
-git-buildpackage (0.4.5) unstable; urgency=low
-
- * git-import-orig: fix missing s/upstream/upstream_branch/ rename
- (Closes: #447920) - Thanks to Arnaud Cornet
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 24 Oct 2007 22:56:24 +0200
-
-git-buildpackage (0.4.4) unstable; urgency=low
-
- * git-buildpackage: use upstream-branch in case the tag doesn't exist
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 22 Oct 2007 17:00:12 +0200
-
-git-buildpackage (0.4.3) experimental; urgency=low
-
- * git-dch: properly quote "" (Closes: #447211)
- * git-dch: use Command() instead of implementing it again
- * documentation updates
- * don't split up the manual that much (local.dsl taken from
- darcs-buildpackage)
- * add version number to docs and a tools (--version)
- * pylint and other consistency updates
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 19 Oct 2007 10:12:40 +0200
-
-git-buildpackage (0.4.2) experimental; urgency=low
-
- * git-dch:
- * make --git-log a config file option
- * git-dch: fix help message for --debian-branch
- * doc: snapshot-number can be used in gbp.conf too
- * git-buildpackage:
- * add --git-export-dir=dir/, --git-export=treeish (Closes: #446042)
- * allow to use any treeish object for --git-upstream-branch
- * add missing examples to gbp.conf
- * parse .gbp.conf in the repository directory (Closes: #426009)
- * minor doc updates and clarifications
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 17 Oct 2007 00:00:13 +0200
-
-git-buildpackage (0.4.1) unstable; urgency=low
-
- * make sure the changelog section's trailer points to the person
- invoking git-dch
- * depend on devscripts with a working 'dch ""'
- * git-dch: eval() the snapshot number calculation
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 10 Oct 2007 18:15:54 +0200
-
-git-buildpackage (0.4.0) experimental; urgency=low
-
- * add support for automatic snapshot releases as suggested by Ottavio
- Salvador
- * make git-dch actually useful:
- * --auto: guess last changelogged commit from the snapshot header
- * add short options for --snapshot and --release
- * don't fail if the commit msg starts with '--'
- * add a check for the debian branch instead of always using it as the
- tip
- * handle versions containing epochs
- * add --git-log to pass options along to git-log
- * allow to specify paths to look at: git-dch path1 path2 - useful if
- upstream uses git
- * add some basic documentation for git-dch
-
- -- Guido Guenther <agx@sigxcpu.org> Sun, 07 Oct 2007 15:32:40 +0200
-
-git-buildpackage (0.3.6) unstable; urgency=low
-
- * create upstream branch when importing into an empty archive
- (Closes: #443305)
- * detect upstream version from common tarball formats
- (Closes: #443306)
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 03 Oct 2007 18:01:15 +0200
-
-git-buildpackage (0.3.5) unstable; urgency=low
-
- * add a minimalistic git-dch that creates changelog entries from git commit
- messages
- * s/reopsitory/repository/ - thanks to Loïc Minier (Closes: #444702)
- * update TODO
- * short paragraph on hacking on arbitrary debian packages
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 03 Oct 2007 14:10:05 +0200
-
-git-buildpackage (0.3.4) unstable; urgency=low
-
- * introduce --git-no-create-orig to skip building of any orig.tar.gz - this
- is especially usefull if you're working on an NMU that has a X-0.Y version
- number although it's a Debian native package
- * fix the error path in case the tgz can't be unpacked
- * git-pbuilder: add filter for git meta data and allow to pass options to
- pbuilder vi $PBUILDER_OPTS (Closes: #439535)
-
- -- Guido Guenther <agx@sigxcpu.org> Sat, 08 Sep 2007 20:40:36 +0200
-
-git-buildpackage (0.3.3) unstable; urgency=low
-
- * git-buildpackage: don't hardcode -i\.git -I.git as build arguments
- (Closes: #438669)
- * git-import-dsc: support --debian-branch (Closes: #432084)
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 20 Aug 2007 19:22:24 +0200
-
-git-buildpackage (0.3.2) unstable; urgency=low
-
- * git-import-orig: allow to import into an empy git repository
- * docs: we don't use git_load_dirs internally anymore
- * docs: howto start a package from scratch
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 27 Jun 2007 04:06:33 +0300
-
-git-buildpackage (0.3.1) unstable; urgency=low
-
- * don't fail imports on large archives
- * print a sensible error message, when a git repository isn't a debian
- source package
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 11 Jun 2007 18:06:15 +0200
-
-git-buildpackage (0.3.0) unstable; urgency=low
-
- * don't use git_load_dirs for imports, this addresses:
- * upstream directory removal (#423363)
- * empty dirs and files not under version control (#409606)
- * filtering out of files (Closes: #425986)
- * importing of an empty .diff.gz (like libx86 0.99-1.2)
- * doc: remove stray ';' from special.sgml. Thanks to Loïc Minier
- * doc: gbp.conf is per working copy, not per repository
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 28 May 2007 03:19:32 +0200
-
-git-buildpackage (0.2.31) unstable; urgency=low
-
- * git-import-orig: rename --upstreamversion to --upstream-version, to match
- the documentation and the other --upstream-* options
- * add several missing options to manpages and documentation
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 24 May 2007 09:38:35 +0200
-
-git-buildpackage (0.2.30) unstable; urgency=low
-
- * fix changelog upstream version parsing (Closes: #425615)
- * git-import-orig: allow to import from an unpacked source tree
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 24 May 2007 06:19:06 +0200
-
-git-buildpackage (0.2.29) unstable; urgency=low
-
- * git-import-orig: more specific error message, when the merge merge fails
- (Closes: #424036)
-
- -- Guido Guenther <agx@sigxcpu.org> Tue, 15 May 2007 23:55:07 +0200
-
-git-buildpackage (0.2.28) unstable; urgency=low
-
- * git-import-orig: support import of tar.bz2 (Closes: #423254)
- * type fixes by Aurélien GÉRÔME. Thanks! (Closes: #422171)
-
- -- Guido Guenther <agx@sigxcpu.org> Sun, 13 May 2007 14:13:00 +0200
-
-git-buildpackage (0.2.27) unstable; urgency=low
-
- * git_load_dirs now supports --summary, use this for nicer import messages
- * bump versioned dependency on git-load-dirs therefore
- * improve tagging messages
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 12 Apr 2007 18:25:40 +0200
-
-git-buildpackage (0.2.26) unstable; urgency=low
-
- * use GbpError everywhere
- * move commands into a submodule
- * git-import-orig: pass --verbose on to git_load_dirs
- * use default python version in setup.py
- * depend on a git that has the "removed files left in working copy after
- merge" bug (#410325)
- * adjust to new output of git-status in git 1.5
-
- -- Guido Guenther <agx@sigxcpu.org> Tue, 27 Feb 2007 19:11:06 +0100
-
-git-buildpackage (0.2.25) unstable; urgency=low
-
- * posttag support for git-buildpackage: use --git-posttag to run a command
- after a successfull build and tag (e.g. --git-posttag='git-push --tags
- git.alioth.org')
- * repositories that weren't created by git-import-dsc and never had the
- upstream sources as a single commit (let alone an upstream branch) can be
- made git-import-orig compatible by using git's grafts - mention this in
- the manual. This (Closes: #403988) since with this every git repo can use
- git-import-orig (with some preparation).
- * Allow to specify the tag format. The format of generated tags can now be
- specified via the debian-tag and upsteam-tag options. The default now puts
- debian tags and upstream tags into different namespaces (Closes: #408990).
- * add example for pbuilder
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 2 Feb 2007 16:26:52 +0100
-
-git-buildpackage (0.2.24) unstable; urgency=low
-
- * add XS-Vcs-Git
- * fix error message in case the upstream branch doesn't exist
-
- -- Guido Guenther <agx@sigxcpu.org> Sat, 13 Jan 2007 22:05:23 +0100
-
-git-buildpackage (0.2.23) unstable; urgency=low
-
- * depend on gtk-doc-tools, sgml2x and jade (Closes: #404673)
- * use docbook-utils insted of docbook-to-man
- * docbook updates
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 29 Dec 2006 18:18:50 +0100
-
-git-buildpackage (0.2.22) unstable; urgency=low
-
- * git-buildpackage: check if upstream branch exists
- * git-import-dsc: improve error handling
- * add GitRepository class
- * make pylint a bit happier
- * update manpages
-
- -- Guido Guenther <agx@sigxcpu.org> Tue, 26 Dec 2006 00:27:44 +0100
-
-git-buildpackage (0.2.21) unstable; urgency=low
-
- * While dpkg-buildpackage's -i argument takes a regexp -I doesn't - fix
- inclusion of git metadata in debian native packages
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 22 Dec 2006 17:59:49 +0100
-
-git-buildpackage (0.2.20) unstable; urgency=low
-
- * git-import-orig: improve error message when the upstream branch cannot be
- found. We cannot create the branch automatically since on repositories
- not created by git-import-dsc it's not clear where to branch from.
- (Closes: #403990)
- * remove pointless patch arguments from most of the git helper functions
- * add some more documentation
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 22 Dec 2006 17:30:11 +0100
-
-git-buildpackage (0.2.19) unstable; urgency=low
-
- * git-buildpackage: add an option (--git-cleaner) that allows to specify
- a different clean command (Closes: #403987)
- * depend on a git-core that has git-archive
- * s/keyid/GPG keyid/
- * minor fixes all over the place
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 21 Dec 2006 15:18:40 +0100
-
-git-buildpackage (0.2.18) experimental; urgency=low
-
- * git-buildpackage: detect the branch we're on and bail out if it's not the
- debian branch
- * doc updates
-
- -- Guido Guenther <agx@sigxcpu.org> Sun, 10 Dec 2006 14:57:35 +0100
-
-git-buildpackage (0.2.17) experimental; urgency=low
-
- * fix wrong default debian branch
- * git-buildpackage: fix typo in git-ignore-new
-
- -- Guido Guenther <agx@sigxcpu.org> Sat, 9 Dec 2006 13:22:33 +0100
-
-git-buildpackage (0.2.16) experimental; urgency=low
-
- * git-buildpackage: properly pass builder args
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 8 Dec 2006 17:13:32 +0100
-
-git-buildpackage (0.2.15) experimental; urgency=low
-
- * git-buildpackage now supports signed tags via the "sign-tag" and "keyid"
- options. This allows us to have a nice "trustable" history. See:
- http://www.kernel.org/pub/software/scm/git/docs/
- on how this ensured.
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 6 Dec 2006 22:04:41 +0100
-
-git-buildpackage (0.2.14) experimental; urgency=low
-
- * config file parsing to set default branches and build commands
-
- -- Guido Guenther <agx@sigxcpu.org> Tue, 5 Dec 2006 19:36:41 +0100
-
-git-buildpackage (0.2.13) experimental; urgency=low
-
- * fix typos in 'git-buildpackage -v'
-
- -- Guido Guenther <agx@sigxcpu.org> Sun, 3 Dec 2006 22:27:11 +0100
-
-git-buildpackage (0.2.12) experimental; urgency=low
-
- * upload to experimental (Closes: #389710)
- * bump dependency on git-load-dirs again
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 30 Nov 2006 09:47:33 +0100
-
-git-buildpackage (0.2.11) git-buildpackage; urgency=low
-
- * git-buildpackage: use pipes module instead of os.system
- * git-import-orig: fix printout of branch name
-
- -- Guido Guenther <agx@sigxcpu.org> Tue, 28 Nov 2006 16:33:54 +0100
-
-git-buildpackage (0.2.10) git-buildpackage; urgency=low
-
- * build an orig.tar.gz if nones there
-
- -- Guido Guenther <agx@sigxcpu.org> Sun, 19 Nov 2006 14:17:40 +0100
-
-git-buildpackage (0.2.9) git-buildpackage; urgency=low
-
- * depend on a fixed git-load-dirs that contains the git_load_dirs executable
- * git-import-dsc: fix importing debian native packages
-
- -- Guido Guenther <agx@sigxcpu.org> Tue, 14 Nov 2006 12:39:26 +0100
-
-git-buildpackage (0.2.8) git-buildpackage; urgency=low
-
- * sanitze_version: strip of epochs
- * don't use a regexp for version parsing on import
- * minor cosmetic cleanups all over the place
- * README: no need to mention git-load-dirs anymore, it's in unstable now.
- Thanks John.
- * git-import-orig: implement "--no-merge"
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 8 Nov 2006 10:36:55 +0100
-
-git-buildpackage (0.2.7) git-buildpackage; urgency=low
-
- * more robust regex matching
- * sanitize all version numbers before running git-tag
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 6 Oct 2006 18:40:12 +0200
-
-git-buildpackage (0.2.6) git-buildpackage; urgency=low
-
- * run pychecker during build
- * also filter out git metadata when building tarballs, not only when
- building diffs (affects Debian native packages)
- * git-import-dsc: allow for '+' in Debian as well as upstream version
- numbers
- * check if we're at the top level of a git repository before starting the
- build
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 5 Oct 2006 19:46:23 +0200
-
-git-buildpackage (0.2.5) git-buildpackage; urgency=low
-
- * fix syntax error in tag replacement
- * minor manpage reformating
- * cleanup generated manpage.* files
-
- -- Guido Guenther <agx@sigxcpu.org> Thu, 5 Oct 2006 11:21:01 +0200
-
-git-buildpackage (0.2.4) git-buildpackage; urgency=low
-
- * add manpages
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 4 Oct 2006 19:39:13 +0200
-
-git-buildpackage (0.2.3) git-buildpackage; urgency=low
-
- * git doesn't like '~' in tag names so replace this with a dot when tagging
-
- -- Guido Guenther <agx@sigxcpu.org> Mon, 2 Oct 2006 18:30:20 +0200
-
-git-buildpackage (0.2.2) git-buildpackage; urgency=low
-
- * git-import-dsc: don't fail if the dsc is a plain filename without a
- directory component
- * git-buildpackage: add --git-verbose option
- * git-import-{orig,dsc}: allow to set the name of the upstream branch
-
- -- Guido Guenther <agx@sigxcpu.org> Fri, 29 Sep 2006 19:08:08 +0200
-
-git-buildpackage (0.2.1) git-buildpackage; urgency=low
-
- * git-import-orig: don't try import new upstream versions when there
- are uncommitted changes
- * git-buildpackage: use helpers from git_buildpackage
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 27 Sep 2006 12:15:47 +0200
-
-git-buildpackage (0.2) git-buildpackage; urgency=low
-
- * git-import-dsc: import of debian native packages
-
- -- Guido Guenther <agx@sigxcpu.org> Wed, 27 Sep 2006 00:40:46 +0200
-
-git-buildpackage (0.01) unstable; urgency=low
-
- * Initial release
-
- -- Guido Guenther <agx@sigxcpu.org> Tue, 12 Sep 2006 14:55:57 +0200
+++ /dev/null
-Source: git-buildpackage
-Section: vcs
-Priority: optional
-Maintainer: Guido Günther <agx@sigxcpu.org>
-Build-Depends:
- bash-completion,
- dh-python,
- debhelper (>= 9~),
- docbook-utils,
- gtk-doc-tools,
- openjade,
- perl,
- python3,
- python-epydoc | pydoctor | python-pydoctor,
- python3-nose,
- python3-pkg-resources,
- python3-setuptools,
- python3-dateutil,
- sgml2x,
- librpm-tizen,
-# For rpm (epydoc)
- python3-rpm
-Standards-Version: 3.9.4
-Vcs-Git: git://honk.sigxcpu.org/git/git-buildpackage.git
-Vcs-Browser: https://honk.sigxcpu.org/gitweb/?p=git-buildpackage.git
-Homepage: https://honk.sigxcpu.org/piki/projects/git-buildpackage/
-X-Python3-Version: >= 3.5
-
-
-Package: git-buildpackage-common
-Architecture: all
-Depends: ${python3:Depends},
- ${shlibs:Depends},
- ${misc:Depends},
- devscripts (>= 2.13.5~),
- git (>= 1:1.7.9.1-1~),
- man-db,
- python3-pkg-resources,
- python3-dateutil,
-#unittest need
- zipmerge
-Recommends: pristine-tar (>= 0.5)
-Suggests: python3-notify2, unzip, zipmerge
-Description: Suite to help with packaging in Git repositories
- This package contains the common API and scripts for Debian and rpm packaging
-
-Package: git-buildpackage
-Architecture: all
-Depends: ${python3:Depends},
- ${shlibs:Depends},
- ${misc:Depends},
- devscripts,
- git-buildpackage-common (= ${binary:Version})
-Recommends: cowbuilder
-Description: Suite to help with Debian packages in Git repositories
- This package contains the following tools:
- * gbp import-{dsc,dscs}: import existing Debian source packages into a git
- repository
- * gbp import-orig: import a new upstream version into the git repository
- * gbp buildpackage: build a package out of a git repository, check for local
- modifications and tag appropriately
- * gbp dch: generate Debian changelog entries from Git commit messages
- * gbp {pull,clone}: clone and pull from remote repos
- * gbp pq: manage debian/patches easily
- * gbp create-remote-repo: create remote repositories
-
-Package: git-buildpackage-rpm
-Architecture: all
-Depends: ${python3:Depends},
- ${shlibs:Depends},
- ${misc:Depends},
- python3-rpm,
- rpm2cpio,
- git-buildpackage-common (= ${binary:Version})
-Recommends: rpm
-Description: Suite to help with rpm packages in Git repositories
- This package contains the following tools:
- * git-import-srpm: import existing rpm source packages into a git
- repository
- * git-import-orig-rpm: import a new upstream version into the git repository
- * git-buildpackage-rpm: build a package out of a git repository, check for local
- modifications and tag appropriately
- * gbp-pq-rpm: manage separate development and packaging branches
-
-Package: git-buildpackage-bb
-Architecture: all
-Depends: ${python3:Depends},
- ${misc:Depends},
- git-buildpackage-common (= ${binary:Version}),
- git-buildpackage-rpm (= ${binary:Version}),
-Recommends: bitbake
-Description: Suite to help with BitBake builds from Git repositories
- This package contains the following tools:
- * gbp import-bb: import sources from distribution repository
- * gbp buildpackage-bb: build a package out of a Git repository
- * gbp pq-bb: manage separate development and packaging branches
+++ /dev/null
-This package was debianized by Guido Günther <agx@sigxcpu.org> on
-Tue, 12 Sep 2006 14:55:57 +0200.
-
-It was downloaded from https://honk.sigxcpu.org/piki/projects/git-buildpackage/
-
-Upstream Author: Guido Günther <agx@sigxcpu.org>
-
-Copyright: 2006,2007,2008,2009,2010, Guido Günther
-
-License:
-
-You are free to distribute this software under the terms of the GNU General
-Public License Version 2. The full text of this license can be found in the
-file /usr/share/common-licenses/GPL-2
-
-Git-buildpackage includes git-pbuilder written by Russ Allbery
-<rra@stanford.edu>
-
-Copyright: 2008, 2009, 2010 Board of Trustees, Leland Stanford Jr. University
-License:
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted, provided
-that the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation, and that the name of Stanford University not be used in
-advertising or publicity pertaining to distribution of the software without
-specific, written prior permission. Stanford University makes no
-representations about the suitability of this software for any purpose. It
-is provided "as is" without express or implied warranty.
+++ /dev/null
-usr/lib/python*/dist-packages/gbp/bb/
-usr/lib/python*/dist-packages/gbp/scripts/*bb*.py*
+++ /dev/null
-Document: git-buildpackage
-Title: Git-Buildpackage Manual
-Author: Guido Guenther
-Abstract: git-buildpackage is a suite to help with Debian packages in Git
- repositories. This manual describes the utilities in this package, their
- configuration and possible workflows.
-Section: Programming
-
-Format: HTML
-Index: /usr/share/doc/git-buildpackage-common/manual-html/index.html
-Files: /usr/share/doc/git-buildpackage-common/manual-html/*.html
+++ /dev/null
-README
-docs/manual-html/
+++ /dev/null
-examples/*
+++ /dev/null
-usr/bin/gbp
-usr/bin/gbp-clone
-usr/bin/gbp-pull
-usr/lib/python*/dist-packages/gbp/*.py*
-usr/lib/python*/dist-packages/gbp/scripts/__init__.py*
-usr/lib/python*/dist-packages/gbp/scripts/clone.py*
-usr/lib/python*/dist-packages/gbp/scripts/config.py*
-usr/lib/python*/dist-packages/gbp/scripts/pull.py*
-usr/lib/python*/dist-packages/gbp/scripts/supercommand.py*
-usr/lib/python*/dist-packages/gbp/scripts/common/*.py*
-usr/lib/python*/dist-packages/gbp/git/*.py*
-usr/lib/python*/dist-packages/gbp/pkg/*.py*
-etc/git-buildpackage/gbp.conf
+++ /dev/null
-/usr/share/doc/git-buildpackage-common/manual-html/gbp.html /usr/share/doc/git-buildpackage-common/manual-html/index.html
+++ /dev/null
-docs/gbp.1
-docs/gbp-clone.1
-docs/gbp-config.1
-docs/gbp-pull.1
-docs/*.5
+++ /dev/null
-usr/bin/*rpm*
-usr/lib/python*/dist-packages/gbp/rpm/*.py*
-usr/lib/python*/dist-packages/gbp/scripts/*rpm*.py*
+++ /dev/null
-# -*- shell-script -*-
-#
-# Bash tab auto-completion rules for git-buildpackage.
-#
-# Copyright (C) 2010 Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com>
-# Copyright (C) 2010,2013 Guido Guenther <agx@sigxcpu.org>
-#
-# Distributed under the GNU General Public License, version 2.0.
-
-_gbp_branches ()
-{
- [ -d .git ] || return 0
- git for-each-ref --format="%(refname:short)" refs/heads
-}
-
-
-_gbp_tags ()
-{
- [ -d .git ] || return 0
- git for-each-ref --format="%(refname:short)" refs/tags
-}
-
-
-_gbp_options ()
-{
- $1 --help | sed -ne 's/^ \+\(\(\-[a-z]\), \)\?\(\-\-[a-z\-]\+\=\?\).*/\2 \3/p'
-}
-
-
-_gbp_commands ()
-{
- gbp --list-cmds | sed -ne 's/^ \+\([a-z\-]\+\) \-.*/\1/p'
-}
-
-
-_gbp_comp ()
-{
- local cur="${COMP_WORDS[COMP_CWORD]}"
- local prev="${COMP_WORDS[COMP_CWORD - 1]}"
- local options=$1
- local branch_opts=$2
- local tag_opts=$3
- local tristate_opts=$4
-
-# COMPREPLY considers '=' as a word. For $prev we prefer the word before the actual "="
- if [[ "$prev" == "=" ]]; then
- prev="${COMP_WORDS[COMP_CWORD - 2]}"
- elif [[ "$cur" == "=" ]]; then
- cur=""
- fi
-
- if [[ "${branch_opts}" == *$prev* ]]; then
- local refs=$(_gbp_branches)
- COMPREPLY=( $(compgen -W "$refs" -- $cur ) )
- return 0
- fi
-
- if [[ "${tag_opts}" == *$prev* ]]; then
- local refs=$(_gbp_tags)
- COMPREPLY=( $(compgen -W "$refs" -- $cur ) )
- return 0
- fi
-
- if [[ "${tristate_opts}" == *$prev* ]]; then
- COMPREPLY=( $(compgen -W 'on off auto' -- $cur ) )
- return 0
- fi
-
- if [[ "${cbdist_opts}" == *$prev* ]]; then
- local BASE="/var/cache/pbuilder/base-"
- COMPREPLY=( $( compgen -o dirnames -G "${BASE}${cur}*.cow" \
- | sed -e "s,${BASE}\(.*\)\.cow,\1,g" ) )
- return 0
- fi
-
- # separate opts by tab so we can append a space to all options not ending
- # with an equal sign
- tab_opts=$(echo "$options" | sed -e 's/ \+/\t/g' -e 's/[^=]$/& /g')
- type compopt &>/dev/null && compopt -o nospace
- local IFS=$'\t\n'
- COMPREPLY=($(compgen -W "$tab_opts" -- $cur))
-}
-
-# check if we can find a gbp command on the commandline
-_gbp_find_cmd_on_cmdline ()
-{
- local cmds="$1" # list of commands to check for
- local word cmd c=1
-
- while [ $c -lt $((COMP_CWORD)) ]; do
- word="${COMP_WORDS[c]}"
- for cmd in $cmds; do
- if [ "$cmd" = "$word" ]; then
- echo "$cmd"
- return
- fi
- done
- ((c++))
- done
-}
-
-have git-buildpackage &&
-_gbp_buildpackage()
-{
- local options=$(_gbp_options git-buildpackage)
- local branch_opts="--git-debian-branch\= --git-upstream-branch\= --git-upstream-tree\="
- local tag_opts="--git-debian-tag\= --git-upstream-tag\="
- local tristate_opts="--git-color\= --git-notify\="
- local cbdist_opts="--git-dist\="
-
- _gbp_comp "$options" "$branch_opts" "$tag_opts" "$tristate_opts" \
- "$cbdist_opts"
-}
-[ "${have:-}" ] && complete -F _gbp_buildpackage -o default git-buildpackage
-
-
-have git-dch &&
-_gbp_dch ()
-{
- local options=$(_gbp_options git-dch)
- local branch_opts="--debian-branch\="
- local tag_opts="--debian-tag\= --upstream-tag\="
- local tristate_opts="--color\="
-
- _gbp_comp "$options" "$branch_opts" "$tag_opts" "$tristate_opts"
-}
-[ "${have:-}" ] && complete -F _gbp_dch -o default git-dch
-
-
-have git-import-orig &&
-_gbp_import_orig ()
-{
- local options=$(_gbp_options git-import-orig)
- local branch_opts="--debian-branch\= --upstream-branch\="
- local tag_opts="--debian-tag\= --upstream-tag\="
- local tristate_opts="--color\="
-
- _gbp_comp "$options" "$branch_opts" "$tag_opts" "$tristate_opts"
-}
-[ "${have:-}" ] && complete -F _gbp_import_orig -o default git-import-orig
-
-
-have git-import-dsc &&
-_gbp_import_dsc ()
-{
- local options=$(_gbp_options git-import-dsc)
- local branch_opts="--debian-branch\= --upstream-branch\="
- local tag_opts="--debian-tag\= --upstream-tag\="
- local tristate_opts="--color\="
-
- _gbp_comp "$options" "$branch_opts" "$tag_opts" "$tristate_opts"
-}
-[ "${have:-}" ] && complete -F _gbp_import_dsc -o default git-import-dsc
-
-have git-import-dscs &&
-_gbp_import_dscs ()
-{
- local options="$(_gbp_options git-import-dscs) $(_gbp_options git-import-dsc)"
- local branch_opts="--debian-branch\= --upstream-branch\="
- local tag_opts="--debian-tag\= --upstream-tag\="
- local tristate_opts="--color\="
-
- _gbp_comp "$options" "$branch_opts" "$tag_opts" "$tristate_opts"
-}
-[ "${have:-}" ] && complete -F _gbp_import_dscs -o default git-import-dscs
-
-have gbp-pq &&
-_gbp_pq ()
-{
- local options=$(_gbp_options gbp-pq)
- options="$options export import rebase drop apply switch"
- local tristate_opts="--color\="
-
- _gbp_comp "$options" "" "" "$tristate_opts"
-}
-[ "${have:-}" ] && complete -F _gbp_pq -o default gbp-pq
-
-have gbp-pull &&
-_gbp_pull ()
-{
- local options=$(_gbp_options gbp-pull)
- local branch_opts="--debian-branch\= --upstream-branch\="
- local tag_opts="--debian-tag\= --upstream-tag\="
- local tristate_opts="--color\="
-
- _gbp_comp "$options" "$branch_opts" "$tag_opts" "$tristate_opts"
-}
-[ "${have:-}" ] && complete -F _gbp_pull -o default gbp-pull
-
-have gbp-clone &&
-_gbp_clone ()
-{
- local options=$(_gbp_options gbp-clone)
- local branch_opts="--debian-branch\= --upstream-branch\="
- local tag_opts="--debian-tag\= --upstream-tag\="
- local tristate_opts="--color\="
-
- _gbp_comp "$options" "$branch_opts" "$tag_opts" "$tristate_opts"
-}
-[ "${have:-}" ] && complete -F _gbp_clone -o default gbp-clone
-
-have gbp-create-remote-repo &&
-_gbp_create_remote_repo ()
-{
- local options=$(_gbp_options gbp-create-remote-repo)
- local branch_opts="--debian-branch\= --upstream-branch\="
- local tristate_opts="--color\="
-
- _gbp_comp "$options" "$branch_opts" "" "$tristate_opts"
-}
-[ "${have:-}" ] && complete -F _gbp_create_remote_repo -o default gbp-create-remote-repo
-
-have gbp &&
-_gbp ()
-{
- local cur="${COMP_WORDS[COMP_CWORD]}"
- local commands=$(_gbp_commands)
- local func
-
- command=$(_gbp_find_cmd_on_cmdline "$commands")
- if [ -z $command ]; then
- COMPREPLY=( $(compgen -W "$commands" -- $cur ) )
- else
- func=_gbp_$(echo $command | sed -e 's/-/_/g')
- $func
- fi
-}
-[ "${have:-}" ] && complete -F _gbp -o default gbp
+++ /dev/null
-usr/bin/gbp-pq
-usr/bin/git-buildpackage
-usr/bin/git-dch
-usr/bin/git-import-dsc
-usr/bin/git-import-dscs
-usr/bin/git-import-orig
-usr/bin/git-pbuilder
-usr/bin/gbp-create-remote-repo
-usr/lib/python*/dist-packages/gbp/deb/*.py*
-usr/lib/python*/dist-packages/gbp/scripts/pq.py*
-usr/lib/python*/dist-packages/gbp/scripts/buildpackage.py*
-usr/lib/python*/dist-packages/gbp/scripts/dch.py*
-usr/lib/python*/dist-packages/gbp/scripts/import_dsc.py*
-usr/lib/python*/dist-packages/gbp/scripts/import_dscs.py*
-usr/lib/python*/dist-packages/gbp/scripts/import_orig.py*
-usr/lib/python*/dist-packages/gbp/scripts/create_remote_repo.py*
+++ /dev/null
-docs/gbp-buildpackage.1
-docs/gbp-create-remote-repo.1
-docs/gbp-dch.1
-docs/gbp-import-dsc.1
-docs/gbp-import-dscs.1
-docs/gbp-import-orig.1
-docs/gbp-pq.1
-docs/git-pbuilder.1
+++ /dev/null
-#compdef gbp
-#description build debian packages from a git repository
-
-__gbp_common_options() {
- local prefix="$1"
- # these can't be prefixed
- _arguments '--help[Show help]' \
- '--version[Show version information]'
-
- _arguments "--${prefix}verbose[Verbose execution]" \
- "--${prefix}color=-[Use colored output]:color:(on auto off)"
-
-}
-
-__gbp_branch_options() {
- local prefix="$1"
- _arguments \
- "--${prefix}debian-branch=-[The branch the Debian package is being developed on]" \
- "--${prefix}upstream-branch=-[The branch the upstream sources are put onto]" \
- "--${prefix}pristine-tar[Track pristine tar branch]"
-}
-
-__gbp_tag_format_options() {
- local prefix="$1"
- _arguments \
- "--${prefix}debian-tag=-[format string for debian tags]" \
- "--${prefix}upstream-tag=-[format string for upstream tags]"
-}
-
-__gbp_tag_sign_options() {
- local prefix="$1"
- _arguments \
- "(--${prefix}sign-tags --${prefix}no-sign-tags)--${prefix}sign-tags[GPG sign all generated tags]" \
- "(--${prefix}sign-tags --${prefix}no-sign-tags)--${prefix}no-sign-tags[Do not GPG sign generated tags]" \
- "--${prefix}keyid=-[GPG keyid to sign tags with]:GPG key:"
-}
-
-_gbp() {
- local curcontext="$curcontext" state line
- typeset -A opt_args
- _arguments -C \
- ':command:->command' \
- '*::options:->options' \
-
- case $state in
- (command)
- #breaks if defined outside the func
- local -a subcommands
- subcommands=(
- 'buildpackage:Build a Debian package'
- 'clone:Clone a Git repository from a remote and set up the necessary branch tracking.'
- 'create-remote-repo:Create a remote Git repository'
- 'dch:Generate the debian/changelog from Git commit history'
- 'import-dsc:Import a single Debian source package'
- 'import-dscs:Import multiple Debian source packages'
- 'import-orig:Import a new upstream tarball'
- 'pq:Manage debian/patches using Git rebase'
- 'pull:Update a Git repository from a remote'
- )
-
- _describe -t commands gbp subcommands
- ;;
- (options)
- local funcname
- funcname=_gbp-$line[1]
- if type $funcname | grep -q "shell function" ; then
- $funcname
- fi
- ;;
- esac
-}
-
-_gbp-buildpackage() {
- __gbp_common_options git-
- __gbp_branch_options git-
- __gbp_tag_format_options git-
- __gbp_tag_sign_options git-
- _arguments \
- '--git-ignore-new[build with uncommited changes in the source tree]' \
- '--git-no-ignore-new[negates --git-ignore-new]' \
- '--git-tag[create a tag after a successful build]' \
- '--git-tag-only[do not build, only tag and run the posttag hook]' \
- '--git-retag[do not fail if the tag already exists]' \
- '--git-force-create[force creation of orig.tar.gz]' \
- '--git-no-create-orig[do not create orig.tar.gz]' \
- '--git-tarball-dir=-[location to look for external tarballs]:tarball directory:_files -/' \
- '--git-compression=-[compression type]:compression:(auto gzip bzip2 lzma xz)' \
- '--git-compression-level=-[set compression level]:level:(1 2 3 4 5 6 7 8 9)' \
- '--git-ignore-branch[build although debian-branch != current branch]' \
- '--git-no-ignore-branch[negates --git-ignore-branch]' \
- '--git-builder=-[command to build the Debian package]:command:' \
- '--git-cleaner=-[command to clean the working copy]:command:' \
- '--git-prebuild=-[command to run before a build]:command:' \
- '--git-postbuild=-[hook run after a successful build]:command:' \
- '--git-posttag=-[hook run after a successful tag operation]:command:' \
- '--git-pbuilder[invoke git-pbuilder for building]' \
- '--git-no-pbuilder[negates --git-pbuilder]' \
- '--git-dist=-[build for this distribution when using git-pbuilder]:distribution:' \
- '--git-arch=-[build for this architecture when using git-pbuilder]:architecture:' \
- '--git-export-dir=-[before building the package export the source into this directory]:directory:_files -/' \
- '--git-export=-[export treeish object instead of HEAD]:treeish:' \
- '--git-dont-purge[retain exported package build directory]' \
- '--git-overlay[extract orig tarball when using export-dir option]' \
- '--git-no-overlay[negates --git-overlay]' \
- '--git-notify=-[Send a desktop notification after build]:notify:(on auto off)' \
- '*:Other options:_dpkg-buildpackage'
-}
-
-_gbp-clone() {
- __gbp_common_options
- __gbp_branch_options
- _arguments \
- '--all[Track all branches, not only debian and upstream]'
-}
-
-_gbp-create-remote-repo() {
- __gbp_common_options
- _arguments \
- '--remote-url-pattern=-[Where to create remote repository]' \
- '--remote-name=-[What name git will use when refering to that repository]' \
- '--template-dir=-[Template dir to pass to git init]' \
- '--remote-config=-[Name of config file section to specify params]' \
- '(--track --no-track)--track[Set up branch tracking]' \
- '(--track --no-track)--no-track[Do not set up branch tracking]'
-
-}
-
-_gbp-dch () {
- __gbp_common_options
- __gbp_branch_options
- __gbp_tag_format_options
-
- _arguments \
- '--git-ignore-branch[build although debian-branch != current branch]' \
- '--since=-[Start point for reading commits]:commitish:' \
- '--auto[Guess the last commit documented in the changelog]' \
- '(--meta --no-meta)--meta[Parse meta tags]' \
- '(--meta --no-meta)--no-meta[Do not parse meta tags]' \
- '--meta-closes=-[What meta tags to look for to generate bug-closing changelog entries]' \
- '(--full --no-full)--full[Include the full commit message]' \
- '(--full --no-full)--no-full[Do not include the full commit message]' \
- '(--snapshot -S)'{-S,--snapshot}'[Create a snapshot release entry]' \
- '--snapshot-number=-[Python expression that gets eval()ed to the new snapshot number]' \
- '(--release -R)'{-R,--release}'[Remove any snapshot release banners]' \
- '(--new-version -N)'{-R,--release}'=[Specify changelog version]' \
- '--team[Create a team upload entry]' \
- '--bpo[Increment the release number for a backports upload]' \
- '--nmu[Increment the release number for a NMU upload]' \
- '--qa[Increment the release number for a QA upload]' \
- '--distribution=-[Set the distribution field]' \
- '--force-distribution[Force distribution]' \
- '--urgency=-[Set the upload urgency]' \
- '--git-log=-[Options passed to git log]' \
- '--id-length=-[Number of commit id digits to include]' \
- '--ignore-regex=-[Ignore matching commit lines]' \
- '--git-author[Use git name configuration for changelog signature]' \
- '(--multimaint-merge --no-multimaint-merge)--multimaint-merge[Merge commits by maintainer]' \
- '(--multimaint-merge --no-multimaint-merge)--multimaint-merge[Do not merge commits by maintainer]' \
- '--spawn-editor=[Spawn an editor]:when:(always snapshot release)' \
- '--commit-msg=[Commit message format string]' \
- '--commit[Commit the generated changelog]' \
- '*:Paths:_files -/'
-}
-
-_gbp-import-dsc() {
- __gbp_common_options
- __gbp_branch_options
- __gbp_tag_format_options
- __gbp_tag_sign_options
- _arguments \
- '--filter=-[Filter out files]' \
- '--download=-[Download the source package]' \
- '--allow-unauthenticated[Skip signature verification on downloads]' \
- '--allow-same-version[Import a package with the same debian version]' \
- '--author-is-committer[Use the author identity as committer identity]' \
- '--author-date-is-committer-date[Use author date as commit date]' \
- '*:package:_files -g "*.dsc"'
- # TODO: complete source package names
- # TODO: pass only one tarball/source package name
-}
-
-_gbp-import-dscs() {
- # same options
- _gbp-import_dsc
- _arguments \
- '--debsnap[Fetch snapshots from snapshots.debian.org]' \
- '--ignore-repo-config[Ignore options in gbp.conf]'
- # TODO: multiple dscs or one source package name + debsnap
-}
-
-_gbp-import-orig() {
- __gbp_common_options
- __gbp_branch_options
- __gbp_tag_format_options
- __gbp_tag_sign_options
- _arguments \
- '(--upstream-version -u)'{--upstream-version,-u}'=[The upstream version number]' \
- '--merge[Merge the upstream branch into the debian branch]' \
- '--upstream-vcs-tag=-[Add a tag as an additional parent to the upstream tarball commit]' \
- '--import-msg=-[Commit message format string]' \
- '--filter=-[Filter out files]' \
- '--filter-pristine-tar[When filtering also filter out of pristine-tar tarballs]' \
- '(--symlink-orig --no-symlink-orig)--symlink-orig=[Create a symlink with a debian-compliant name]' \
- '(--symlink-orig --no-symlink-orig)--no-symlink-orig=[Do not create a symlink with a debian-compliant name]' \
- '--postimport=-[Run a command after import]' \
- '--uscan[Use uscan to fetch the new upstream version]' \
- '*:file:_files'
-
- # TODO: pass only one tarball
- # TODO: Do not complete files when uscan option is enabled
-}
-
-_gbp-pq() {
- __gbp_common_options
- _arguments \
- '(--patch-numbers --no-patch-numbers)--patch-numbers[Add numbers to patch files]' \
- '(--patch-numbers --no-patch-numbers)--no-patch-numbers[Do not add numbers to patch files]' \
- '--topic=-[Topic to use when importing a single patch]' \
- '--time-machine=-[Go back N commits trying to apply patch queue]'
-
- local -a pqcommands
- pqcommands=(
- 'import:Create a patch queue branch'
- 'export:Export the patches on the patch-queue branch'
- 'rebase:Rebase the patch-queue branch against the current branch'
- 'drop:Drop the patch queue'
- 'apply:Add a single patch to the patch-queue'
- 'switch:Switch to the patch-queue branch if on the base branch and viceversa'
- )
- # TODO: only display these commands once
- _describe -t pqcommands gbp-pq pqcommands
-}
-
-_gbp-pull() {
- __gbp_common_options
- __gbp_branch_options
- _arguments \
- '--force[Update even non fast-forward]' \
- '--redo-pq[Rebuild the patch queue]' \
- '--ignore-branch[Dont care if on a detached state]' \
- '--depth=-[Depth for deepening shallow clones]'
-}
-
-_gbp "$@"
-
-
-
-__gbp_common_options() {
- local prefix="$1"
- # these can't be prefixed
- _arguments '--help[Show help]' \
- '--version[Show version information]'
-
- _arguments "--${prefix}verbose[Verbose execution]" \
- "--${prefix}color=-[Use colored output]:color:(on auto off)"
-
-}
-
-__gbp_branch_options() {
- local prefix="$1"
- _arguments \
- "--${prefix}debian-branch=-[The branch the Debian package is being developed on]" \
- "--${prefix}upstream-branch=-[The branch the upstream sources are put onto]" \
- "--${prefix}pristine-tar[Track pristine tar branch]"
-}
-
-__gbp_tag_format_options() {
- local prefix="$1"
- _arguments \
- "--${prefix}debian-tag=-[format string for debian tags]" \
- "--${prefix}upstream-tag=-[format string for upstream tags]"
-}
-
-__gbp_tag_sign_options() {
- local prefix="$1"
- _arguments \
- "(--${prefix}sign-tags --${prefix}no-sign-tags)--${prefix}sign-tags[GPG sign all generated tags]" \
- "(--${prefix}sign-tags --${prefix}no-sign-tags)--${prefix}no-sign-tags[Do not GPG sign generated tags]" \
- "--${prefix}keyid=-[GPG keyid to sign tags with]:GPG key:"
-}
-
-_gbp() {
- local curcontext="$curcontext" state line
- typeset -A opt_args
- _arguments -C \
- ':command:->command' \
- '*::options:->options' \
-
- case $state in
- (command)
- #breaks if defined outside the func
- local -a subcommands
- subcommands=(
- 'buildpackage:Build a Debian package'
- 'clone:Clone a Git repository from a remote and set up the necessary branch tracking.'
- 'create-remote-repo:Create a remote Git repository'
- 'dch:Generate the debian/changelog from Git commit history'
- 'import-dsc:Import a single Debian source package'
- 'import-dscs:Import multiple Debian source packages'
- 'import-orig:Import a new upstream tarball'
- 'pq:Manage debian/patches using Git rebase'
- 'pull:Update a Git repository from a remote'
- )
-
- _describe -t commands gbp subcommands
- ;;
- (options)
- local funcname
- funcname=_gbp-$line[1]
- if type $funcname | grep -q "shell function" ; then
- $funcname
- fi
- ;;
- esac
-}
-
-_gbp-buildpackage() {
- __gbp_common_options git-
- __gbp_branch_options git-
- __gbp_tag_format_options git-
- __gbp_tag_sign_options git-
- _arguments \
- '--git-ignore-new[build with uncommited changes in the source tree]' \
- '--git-no-ignore-new[negates --git-ignore-new]' \
- '--git-tag[create a tag after a successful build]' \
- '--git-tag-only[do not build, only tag and run the posttag hook]' \
- '--git-retag[do not fail if the tag already exists]' \
- '--git-force-create[force creation of orig.tar.gz]' \
- '--git-no-create-orig[do not create orig.tar.gz]' \
- '--git-tarball-dir=-[location to look for external tarballs]:tarball directory:_files -/' \
- '--git-compression=-[compression type]:compression:(auto gzip bzip2 lzma xz)' \
- '--git-compression-level=-[set compression level]:level:(1 2 3 4 5 6 7 8 9)' \
- '--git-ignore-branch[build although debian-branch != current branch]' \
- '--git-no-ignore-branch[negates --git-ignore-branch]' \
- '--git-builder=-[command to build the Debian package]:command:' \
- '--git-cleaner=-[command to clean the working copy]:command:' \
- '--git-prebuild=-[command to run before a build]:command:' \
- '--git-postbuild=-[hook run after a successful build]:command:' \
- '--git-posttag=-[hook run after a successful tag operation]:command:' \
- '--git-pbuilder[invoke git-pbuilder for building]' \
- '--git-no-pbuilder[negates --git-pbuilder]' \
- '--git-dist=-[build for this distribution when using git-pbuilder]:distribution:' \
- '--git-arch=-[build for this architecture when using git-pbuilder]:architecture:' \
- '--git-export-dir=-[before building the package export the source into this directory]:directory:_files -/' \
- '--git-export=-[export treeish object instead of HEAD]:treeish:' \
- '--git-dont-purge[retain exported package build directory]' \
- '--git-overlay[extract orig tarball when using export-dir option]' \
- '--git-no-overlay[negates --git-overlay]' \
- '--git-notify=-[Send a desktop notification after build]:notify:(on auto off)' \
- '*:Other options:_dpkg-buildpackage'
-}
-
-_gbp-clone() {
- __gbp_common_options
- __gbp_branch_options
- _arguments \
- '--all[Track all branches, not only debian and upstream]'
-}
-
-_gbp-create-remote-repo() {
- __gbp_common_options
- _arguments \
- '--remote-url-pattern=-[Where to create remote repository]' \
- '--remote-name=-[What name git will use when refering to that repository]' \
- '--template-dir=-[Template dir to pass to git init]' \
- '--remote-config=-[Name of config file section to specify params]' \
- '(--track --no-track)--track[Set up branch tracking]' \
- '(--track --no-track)--no-track[Do not set up branch tracking]'
-
-}
-
-_gbp-dch () {
- __gbp_common_options
- __gbp_branch_options
- __gbp_tag_format_options
-
- _arguments \
- '--git-ignore-branch[build although debian-branch != current branch]' \
- '--since=-[Start point for reading commits]:commitish:' \
- '--auto[Guess the last commit documented in the changelog]' \
- '(--meta --no-meta)--meta[Parse meta tags]' \
- '(--meta --no-meta)--no-meta[Do not parse meta tags]' \
- '--meta-closes=-[What meta tags to look for to generate bug-closing changelog entries]' \
- '(--full --no-full)--full[Include the full commit message]' \
- '(--full --no-full)--no-full[Do not include the full commit message]' \
- '(--snapshot -S)'{-S,--snapshot}'[Create a snapshot release entry]' \
- '--snapshot-number=-[Python expression that gets eval()ed to the new snapshot number]' \
- '(--release -R)'{-R,--release}'[Remove any snapshot release banners]' \
- '(--new-version -N)'{-R,--release}'=[Specify changelog version]' \
- '--team[Create a team upload entry]' \
- '--bpo[Increment the release number for a backports upload]' \
- '--nmu[Increment the release number for a NMU upload]' \
- '--qa[Increment the release number for a QA upload]' \
- '--distribution=-[Set the distribution field]' \
- '--force-distribution[Force distribution]' \
- '--urgency=-[Set the upload urgency]' \
- '--git-log=-[Options passed to git log]' \
- '--id-length=-[Number of commit id digits to include]' \
- '--ignore-regex=-[Ignore matching commit lines]' \
- '--git-author[Use git name configuration for changelog signature]' \
- '(--multimaint-merge --no-multimaint-merge)--multimaint-merge[Merge commits by maintainer]' \
- '(--multimaint-merge --no-multimaint-merge)--multimaint-merge[Do not merge commits by maintainer]' \
- '--spawn-editor=[Spawn an editor]:when:(always snapshot release)' \
- '--commit-msg=[Commit message format string]' \
- '--commit[Commit the generated changelog]' \
- '*:Paths:_files -/'
-}
-
-_gbp-import-dsc() {
- __gbp_common_options
- __gbp_branch_options
- __gbp_tag_format_options
- __gbp_tag_sign_options
- _arguments \
- '--filter=-[Filter out files]' \
- '--download=-[Download the source package]' \
- '--allow-unauthenticated[Skip signature verification on downloads]' \
- '--allow-same-version[Import a package with the same debian version]' \
- '--author-is-committer[Use the author identity as committer identity]' \
- '--author-date-is-committer-date[Use author date as commit date]' \
- '*:package:_files -g "*.dsc"'
- # TODO: complete source package names
- # TODO: pass only one tarball/source package name
-}
-
-_gbp-import-dscs() {
- # same options
- _gbp-import_dsc
- _arguments \
- '--debsnap[Fetch snapshots from snapshots.debian.org]' \
- '--ignore-repo-config[Ignore options in gbp.conf]'
- # TODO: multiple dscs or one source package name + debsnap
-}
-
-_gbp-import-orig() {
- __gbp_common_options
- __gbp_branch_options
- __gbp_tag_format_options
- __gbp_tag_sign_options
- _arguments \
- '(--upstream-version -u)'{--upstream-version,-u}'=[The upstream version number]' \
- '--merge[Merge the upstream branch into the debian branch]' \
- '--upstream-vcs-tag=-[Add a tag as an additional parent to the upstream tarball commit]' \
- '--import-msg=-[Commit message format string]' \
- '--filter=-[Filter out files]' \
- '--filter-pristine-tar[When filtering also filter out of pristine-tar tarballs]' \
- '(--symlink-orig --no-symlink-orig)--symlink-orig=[Create a symlink with a debian-compliant name]' \
- '(--symlink-orig --no-symlink-orig)--no-symlink-orig=[Do not create a symlink with a debian-compliant name]' \
- '--postimport=-[Run a command after import]' \
- '--uscan[Use uscan to fetch the new upstream version]' \
- '*:file:_files'
-
- # TODO: pass only one tarball
- # TODO: Do not complete files when uscan option is enabled
-}
-
-_gbp-pq() {
- __gbp_common_options
- _arguments \
- '(--patch-numbers --no-patch-numbers)--patch-numbers[Add numbers to patch files]' \
- '(--patch-numbers --no-patch-numbers)--no-patch-numbers[Do not add numbers to patch files]' \
- '--topic=-[Topic to use when importing a single patch]' \
- '--time-machine=-[Go back N commits trying to apply patch queue]'
-
- local -a pqcommands
- pqcommands=(
- 'import:Create a patch queue branch'
- 'export:Export the patches on the patch-queue branch'
- 'rebase:Rebase the patch-queue branch against the current branch'
- 'drop:Drop the patch queue'
- 'apply:Add a single patch to the patch-queue'
- 'switch:Switch to the patch-queue branch if on the base branch and viceversa'
- )
- # TODO: only display these commands once
- _describe -t pqcommands gbp-pq pqcommands
-}
-
-_gbp-pull() {
- __gbp_common_options
- __gbp_branch_options
- _arguments \
- '--force[Update even non fast-forward]' \
- '--redo-pq[Rebuild the patch queue]' \
- '--ignore-branch[Dont care if on a detached state]' \
- '--depth=-[Depth for deepening shallow clones]'
-}
-
-_gbp "$@"
+++ /dev/null
-/usr/share/doc/git-buildpackage/manual-html/gbp.html /usr/share/doc/git-buildpackage/manual-html/index.html
-# As long as we keep the old aliases
-/usr/share/man/man1/gbp-import-orig.1.gz /usr/share/man/man1/git-import-orig.1.gz
-/usr/share/man/man1/gbp-buildpackage.1.gz /usr/share/man/man1/git-buildpackage.1.gz
-/usr/share/man/man1/gbp-import-dsc.1.gz /usr/share/man/man1/git-import-dsc.1.gz
-/usr/share/man/man1/gbp-import-dscs.1.gz /usr/share/man/man1/git-import-dscs.1.gz
-/usr/share/man/man1/gbp-dch.1.gz /usr/share/man/man1/git-dch.1.gz
+++ /dev/null
-debian/tmp/usr/lib/python3.*/dist-packages/gbp/deb/__pycache__
-debian/tmp/usr/lib/python3.*/dist-packages/gbp/git/__pycache__
-debian/tmp/usr/lib/python3.*/dist-packages/gbp/pkg/__pycache__
-debian/tmp/usr/lib/python3.*/dist-packages/gbp/__pycache__
-debian/tmp/usr/lib/python3.*/dist-packages/gbp/rpm/__pycache__
-debian/tmp/usr/lib/python3.*/dist-packages/gbp/scripts/common/__pycache__
-debian/tmp/usr/lib/python3.*/dist-packages/gbp/scripts/__pycache__
+++ /dev/null
-#!/usr/bin/make -f
-
-# HACK: disable checks, i.e. unit tests
-DEB_BUILD_OPTIONS += nocheck
-export WITHOUT_NOSETESTS := 1
-
-EXAMPLE_SCRIPTS=\
- gbp-add-patch \
- gbp-cowbuilder-sid \
- gbp-posttag-push \
- gbp-configure-unpatched-source \
- wrap_cl.py
-
-DEB_COMPRESS_EXCLUDE=$(EXAMPLE_SCRIPTS)
-
-ZSH_COMPDIR = /usr/share/zsh/vendor-completions/
-
-PYCHECKER_ARGS=-boptparse --no-override --no-shadowbuiltin
-
-%:
- dh $@ --with python3 --buildsystem=pybuild
-
-override_dh_auto_test:
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
- dh_auto_test
- export GIT_AUTHOR_NAME="Gbp Tests"; \
- export GIT_AUTHOR_EMAIL=tests@example.com; \
- export GIT_COMMITTER_NAME=$$GIT_AUTHOR_NAME; \
- export GIT_COMMITTER_EMAIL=$$GIT_AUTHOR_EMAIL; \
- PYTHONPATH=. \
- python3 setup.py nosetests
-
-else
- @echo "Checks disabled via DEB_BUILD_OPTIONS"
-endif
-
-override_dh_auto_build:
- dh_auto_build
- make -C docs
-
-override_dh_auto_install:
- dh_auto_install
- dh_bash-completion
- mkdir -p debian/git-buildpackage/$(ZSH_COMPDIR)
- install -m644 debian/git-buildpackage.zsh-completion \
- debian/git-buildpackage/$(ZSH_COMPDIR)/_gbp
-
-override_dh_auto_clean:
- dh_auto_clean
- # Remove renamed files - renames are not correctly expressed in debian.diff
- rm -f debian/doc-base
- rm -f debian/docs
- rm -f debian/examples
- rm -f debian/manpages
- rm -rf build/
- make -C docs/ clean
- -rm gbp/version.py
-
-override_dh_compress:
- dh_compress --exclude=usr/share/doc/git-buildpackage/examples/
-
+++ /dev/null
-extend-diff-ignore = "^(tests/test_rpm_data/.*|tests/component/rpm/data/.*|tests/component/deb/data/.*)"
-diff-ignore
--- /dev/null
+-r requirements.txt
+
+coverage>=2.85
+flake8==3.5.0
+nose==1.3.7
+nosexcover>=1.0.7
MAN1S = \
gbp \
gbp-buildpackage \
- gbp-buildpackage-rpm \
gbp-clone \
gbp-config \
gbp-create-remote-repo \
gbp-dch \
+ gbp-export-orig \
gbp-import-dsc \
gbp-import-dscs \
gbp-import-orig \
- gbp-import-orig-rpm \
- gbp-import-srpm \
+ gbp-import-ref \
gbp-pq \
- gbp-pq-rpm \
+ gbp-pristine-tar \
gbp-pull \
+ gbp-push \
+ gbp-setup-gitattributes \
+ gbp-tag \
+ gbp-buildpackage-rpm \
+ gbp-import-srpm \
+ gbp-pq-rpm \
gbp-rpm-ch \
$(NULL)
-MAN5S = gbp.conf
+MAN5S = \
+ gbp.conf \
+ $(NULL)
MANUAL=manual-html
-SGML_MANPAGES=$(patsubst %,%.1,$(MAN1S)) $(patsubst %,%.5,$(MAN5S))
+XML_MANPAGES=$(patsubst %,%.1,$(MAN1S)) $(patsubst %,%.5,$(MAN5S))
POD_MANPAGES=git-pbuilder.1
-MANPAGES=$(SGML_MANPAGES) $(POD_MANPAGES)
+MANPAGES=$(XML_MANPAGES) $(POD_MANPAGES)
VERSION_ENT=version.ent
GBP_VERSION=../gbp/version.py
-DEB_VERSION=$(shell sed -ne 's/^gbp_version="\([.a-z0-9~-]\+\)"/\1/p' $(GBP_VERSION))
+DEB_VERSION=$(shell sed -ne 's/^gbp_version\s\+=\s\+"\([.a-z0-9~-]\+\)"/\1/p' $(GBP_VERSION))
CHANGELOG=../debian/changelog
+MAN_DATE=$(shell dpkg-parsechangelog -l ../debian/changelog -SDate | TZ=UTC LC_ALL=C date -f- +'%d %B %Y')
+IMAGES=$(wildcard images/*png)
+DEST_IMAGES=$(subst images/,$(MANUAL)/images/,$(IMAGES))
-# Stuff to build docs outside Debian
-HAVE_SGML2X ?= 1
-GTK_DOC_CATALOG_FILE ?= /usr/share/sgml/gtk-doc/gtk-doc.cat
-
-all: $(MANUAL) $(MANPAGES)
+# Select python
+ifneq ($(strip $(shell which python3)),)
+ PYTHON=python3
+else
+ PYTHON=python
+endif
-$(MANUAL): main.sgml manual.sgml manual-rpm.sgml chapters/*.sgml manpages/*.sgml
-ifeq ($(HAVE_SGML2X),1)
- docbook-2-html -s local $<
- rm -rf $(MANUAL)
- mv main-html $(MANUAL)
+# Select docbook-to-man tool
+ifneq ($(strip $(shell which docbook2x-man)),)
+ DOCBOOK_TO_MAN=docbook2x-man
+else ifneq ($(strip $(shell which docbook-to-man)),)
+ DOCBOOK_TO_MAN=docbook-to-man
+else ifneq ($(strip $(shell which docbook2man)),)
+ DOCBOOK_TO_MAN=docbook2man
else
- docbook2html -d local-nosgml2x.dsl -c $(GTK_DOC_CATALOG_FILE) -o $(MANUAL) $<
+ $(error Unable to find usable docbook to man conversion tool)
endif
- cp /usr/share/gtk-doc/data/*.png $(MANUAL)
-# We build manpages under 'buildxref/' just to get an updated cross-reference
-# file (manpage.refs), before building the final manpages
-BUILD_MAN_XREF_PAGES=$(patsubst %,buildxref/%,$(SGML_MANPAGES))
+all: manual $(MANPAGES)
+
+manual: $(MANUAL)/index.html $(DEST_IMAGES) css
+
+$(MANUAL)/index.html: manual.xml chapters/*.xml manpages/*.xml common.ent $(VERSION_ENT)
+ mkdir -p $(MANUAL)
+ xsltproc -o $(MANUAL)/ /usr/share/gtk-doc/data/gtk-doc.xsl $<
+ cp /usr/share/gtk-doc/data/*.png \
+ /usr/share/gtk-doc/data/*.css \
+ $(MANUAL)
+
+$(MANUAL)/gbp.pdf: manual.xml chapters/*.xml manpages/*.xml common.ent $(VERSION_ENT)
+ xsltproc -o $(MANUAL)/ /usr/share/gtk-doc/data/gtk-doc.xsl $<
-buildxref/%.1 buildxref/%.5: man.%.sgml manpages/%.sgml
- docbook2man -o buildxref $<
+css: $(MANUAL)/gbp.css $(MANUAL)/gbp.svg
+$(MANUAL)/gbp.css $(MANUAL)/gbp.svg: gbp.css gbp.svg
+ cp gbp.css gbp.svg $(MANUAL)/
-manpage.refs: $(BUILD_MAN_XREF_PAGES)
- cp buildxref/$@ $@
+html_images: $(DEST_IMAGES)
+$(MANUAL)/images/%.png: images/%.png
+ mkdir -p $(basename $@)
+ install $< $@
-%.1 %.5: manpage.refs
- docbook2man -o . man.$*.sgml
+%.1 %.5: man.gbp.xml manpages/%.xml
+ $(DOCBOOK_TO_MAN) -o . $<
git-pbuilder.1: ../bin/git-pbuilder
pod2man $< $@
-main.sgml: $(VERSION_ENT)
+manual.xml: $(VERSION_ENT)
+
+$(GBP_VERSION): ../debian/changelog
+ cd .. && $(PYTHON) setup.py build --help >/dev/null
$(VERSION_ENT): $(GBP_VERSION)
echo '<!ENTITY gbp-version "$(DEB_VERSION)">' > $(VERSION_ENT)
clean:
- -rm -r manual-html/
- -rm *.1 *.5 manpage.* $(VERSION_ENT)
- -rm -r buildxref
+ -rm -r $(MANUAL)
+ -rm *.1 *.5 $(VERSION_ENT)
+
+po4a:
+ po4a -v -f po/po4a.cfg
+
+langs: po4a
+ $(MAKE) -C _gen/de -f ../../Makefile.lang
--- /dev/null
+MANUAL = manual-html
+
+ENTS = \
+ manpages/manpages.ent \
+ manpages/man.common-options.ent \
+ chapters/chapters.ent \
+ version.ent \
+ common.ent \
+ $(NULL)
+
+all: $(MANUAL)/index.html
+
+manpages/manpages.ent: ../../manpages/manpages.ent
+ cp -f $< $@
+
+manpages/man.common-options.ent: ../../manpages/man.common-options.ent
+ cp -f $< $@
+
+chapters/chapters.ent: ../../chapters/chapters.ent
+ cp -f $< $@
+
+version.ent: ../../version.ent
+ cp -f $< $@
+
+common.ent: ../../common.ent
+ cp -f $< $@
+
+$(MANUAL)/index.html: manual.xml chapters/*.xml manpages/*.xml $(ENTS)
+ mkdir -p $(MANUAL)
+ xsltproc -o $(MANUAL)/ /usr/share/gtk-doc/data/gtk-doc.xsl $<
+ cp /usr/share/gtk-doc/data/*.png \
+ /usr/share/gtk-doc/data/*.css \
+ $(MANUAL)
+++ /dev/null
-<chapter id="gbp.rpm.building">
- <title>Building RPM packages from the &git; repository</title>
- <para>
- The &gbp-buildpackage-rpm; tool is used for building.
- The tool creates the source tarball and copies it and the packaging files
- to a separate build directory and builds the package there. By default,
- &rpmbuild; is used as the builder command. You can define a different
- builder command with the <option>--git-builder</option> option.
- </para>
-
- <para>
- To build the (non-native) package when on <emphasis>packaging-branch</>,
- using pristine-tar to create upstream tarball:
- <screen>
- $ &gbp-buildpackage-rpm; --pristine-tar
- </screen>
- During development, if you have unclean git tree (untracked files and/or
- uncommitted changes) you may use:
- <screen>
- $ &gbp-buildpackage-rpm; --git-ignore-untracked
- </screen>
- or:
- <screen>
- $ &gbp-buildpackage-rpm; --git-ignore-new
- </screen>
- </para>
-
- <para>
- Git-buildpackage-rpm always builds in a separate build directory
- (<emphasis>./rpmbuild/</emphasis> by default). You may change that and also
- build a different revision that your current branch HEAD. The revision can
- be any git "commit-ish", i.e. branch or tag name or a commit sha1.
- Git-buildpackage also supports some "special revisions", i.e.
- <emphasis>INDEX</> refer to the current index,
- <emphasis>WC</> or <emphasis>WC.IGNORED</> refer to the current working
- copy with all (even untracked and ignored) files,
- <emphasis>WC.TRACKED</> refers to the current working copy of the files
- tracked by git,
- <emphasis>WC.UNTRACKED</> refers to the current working copy of all files
- excluding ignore files.
- Some examples:
- <screen>
- $ &gbp-buildpackage-rpm; --git-export-dir=/home/user/rpmbuild
- $ &gbp-buildpackage-rpm; --git-export-dir=/home/user/rpmbuild --git-export=v1.2.3
- $ &gbp-buildpackage-rpm; --git-export=WC.UNTRACKED
- $ &gbp-buildpackage-rpm; --git-export=INDEX
- $ &gbp-buildpackage-rpm; --git-export=feature/cool-new-thing
- $ &gbp-buildpackage-rpm; --git-export=8d55173610f
- </screen>
- </para>
-
- <sect1 id="gbp.rpm.building.patch-generation">
- <title>Automatic patch generation</title>
- <para>
- When developing a non-native package with packaging and sources
- in the same branch
- (see <xref linkend="gbp.rpm.development.models.nonnative1">)
- you usually want for &gbp-buildpackage-rpm; to automatically generate
- patches. In this mode, &gbp-buildpackage-rpm; generates the upstream
- tarball and copies packaging files to the build dir. After that it
- generates patches from commits between <option>upstream</> and the
- revision to be built, and, updates the spec file accordingly.
- Git-buildpackage-rpm also have some options to alter the patch
- generation. Build package with patch generation:
- <screen>
- $ &gbp-buildpackage-rpm; --git-patch-export
- </screen>
- Ignore changes to packaging/ directory and compress patches larger
- than 100 kilobytes:
- <screen>
- $ &gbp-buildpackage-rpm; --git-patch-export --git-patch-export-compress=100k --git-patch-export-ignore-path='^packaging/.*'
- </screen>
- </para>
- </sect1>
-
- <sect1 id="gbp.rpm.building.patch-queue">
- <title>Working with separate development branch</title>
- <para>
- When developing a non-native package with packaging data and source
- code in separate branches
- (see <xref linkend="gbp.rpm.development.models.nonnative2">)
- you use the &gbp-pq-rpm; tool to handle the patches. You work on the
- source code on the development branch and then <emphasis>export</>
- the patches to the packaging branch when building the RPM package.
- </para>
-
- <para>
- Create a <emphasis>development</> (or <emphasis>patch-queue</>) branch
- by applying the patches in current packaging branch on top of the
- upstream version. This will create a new branch, e.g.
- <emphasis>development/master</> assuming your current branch is
- <emphasis>master</>. Simply:
- <screen>
- $ &gbp-pq-rpm; import
- </screen>
- Now you can develop normally on the development branch (add, remove,
- rebase, amend commits). Just make sure you stay based on the correct
- upstream version, if doing git-rebase. After you're happy with your
- changes and you're ready to build an RPM package, you have to
- <emphasis>export</> the patches with &gbp-pq-rpm;. This will change
- back to you packaging branch, generate patches from commits between
- between <emphasis>upstream</> and the HEAD of the development branch
- and update the spec file with the new patches:
- <screen>
- $ &gbp-pq-rpm; export
- </screen>
- Commit the changes to packaging branch, and build. For example:
- <screen>
- $ <command>git add</> *patch *spec
- $ <command>git commit</> -a
- $ &gbp-buildpackage-rpm;
- </screen>
- Of course you can build even without committing by using the
- <option>--git-export=WC.UNTRACKED</> option of &gbp-buildpackage-rpm;.
- </para>
-
- <para>
- Moving to a new upstream version is basically simple. Assuming you
- have imported/pulled new upstream version to your git-tree, just:
- <screen>
- $ <command>git checkout</> master
- # Edit the spec file and change the 'Version:' tag to new upstream version
- $ <command>vim</> *spec
- $ <command>git commit</> *spec
- $ &gbp-pq-rpm; rebase
- </screen>
- However, if the patches do not apply cleanly, you have to manually
- apply and resolve the patches.
- </para>
- </sect1>
-
-</chapter>
+++ /dev/null
-<chapter id="gbp.building">
- <title>Building packages from the &git; repository</title>
- <para>
- In order to build a &debian; package from the &git; repository you use:
- &gbp-buildpackage;. This builds the upstream tarball as will be described below and
- invokes &debuild; to build the package. To use another build command you
- can use the <option>--git-builder</option> option as described later in the manual
- but &debuild; is nice since it can invoke <productname>lintian</productname>.
- During the development phase (when you're either not on the
- <emphasis>debian-branch</emphasis> or when you have uncommitted changes in
- your repository) you'll usually use:
- </para>
-<screen>
-&gbp-buildpackage; <option>--git-ignore-new</option>
-</screen>
- <para>If &gbp-buildpackage; doesn't find a valid upstream tarball it will
- create one by looking at the tag matching the upstream version. To change
- this behaviour see the <option>--git-upstream-tree</option> option.
- </para><para>
- If you want to recreate the original tarball using the additional
- information from the <option>pristine-tar branch</option> you have to
- specify the <option>--git-pristine-tar</option> option. This will make sure
- the upstream tarball matches exactly the one imported. Using this option is
- the recommended way of recreating the upstream tarball.
- </para>
- <para>Once you're satisfied with the build and want to do a release you commit all
- your changes and issue:</para>
-<screen>
-&gbp-buildpackage; <option>--git-tag</option>
-</screen>
- <para>This will again build the debian package and tag the final result after
- extracting the current version from the changelog. If you want &gpg; signed
- tags you can use the <option>--git-sign</option> and
- <option>--git-keyid</option> options. To save typing these option can be
- specified via the configuration files. You can futhermore change the tag
- format used when creating tags with the <option>debian-tag</option>
- option, the default is <replaceable>debian/<version></replaceable>.</para>
- <sect1 id="gbp.building.export">
- <title>Using a separate build dir</title>
- <para>Tools like &svn-buildpackage; use a separate build-area. To achieve a similar behaviour
- with &gbp-buildpackage; use the <option>--git-export-dir</option> option:</para>
-<screen>
-&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area/</replaceable>
-</screen>
- <para>This will export the head of the ecurrent branch to
- <replaceable>../build-area/package-version</replaceable>, build the
- package. If you don't want to export the current branch head you can use
- <option>--git-export</option> to export any treeish object, here are some
- examples:</para>
-<screen>
-&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>debian/0.4.3</replaceable>
-&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>etch</replaceable>
-&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>8caed309653d69b7ab440e3d35abc090eb4c6697</replaceable>
-&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>INDEX</replaceable>
-&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>WC</replaceable>
-</screen>
- <para>The special argument <replaceable>INDEX</replaceable> exports the
- state of the current index which can be used to include staged but uncommitted
- changes in the build. Whereas the special argument
- <replaceable>WC</replaceable> exports the current working copy as is.</para>
- <para>If you want to default to build in a separate build area you can
- specify the directory to use in the gbp.conf.
-<programlisting>
-[git-buildpackage]
-# use a build area relative to the git repository
-export-dir=../build-area
-# to use the same build area for all packages use an absolute path:
-#export-dir=/home/debian-packages/build-area
-</programlisting>
- &gbp-buildpackage; will cleanup the build-area after a successful build. If
- you want to keep the build tree use <replaceable>--git-no-purge</replaceable>.
- </para>
- </sect1>
- <sect1 id="gbp.building.hooks">
- <title>Invoking external programs</title>
- <para>
- Besides the commands for cleaning the package build dir
- (<option>cleaner</option>) and building the package
- (<option>builder</option>) you can also invoke hooks during the package
- build: immediately before a build (<option>prebuild</option>),
- after a successful build (<option>postbuild</option>) and after
- creating a tag (<option>posttag</option>). Typical applications are running
- <productname>lintian</productname> or pushing changes into a remote
- repository.
- </para>
- <sect2 id="gbp.building.lintian">
- <title>Running lintian</title>
- <para>&gbp-buildpackage; exports several variables into the
- <option>posttag</option>'s environment (for details see the <xref
- linkend="man.gbp.buildpackage">).
- To invoke &lintian; we need to tell it where to find the changes file:
-<programlisting>
-<command>git-buildpackage</command> <option>--git-postbuild</option>=<replaceable>'lintian $GBP_CHANGES_FILE'</replaceable>
-</programlisting>
- To call &lintian; automatically after each successful build add:
-<programlisting>
-<option>postbuild</option>=<replaceable>lintian $GBP_CHANGES_FILE</replaceable>
-</programlisting>
- to your <filename>.gbp.conf</filename>.
- </para>
- </sect2>
- <sect2 id="gbp.building.push">
- <title>Pushing into a remote repository</title>
- <para>If you want to push your changes automatically after a successful build and tag
- you can use &gbp-buildpackage;'s posttag hook. A very simple invocation would look like this:
-<programlisting>
-<command>git-buildpackage</command> <option>--git-tag</option> <option>--git-posttag</option>=<replaceable>"git push && git push --tags"</replaceable>
-</programlisting>
- This assumes you have set up a remote repository to push to in
- <filename>.git/config</filename>.</para>
-
- <para>Usually you want to make sure you don't push out any
- unrelated changes into the remote repository. This is handled by the
- following hook which only pushes out the created tag to where you pulled
- from and also forwards the corresponding remote branch to that position:
-<programlisting>
-#!/bin/sh -e
-#
-# gbp-posttag-push: post tag hook to push out the newly created tag and to
-# forward the remote branch to that position
-
-if ! REMOTE=$(git config --get branch."${GBP_BRANCH}".remote); then
- REMOTE=origin
-fi
-
-if [ "$GBP_TAG" ]; then
- echo "Pushing $GBP_TAG to $REMOTE"
- git push "$REMOTE" "$GBP_TAG"
-else
- echo "GBP_TAG not set."
- exit 1
-fi
-
-if [ "$GBP_SHA1" ] && [ "$GBP_BRANCH" ]; then
- git push "$REMOTE" "$GBP_SHA1":"$GBP_BRANCH"
-else
- echo "GBP_SHA1 or GBP_BRANCH not set."
- exit 1
-fi
-echo "done."
-</programlisting>
- <envar>GBP_TAG</envar>, <envar>GBP_SHA1</envar>
- and <envar>GBP_BRANCH</envar> are passed to the hook via the
- environment. To call this hook automatically upon tag creation add:
-<programlisting>
-<option>posttag</option>=<replaceable>"gbp-posttag-push"</replaceable>
-</programlisting>
- to your <filename>.gbp.conf</filename> and make sure <filename>gbp-push</filename>
- is somewhere in your <envar>$PATH</envar>. On Debian
- systems a more complete example can be found in
- <filename>/usr/share/doc/examples/git-buildpackage/examples/gbp-posttag-push</filename>.
- </para>
- </sect2>
- <sect2 id="gbp.building.postexport">
- <title>Running postexport hook</title>
- <para>&gbp-buildpackage; exports several variables into the
- <option>postexport</option>'s environment (for details see
- the <xref linkend="man.gbp.buildpackage">). The motivation
- for the postexport action is to allow further adjustment of
- the sources prior to building the package. A typical use case
- scenario is to allow creating multiple source and binary
- packages from one Debian branch - e.g. the bootstrap gcc and
- in the next stage the full gcc.
- </para>
- <para> The postexport action, postpones the creation of the
- upstream tarball, so that the metadata for creating it is
- already present in the exported source tree. The example
- postexport script below (crosstoolchain-expand.sh) expands
- changelog, lintian override files, rules and control files
- according to an environment variable 'PKG_FLAVOR'.
- </para>
-
- <para>Sample gbp.conf - enables source tree export by specifying
- the export directory:
- </para>
-<programlisting>
-[git-buildpackage]
-# use a build area relative to the git repository
-export-dir = ../build-area
-# disable the since the sources are being exported first
-cleaner =
-# post export script that handles expansion of Debian specific files
-postexport = crosstoolchain-expand.sh
-</programlisting>
-
-
-<para>Sample postexport script: crosstoolchain-expand.sh</para>
-<programlisting>
-#!/bin/sh
-#
-# Purpose: this script is intended for creating multiple source and
-# binary Debian packages from one source tree. It can be used in
-# conjunction with git-buildpackage that support a postexport hook
-#
-# A typical use is preparing a bootstrap gcc package that is needed
-# for building newlib and then preparing a full gcc package from the
-# same source tree. The user may specify the package flavor via
-# PKG_FLAVOR environmental variable.
-#
-#
-# The script expands/processes the following files:
-#
-# - changelog.tmpl is converted to standard Debian changelog
-#
-#
-# - all binary package lintian override template files are expanded
-# and renamed to the requested package flavor
-#
-# - source package lintian override template file is expanded and
-# renamed
-#
-# - rules.$PKG_FLAVOR and control.$PKG_FLAVOR are renamed to rules and
-# control resp.
-
-
-# the template string has been carefully chosen, so that
-# e.g. changelogs that refer to the source package can still be
-# processed by dch/git-dch resp.
-TMPL_STR=-XXXXXX
-
-# by default replace string for the template is empty
-REPLACE_STR=
-
-if [ -n "$PKG_FLAVOR" ]; then
- REPLACE_STR=-$PKG_FLAVOR
-fi
-
-REPLACE_EXPR="s/$TMPL_STR/$REPLACE_STR/g"
-
-
-# actual processing of relevant files
-cd debian
-
-# expand the template changelog
-# remove the symlinked version
-rm changelog
-chglog_tmpl=changelog.tmpl
-[ -f "$chglog_tmpl" ] || {
- echo "Missing changelog template (debian/$chglog_tmpl)"
- exit 1
-}
-cat changelog.tmpl | sed -e "$REPLACE_EXPR" > changelog
-rm changelog.tmpl
-
-# process binary package lintian overrides - each override must match
-# its package name
-for f in *.lintian-overrides.tmpl; do
- outfile=${f%.tmpl}
- [ -f "$f" ] || {
- echo "Missing lintian override files for binary packages"
- exit 1
- }
- cat $f | sed -e "$REPLACE_EXPR" > ${outfile/$TMPL_STR/$REPLACE_STR}
- rm $f
-done
-
-# process the only source package lintian override
-source_lintian=source/lintian-overrides.tmpl
-cat $source_lintian | sed -e "$REPLACE_EXPR" > ${source_lintian%.tmpl}
-rm $source_lintian
-
-# rules and control file are package flavor specific
-[ -f rules.$PKG_FLAVOR ] && mv rules.$PKG_FLAVOR rules
-[ -f control.$PKG_FLAVOR ] && mv control.$PKG_FLAVOR control
-rm -f rules.* control.*
-
-exit 0
-</programlisting>
- </sect2>
- </sect1>
- <sect1 id="gbp.building.patch">
- <title>Working with patches</title>
- <para>
- You can use &gbp-pq; to handle patches. See
- <ulink url="https://honk.sigxcpu.org/piki/development/debian_packages_in_git/"></ulink>
- for an example workflow.
- </para>
- <para>
- In order to avoid a patched (unclean) source tree after the build you
- can use &dpkg-source;'s <option>unapply-patches</option> option and
- tell &git; to ignore the <filename>.pc</filename> directory.
- <filename>/usr/share/doc/git-buildpackage/examples/gbp-configure-unpatched-source</filename>
- sets up these two files for you.
- </para>
- </sect1>
-</chapter>
--- /dev/null
+<chapter id="gbp.building">
+ <title>Building Packages from the &git; Repository</title>
+ <para>
+ In order to build a &debian; package from the &git; repository, you use:
+ &gbp-buildpackage;. This builds the upstream tarball (as will be described below) and
+ invokes &debuild; to build the package. To use another build command, you
+ can use the <option>--git-builder</option> option as described later in the manual,
+ but &debuild; is nice since it can invoke <productname>lintian</productname>.
+ During the development phase (when you're either not on the
+ <emphasis>debian-branch</emphasis> or when you have uncommitted changes in
+ your repository), you'll usually use:
+ </para>
+<programlisting>
+&gbp-buildpackage; <option>--git-ignore-new</option>
+</programlisting>
+ <para>If &gbp-buildpackage; doesn't find a valid upstream tarball, it will
+ create one by looking at the tag matching the upstream version. To change
+ this behaviour, see the <option>--git-upstream-tree</option> option.
+ </para><para>
+ If you want to recreate the original tarball using the additional
+ information from the <option>pristine-tar branch</option>, you have to
+ specify the <option>--git-pristine-tar</option> option. This will make sure
+ the upstream tarball matches exactly the one imported. Using this option is
+ the recommended way of recreating the upstream tarball.
+ </para>
+ <para>Once you're satisfied with the build and want to do a release, you commit all
+ your changes and issue:</para>
+<programlisting>
+&gbp-buildpackage; <option>--git-tag</option>
+</programlisting>
+ <para>This will again build the &debian; package and tag the final result after
+ extracting the current version from the changelog. If you want &gpg;-signed
+ tags, you can use the <option>--git-sign</option> and
+ <option>--git-keyid</option> options. To save typing, these option can be
+ specified via the configuration files. You can furthermore change the tag
+ format used when creating tags with the <option>debian-tag</option>
+ option; the default is <replaceable>debian/<version></replaceable>.</para>
+ <sect1 id="gbp.building.export">
+ <title>Using a separate build dir</title>
+ <para>Tools like &svn-buildpackage; use a separate build-area. To achieve a similar behaviour
+ with &gbp-buildpackage;, use the <option>--git-export-dir</option> option:</para>
+<programlisting>
+&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area/</replaceable>
+</programlisting>
+ <para>This will export the head of the current branch to
+ <replaceable>../build-area/package-version</replaceable> and build the
+ package. If you don't want to export the current branch head, you can use
+ <option>--git-export</option> to export any treeish object. Here are some
+ examples:</para>
+<programlisting>
+&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>debian/0.4.3</replaceable>
+&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>etch</replaceable>
+&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>8caed309653d69b7ab440e3d35abc090eb4c6697</replaceable>
+&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>INDEX</replaceable>
+&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>WC</replaceable>
+</programlisting>
+ <para>The special argument <replaceable>INDEX</replaceable> exports the
+ state of the current index, which can be used to include staged but uncommitted
+ changes in the build. Whereas the special argument
+ <replaceable>WC</replaceable> exports the current working copy as is.</para>
+ <para>If you want to default to build in a separate build area, you can
+ specify the directory to use in the <filename>gbp.conf</filename> file.
+<programlisting>
+[buildpackage]
+# use a build area relative to the git repository
+export-dir=../build-area
+# to use the same build area for all packages use an absolute path:
+#export-dir=/home/debian-packages/build-area
+</programlisting>
+ &gbp-buildpackage; will cleanup the build-area after a successful build. If
+ you want to keep the build tree, use <replaceable>--git-no-purge</replaceable>.
+ </para>
+ </sect1>
+ <sect1 id="gbp.building.hooks">
+ <title>Invoking external programs</title>
+ <para>
+ Besides the commands for cleaning the package build dir
+ (<option>cleaner</option>) and building the package
+ (<option>builder</option>), you can also invoke hooks during the package
+ build: immediately before a build (<option>prebuild</option>),
+ after a successful build (<option>postbuild</option>), and after
+ creating a tag (<option>posttag</option>). Typical applications are running
+ <productname>lintian</productname> or pushing changes into a remote
+ repository.
+ </para>
+ <sect2 id="gbp.building.lintian">
+ <title>Running lintian</title>
+ <para>&gbp-buildpackage; exports several variables into the
+ <option>posttag</option>'s environment (for details see the <xref
+ linkend="man.gbp.buildpackage"/> manual page).
+ To invoke &lintian;, we need to tell it where to find the changes file:
+<programlisting>
+&gbp-buildpackage; <option>--git-postbuild</option>=<replaceable>'lintian $GBP_CHANGES_FILE'</replaceable>
+</programlisting>
+ To call &lintian; automatically after each successful build, add:
+<programlisting>
+<option>postbuild</option>=<replaceable>lintian $GBP_CHANGES_FILE</replaceable>
+</programlisting>
+ to your <filename>.gbp.conf</filename>.
+ </para>
+ </sect2>
+ <sect2 id="gbp.building.push">
+ <title>Pushing into a remote repository</title>
+ <para>If you want to push your changes automatically after a successful build and tag,
+ you can use &gbp-buildpackage;'s posttag hook. A very simple invocation would look like this:
+<programlisting>
+&gbp-buildpackage; <option>--git-tag</option> <option>--git-posttag</option>=<replaceable>"git push && git push --tags"</replaceable>
+</programlisting>
+ This assumes you have set up a remote repository to push to in
+ <filename>.git/config</filename>.</para>
+
+ <para>Usually, you want to make sure you don't push out any
+ unrelated changes into the remote repository. This is handled by the
+ following hook which only pushes out the created tag to where you pulled
+ from and also forwards the corresponding remote branch to that position:
+<programlisting>
+#!/bin/sh -e
+#
+# gbp-posttag-push: post tag hook to push out the newly created tag and to
+# forward the remote branch to that position
+
+if ! REMOTE=$(git config --get branch."${GBP_BRANCH}".remote); then
+ REMOTE=origin
+fi
+
+if [ "$GBP_TAG" ]; then
+ echo "Pushing $GBP_TAG to $REMOTE"
+ git push "$REMOTE" "$GBP_TAG"
+else
+ echo "GBP_TAG not set."
+ exit 1
+fi
+
+if [ "$GBP_SHA1" ] && [ "$GBP_BRANCH" ]; then
+ git push "$REMOTE" "$GBP_SHA1":"$GBP_BRANCH"
+else
+ echo "GBP_SHA1 or GBP_BRANCH not set."
+ exit 1
+fi
+echo "done."
+</programlisting>
+ <envar>GBP_TAG</envar>, <envar>GBP_SHA1</envar>
+ and <envar>GBP_BRANCH</envar> are passed to the hook via the
+ environment. To call this hook automatically upon tag creation, add:
+<programlisting>
+<option>posttag</option>=<replaceable>"gbp-posttag-push"</replaceable>
+</programlisting>
+ to your <filename>.gbp.conf</filename> and make sure <filename>gbp-push</filename>
+ is somewhere in your <envar>$PATH</envar>. On &debian;
+ systems, a more complete example can be found in
+ <filename>/usr/share/doc/examples/git-buildpackage/examples/gbp-posttag-push</filename>.
+ </para>
+ </sect2>
+ <sect2 id="gbp.building.postexport">
+ <title>Running postexport hook</title>
+ <para>&gbp-buildpackage; exports several variables into the
+ <option>postexport</option>'s environment (for details see
+ the <xref linkend="man.gbp.buildpackage"/> manual page). The motivation
+ for the postexport action is to allow further adjustment of
+ the sources prior to building the package. A typical use case
+ scenario is to allow creating multiple source and binary
+ packages from one &debian; branch, e.g. the bootstrap gcc and
+ in the next stage the full gcc.
+ </para>
+ <para>The postexport action postpones the creation of the
+ upstream tarball, so that the metadata for creating it is
+ already present in the exported source tree. The example
+ postexport script below (<filename>crosstoolchain-expand.sh</filename>)
+ expands changelog, lintian override files, rules and control files
+ according to an environment variable <envar>PKG_FLAVOR</envar>.
+ </para>
+
+ <para>Sample <filename>gbp.conf</filename> - enables source tree export
+ by specifying the export directory:
+ </para>
+<programlisting>
+[buildpackage]
+# use a build area relative to the git repository
+export-dir = ../build-area
+# disable the since the sources are being exported first
+cleaner =
+# post export script that handles expansion of &debian; specific files
+postexport = crosstoolchain-expand.sh
+</programlisting>
+
+
+<para>Sample postexport script: <filename>crosstoolchain-expand.sh</filename></para>
+<programlisting>
+#!/bin/sh
+#
+# Purpose: this script is intended for creating multiple source and
+# binary Debian packages from one source tree. It can be used in
+# conjunction with git-buildpackage that support a postexport hook
+#
+# A typical use is preparing a bootstrap gcc package that is needed
+# for building newlib and then preparing a full gcc package from the
+# same source tree. The user may specify the package flavor via
+# PKG_FLAVOR environmental variable.
+#
+#
+# The script expands/processes the following files:
+#
+# - changelog.tmpl is converted to standard Debian changelog
+#
+#
+# - all binary package lintian override template files are expanded
+# and renamed to the requested package flavor
+#
+# - source package lintian override template file is expanded and
+# renamed
+#
+# - rules.$PKG_FLAVOR and control.$PKG_FLAVOR are renamed to rules and
+# control resp.
+
+
+# the template string has been carefully chosen, so that
+# e.g. changelogs that refer to the source package can still be
+# processed by dch/git-dch resp.
+TMPL_STR=-XXXXXX
+
+# by default replace string for the template is empty
+REPLACE_STR=
+
+if [ -n "$PKG_FLAVOR" ]; then
+ REPLACE_STR=-$PKG_FLAVOR
+fi
+
+REPLACE_EXPR="s/$TMPL_STR/$REPLACE_STR/g"
+
+
+# actual processing of relevant files
+cd debian
+
+# expand the template changelog
+# remove the symlinked version
+rm changelog
+chglog_tmpl=changelog.tmpl
+[ -f "$chglog_tmpl" ] || {
+ echo "Missing changelog template (debian/$chglog_tmpl)"
+ exit 1
+}
+cat changelog.tmpl | sed -e "$REPLACE_EXPR" > changelog
+rm changelog.tmpl
+
+# process binary package lintian overrides - each override must match
+# its package name
+for f in *.lintian-overrides.tmpl; do
+ outfile=${f%.tmpl}
+ [ -f "$f" ] || {
+ echo "Missing lintian override files for binary packages"
+ exit 1
+ }
+ cat $f | sed -e "$REPLACE_EXPR" > ${outfile/$TMPL_STR/$REPLACE_STR}
+ rm $f
+done
+
+# process the only source package lintian override
+source_lintian=source/lintian-overrides.tmpl
+cat $source_lintian | sed -e "$REPLACE_EXPR" > ${source_lintian%.tmpl}
+rm $source_lintian
+
+# rules and control file are package flavor specific
+[ -f rules.$PKG_FLAVOR ] && mv rules.$PKG_FLAVOR rules
+[ -f control.$PKG_FLAVOR ] && mv control.$PKG_FLAVOR control
+rm -f rules.* control.*
+
+exit 0
+</programlisting>
+ </sect2>
+ <sect2 id="gbp.building.preexport">
+ <title>Running preexport hook</title>
+ <para>&gbp-buildpackage; exports several variables into the
+ <option>preexport</option>'s environment (for details see
+ the <xref linkend="man.gbp.buildpackage"/> manual page). The motivation
+ for the preexport action is to allow further actions before preparing and
+ exporting the orig tarballs to the build directory.
+ A usecase could be having the orig tarballs in a separate repository due to
+ very large binary assets, that need to be checked out to the correct branch
+ before creating the tarballs.
+ </para>
+ </sect2>
+ </sect1>
+</chapter>
+++ /dev/null
-<chapter id="gbp.cfgfile">
- <title>Configuration files</title>
- <para>The configuration files are parsed in this order:
- <variablelist>
- <varlistentry>
- <term>/etc/git-buildpackage/gbp.conf</term>
- <listitem><para>system wide configuraton</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>~/.gbp.conf</term>
- <listitem><para>per user configuration</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>.gbp.conf</term>
- <listitem><para>per repository/branch configuration (deprecated)</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>debian/gbp.conf</term>
- <listitem><para>per repository/branch configuration</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>.git/gbp.conf</term>
- <listitem><para>per (local) repository configuration</para></listitem>
- </varlistentry>
- </variablelist>
- All have the same format. They consist of several sections, all of them are optional:
- <variablelist>
- <varlistentry>
- <term>[DEFAULT]</term>
- <listitem><para>Options in this section apply to &gbp-buildpackage;,
- &gbp-import-orig;, &gbp-import-dsc; and &gbp-dch;.</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>[buildpackage]</term>
- <listitem><para>Options in this section apply to &gbp-buildpackage; only and override options from the
- [DEFAULT] section.</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>[import-orig]</term>
- <listitem><para>Options in this section apply to &gbp-import-orig; only and override options from the
- [DEFAULT] section.</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>[import-dsc]</term>
- <listitem><para>Options in this section apply to &gbp-import-dsc; only and override options from the
- [DEFAULT] section.</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>[dch]</term>
- <listitem><para>Options in this section apply to &gbp-dch; only and override options from the
- [DEFAULT] section.</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>...</term>
- <listitem><para>Same for the other &gbp; commands</para></listitem>
- </varlistentry>
- </variablelist>
- The actual options in these sections are the command line options without
- the '--' prefix. So <option>--upstream-branch=</option><replaceable>dfsgfree</replaceable> would read:
- </para>
-<screen>
-<option>upstream-branch</option>=<replaceable>dfsgfree</replaceable>
-</screen>
-<para>
- in the config file. In the special case of &gbp-buildpackage; the stripped
- prefix is not '--' but '--git-'. Here's a more complete example:
-</para>
-<programlisting>
-[DEFAULT]
-# the default build command
-builder=debuild -i\.git -I.git
-# the default branch for upstream sources
-upstream-branch=upstream
-# the default branch for the debian patch
-debian-branch=master
-
-[buildpackage]
-upstream-branch=dfsgclean
-# Sign tags with GPG:
-sign-tags = True
-# Keyid to sign tags with
-#keyid = 0xdeadbeef
-
-[import-orig]
-upstream-branch=notdfsgclean
-
-[import-dsc]
-upstream-branch=notdfsgclean
-
-[dch]
-git-log=--no-merges
-</programlisting>
-<para>
-For more details see the <xref linkend="man.gbp.conf"> manual page.
-</para>
-</chapter>
--- /dev/null
+<chapter id="gbp.cfgfile">
+ <title>Configuration Files</title>
+ <para>The configuration files are parsed in this order:
+ <variablelist>
+ <varlistentry>
+ <term>/etc/git-buildpackage/gbp.conf</term>
+ <listitem><para>system wide configuration</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>~/.gbp.conf</term>
+ <listitem><para>per user configuration</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>.gbp.conf</term>
+ <listitem><para>per repository/branch configuration (deprecated)</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>debian/gbp.conf</term>
+ <listitem><para>per repository/branch configuration</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>.git/gbp.conf</term>
+ <listitem><para>per (local) repository configuration</para></listitem>
+ </varlistentry>
+ </variablelist>
+ All have the same format. They consist of several sections, all of them are optional:
+ <variablelist>
+ <varlistentry>
+ <term>[DEFAULT]</term>
+ <listitem>
+ <para>Options in this section apply to all &gbp; commands.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>[buildpackage]</term>
+ <listitem><para>Options in this section apply to &gbp-buildpackage; only and override options from the
+ [DEFAULT] section.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>[import-orig]</term>
+ <listitem><para>Options in this section apply to &gbp-import-orig; only and override options from the
+ [DEFAULT] section.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>[import-dsc]</term>
+ <listitem><para>Options in this section apply to &gbp-import-dsc; only and override options from the
+ [DEFAULT] section.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>[dch]</term>
+ <listitem><para>Options in this section apply to &gbp-dch; only and override options from the
+ [DEFAULT] section.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>...</term>
+ <listitem><para>Same for the other &gbp; commands</para></listitem>
+ </varlistentry>
+ </variablelist>
+ The actual options in these sections are the command line options without
+ the '--' prefix. So <option>--upstream-branch=</option><replaceable>dfsgfree</replaceable> would read:
+ </para>
+ <screen>
+ <option>upstream-branch</option>=<replaceable>dfsgfree</replaceable>
+ </screen>
+ <para>
+ in the config file. In the special case of &gbp-buildpackage;, the stripped
+ prefix is not '--' but '--git-'. Here's a more complete example:
+ </para>
+ <programlisting>
+ [DEFAULT]
+ # the default build command
+ builder=debuild -i\.git -I.git
+ # the default branch for upstream sources
+ upstream-branch=upstream
+ # the default branch for the debian patch
+ debian-branch=master
+
+ [buildpackage]
+ upstream-branch=dfsgclean
+ # Sign tags with GPG:
+ sign-tags = True
+ # Keyid to sign tags with
+ #keyid = 0xdeadbeef
+
+ [import-orig]
+ upstream-branch=notdfsgclean
+
+ [import-dsc]
+ upstream-branch=notdfsgclean
+
+ [dch]
+ git-log=--no-merges
+ </programlisting>
+ <para>
+ For more details, see the <xref linkend="man.gbp.conf"/> manual page.
+ </para>
+
+ <sect1 id="gbp.cfgfile.order">
+ <title>Overriding Parsing Order</title>
+ <para>
+ The environment variable <envar>GBP_CONF_FILES</envar> can be
+ used to override the order in which configuration files are
+ parsed. The following example parses two configuration files in the
+ users home directory (<filename>~/.gbp.conf</filename> and
+ <filename>~/.gbp.late.conf</filename>) and in the debian
+ directory (<filename>debian/gbp.conf</filename>).
+ The file are parsed from left to right. Since <filename>
+ ~/.gbp.late.conf</filename> is at the very end of the list it
+ can be used to override configuration entries shipped by the
+ package. This can be useful if packages set
+ e.g. <option>export-dir</option> or
+ <option>tarball-dir</option> and you perfer different locations:
+ <programlisting>
+ $ cat <<EOF >~/.gbp.late.conf
+ [DEFAULT]
+ export-dir = ../build-area
+ tarball-dir = ../tarballs
+ EOF
+
+ $ export GBP_CONF_FILES=~/.gbp.conf:debian/gbp.conf:~/.gbp.late.conf
+ $ cd <mypkg>
+ $ gbp config buildpackage.export-dir
+ ../build-area
+ </programlisting>
+ </para>
+ <para>
+ If you want all configuration files to be skipped, set
+ <envar>GBP_CONF_FILES</envar> to a non existing location. This way
+ only default values and options from the command line will be used:
+ <programlisting>
+ $ export GBP_CONFI_FILES=/does/not/exist
+ $ gbp config buildpackage.debian-branch
+ master
+ </programlisting>
+ </para>
+ </sect1>
+</chapter>
+++ /dev/null
-<!ENTITY ch.intro-rpm SYSTEM "intro-rpm.sgml">
-<!ENTITY ch.development-rpm SYSTEM "development-rpm.sgml">
-<!ENTITY ch.building-rpm SYSTEM "building-rpm.sgml">
-<!ENTITY ch.intro SYSTEM "intro.sgml">
-<!ENTITY ch.workflow SYSTEM "workflow.sgml">
-<!ENTITY ch.import SYSTEM "import.sgml">
-<!ENTITY ch.building SYSTEM "building.sgml">
-<!ENTITY ch.releases SYSTEM "releases.sgml">
-<!ENTITY ch.cfgfile SYSTEM "cfgfile.sgml">
-<!ENTITY ch.special SYSTEM "special.sgml">
+<!ENTITY ch.intro SYSTEM "intro.xml">
+<!ENTITY ch.workflow SYSTEM "workflow.xml">
+<!ENTITY ch.import SYSTEM "import.xml">
+<!ENTITY ch.building SYSTEM "building.xml">
+<!ENTITY ch.patches SYSTEM "patches.xml">
+<!ENTITY ch.releases SYSTEM "releases.xml">
+<!ENTITY ch.cfgfile SYSTEM "cfgfile.xml">
+<!ENTITY ch.special SYSTEM "special.xml">
+++ /dev/null
-<chapter id="gbp.rpm.development">
- <title>Development flow</title>
-
- <sect1 id="gbp.rpm.development.models">
- <title>Development models</title>
- <para>
- The &gbp-buildpackage-rpm; toolset basically supports three different
- models of package maintenance.
- </para>
-
- <sect2 id="gbp.rpm.development.models.native"
- xreflabel="Native package">
- <title>Native package</title>
- <para>
- This means that you are the upstream, there is no separate
- upstream with which you have to sync. Basically, only
- <option>packaging-branch</> is used - it contains both the source
- code and packaging files. No patches should be present as all
- changes can be directly committed to upstream (which is you).
- When building, &gbp-buildpackage-rpm; will create the source
- tarball and copy it and the packaging to the build directory.
- </para>
- </sect2>
-
- <sect2 id="gbp.rpm.development.models.nonnative1"
- xreflabel="Non-native package, model 1">
- <title>Upstream package, alternative 1: packaging and sources in
- the same branch</title>
- <para>
- This represents somewhat Debian-style package maintenance.
- All changes (packaging and source code) are done to the same
- branch, i.e., the <option>packaging-branch</>, based on the
- <option>upstream-branch</>. When package is built,
- &gbp-buildpackage-rpm; can automatically generate patches from
- upstream version to packaging branch head (one patch per commit).
- and modify the spec file accordingly.
- </para>
- </sect2>
-
- <sect2 id="gbp.rpm.development.models.nonnative2"
- xreflabel="Non-native package, model 2">
- <title>Upstream package, alternative 2: packaging and sources in
- separate branches</title>
- <para>
- In this model packaging files (spec and patches) are held in
- <option>packaging-branch</> and upstream sources in
- <option>upstream-branch</>.
- Your code development is done on the <option>patch-queue-branch</>,
- based on the <option>upstream-branch</>, which only contains source
- code but no packaging files. When building the package,
- &gbp-pq-rpm; tool is used to export patches from the patch queue
- branch to the packaging branch and edit the spec file accordingly.
- Finally, &gbp-buildpackage-rpm; will create the upstream source
- tarball and export it and the packaging files to the build
- directory, and, build the RPM package.
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="gbp.rpm.development.scratch">
- <title>Starting from scratch with a non-native package</title>
- <para>
- In this case, you most probably want to package software not yet
- found in your distro. First, create an empty repository:
- <screen>
- $ <command>mkdir</> mypackage
- $ <command>cd</> mypackage
- $ <command>git init</>
- </screen>
- Then, import the upstream sources, create the packaging/development
- branch and add the rpm packaging files. You have two choices:
- </para>
-
- <orderedlist>
- <listitem><para>
- packaging files and development sources in the same branch
- <screen>
- $ <command>git-import-orig-rpm</> ../mypackage.tar.gz
- # Optionally (recommended): add gbp.conf
- $ <command>vim</> .gbp.conf && <command>git add</> .gbp.conf && <command>git commit</> -m"Add gbp.conf"
- # Add packaging files to source tree under subdir 'packaging'
- $ <command>mkdir</> packaging && <command>cd</> packaging
- $ <command>vim</> mypackage.spec
- $ <command>git add</> .
- $ <command>git commit</> -m"Add packaging files"
- </screen></para>
- </listitem>
-
- <listitem><para>
- development sources and packaging files in separate branches
- <screen>
- $ <command>git-import-orig-rpm</> --no-merge ../mypackage.tar.gz
- # Optionally (recommended): add gbp.conf
- $ <command>vim</> .gbp.conf && <command>git add</> .gbp.conf && <command>git commit</> -m"Add gbp.conf"
- # Add packaging files (to root of master branch)
- $ <command>vim</> mypackage.spec
- $ <command>git add </> .
- $ <command>git commit</> -m"Add packaging files"
- </screen></para>
- </listitem>
- </orderedlist>
- </sect1>
-
- <sect1 id="gbp.rpm.development.convert">
- <title>Converting an existing git repository of a non-native package</>
- <para>
- In this case, you already have a git repository containing the
- upstream source, but it was created neither with &gbp-clone; nor
- &gbp-import-srpm;.
- You need to have a separate branch for upstream sources.
- If you already have that, you can simply rename that branch to the
- default upstream-branch:
- <screen>
- $ <command>git branch</> -m my-old-upstream-branch upstream
- </screen>
- OR just add the name of your upstream branch to gbp.conf.
- Then, you just create a packaging/development branch(es) with git and
- add packaging files to the packaging branch. If you want to maintain
- sources and packaging in the same branch
- (<xref linkend="gbp.rpm.development.models.nonnative1">)
- do something like:
- <screen>
- $ <command>git checkout</> -b master upstream
- # Optionally (recommended): add gbp.conf
- $ <command>vim</> .gbp.conf && <command>git add</> .gbp.conf && <command>git commit</> -m"Add gbp.conf"
- # Add packaging files to source tree, add and commit the packaging files
- # ...
- </screen>
- If you want to maintain development sources and packaging in separate
- branches
- (<xref linkend="gbp.rpm.development.models.nonnative2">):
- <screen>
- $ <command>git checkout</> --orphan master
- $ <command>rm</> .git/index
- $ <command>git commit</> --allow-empty -m"Create packaging branch"
- # Optionally (recommended): add gbp.conf
- $ <command>vim</> .gbp.conf && <command>git add</> .gbp.conf && <command>git commit</> -m"Add gbp.conf"
- # Next, add and commit the packaging files (.spec etc)
- $ <command>vim</> mypackage.spec && <command>git add</> mypackage.spec && <command>git commit</> -m"Add packaging files"
- # Now, you can create the development branch (and import possible patches)
- $ &gbp-pq-rpm; import
- </screen>
- </para>
- </sect1>
-</chapter>
-
+++ /dev/null
-<chapter id="gbp.import">
- <title>Importing Sources</title>
-
- <sect1 id="gbp.import.existing">
- <title>Importing already existing &debian; packages</title>
- <para>Importing an already exsting debian package into a git repository is as easy as:
- <screen>
-&gbp-import-dsc; package_0.1-1.dsc
- </screen>
- This will create a new git repository named after the imported package, put
- the upstream sources onto the <option>upstream-branch</option> and the
- debian patch on the <option>debian-branch</option>. In case of a debian
- native package only the <option>debian-branch</option> is being used.
- You can specify alternative branch names via the
- <option>--upstream-branch</option> and <option>--debian-branch</option>
- options or via the <option>upstream-branch</option> and
- <option>debian-branch</option> options in the configuration file.
- </para>
- <para>
- If you want to be able to exactly recreate the original tarball
- (orig.tar.gz) from &git; you should also specify the
- <option>--pristine-tar</option> option. This is recommended.
- </para>
- <para>
- If you want to import further versions you can change into your shiny new
- &git; repository and just continue with the same command:
- <screen>
-cd package/
-&gbp-import-dsc; package_0.1-2.dsc
-&gbp-import-dsc; package_0.1-3.dsc
-&gbp-import-dsc; package_0.2-1.dsc
- </screen>
- </para>
- <para>
-Or you can import all versions at once using &gbp-import-dscs;:
- <screen>
-&gbp-import-dscs; /path/to/history/package_*.dsc
- </screen>
-This will create a &git; repository if necessary and import all versions sorted
-by version number.
- </para>
- </sect1>
-
- <sect1 id="gbp.import.new.upstream">
- <title>Importing a new upstream version</title>
- <para>Change into your git repository (which can be empty), make sure it
- has all local modifications committed and run either of:
- <screen>
-&gbp-import-orig; <filename>/path/to/package_0.2.orig.tar.gz</filename>
-&gbp-import-orig; <filename>/path/to/package_0.2.tar.bz2</filename>
-&gbp-import-orig; <filename>/path/to/package-0.2/</filename>
- </screen>
- This puts the upstream souces onto the <option>upstream-branch</option> and
- tags them accordingly (the default tag format is
- <replaceable>upstream/%(version)s</replaceable>).
- The result is then merged onto the <option>debian-branch</option>
- and a new &debian; changelog entry is created. You can again specify
- different branch names via the <option>--upstream-branch</option> and
- <option>--debian-branch</option> options. You can also filter out content
- you don't want imported:
- <screen>
-&gbp-import-orig; <option>--filter</option>=<replaceable>'CVS/*'</replaceable> <filename>/path/to/package_0.2.orig.tar.gz</filename>
- </screen>
- The <option>--filter</option> option can be used multiple times for more
- complex filtering.
- </para>
- <para>
- If you expect a merge conflict you can delay the merge to the
- <option>debian-branch</option> via the <option>--no-merge</option> and pull in
- the changes from the <option>upstream-branch</option> later.
- </para>
- <para>
- If you want to be able to exactly recreate the original tarball
- (orig.tar.gz) from &git; you should also specify the
- <option>--pristine-tar</option> option. This is recommended.
- </para>
- <para>To customize the commit message used by &gbp-import-orig; use
- the <option>--import-msg</option> option. This string is a standard
- python format string, into which the
- <replaceable>version</replaceable> variable is interpolated. (i.e.,
- use <replaceable>%(version)s</replaceable> in your message to get
- the imported upstream version).
- </para>
- </sect1>
-
- <sect1 id="gbp.import.convert">
- <title>Converting an existing &git; repository</title>
- <para>
- If the &git; repository wasn't created with &gbp-import-dsc; you have to tell
- &gbp-buildpackage; and friends where to find the upstream sources.
- </para>
- <sect2>
- <title>Upstream sources on a branch</title>
- <para>
- If the upstream sources are already on a separate branch things are pretty
- simple. You can either rename that branch to the default
- <option>upstream-branch</option> name <emphasis>upstream</emphasis> with:
- <screen>
-&gitcmd; branch upstream theupstream-branch
-&gitcmd; branch <option>-D</option> theupstream-branch
- </screen>
- or you can tell &gbp-buildpackage; the name of the branch to use as
- <option>upstream-branch</option>:
- <screen>
-<command>cat</command> <<EOF > <filename>.git/gbp.conf</filename>
-[DEFAULT]
-# this is the upstream-branch:
-upstream-branch=theupstream-branch
-EOF
- </screen>
- If you then use &gbp-import-orig; to import new upstream sources, they will
- from now on end up on <emphasis>theupstream-branch</emphasis> and
- merged to the <option>debian-branch</option>.
- </para>
- </sect2>
- <sect2>
- <title>Upstream sources not on a branch</title>
- <para>
- If you don't have an upstream branch but started your repository with only
- the upstream sources (not the debian patch) you can simply branch from that
- point. So use &gitkcmd; or &gitcmd;-log to locate the commit-id of that commit
- and create the upstream branch from there, e.g.:
-<screen>
- COMMIT_ID=`&gitcmd; log --pretty=oneline | tail -1 | awk '{ print $1 }'`
- &gitcmd; branch upstream $COMMIT_ID
-</screen>
- The important thing here is that the <envar>COMMIT_ID</envar> specifies a
- point on the master branch that carried <emphasis>only</emphasis> the
- upstream sources and not the debian modifications. The above example
- assumes that this was the first commit to that repository.
- </para>
- <warning><para>There's currently no <emphasis>easy</emphasis> way to create the
- <option>upstream-branch</option> if you never had the upstream sources
- as a single commit. Using &gbp-import-orig; on such repositories might lead
- to unexpected merge results.</para></warning>
- <para>In order to fix this you can prepend the upstream sources as a
- single commit to your tree using &git;'s <ulink
- url="http://git.or.cz/gitwiki/GraftPoint">grafts</ulink>. Afterwards you
- can simply create a branch as explained above and &gbp-import-orig; will
- work as expected.</para>
- <para>Alternatively, if you are only importing source from original tarballs
- (for instance when converting from a Subversion repository where the
- mergeWithUpstream was set for svn-buildpackage), you can create an empty
- upstream branch with the following commands:
-<screen>
- <command>git checkout</command> <option>--orphan</option> <replaceable>upstream</replaceable>
- <command>git rm</command> <option>-rf</option> <replaceable>.</replaceable>
- <command>git commit</command> <option>--allow-empty</option> <option>-m</option> <replaceable>'Initial upstream branch.'</replaceable>
- <command>git checkout</command> <option>-f</option> <replaceable>master</replaceable>
-</screen>
- With Git versions lower than 1.7.2.3, the commands are slightly more complicated:
-<screen>
- <command>git symbolic-ref</command> <replaceable>HEAD</replaceable> <replaceable>refs/heads/upstream</replaceable>
- <command>git rm</command> <option>--cached</option> <option>-r</option> <replaceable>.</replaceable>
- <command>git commit</command> <option>--allow-empty</option> <option>-m</option> <replaceable>'Initial upstream branch.'</replaceable>
- <command>git checkout</command> <option>-f</option> <replaceable>master</replaceable>
-</screen>
- </para>
- </sect2>
- </sect1>
-
- <sect1 id="gbp.import.fromscratch">
- <title>Starting a Debian package from scratch</title>
- <para>
- So far we assumed you already have a &debian; package to start with but
- what if you want to start a new package? First create an empty repository:
- </para>
- <screen>
-<command>mkdir</command> package-0.1
-<command>cd</command> package-0.1
-<command>git init</command>
- </screen>
- <para>Then you import the upstream sources, branch off the
- <option>upstream-branch</option> branch and add the debian files (e.g. via dh_make):
- <screen>
-&gbp-import-orig; <option>-u</option> <replaceable>0.1</replaceable> <filename>../package-0.1.tar.gz</filename>
-<command>dh_make</command>
- </screen>
- That's it, you're done. If you want to publish you're new repository you can use &gbp-create-remote-repo;.
- </para>
- </sect1>
-
- <sect1 id="gbp.import.upstream-git">
- <title>When upstream uses GIT</title>
- <para>
- If upstream already uses git for packaging there are several ways to handle packaging. Two of them will
- be described in a bit detail here:
- </para>
-
- <sect2 id="gbp.import.upstream.git.notarball">
- <title>No upstream tarballs</title>
- <para>If upstream doesn't build upstream tarballs or you don't care about them the simplest
- way is to clone upstreams repository and create a separate packaging branch in there.
- </para>
-
- <para>
- In order to help &gbp-buildpackage; to find upstream tags you need to specify the format
- using the <option>--git-upstream-tag</option> comand line option or the the <option>upstream-tag</option>
- configuration variable.
- </para>
-
- <para>
- A common upstream format is to put a <replaceable>v</replaceable> in front of the version number.
- In this case the configuration option would look like:
- </para>
- <screen>
-[git-buildpackage]
-upstream-tag = v%(version)s
- </screen>
- <para>
- <replaceable>version</replaceable> will be replaced with the upstream version number as read from
- <filename>debian/changelog</filename>.
- </para>
- <para>If you're using &pristine-tar; you can make &gbp-buildpackage commit the generated tarball back to the
- pristine-tar branch by using the <option>--git-pristine-tar-commit</option> option. This will make sure
- others building your package can regenerate the tarball you generated for building the Debian pacakge.
- </para>
-
- <sect3>
- <title>Step by step</title>
- <para>To not make any assumptions about &gbp;'s configuration the following steps have all options given
- in its long versions on the command line . You can add these
- to &gbp.conf; to save lots of typing.
- </para>
-
- <para>First we clone the upstream repository. To avoid any dis ambiguities between the Debian packaging repository
- and the upstream repository we name the upstream repository <replaceable>ustream</replaceable> instead of the
- default <replaceable>origin</replaceable>.
- <screen>
- git clone --no-checkout -o upstream git://git.example.com/libgbp.git
- cd libgbp
- git checkout -b debian/sid v1.0
- </screen>
- The above makes sure we have <replaceable>debian/sid</replaceable> for the Debian packaging. We didn't create
- any <replaceable>upstream/*</replaceable> branches, they're not needed for the packaging and only need to be
- kept up to date. After adding the Debian packaging we build the package. This assumes you're using &pristine-tar;
- and upstream uses a version number format as described above:
- <screen>
- gbp buildpackage --git-pristine-tar --git-pristine-tar-commit --git-upstream-tag='v%(version)s' --git-debian-branch=debian/sid
- </screen>
- When updating to a new upstream version we simply fetch from upstream and merge in the new tag. Afterwards we
- update the changelog and build the package:
- <screen>
- git fetch upstream
- git merge v1.1
- gbp dch --debian-branch=debian/sid --snapshot --auto debian/
- gbp buildpackage --git-ignore-new --git-pristine-tar --git-pristine-tar-commit --git-upstream-tag='v%(version)s'
- </screen>
- Note that the above &gbp-dch; call makes sure we only pickup changes in the <filename>debian/</filename>
- directory. Since we told it to build a snapshot changelog entry and we didn't commit the changelog yet
- we need to tell &gbp-buildpackage; that the working directory is unclean via the <option>--git-ignore-new</option>.
- Once everything looks good commit the changelog and build a release version:
- <screen>
- gbp dch --release --auto --git-debian-branch=debian/sid
- git commit -m"Release 1.1-1" debian/changelog
- gbp buildpackage --git-upstream-tag='v%(version)s' --git-debian-branch=debian/sid
- </screen>
- If you want to share you're repository with others you can use &gbp-create-remote-repo; and &gbp-pull; as usual.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="gbp.import.upstream.git.tarball">
- <title>Upstream tarballs</title>
- <para>If you want to track upstream's git but continue to import the upstream tarballs,
- e.g. to make sure the tarball uploaded
- to &debian; has the same checksum as upstream's you can use the <option>--upstream-vcs-tag</option> option
- when importing new tarballs with &gbp-import-orig;. Assuming you have the upstream source in your
- repository with a tag <replaceable>v0.0.1</replaceable> you can use:
- <screen>
- &gbp-import-orig; --upstream-vcs-tag=v0.0.1 foo_0.0.1.orig.tar.gz
- </screen>
- to add upstream's tag as additional parent to the merge commit.
- See <ulink url="http://bugs.debian.org/664771">#664771</ulink> for more details.
- </para>
- </sect2>
-
- </sect1>
- <sect1 id="gbp.branch.naming">
- <title>Branch layout</title>
- <para>
- By default &gbp; uses one branch to keep the Debian packaging called <emphasis>master</emphasis>
- and a branch to keep the upstream packaging called <emphasis>upstream</emphasis>.
- </para>
- <para>
- This layout is simple to get started but fails short if one needs to maintain several versions of
- the package at the same time. Therefore the following layout is recommended:
- </para>
-
- <variablelist>
- <varlistentry>
- <term>
- debian/<release>
- </term>
- <listitem>
- <para>
- the Debian packaging for a release <emphasis>jessie</emphasis>,
- <emphasis>wheezy</emphasis>, <emphasis>sid</emphasis> or <emphasis>experimental</emphasis>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- upstream/<release>
- </term>
- <listitem>
- <para>
- the upstream sources for a release matching one of the above
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- security/<release>
- </term>
- <listitem>
- <para>
- security updates for a certain release
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- backports/<release>
- </term>
- <listitem>
- <para>
- backports to a certain release
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- dfsg/<release>
- </term>
- <listitem>
- <para>
- the dfsg clean upstream sources in case the cleanup is done via a &git;
- merge from upstream to this branch.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>
- In case &pristine-tar; is being used there will be a single <emphasis>pristine-tar</emphasis>
- branch that keeps all binary deltas.
- </para>
- </sect1>
-</chapter>
-
-<!-- LocalWords: tarballs
- -->
--- /dev/null
+<chapter id="gbp.import">
+ <title>Importing Sources</title>
+
+ <sect1 id="gbp.import.existing">
+ <title>Importing already existing &debian; packages</title>
+ <para>Importing an already existing &debian; package into a &git; repository is as easy as:
+<programlisting>
+ &gbp-import-dsc; package_0.1-1.dsc
+</programlisting>
+ This will create a new &git; repository named after the imported package, put
+ the upstream sources onto the <option>upstream-branch</option> and the
+ &debian; patch on the <option>debian-branch</option>. In case of a &debian;
+ native package, only the <option>debian-branch</option> is being used.
+ You can specify alternative branch names via the
+ <option>--upstream-branch</option> and <option>--debian-branch</option>
+ options, or via the <option>upstream-branch</option> and
+ <option>debian-branch</option> options in the configuration file.
+ </para>
+ <para>
+ If you want to be able to exactly recreate the original tarball
+ (orig.tar.gz) from &git;, you should also specify the
+ <option>--pristine-tar</option> option. This is recommended.
+ </para>
+ <para>
+ If you want to import further versions, you can change into your shiny new
+ &git; repository and just continue with the same command:
+<programlisting>
+ cd package/
+ &gbp-import-dsc; package_0.1-2.dsc
+ &gbp-import-dsc; package_0.1-3.dsc
+ &gbp-import-dsc; package_0.2-1.dsc
+</programlisting>
+ </para>
+ <para>
+Or you can import all versions at once using &gbp-import-dscs;:
+<programlisting>
+ &gbp-import-dscs; /path/to/history/package_*.dsc
+</programlisting>
+This will create a &git; repository if necessary and import all versions sorted
+by version number.
+ </para>
+ <para>You can also import all versions of a package known from the
+ <ulink url="http://snapshot.debian.org/">snapshot.debian.org</ulink> service
+ using the <option>--debsnap</option> option of &gbp-import-dscs;:
+<programlisting>
+ &gbp-import-dscs; --debsnap package
+</programlisting>
+ </para>
+ </sect1>
+
+ <sect1 id="gbp.import.new.upstream">
+ <title>Importing a new upstream version</title>
+ <para>Change into your &git; repository (which can be empty), make sure it
+ has all local modifications committed, and run either of:
+<programlisting>
+ &gbp-import-orig; <filename>/path/to/package_0.2.orig.tar.gz</filename>
+ &gbp-import-orig; <filename>/path/to/package_0.2.tar.bz2</filename>
+ &gbp-import-orig; <filename>/path/to/package-0.2/</filename>
+</programlisting>
+ This puts the upstream sources onto the <option>upstream-branch</option> and
+ tags them accordingly (the default tag format is
+ <replaceable>upstream/%(version)s</replaceable>).
+ </para>
+ <para>
+ The result is then placed onto
+ the <option>debian-branch</option>. The way this happens is
+ determined by the <option>--merge-mode</option> option. The
+ default mode <option>auto</option> replaces the upstream sources
+ while preserving the <filename>debian/</filename> directory for
+ 3.0 (quilt) packages. A &git; merge is used for all other source
+ format versions.
+ </para>
+ <para>
+ You can again specify different branch names via
+ the <option>--upstream-branch</option> and
+ <option>--debian-branch</option> options.
+ </para>
+ <para>If you are using <filename>debian/watch</filename> to keep
+ track of how to retrieve upstream sources, you can simply use
+ the <option>--uscan</option> option to download and import the
+ latest upstream version:
+<programlisting>
+ &gbp-import-orig; --uscan
+</programlisting>
+ </para>
+ <para>You can also filter out content
+ you don't want imported:
+<programlisting>
+ &gbp-import-orig; <option>--filter</option>=<replaceable>'CVS/*'</replaceable> <filename>/path/to/package_0.2.orig.tar.gz</filename>
+</programlisting>
+ The <option>--filter</option> option can be used multiple times for more
+ complex filtering.
+ </para>
+ <para>
+ If you expect a merge conflict, you can delay the merge to the
+ <option>debian-branch</option> via the <option>--no-merge</option> option and pull in
+ the changes from the <option>upstream-branch</option> later.
+ </para>
+ <para>
+ If you want to be able to exactly recreate the original tarball
+ (orig.tar.gz) from &git;, you should also specify the
+ <option>--pristine-tar</option> option. This is recommended.
+ </para>
+ <para>To customize the commit message used by &gbp-import-orig;, use
+ the <option>--import-msg</option> option. This string is a
+ &pyformat;, into which the
+ <replaceable>version</replaceable> variable is
+ interpolated. (i.e., use <replaceable>%(version)s</replaceable> in
+ your message to get the imported upstream version).
+ </para>
+
+ <sect2 id="gbp.import.error.recovery">
+ <title>Recovering from errors</title>
+ <para>In case of an error &gbp-import-orig; will by default
+ rollback (undo) all changes it has done to the repository so far:
+ </para>
+ <programlisting>
+ $ &gbp; import-orig --verbose --filter='CVS/*' --filter='.bzr/*' --filter='.hg/*' --filter='.svn/*' --upstream-version=1.9 ../gif2apng-1.9.tar.gz
+ gbp:info: Importing '../gif2apng-1.9.tar.gz' to branch 'upstream' (filtering out ["'CVS/*'", "'.bzr/*'", "'.hg/*'", "'.svn/*'"])...
+ gbp:info: Source package is gif2apng
+ gbp:info: Upstream version is 1.9
+ gbp:info: Merging to 'master'
+ gbp:error: Automatic merge failed.
+ gbp:error: Error detected, Will roll back changes.
+ gbp:info: Rolling back branch upstream by resetting it to a6733c1f1e190ac0ed4774abc3466e9986a6df5e
+ gbp:info: Rolling back branch pristine-tar by resetting it to 0ee24ac614c920e30af82d602882c2ee841c88e5
+ gbp:info: Rolling back tag upstream/1.9 by deleting it
+ gbp:info: Rolling back branch master by resetting it to ce99782336e83a56e8e579b3cdadf93b0c19e1a8
+ gbp:info: Rolling back failed merge of upstream/1.9
+ gbp:error: Rolled back changes after import error.
+ </programlisting>
+ <para>
+ In this case the import failed due to a merge conflict. Other
+ reasons are running out of disk space, problems when generating
+ the pristine-tar delta. If you don't want &gbp-import-orig; to
+ undo changes made to the repository use
+ the <option>--no-rollback</option>.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="gbp.import.convert">
+ <title>Converting an existing &git; repository</title>
+ <para>
+ If the &git; repository wasn't created with &gbp-import-dsc;, you have to
+ tell &gbp-buildpackage; and friends where to find the upstream sources.
+ </para>
+ <sect2 id="gbp.import.upstream.on.branch">
+ <title>Upstream sources on a branch</title>
+ <para>
+ If the upstream sources are already on a separate branch, things are pretty
+ simple. You can either rename that branch to the default
+ <option>upstream-branch</option> name <emphasis>upstream</emphasis> with:
+<programlisting>
+ &gitcmd; branch -m theupstream-branch upstream
+</programlisting>
+ or you can tell &gbp-buildpackage; the name of the branch to use as
+ <option>upstream-branch</option>:
+<programlisting>
+<command>cat</command> <<EOF > <filename>.git/gbp.conf</filename>
+[DEFAULT]
+# this is the upstream-branch:
+upstream-branch=theupstream-branch
+EOF
+</programlisting>
+ If you then use &gbp-import-orig; to import new upstream sources, they will
+ from now on end up on <emphasis>theupstream-branch</emphasis> and
+ merged to the <option>debian-branch</option>.
+ </para>
+ </sect2>
+ <sect2 id="gbp.import.upstream.not.on.branch">
+ <title>Upstream sources not on a branch</title>
+ <para>
+ If you don't have an upstream branch but started your repository with only
+ the upstream sources (not the &debian; patch), you can simply branch from that
+ point. So use &gitkcmd; or &gitcmd;-log to locate the commit-id of that commit
+ and create the upstream branch from there, e.g.:
+<programlisting>
+ &gitcmd; branch upstream $(&gitcmd; log --format='%H' | tail -1)
+</programlisting>
+ The important thing here is that the <envar>COMMIT_ID</envar> specifies a
+ point on the master branch that carried <emphasis>only</emphasis> the
+ upstream sources and not the &debian; modifications. The above example
+ assumes that this was the first commit to that repository.
+ </para>
+ <warning><para>There's currently no <emphasis>easy</emphasis> way to create the
+ <option>upstream-branch</option> if you never had the upstream sources
+ as a single commit. Using &gbp-import-orig; on such repositories might lead
+ to unexpected merge results.</para></warning>
+ <para>In order to fix this you can prepend the upstream sources as a
+ single commit to your tree using &git;'s <ulink
+ url="http://git.or.cz/gitwiki/GraftPoint">grafts</ulink>. Afterwards you
+ can simply create a branch as explained above and &gbp-import-orig; will
+ work as expected.</para>
+ <para>Alternatively, if you are only importing source from original tarballs
+ (for instance when converting from a Subversion repository where the
+ mergeWithUpstream was set for svn-buildpackage), you can create an empty
+ upstream branch with the following commands:
+<programlisting>
+ <command>git checkout</command> <option>--orphan</option> <replaceable>upstream</replaceable>
+ <command>git rm</command> <option>-rf</option> <replaceable>.</replaceable>
+ <command>git commit</command> <option>--allow-empty</option> <option>-m</option> <replaceable>'Initial upstream branch.'</replaceable>
+ <command>git checkout</command> <option>-f</option> <replaceable>master</replaceable>
+ # When not using 3.0 (quilt) with the default --merge-mode=auto
+ <command>git merge</command> <option>--allow-unrelated-histories</option> <replaceable>upstream</replaceable>
+</programlisting>
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="gbp.import.fromscratch">
+ <title>Starting a &debian; package from scratch</title>
+ <para>
+ So far, we assumed you already have a &debian; package to start with, but
+ what if you want to start a new package? First, create an empty repository:
+ </para>
+<programlisting>
+ <command>mkdir</command> package-0.1
+ <command>cd</command> package-0.1
+ <command>git init</command>
+</programlisting>
+ <para>Then, you import the upstream sources, branch off the
+ <option>upstream-branch</option> branch and add the &debian; files (e.g. via dh_make):
+<programlisting>
+ &gbp-import-orig; <option>-u</option> <replaceable>0.1</replaceable> <filename>../package-0.1.tar.gz</filename>
+ <command>dh_make</command>
+</programlisting>
+ That's it, you're done. If you want to publish your new repository, you can use &gbp-create-remote-repo;.
+ </para>
+ </sect1>
+
+ <sect1 id="gbp.import.upstream-git">
+ <title>When upstream uses Git</title>
+ <para>
+ If upstream uses &git; for development (and you don't want to
+ ignore that fact entirely), there are at least three ways to
+ handle packaging. The first one uses &git; exclusively and
+ creates the upstream tarballs from the upstream tag while the
+ second one still uses upstream tarballs but links your packaging
+ &git; history with upstreams &git; history. The third one also
+ uses a tarballs but does not link to the upstream history.
+ </para>
+
+ <sect2 id="gbp.import.upstream.git.notarball">
+ <title>No upstream tarballs</title>
+ <para>If upstream doesn't build upstream tarballs, or you
+ don't care about them, the simplest way is to clone
+ upstream's repository and create a separate packaging branch
+ in there. You will not need &gbp-import-orig; at all with
+ this workflow. &gbp-buildpackage; will handle creating the
+ upstream tarballs needed for the Debian source package.
+ </para>
+ <para>
+ For that to work you need to tell &gbp; what the
+ upstream tag format looks like. Therefore you either
+ use the <option>--git-upstream-tag</option> command line option
+ or the <option>upstream-tag</option> configuration file
+ variable to specify upstream's tag format.
+ </para>
+
+ <para>
+ For example a common upstream format is to put
+ a <replaceable>v</replaceable> in front of the version
+ number. In this case, the configuration option would look
+ like:
+ </para>
+<programlisting>
+[DEFAULT]
+upstream-tag = v%(version)s
+</programlisting>
+ <para>
+ <replaceable>version</replaceable> will be replaced by &gbp;
+ with the upstream version number as determined from
+ <filename>debian/changelog</filename>. The <replaceable>%()s</replaceable>
+ might be familiar from &pyformat;s. The option was placed in
+ the <emphasis>[DEFAULT]</emphasis> section instead of
+ the <emphasis>[buildpackage]</emphasis> section of the
+ configuration so other tools like &gbp-dch; make use of it
+ too.
+ </para>
+
+ <para>
+ Some upstreams use other formats though and don't separate
+ numbers by dots but rather by
+ underscore(<replaceable>_</replaceable>),
+ hyphen(<replaceable>-</replaceable>) or anything else. In
+ order to cope with that you can use version mangling of these
+ characters via substitution. The substitution works as
+ follows:
+ </para>
+<programlisting>
+[DEFAULT]
+upstream-tag = v%(version%.%_)s
+</programlisting>
+ <para>
+ This means that each occurrence
+ of <replaceable>.</replaceable> will be replaced
+ by <replaceable>_</replaceable> in the upstream version
+ number. For example the upstream
+ version <replaceable>1.2.3</replaceable> as determined from
+ the <filename>debian/changelog</filename> will be looked up
+ as &git; tag <replaceable>v1_2_3</replaceable> by
+ &gbp-buildpackage;.
+ </para>
+ <para>
+ If you want the substitution to be the <replaceable>%</replaceable> character
+ you have to escape it. E.g. <replaceable>%(version%-%\%)s</replaceable> will replace <replaceable>-</replaceable> with
+ <replaceable>%</replaceable>, transforming <replaceable>1-A.B.C</replaceable> to <replaceable>1%A.B.C</replaceable>.
+ Only a single replacement is supported and it can only replace a single character.
+ <warning>
+ <para>
+ Since some of the possible mangling characters
+ like <replaceable>_</replaceable> and <replaceable>%</replaceable> are also used to denote epochs and tilde revisions
+ these versions can't be reconstructed when mapping from &git; tags back to &debian; versions and will therefore break other tools
+ like &gbp-dch;. So use version mangling with care. It's better to come up with a Debian compatible tag format upstream.
+ See &dep14; for the currently used expansion rules for Debian version numbers.
+ </para>
+ </warning>
+ </para>
+
+ <para>If you're using &pristine-tar; you can make
+ &gbp-buildpackage; commit the generated tarball back to the
+ pristine-tar branch using
+ the <option>--git-pristine-tar-commit</option> option or you
+ can use &gbp-pristine-tar; after you've created the
+ tarballs.
+
+ This will make sure others building your package can exactly
+ regenerate the tarball you created when building the
+ &debian; package.
+ </para>
+
+ <sect3>
+ <title>Step by step</title>
+ <para>To not make any assumptions about &gbp;'s configuration, the following steps have all options given
+ in its long versions on the command line. You can add these
+ to &gbp.conf; to save lots of typing.
+ </para>
+
+ <para>First, we clone the upstream repository. To avoid any ambiguities between the &debian; packaging repository
+ and the upstream repository, we name the upstream repository <replaceable>upstream</replaceable> instead of the
+ default <replaceable>origin</replaceable>.
+<programlisting>
+ <command>git clone</command> --no-checkout -o upstream git://git.example.com/libgbp.git
+ <command>cd</command> libgbp
+ <command>git checkout</command> -b debian/sid v1.0
+</programlisting>
+ The above makes sure we have <replaceable>debian/sid</replaceable> for the &debian; packaging. We didn't create
+ any <replaceable>upstream/*</replaceable> branches; they're not needed for the packaging and only need to be
+ kept up to date. We started the branch at the commit corresponding to the tag <replaceable>v1.0</replaceable>.
+ </para>
+
+ <para>After adding the &debian; packaging, we build the package. This assumes you're using &pristine-tar;
+ and upstream uses a version number format as described above:
+<programlisting>
+ <command>gbp buildpackage</command> --git-pristine-tar --git-pristine-tar-commit --git-upstream-tag='v%(version)s' --git-debian-branch=debian/sid
+</programlisting>
+ When updating to a new upstream version, we simply fetch from upstream and merge in the new tag. Afterwards, we
+ update the changelog and build the package:
+<programlisting>
+ <command>git fetch</command> upstream
+ <command>git merge</command> v1.1
+ <command>gbp dch</command> --debian-branch=debian/sid --snapshot --auto debian/
+ &gbp-buildpackage; --git-ignore-new --git-pristine-tar --git-pristine-tar-commit --git-upstream-tag='v%(version)s'
+</programlisting>
+ Note that the above &gbp-dch; call makes sure we only pickup changes in the <filename>debian/</filename>
+ directory. Since we told it to build a snapshot changelog entry and we hadn't commit the changelog yet,
+ we need to tell &gbp-buildpackage; that the working directory is unclean via the <option>--git-ignore-new</option> option.
+ Once everything looks good, commit the changelog and build a release version:
+<programlisting>
+ <command>gbp dch</command> --release --auto --debian-branch=debian/sid
+ <command>git commit</command> -m"Release 1.1-1" debian/changelog
+ &gbp-buildpackage; --git-upstream-tag='v%(version)s' --git-debian-branch=debian/sid
+</programlisting>
+ If you want to share your repository with others, you can use &gbp-create-remote-repo; and &gbp-pull; as usual.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="gbp.import.upstream.git.tarball">
+ <title>Upstream tarballs and linked upstream history</title>
+ <para>If you want to track upstream's &git; but continue to import the upstream tarballs,
+ e.g. to make sure the tarball uploaded
+ to &debian; has the same checksum as upstream's, you can use the <option>--upstream-vcs-tag</option> option
+ when importing new tarballs with &gbp-import-orig;. Assuming you have the upstream source in your
+ repository with a tag <replaceable>v0.0.1</replaceable>, you can use:
+<programlisting>
+ &gbp-import-orig; --upstream-vcs-tag=v0.0.1 foo_0.0.1.orig.tar.gz
+</programlisting>
+ to add upstream's tag as additional parent to the merge commit.
+ See <ulink url="http://bugs.debian.org/664771">#664771</ulink> for more details.
+ </para>
+ </sect2>
+
+ <sect2 id="gbp.import.upstream.git.separate">
+ <title>Upstream tarballs and separate upstream history</title>
+ <para>
+ If you want to have upstream's &git; history available but
+ don't want to link it to your packaging history you can
+ simply keep it as a separate history. E.g. if you already have
+ a &git; repository with your packaging, change into that
+ repository and do:
+<programlisting>
+ &gitcmd; remote add upstream https://upstream.example.com/upstream.git
+ &gitcmd; fetch upstream
+</programlisting>
+ This will pull in upstream's &git; history into your repo but since
+ your packaging commits and upstreams commits have no common
+ parents the two histories will stay nicely separated.
+ Of course you can browse it and cherry-pick from it but
+ any remote repos you push to will not get upstream's history
+ by default unless you push any of upstream's refs.
+ <warning>
+ <para>
+ Since &git; has a single tag namespace pushing
+ changes with <command>git push --tags</command> will
+ push upstream's tags (and therefore it's history) too so
+ be sure to only push dedicated tag names.
+ </para>
+ </warning>
+ </para>
+ </sect2>
+
+ </sect1>
+ <sect1 id="gbp.branch.naming">
+ <title>Branch layout</title>
+ <para>
+ By default, &gbp; uses one branch to keep the &debian; packaging called <emphasis>master</emphasis>
+ and a branch to keep the upstream packaging called <emphasis>upstream</emphasis>.
+ </para>
+ <para>
+ This layout is simple to get started but falls short if one needs to maintain several versions of
+ the package at the same time. Therefore the following the &dep14; layout is recommended:
+ </para>
+
+ <variablelist>
+ <varlistentry>
+ <term>
+ debian/<release>
+ </term>
+ <listitem>
+ <para>
+ the &debian; packaging for a release <emphasis>jessie</emphasis>,
+ <emphasis>stretch</emphasis>, <emphasis>sid</emphasis>, <emphasis>jessie</emphasis>, <emphasis>jessie-backports</emphasis>, <emphasis>jessie-security</emphasis>
+ or <emphasis>experimental</emphasis>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ upstream/latest
+ </term>
+ <listitem>
+ <para>
+ the latest upstream sources.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ dfsg/latest
+ </term>
+ <listitem>
+ <para>
+ the DFSG-clean upstream sources in case the cleanup is done via a &git;
+ merge from upstream to this branch.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ In case &pristine-tar; is being used, there will be a single <emphasis>pristine-tar</emphasis>
+ branch that keeps all binary deltas.
+ </para>
+ </sect1>
+</chapter>
+
+<!-- LocalWords: tarballs
+ -->
+++ /dev/null
-<chapter id="gbp.rpm.intro">
- <title>Introduction</title>
-
- <para>
- Git-buildpackage is a <ulink url="http://www.debian.org/">Debian</ulink>
- toolset for maintaining and building packages in/from git repositories.
- The still experimental RPM variants of the tool, extend the support
- from Debian-only to building and maintaining RPM packages, too.
- The documentation of git-buildpackage-rpm here reflects the the
- <ulink url="gbp.html">Debian git-buildpackage documentation</>
- <!--<xref linkend="gbp">Debian git-buildpackage documentation</xref>.-->
- </para>
-
- <para>
- The RPM versions of the tools can in their current state
- do basically all the same tasks as the Debian versions, except for changelog generation.
- However, the philosophy is somewhat different in some parts. The RPM tools
- read the .spec file instead of changelog in determining packaging
- information (version number, name etc). Another clear difference is
- that &gbp-buildpackage-rpm; will always build in a separate build
- directory whereas &gbp-buildpackage; (the Debian) tool builds in the
- git working dir, by default.
- Third, conceptual, difference (for non-native packages) is that you may
- have packaging files in an orphan branch, without development sources:
- i.e. you develop code in 'patch-queue' branch that doesn't contain any
- packaging files, and, do 'pq-rpm export' to 'packaging' branch that only
- contains packaging files (.spec file, patches etc.) but no sources.
- The Debian/RPM tool equivalence is:
- <itemizedlist>
- <listitem><para>&gbp-buildpackage; -> RPM: &gbp-buildpackage-rpm;</para></listitem>
- <listitem><para>&gbp-import-dsc; -> RPM: &gbp-import-srpm;</para></listitem>
- <listitem><para>&gbp-import-orig; -> RPM: &gbp-import-orig-rpm;</para></listitem>
- <listitem><para>&gbp-pq; -> RPM: &gbp-pq-rpm;</para></listitem>
- <listitem><para>&gbp-clone; -> RPM: &gbp-clone; (the same tool)</para></listitem>
- <listitem><para>&gbp-pull; -> RPM: &gbp-pull; (the same tool)</para></listitem>
- <listitem><para>&gbp-dch; -> RPM: not available</para></listitem>
- <listitem><para>&gbp-import-dscs; -> RPM: not available</para></listitem>
- </itemizedlist>
- </para>
-
-<sect1 id="gbp.rpm.repository">
- <title>RPM Repository Layout</title>
-
- <para>
- The required repository layout is similar to Debian: basically the only
- requirement is that non-native packages must have clean upstream sources
- in a separate branch. Other branches are:
- </para>
-
- <itemizedlist>
- <listitem><para>
- <option>packaging-branch</> contains packaging files (spec
- and source files, e.g. patches, needed by rpmbuild, except for the orig
- tarball). This branch <emphasis>may</> contain the development sources as well
- (always true for native packages).
- </para></listitem>
-
- <listitem><para>
- <option>upstream-branch</> contains upstream sources.
- This can either be a branch you import to or a branch of an upstream
- repository you pull from.
- </para></listitem>
-
- <listitem><para>
- <option>pristine-tar-branch</> contains pristine-tar data to
- recreate the original upstream tarball from the upstream-branch.
- </para></listitem>
-
- <listitem><para>
- <option>patch-queue-branch(es)</> are related to
- <option>packaging-branch(es)</>. These are also called the
- <emphasis>development</> branhces in the RPM tools.
- The development/patch-queue branch is the upstream
- plus the patches from packaging branch applied. In RPM tools the
- default branch name of the development/patch-queue branch is
- <option>development/<packaging-branch-name></>.
- </para></listitem>
- </itemizedlist>
-</sect1>
-
-<sect1 id="gbp.rpm.workflow">
- <title>RPM Workflow</title>
-
- <para>
- The basic workflow is very similar to Debian:
- </para>
-
- <orderedlist>
- <listitem><para>
- Import a package via &gbp-import-srpm; OR clone from the
- distro git with &gbp-clone; if the package is already maintained with
- &gbp-buildpackage-rpm;.
- </para></listitem>
-
- <listitem><para>
- Develop, test, commit changes.</para></listitem>
- <listitem><para>Once satisfied you can build the final package with
- &gbp-buildpackage-rpm; (optionally with --git-tag to create a tag in
- git) and push it to git server.
- </para></listitem>
- </orderedlist>
-</sect1>
-
-</chapter>
+++ /dev/null
-<chapter id="gbp.intro">
- <title>Introduction</title>
- <para>
- Welcome to &gbp;, a system that integrates the
- <ulink url="http://www.debian.org/">Debian</ulink> package build
- system with <ulink url="http://git.or.cz/">Git</ulink>. The current version of this manual can be found
- <ulink url="https://honk.sigxcpu.org/piki/projects/git-buildpackage">here</ulink>.
- </para>
- <para>
- What can these tools do for you:
- <itemizedlist>
- <listitem><para>Import an existing &debian; package into &git;</para></listitem>
- <listitem><para>Import new upstream versions, NMUs etc. with optional filters</para></listitem>
- <listitem><para>Automatic upstream tarball generation</para></listitem>
- <listitem><para>Maintain a consistent branch and tag naming across
- repositories or across a team of developers</para></listitem>
- <listitem><para>Automatically sign tags</para></listitem>
- <listitem><para>Automatically push changes to remote repositories</para></listitem>
- <listitem><para>Make sure you have committed all changes to the right
- branch before releasing</para></listitem>
- <listitem><para>Export to a clean build area before building</para></listitem>
- <listitem><para>Automatic debian/changelog generation</para></listitem>
- <listitem><para>Automatic generation of snapshot releases for local testing</para></listitem>
- <listitem><para>Simple patch management</para></listitem>
- </itemizedlist>
- All of this is (hopefully) being done without restricting the user to certain usage patterns.
- </para>
-
-<sect1 id="gbp.repository">
- <title>Repository Layout and Terminology</title>
- <para>It is recommended to have the Debian packaging on a seprate
- branch than the upstream source <footnote><para>this, of course, has
- no meaning for Debian native packages</para></footnote>.
- This is necessary to be able to import
- and merge in new upstream versions via &gbp-import-orig;.
- To distinguish these two branches the following terminology
- <footnote><para>corresponding to the command
- line and config file options</para></footnote> is used:
- </para>
- <itemizedlist>
- <listitem><para>The <option>debian-branch</option> (the default branch
- name used in the &git; repository is <emphasis>master</emphasis>) holds
- your current development work. That's the branch you usually cut your
- releases from and the default branch new upstream releases are merged
- onto.</para></listitem>
-
- <listitem><para> The <option>upstream-branch</option> (the default
- branch name used in the &git; repository is
- <emphasis>upstream</emphasis>) holds the upstream releases. This can
- either be a branch you import to or a branch of an upstream repository
- you pull from.</para></listitem>
-
- <listitem><para> The <option>pristine-tar branch</option> (the default
- branch name used in the &git; repository is
- <emphasis>pristine-tar</emphasis>) holds the necessary additional
- information to recreate the original tarball from the
- <option>upstream-branch</option>. In order to use this feature you need
- to install the &pristine-tar; package.</para></listitem>
-
- <listitem><para> There can be one or more <option>patch-queue
- branches</option>. Every patch-queue branch is related to a
- <option>debian-branch</option>. If the <option>debian-branch</option> is called
- <emphasis>master</emphasis> the corresponding patch-queue branch is
- called <emphasis>patch-queue/master</emphasis>. The patch-queue branch is
- the debian branch plus the contents of
- <emphasis>debian/patches</emphasis> applied. These branches are managed
- with &gbp-pq;.
- </para></listitem>
- </itemizedlist>
-
- <para>You're completely
- free to pick any repository layout and the branch names above are only
- &gbp;'s defaults. They can be changed at any point in time
- and you can work with an arbitrary number of branches.
- For example branches like <emphasis>nmu</emphasis>,
- <emphasis>backports</emphasis> or <emphasis>stable</emphasis> might
- (temporarily or permanent) become your <option>debian-branch</option>
- and branches like <emphasis>dfsg</emphasis> or
- <emphasis>snapshots</emphasis> might become your
- <option>upstream-branch</option> - it doesn't matter if these branches
- are maintained with &gbp-import-orig; or not.</para>
- <para>
- A recommended branch layout is described in <xref linkend="gbp.branch.naming">.
- </para>
-
- <para>Since &gbp-buildpackage; only works with local &git;-repositories
- you have to use <command>git push</command> in order to publish your
- changes to remote repositories like <ulink
- url="http://git.debian.org/">git.debian.org</ulink>, this can also be
- automized with &gbp-buildpackage;'s <option>post-tag</option>
- hook.</para>
-</sect1>
-
-<sect1 id="gbp.workflow">
- <title>Workflow</title>
- <para>
- A typical, simple workflow consists of the following steps:
- </para>
- <orderedlist>
- <listitem><para>Import a new Debian package via &gbp-import-dsc;. This
- imports the &debian; Package on the <option>debian-branch</option>
- and the upstream sources on the <option>upstream-branch</option>.</para></listitem>
- <listitem><para>Develop, test, commit changes. During this time you can
- always build the package with &gbp-buildpackage;. In case you have
- uncommitted changes in your source tree you can use the
- <option>--git-ignore-new</option> option.</para></listitem>
- <listitem><para>Optionally you can create the Debian changelog entries
- using &gbp-dch; and create snapshot releases for testing using its
- <option>--snapshot</option> option.</para></listitem>
- <listitem><para>Once satisfied you can build the final package with
- &gbp-buildpackage; <option>--git-tag</option>. This additionally
- creates a tag within &git; so you can switch back to that version later
- at any time. The format of the tags can be specified, tags can
- be &gpg; signed.</para></listitem>
- <listitem><para>When a new upstream version is released and upstream
- isn't using &git; you can import the new version via &gbp-import-orig;
- onto the <option>upstream-branch</option>. &gbp-import-orig; will
- by default try to merge the new upstream version onto the
- <option>debian-branch</option>. You can skip the merge with
- <option>--no-merge</option>. After resolving any potential conflicts
- go back to the second step. </para></listitem>
- </orderedlist>
- <para>These steps will be explaind in more details in the following sections.</para>
-</sect1>
-
-</chapter>
--- /dev/null
+<chapter id="gbp.intro">
+ <title>Introduction</title>
+ <para>
+ Welcome to git-buildpackage (short &gbp;), a system that integrates the
+ <ulink url="http://www.debian.org/">Debian</ulink> package build
+ system with <ulink url="http://git.or.cz/">Git</ulink>. The most
+ recent version of this manual can be found &manual;.
+ </para>
+ <para>
+ This is what &gbp; can do for you:
+ <itemizedlist>
+ <listitem><para>Initially import an existing &debian; package into &git;</para></listitem>
+ <listitem><para>Incrementally import new versions of a Debian
+ package into &git; e.g. for importing NMUs or to maintain
+ downstream modifications</para></listitem>
+ <listitem><para>Import new upstream versions from tarballs with optionally filters applied</para></listitem>
+ <listitem><para>Recreate the upstream tarball from information stored in &git;</para></listitem>
+ <listitem><para>Maintain a consistent branch and tag naming within a &git; repository, across
+ repositories or across a team of developers</para></listitem>
+ <listitem><para>Automatically sign generated tags</para></listitem>
+ <listitem><para>Make sure you have committed all changes to the right
+ branch before building and releasing</para>
+ </listitem>
+ <listitem><para>Execute hooks at various points of the package
+ build process e.g. to automatically push changes to remote
+ repositories</para>
+ </listitem>
+ <listitem><para>Integrate the build process with cowbuilder or other builders</para></listitem>
+ <listitem><para>Export to a clean build area before building the package</para></listitem>
+ <listitem><para>Generate debian/changelog automatically</para></listitem>
+ <listitem><para>Manage your quilt patches when using 3.0 (quilt)
+ source format</para></listitem>
+ </itemizedlist>
+ All of this is (hopefully) being done without restricting the user to certain usage patterns.
+ </para>
+
+<sect1 id="gbp.repository">
+ <title>Repository Layout and Terminology</title>
+ <para>It is recommended to have the &debian; packaging on a separate
+ branch than the upstream source <footnote><para>this, of course, has
+ no meaning for &debian; native packages</para></footnote>.
+ This is necessary to be able to import
+ and merge in new upstream versions via &gbp-import-orig;.
+ To distinguish these two branches, the following terminology
+ <footnote><para>corresponding to the command
+ line and config file options</para></footnote> is used:
+ </para>
+ <itemizedlist>
+ <listitem><para>The <option>debian-branch</option> (the default branch
+ name used in the &git; repository is <emphasis>master</emphasis>) holds
+ your current development work. That's the branch you usually cut your
+ releases from and the default branch new upstream releases are merged
+ onto.</para></listitem>
+
+ <listitem><para> The <option>upstream-branch</option> (the default
+ branch name used in the &git; repository is
+ <emphasis>upstream</emphasis>) holds the upstream releases. This can
+ either be a branch you import to or a branch of an upstream &git; repository
+ you pull from.</para></listitem>
+
+ <listitem><para> The <option>pristine-tar branch</option> (the default
+ branch name used in the &git; repository is
+ <emphasis>pristine-tar</emphasis>) holds the necessary additional
+ information to recreate the original tarball from the
+ <option>upstream-branch</option>. In order to use this feature, you need
+ to install the &pristine-tar; package.</para></listitem>
+
+ <listitem><para> There can be one or more <option>patch-queue</option> branches.
+ Every patch-queue branch is related to a
+ <option>debian-branch</option>. If the <option>debian-branch</option> is called
+ <emphasis>master</emphasis>, the corresponding patch-queue branch is
+ called <emphasis>patch-queue/master</emphasis>. The patch-queue branch is
+ the &debian; branch plus the contents of
+ <emphasis>debian/patches</emphasis> applied. These branches are managed
+ with &gbp-pq;.
+ </para></listitem>
+ </itemizedlist>
+
+ <para>You're completely
+ free to pick any repository layout; the branch names above are only
+ &gbp;'s defaults. They can be changed at any point in time,
+ and you can work with an arbitrary number of branches.
+ For example, branches like <emphasis>nmu</emphasis>,
+ <emphasis>backports</emphasis> or <emphasis>stable</emphasis> might
+ (temporarily or permanently) become your <option>debian-branch</option>,
+ and branches like <emphasis>dfsg</emphasis> or
+ <emphasis>snapshots</emphasis> might become your
+ <option>upstream-branch</option>—it doesn't matter if these branches
+ are maintained with &gbp-import-orig; or not.</para>
+ <para>
+ A recommended branch layout is described in <xref linkend="gbp.branch.naming"/>.
+ </para>
+
+ <para>Since &gbp-buildpackage; only works with local &git;-repositories,
+ you have to use <command>git push</command> in order to publish your
+ changes to remote repositories like <ulink
+ url="http://git.debian.org/">git.debian.org</ulink>; this can be
+ automated with &gbp-buildpackage;'s <option>post-tag</option>
+ hook.</para>
+</sect1>
+
+<sect1 id="gbp.workflow">
+ <title>Workflow</title>
+ <para>
+ A typical, simple workflow consists of the following steps:
+ </para>
+ <orderedlist>
+ <listitem><para>Initially import a &debian; package via &gbp-import-dsc;. This
+ imports the &debian; Package on the <option>debian-branch</option>
+ and the upstream sources on the <option>upstream-branch</option>.</para></listitem>
+ <listitem><para>Develop, test, commit changes. During this time, you can
+ always build the package with &gbp-buildpackage;. In case you have
+ uncommitted changes in your source tree, you can use the
+ <option>--git-ignore-new</option> option.</para></listitem>
+ <listitem><para>Optionally you can create the &debian; changelog entries
+ using &gbp-dch; and create snapshot releases for testing using its
+ <option>--snapshot</option> option.</para></listitem>
+ <listitem><para>Once satisfied, you can build the final package with
+ &gbp-buildpackage; <option>--git-tag</option>. This additionally
+ creates a tag within &git; so you can switch back to that version later
+ at any time. The format of the tags can be specified; tags can
+ be &gpg; signed.</para></listitem>
+ <listitem><para>When a new upstream version is released and upstream
+ isn't using &git;, you can import the new version via &gbp-import-orig;
+ onto the <option>upstream-branch</option>. &gbp-import-orig; will
+ by default try to merge the new upstream version onto the
+ <option>debian-branch</option> (you can skip the merge with
+ <option>--no-merge</option>). After resolving any potential conflicts,
+ go back to the second step.</para></listitem>
+ </orderedlist>
+ <para>These steps will be explained in more details in the following sections.</para>
+</sect1>
+
+</chapter>
--- /dev/null
+<chapter id="gbp.patches">
+ <title>Working with Patches</title>
+
+ <para>
+ &gbp-pq; can be used to manage patches that modify the upstream
+ source inside
+ <filename>debian/patches/</filename>. This is mostly intended for
+ 3.0 (quilt) format source packages.
+ </para>
+
+ <para>
+ The basic idea is that patches are imported from your
+ &debian-branch; to a patch-queue branch with one patch file
+ in <filename>debian/patches/</filename> becoming one commit on the
+ the patch-queue branch. The created branch will be named after
+ the branch you imported from
+ with <filename>patch-queue/</filename> prepended. So if you do
+ your &debian; packaging on <filename>debian/sid</filename> and do
+ a
+ </para>
+<programlisting>
+ &gbp-pq-import;
+</programlisting>
+ <para>
+ then the newly created branch will be
+ called <filename>patch-queue/debian/sid</filename>.
+ </para>
+
+ <para>On the patch-queue branch you can work on the commits using
+ familiar &git; commands (rebase, commit --amend, etc). When done,
+ &gbp-pq; will be used to turn the commits on the patch-queue
+ branch into patch in <filename>debian/patches/</filename> files
+ again.
+ </para>
+
+ <para>
+ This workflow facilitates e.g. the cherry-picking of patches for
+ stable releases, the forward-porting of patches to new upstream
+ versions by using git rebase on the patch-queue branch (patches
+ already applied upstream are detected automatically) as well as
+ the reordering, dropping and renaming of patches without having to
+ resort to &quilt;. The generated patches
+ in <filename>debian/patches/</filename> have all the necessary
+ information to forward them upstream since they use a format similar
+ to <command>git-format-patch</command>.
+ </para>
+
+ <para>
+ The main drawback of this workflow is the lack of history on the
+ patch-queue branch since it is frequently droppend and
+ recreated. But there is full history on
+ the your &debian-branch;, of course.
+ </para>
+
+ <para>
+ Also, beware that &gbp-pq; currently has incomplete support for
+ <ulink url="https://dep-team.pages.debian.net/deps/dep3/">DEP3</ulink> headers.
+ Initially, parsing with <command>git-mailinfo(1)</command> is attempted,
+ which supports only the <computeroutput>From</computeroutput> and
+ <computeroutput>Subject</computeroutput> fields. If neither of these are
+ present, &gbp-pq; will attempt to convert the patch from DEP3 format into
+ a <command>git-mailinfo(1)</command> compatible format. This involves first
+ loading <computeroutput>From</computeroutput> using the
+ <computeroutput>Author</computeroutput> field and
+ <computeroutput>Subject</computeroutput> using the first line of the
+ <computeroutput>Description</computeroutput> field. Then, any additional
+ fields (such as <computeroutput>Origin</computeroutput> and
+ <computeroutput>Forwarded</computeroutput>), and the remainder of the
+ <computeroutput>Description</computeroutput> (if any), will be appended to
+ the body.
+ </para>
+
+ <sect1 id="gbp.patches.workflow">
+ <title>Basic Workflow</title>
+
+ <para>
+ This example assumes you're working on a source 3.0 (quilt)
+ format package with patches
+ in <filename>debian/patches</filename> parseable
+ by <command>git-quiltimport(1)</command>. The git branch
+ currently checked out is named <filename>debian/sid</filename>.
+ </para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/pq-unapplied.png" format="PNG"/>
+ </imageobject>
+ <caption>
+ <para>
+ The &debian-branch; we start from.
+ </para>
+ </caption>
+ </mediaobject>
+
+ <para>Let's first create the patch-queue branch and import the
+ contents of <filename>debian/patches</filename> onto it using
+ &gbp-pq;
+ </para>
+
+<programlisting>
+ <command>cd <replaceable>REPO</replaceable></command>
+ &gbp-pq; import
+</programlisting>
+
+<para>
+ This will generate output like:
+<screen>
+ gbp:info: Trying to apply patches at 'aaa1011bfd5aa74fea43620aae94709de05f80be'
+ gbp:info: 18 patches listed in 'debian/patches/series' imported on 'patch-queue/debian/sid'
+</screen>
+ What happened is that &gbp-pq; imported each patch file and switched
+ you to the newly created patch-queue branch
+ (<filename>patch-queue/debian/sid</filename>) automatically.
+</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/pq-applied.png" format="PNG"/>
+ </imageobject>
+ <caption>
+ <para>
+ The patch-queue branch with patches
+ from <filename>debian/patches</filename> applied.
+ </para>
+ </caption>
+ </mediaobject>
+
+<para>
+ Now you can work on the patch-queue branch (add, remove, rebase,
+ test) to get your patches into shape:
+ <itemizedlist>
+ <listitem>
+ <para>
+ To add what will later become a patch
+ in <filename>debian/patches/</filename> simply make a
+ commit. The first line of the commit message will become the
+ patch name later. The following lines include the details of
+ what the patch does.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ To remove or edit commits use git rebase -i . The git
+ documentation explains how to work with git-rebase.
+ </para>
+ </listitem>
+ </itemizedlist>
+</para>
+
+<para>
+ Once satisfied with the commits let's regenerate the patches
+ in <filename>debian/patches/</filename> using &gbp-pq;. This will
+ switch you back to the branch <filename>debian/sid</filename> and
+ regenerate the patches using a method similar
+ to <command>git-format-patch</command>:
+</para>
+
+<programlisting>
+ &gbp-pq; export
+</programlisting>
+
+<para>You can now commit the result by using:</para>
+<programlisting>
+ &gitcmd; add debian/patches
+ &gitcmd; commit
+</programlisting>
+<para>
+ If you don't want to commit the result by hand each time you can also
+ pass <option>--commit</option> to the &gbp; <option>export</option>
+ command above.
+</para>
+
+<para>
+ Next you can update <filename>debian/changelog</filename> (e.g. by
+ running "&gbp-dch; <option>-S</option> <option>-a</option>") and
+ build the package as usual.
+</para>
+
+</sect1>
+<sect1 id="gbp.patches.newupstream">
+ <title>Importing a new upstream version</title>
+
+ <para>
+ To update your patches for a new upstream version one
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Imports the current patches onto the patch-queue branch (if
+ not done already) using &gbp-pq-import;. This will allow you
+ to rebase the patches on the new upstream version later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Imports the new upstream version with
+ &gbp-import-orig; <option>--uscan</option>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Rebases the patches onto the new upstream version using
+ &gbp-pq-rebase;. This will bring the patches up to date
+ regarding the new upstream version. Patches already applied
+ upstream can be dropped and remaining patches can be modified
+ to apply to the new version.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Exports the patches to <filename>debian/patches</filename> using
+ &gbp-pq-export;.
+ </para>
+ </listitem>
+ </orderedlist>
+
+ <para>
+ But don't worry if you forgot to do so before importing the new
+ version (or if another team member imported the version already).
+ </para>
+
+ <para>
+ In this case you can make &gbp-pq; figure out where to apply the
+ patches by using the <option>--time-machine=</option> option. The
+ following command
+ </para>
+
+<programlisting>
+ &gbp-pq-import; --force --time-machine=10
+</programlisting>
+
+ <para>
+ would drop your current patch-queue branch (if existent) and
+ create a new one by going back in your commit history as far as 10
+ commits to find a place where your patches still
+ apply <footnote><para>This is not necessarily
+ your debian-branch; HEAD since the new upstream
+ version might have changed so that the patches no longer apply
+ cleanly there.</para></footnote>. If it finds such a commit on
+ your &debian-branch; it will create the patch-queue branch from
+ there and switch you to that branch. You can now rework your
+ patches to apply to the new upstream version by using
+ &gbp-pq-rebase;:
+ </para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/pq-time-machine.png" format="PNG"/>
+ </imageobject>
+ <caption>
+ <para>
+ The patch-queue branch and &debian-branch; after importing the
+ patches.
+ </para>
+ </caption>
+ </mediaobject>
+
+<programlisting>
+ &gbp-pq-rebase;
+</programlisting>
+
+<para>
+ or you can invoke &gitcmd; <option>rebase</option> directly:
+</para>
+
+<programlisting>
+ &gitcmd; rebase -i debian/sid
+</programlisting>
+
+ <para>
+ Should the rebase fail (e.g. because the upstream source changed
+ at the same place your patches modify the code) you can resolve
+ this by using the options of &gitcmd; <option>rebase</option> (if
+ you simply want to abort use
+ &gitcmd; <option>rebase</option> <option>--abort</option>).
+ </para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/pq-rebase.png" format="PNG"/>
+ </imageobject>
+ <caption>
+ <para>
+ The patch-queue branch after rebasing the patches. Patches
+ that were merged upstream were dropped.
+ </para>
+ </caption>
+ </mediaobject>
+
+ <para>
+ Once done you can export your commits to patch files again:
+ </para>
+<programlisting>
+ &gbp-pq-export; --commit
+</programlisting>
+
+ <para>
+ The export will also switch you back to the &debian-branch;.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/pq-export.png" format="PNG"/>
+ </imageobject>
+ <caption>
+ <para>
+ The &debian-branch; after exporting the patches and committing the changes.
+ </para>
+ </caption>
+ </mediaobject>
+
+ <para>
+ See this in action in a
+ <ulink url="https://honk.sigxcpu.org/piki/projects/git-buildpackage/videos/gbp-pq-new-upstream-version.ogv">short
+ video</ulink>.
+ </para>
+
+</sect1>
+<sect1 id="gbp.patches.firstpatch">
+ <title>Adding your first patch</title>
+
+ <para>
+ If a package doesn't have any patches yet, these are the steps to add
+ your first patch:
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>Launch an import. If there's nothing to import &gbp-pq; will just
+ create an empty branch and switch your working copy to it:
+<programlisting>
+ &gbp-pq-import;
+</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Create your first patch: edit files, test, commit your changes
+ using <command>git commit</command>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ To generate the new Quilt patch set use
+ </para>
+<programlisting>
+ &gbp-pq-export; --commit
+</programlisting>
+<para>
+ This will switch you back to your &debian-branch; branch, generate the
+ patches and commit them right away to this branch.
+</para>
+
+<para>
+ Skip the <option>--commit</option> if you don't want to commit
+ right away. If you want to pick the changelog message from the patch
+ see
+ <filename>/usr/share/doc/git-buildpackage/examples/gbp-add-patch</filename>.
+</para>
+ </listitem>
+ </orderedlist>
+</sect1>
+
+ <sect1 id="gbp.patches.team">
+ <title>Team maintenance</title>
+
+ <para>The easiest way is to not push out any patch-queue/* branches at all.
+ They can be recreated by any team member easily by using</para>
+
+<programlisting>
+ &gbp-pq-import; --force
+</programlisting>
+
+<para>
+ The patch-queue branch can also be re-created when pulling (this
+ will additionally drop your current patch-queue branch and recreate it
+ from <filename>debian/patches</filename>):</para>
+<programlisting>
+ &gbp-pull; --redo-pq
+</programlisting>
+
+<para>
+ Note that you can push out patch-queue branches. Other team
+ members must just be aware that branches in the patch-queue/
+ namespace are being rebased frequently and therefore cause
+ non fast-forward updates.
+</para>
+ </sect1>
+</chapter>
+++ /dev/null
-<chapter id="gbp.releases">
- <title>Releases and Snapshots</title>
- <para>When branching and merging frequently, the different Debian changelog
- entries on the different branches tend to get into the way of the automatic
- merge and the the merge fails - leaving the (pathological) merge to the
- committer. In order to avoid this &gbp-dch; offers a way for creating
- changelog entries from &git; commits before doing a
- release or anytime between releases.</para>
- <para>
- The simplest way is doing all the changes to the
- <option>debian-branch</option> without touching
- <emphasis>debian/changelog</emphasis> at all. Then, when done, do:
- </para>
-<screen>
-&gbp-dch; <option>--release</option>
-</screen>
- <para> This will look up the latest released version in the changelog,
- increment the version in the &debian; changelog, generate changelog
- messages from the corresponding &git; commit id up to the branch head and
- finally spawns an editor for final changelog file editing by invoking &dch;
- <option>--release</option>.</para>
- <para>
- But what if you want to have an (unreleased) snapshot for intermediate testing:
- </para>
-<screen>
-&gbp-dch; <option>--snapshot</option>
-</screen>
- <para>will generate a snapshot release with a specially crafted version number
- and a warning in the changelog that this is a snapshort release:
- </para>
-<programlisting>
-git-buildpackage (0.3.7~1.gbp470ce2) UNRELEASED; urgency=low
-
- ** SNAPSHOT build @470ce29ec7877705c844474a2fd89869aea0406d **
-
- * add support for automatic snapshot
-</programlisting>
- <para>During subsequent calls with <option>--snapshot</option> this version
- number will continue to increase. Since the snapshot banners contains the
- commit id of the current branch head, &gbp-dch; can figure out what to
- append to the changelog by itself:
-<screen>
-&gbp-dch; <option>--snapshot</option> <option>--auto</option>
-</screen>
- will fetch the commit id and add changelog entries from that point to the
- current HEAD - again auto incrementing the version number. If you don't want
- to start at that commit id, you can specify any id or tag with:</para>
-<screen>
-&gbp-dch; <option>--since</option>=<replaceable>e76a6a180a57701ae4ae381f74523cacb3152780</replaceable> <option>--snapshot</option>
-</screen>
- <para>
- After testing you can remove the snapshot header by a final &gbp-dch; call:
- </para>
-<screen>
-&gbp-dch; <option>--since</option>=<replaceable>HEAD</replaceable> <option>--release</option>
-</screen>
- <para>
- This will add no further entries but simply remove the specially crafted
- version number and the snapshort header. Again you can use any commit id
- or tag instead of <option>HEAD</option> if you want to add further changelog
- entries - or you can (of course) use <option>--auto</option> again.
- </para>
-<sect1 id="gbp.release.numbers">
- <title>Customizing snapshot numbers</title>
- <para>If the auto incrementing of the snapshot number doesn't suite you needs you
- can give any python expression that evaluates to a positive integer to
- calculate the new snapshot number:</para>
-<screen>
-&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>1</replaceable>
-&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>'snapshot + 2'</replaceable>
-&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>'os.popen("git-log --pretty=oneline | wc -l").readlines()[0]'</replaceable>
-&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>`git-log --pretty=oneline debian/0.3.3 | wc -l`</replaceable>
-</screen>
-<para>
-You can also add the snapshot-number calculation to <filename>gbp.conf</filename>:
-</para>
-<programlisting>
-[DEFAULT]
-snapshot-number = os.popen("git-log --pretty=oneline | wc -l").readlines()[0]
-</programlisting>
-</sect1>
-<sect1 id="gbp.release.commit">
- <title>More on commit messages</title>
- <para>You can use <option>--full</option> to include the full commit
- message in the changelog, note that you will lose the formatting though,
- since &dch; wraps lines by itself.</para>
- <para>Additionally there are tags <option>Closes:</option> and
-<option>Thanks:</option> available to customize the commit message. Each tag
-has to start at the beginning of a single line. For example the git commit message
-<screen>
-New upstream version
-
-Closes: #1000
-Thanks: cool upstream
-</screen>
- would result in a changelog entry:
-<screen>
- * New upstream version (Closes: #1000) - thanks to cool upstream
-</screen>
-You can use the <option>Closes:</option> tag multiple times.
-</para>
-<para>
-There are several tags to further customize what (and how) commit messages get
-included into the changelog:
-</para><para>
-To exclude a commit from the generated changelog use:
-</para><para>
-<screen>
-Git-Dch: Ignore
-</screen>
-This is e.g. useful if you're just fixing up a previous commit and couldn't
-ammend it or for other janitorial commits that really don't need to end up in
-the changelog. For example, the following git commit message
-<screen>
-Set correct branchnames in debian/gbp.conf
-
-Git-Dch: Ignore
-</screen>
-will not show up in the generated changelog in any way.
-</para>
-<para>
-To include the full commit message in the changelog use:
-<screen>
-Git-Dch: Full
-</screen>
-</para>
-<para>
-To only include the short description in the changelog and skip the body use:
-<screen>
-Git-Dch: Short
-</screen>
-The latter only takes effect when running &gbp-dch; with the
-<option>--full</option> option, since including only the short
-description is the default.
-</para>
-<para>
-Usually changelog entries should correspond to a single &git; commit. In this case it's
-convenient to include the commit id in the changelog entry.
-This has the advantage that it's easy for people to identify changes without
-having to write very extensive changelog messages - the link back to Git can be
-automated via the <option>Vcs-Browser</option> and <option>Vcs-Git</option>
-fields in <filename>debian/control</filename>. See <ulink url="https://honk.sigxcpu.org/cl2vcs">
-Cl2vcs</ulink> for how this looks.
-</para>
-<para>
-The inclusion of the commit id can be done automatically
-via &gbp-dch;'s <option>--id-length</option> option. Using
-<option>--id-length</option>=<replaceable>7</replaceable> would change the above example to:
-<screen>
- * [571bfd4] New upstream version (Closes: #1000) - thanks to cool upstream
-</screen>
-This makes it much easier to see which commit actually fixed bug #1000.
-</para>
-</sect1>
-</chapter>
--- /dev/null
+<chapter id="gbp.releases">
+ <title>Releases and Snapshots</title>
+
+ <para>
+ The &changelog; gives the &debian; package a version number
+ and keeps track of changes made to the package in a particular
+ version. While the changelog can still be maintained by hand we
+ can make use of &gbp-dch; to have our &git; commit messages end up
+ in &changelog;. This avoids the double maintenance of the &git;
+ commit history and the &debian; changelog. If you don't want a
+ one to one mapping of changelog entries to &git; commits you're
+ free to edit the changelog by hand at any point.
+ </para>
+
+ <para>
+ Not committing changelog entries with the actual modifications
+ also has the advantage that the changelog won't cause any trouble
+ when cherry-picking patches from different branches. It can be
+ created when releasing the package or after performing several
+ commits. Invocations of &dch; and &gbp-dch; can be mixed.
+ </para>
+
+ <sect1 id="gbp.maintaining.changelog">
+ <title>Maintaining <filename>debian/changelog</filename></title>
+ <sect2 id="gbp.changelog.release">
+ <title>Creating &changelog; just before the release</title>
+ <para>
+ The simplest way is doing all the changes to the
+ <option>debian-branch</option> without touching
+ <filename>debian/changelog</filename> at all. Then, when done, do:
+ </para>
+<programlisting>
+&gbp-dch; <option>--release</option>
+</programlisting>
+ <para>
+ This will look up the latest released version in the changelog,
+ increment the version in the &debian; changelog, generate changelog
+ messages from the corresponding &git; commit id up to the branch head, and
+ finally spawns an editor for final changelog editing.
+ </para>
+ </sect2>
+ <sect2 id="gbp.incremental.changelog">
+ <title>Incrementally filling &changelog;</title>
+ <para>
+ You can run &gbp-dch; without any options to make it add all
+ commit messages since the last &debian; tag to a new UNRELEASED
+ changelog section:
+<programlisting>
+&gbp-dch;
+</programlisting>
+ You can then commit the <filename>debian/changelog</filename>
+ to have your current changes recorded. Later invocations of
+ &gbp-dch; will check when
+ <filename>debian/changelog</filename> was last modified and
+ not add these commits again. Upon your last call of &gbp-dch;
+ before releasing the package add <option>--release</option>
+ again to have the <emphasis>UNRELEASED</emphasis> distribution
+ in the changelog turned into <emphasis>unstable</emphasis>.
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="gbp.snapshots">
+ <title>Creating snapshots with increasing version numbers</title>
+ <para>
+ The downside of the above methods is that you either have the
+ version number of the last release in &changelog; or that you
+ have a changelog entry with <emphasis>UNRELEASED</emphasis> that
+ has the same version number for all commits you do during the
+ development cycle of your package. Although this is common
+ practice in &debian; it means that also all your test builds
+ have the same version number which makes them hard to
+ distinguish in e.g. continuous integration pipelines.
+ </para>
+
+ <para>
+ To address these shortcomings &gbp-dch; has a
+ <option>--snapshot</option> option that can be used to create
+ (unreleased) snapshots for intermediate testing with a version
+ number that is lower than the one of the final package:
+ </para>
+<programlisting>
+&gbp-dch; <option>--snapshot</option>
+</programlisting>
+ <para>
+ will generate a snapshot release with a specially crafted version number
+ and a warning in the changelog that this is a snapshot release:
+ </para>
+<programlisting>
+git-buildpackage (0.3.7~1.gbp470ce2) UNRELEASED; urgency=low
+
+ ** SNAPSHOT build @470ce29ec7877705c844474a2fd89869aea0406d **
+
+ * add support for automatic snapshot
+</programlisting>
+ <para>
+ During subsequent calls with <option>--snapshot</option>, this
+ version number will continue to increase. Since the snapshot
+ banner contains the commit id of the current branch HEAD,
+ &gbp-dch; can figure out what to append to the changelog by itself
+ (even without committing the changelog first):
+<programlisting>
+&gbp-dch; <option>--snapshot</option>
+</programlisting>
+ will fetch the commit id from &changelog; and add changelog entries from that point to the
+ current HEAD—again auto incrementing the version number. If you don't want
+ to start at that commit id, you can specify any id or tag with:</para>
+<programlisting>
+&gbp-dch; <option>--since</option>=<replaceable>e76a6a180a57701ae4ae381f74523cacb3152780</replaceable> <option>--snapshot</option>
+</programlisting>
+ <para>
+ After testing, you can remove the snapshot header by a final &gbp-dch; call:
+ </para>
+<programlisting>
+&gbp-dch; <option>--release</option>
+</programlisting>
+ <para>
+ This will pick new commit if present and remove the specially
+ crafted version number and the snapshot header. If you want finer
+ control of what is being added you can again use the <option>--since</option>.
+ </para>
+ <sect2 id="gbp.release.numbers">
+ <title>Customizing snapshot numbers</title>
+ <para>If the auto incrementing of the snapshot number doesn't suite your needs, you
+ can give any Python expression that evaluates to a positive integer to
+ calculate the new snapshot number:</para>
+<programlisting>
+&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>1</replaceable>
+&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>'snapshot + 2'</replaceable>
+&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>'os.popen("git-log --pretty=oneline | wc -l").readlines()[0]'</replaceable>
+&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>`git-log --pretty=oneline debian/0.3.3 | wc -l`</replaceable>
+</programlisting>
+ <para>
+ You can also add the snapshot-number calculation to <filename>gbp.conf</filename>:
+ </para>
+<programlisting>
+[DEFAULT]
+snapshot-number = os.popen("git-log --pretty=oneline | wc -l").readlines()[0]
+</programlisting>
+ </sect2>
+ </sect1>
+
+ <sect1 id="gbp.release.commit">
+ <title>Tuning commit messages</title>
+ <para>
+ You can use <option>--full</option> to include the full commit
+ message in the changelog. If you want to tweak the formatting
+ there's a <option>--customizations</option>.
+ </para>
+ <para>
+ Additionally, there are tags <option>Closes:</option> and
+ <option>Thanks:</option> available to customize the commit message. Each tag
+ has to start at the beginning of a single line. For example, the git commit message
+<screen>
+New upstream version
+
+Closes: #1000
+Thanks: cool upstream
+</screen>
+ would result in a changelog entry:
+<screen>
+ * New upstream version (Closes: #1000) - thanks to cool upstream
+</screen>
+You can use the <option>Closes:</option> tag multiple times.
+ </para>
+ <para>
+ There are several tags to further customize what (and how) commit messages get
+ included into the changelog:
+ </para>
+ <para>
+ To exclude a commit from the generated changelog, use:
+ </para>
+ <para>
+<screen>
+Gbp-Dch: Ignore
+</screen>
+ This is e.g. useful if you're just fixing up a previous commit and couldn't
+ amend it, or for other janitorial commits that really don't need to end up in
+ the changelog. For example, the following git commit message
+<screen>
+Set correct branchnames in debian/gbp.conf
+
+Gbp-Dch: Ignore
+</screen>
+ will not show up in the generated changelog in any way.
+ </para>
+ <para>
+ To include the full commit message in the changelog, use:
+<screen>
+Gbp-Dch: Full
+</screen>
+ </para>
+ <para>
+ To only include the short description in the changelog and skip the body, use:
+<screen>
+Gbp-Dch: Short
+</screen>
+ The latter only takes effect when running &gbp-dch; with the
+ <option>--full</option> option since including only the short
+ description is the default.
+ </para>
+ <para>
+ Usually, changelog entries should correspond to a single &git;
+ commit. In this case, it's convenient to include the commit id
+ in the changelog entry. This has the advantage that it's easy
+ for people to identify changes without having to write very
+ extensive changelog messages—the link back to &git; can be
+ automated via the <option>Vcs-Browser</option> and
+ <option>Vcs-Git</option> fields in
+ <filename>debian/control</filename>. See <ulink
+ url="https://honk.sigxcpu.org/cl2vcs"> Cl2vcs</ulink> for how
+ this looks.
+ </para>
+ <para>
+ The inclusion of the commit id can be done automatically
+ via &gbp-dch;'s <option>--id-length</option> option. Using
+ <option>--id-length</option>=<replaceable>7</replaceable> would change the above example to:
+<screen>
+ * [571bfd4] New upstream version (Closes: #1000) - thanks to cool upstream
+</screen>
+ This makes it much easier to see which commit actually fixed bug #1000.
+ </para>
+</sect1>
+</chapter>
+++ /dev/null
- <chapter id="gbp.special">
- <title>Special use cases</title>
- <sect1 id="gbp.special.dfsgfree">
- <title>Handling non-DFSG clean upstream sources</title>
- <para>If you have to handle non DFSG clean upstream sources you can use a
- different branch which you have to create once:
- </para>
- <screen>
-&gitcmd; branch dfsg_clean upstream
- </screen>
- <para>
- This creates the <emphasis>dfsg_clean</emphasis> branch from the tip of a
- branch called <emphasis>upstream</emphasis>. Then, when importing a new
- upstream version, you import the new version on the
- <option>upstream-branch</option> (by default named
- <emphasis>upstream</emphasis>) as usual and just don't merge to the
- <emphasis>debian-branch</emphasis> (by default named
- <emphasis>master</emphasis>):
- </para>
- <screen>
-&gbp-import-orig; --no-merge <filename>/path/to/nondfsg-clean-package_10.4.orig.tar.gz</filename>
-&gitcmd; <option>tag</option> 10.4
- </screen>
- <para>
- After the import you can switch to the <emphasis>dfsg_clean</emphasis>
- branch and get the newly imported changes from the upstream branch:
- </para>
- <screen>
-&gitcmd; <option>checkout</option> dfsg_clean
-&gitcmd; <option>pull</option> <filename>.</filename> upstream
- </screen>
- <para>Now make this checkout dfsg clean (preverably by a cleanup script), commit
- your changes and merge to your <option>debian-branch</option>:</para>
- <screen>
-cleanup-script.sh
-&gitcmd; commit -a -m "Make source dfsg clean"
-&gitcmd; tag <replaceable>10.4.dfsg</replaceable>
-&gitcmd; checkout <replaceable>master</replaceable>
-&gitcmd; pull <replaceable>.</replaceable> <replaceable>dfsg_clean</replaceable>
- </screen>
- </sect1>
-
- <sect1 id="gbp.special.nmus">
- <title>Importing NMUs</title>
- <para>
- First create a branch that holds the NMUs from the tip of your
- <option>debian-branch</option> (default is <emphasis>master</emphasis>) once:
- </para>
- <screen>
-&gitcmd; <option>branch</option> <replaceable>nmu</replaceable> <replaceable>master</replaceable>
- </screen>
- <para>
- To import an NMU change into the git repository and use &gbp-import-dsc;:
- </para>
- <screen>
-&gitcmd; checkout <replaceable>master</replaceable>
-&gbp-import-dsc; <option>--debian-branch</option>=<replaceable>nmu</replaceable> <filename>/path/to/package_1.0-1nmu0.dsc</filename>
- </screen>
- <para>
- This will import the NMU onto the branched named <emphasis>nmu</emphasis>
- instead of the default <option>master</option>. This method can also
- be used to import "old" releases into the &git; repository when migrating
- to &git; from another VCS.
- </para>
- </sect1>
-
- <sect1 id="gbp.special.pbuilder">
- <title>Using &pbuilder;</title>
- <para>
- Since &pbuilder; uses different command line arguments than
- &debuild; and &dpkg-buildpackage; we can't simply pass the options on the
- command line but have to wrap them in the <option>--git-builder</option>
- option instead. <command>git-pbuilder</command> helps you with that:
-
-<programlisting>
-<command>git-buildpackage</command> <option>--git-builder="git-pbuilder"</option> <option>--git-cleaner="fakeroot debian/rules clean"</option>
-</programlisting>
-
- Note that we also used a different clean command since since &pdebuildcmd;
- <option>clean</option> means something different than &debuildcmd;
- <option>clean</option>.
-
- We can shorten this further by using <filename>~/.gbp.conf</filename>:
-
-<programlisting>
-cat <<EOF > <filename>~/.gbp.conf</filename>
-[DEFAULT]
-# tell git-buildpackage howto clean the source tree
-cleaner = fakeroot debian/rules clean
-# this is how we invoke pbuilder, arguments passed to git-buildpackage will be
-# passed to dpkg-buildpackge in the chroot
-builder = /usr/bin/git-pbuilder
-</programlisting>
-
- <command>git-pbuilder</command> defaults to building a package for the
- <envar>sid</envar> distribution. If you want to build for another
- distribution pass this in the <envar>DIST</envar> environment variable.
-
- Invoking &gbp-buildpackage; will now invoke &pdebuildcmd; by
- default and all additional command line arguments are passed to
- <command>dpkg-buildpackage</command>. If you want to use
- <command>debuild</command> again (without modifying
- <filename>~/.gbp.conf</filename>) you can use:
-<programlisting>
-<command>git-buildpackage</command> --git-builder=debuild
-</programlisting>
-
- Furthermore, if you don't want this for all your invocations of
- &gbp-buildpackage; you can use <filename>.git/gbp.conf</filename> in
- one of your &git; repositories instead of
- <filename>~/.gbp.conf</filename>.
- </para>
- </sect1>
-
- <sect1 id="gbp.special.hacking">
- <title>Working on random packages</title>
- <para>
- Whenever you need to work on an arbitrary Debian package you can check it
- right into &git; with one command:
-<programlisting>
-git-import-dsc --download <filename>package</filename>
-cd <filename>package</filename>
-git-branch debian
-</programlisting>
- </para>
- <para>
- This uses <command>apt-get</command> to download the source package,
- puts the orig tarball on the <option>upstream-branch</option> and the
- Debian changes on the <option>debian-branch</option> (by default
- <emphasis>master</emphasis>). The second command
- creates a branch called <emphasis>debian</emphasis>. Now you can easily
- modify the package, revert changes you made, create other branches for
- testing, see what changes you made, etc.. When finished just do</para>
-<programlisting>
-git-commit -a
-git-diff debian --
-</programlisting>
- <para>
-
- to get a nice patch that can be submitted to the Debian BTS. You can also
- fetch the source package from an URL:
-
-<programlisting>
-git-import-dsc --download <filename>http://mentors.debian.net/debian/pool/main/i/ipsec-tools/ipsec-tools_0.7.3-9.dsc</filename>
-</programlisting>
-
- The import works incrementally, you can import new versions on top of
- already imported ones for e.g. easy review of changes.
- </para>
- </sect1>
-</chapter>
--- /dev/null
+ <chapter id="gbp.special">
+ <title>Special Use Cases</title>
+ <sect1 id="gbp.special.dfsgfree">
+ <title>Handling non-DFSG clean upstream sources</title>
+ <para>If you have to handle non-DFSG clean upstream sources, you can use a
+ different branch which you have to create once:
+ </para>
+<programlisting>
+ &gitcmd; branch dfsg_clean upstream
+</programlisting>
+ <para>
+ This creates the <emphasis>dfsg_clean</emphasis> branch from the tip of a
+ branch called <emphasis>upstream</emphasis>. Then, when importing a new
+ upstream version, you import the new version on the
+ <option>upstream-branch</option> (by default named
+ <emphasis>upstream</emphasis>) as usual and just don't merge to the
+ <emphasis>debian-branch</emphasis> (by default named
+ <emphasis>master</emphasis>):
+ </para>
+<programlisting>
+ &gbp-import-orig; --no-merge <filename>/path/to/nondfsg-clean-package_10.4.orig.tar.gz</filename>
+ &gitcmd; <option>tag</option> 10.4
+</programlisting>
+ <para>
+ After the import, you can switch to the <emphasis>dfsg_clean</emphasis>
+ branch and get the newly imported changes from the upstream branch:
+ </para>
+<programlisting>
+ &gitcmd; <option>checkout</option> dfsg_clean
+ &gitcmd; <option>pull</option> <filename>.</filename> upstream
+</programlisting>
+ <para>Now make this checkout dfsg clean (preferably by a cleanup script), commit
+ your changes and merge to your <option>debian-branch</option>:</para>
+<programlisting>
+ cleanup-script.sh
+ &gitcmd; commit -a -m "Make source dfsg clean"
+ &gitcmd; tag <replaceable>10.4.dfsg</replaceable>
+ &gitcmd; checkout <replaceable>master</replaceable>
+ &gitcmd; pull <replaceable>.</replaceable> <replaceable>dfsg_clean</replaceable>
+</programlisting>
+ </sect1>
+
+ <sect1 id="gbp.special.nmus">
+ <title>Importing NMUs</title>
+ <para>
+ First, create a branch that holds the NMUs from the tip of your
+ <option>debian-branch</option> (default is <emphasis>master</emphasis>) once:
+ </para>
+<programlisting>
+ &gitcmd; <option>branch</option> <replaceable>nmu</replaceable> <replaceable>master</replaceable>
+</programlisting>
+ <para>
+ To import an NMU, change into the git repository and use &gbp-import-dsc;:
+ </para>
+<programlisting>
+ &gitcmd; checkout <replaceable>master</replaceable>
+ &gbp-import-dsc; <option>--debian-branch</option>=<replaceable>nmu</replaceable> <filename>/path/to/package_1.0-1nmu0.dsc</filename>
+</programlisting>
+ <para>
+ This will import the NMU onto the branched named <emphasis>nmu</emphasis>
+ instead of the default <option>master</option>. This method can also
+ be used to import "old" releases into the &git; repository when migrating
+ to &git; from another VCS.
+ </para>
+ </sect1>
+
+ <sect1 id="gbp.special.pbuilder">
+ <title>Building with &cowbuilder;</title>
+ <para>
+ &cowbuilder; is nice tool to build Debian packages in a defined
+ environment. It makes sure all build-dependencies are specified
+ correctly by building the package in a clean chroot. As its
+ cousin &pbuilder; it can be extended via hooks to (e.g. run
+ autopkg tests) but doesn't need a tarball unpacked but uses copy
+ on write tree to speed up the build.
+ </para>
+
+ <para>
+ Since &cowbuilder; uses different command line arguments than
+ &debuild; and &dpkg-buildpackage;, we can't simply pass the
+ options to run it on the command line. To simplifiy the
+ integration we use a separate helper named &git-pbuilder;.
+ &gbp; has it's own command line option for this:
+ </para>
+<programlisting>
+ &gbp-buildpackage; <option>--git-pbuilder</option>
+</programlisting>
+ <para>
+ This will set the build command to run &git-pbuilder; (which
+ invokes &cowbuilder; by default) and the clean command
+ to <command>/bin/true</command>. It also activates the parsing
+ of several &git-pbuilder; related options
+ like <option>--git-dist</option>, <option>--git-arch</option> and
+ <option>--git-pbuilder-options</option>.
+ </para>
+
+ <para>
+ We can make &git-pbuilder; usage the default by adding it to
+ <filename>~/.gbp.conf</filename>:
+ </para>
+<programlisting>
+cat <<EOF > <filename>~/.gbp.conf</filename>
+[DEFAULT]
+# We invoke cowbuilder via git-pbuilder. Arguments passed to &gbp-buildpackage;
+# will be passed to dpkg-buildpackage in the chroot
+pbuilder = True
+EOF
+</programlisting>
+ <para>
+ <command>git-pbuilder</command> defaults to building a package for the
+ <envar>sid</envar> distribution. If you want to build for another
+ distribution, pass this in the <option>--git-dist</option> option:
+
+<programlisting>
+ &gbp-buildpackage; --git-pbuilder --git-dist=jessie
+</programlisting>
+
+ If you want to use <command>debuild</command> again (without
+ modifying <filename>~/.gbp.conf</filename>), you can use:
+ </para>
+<programlisting>
+ &gbp-buildpackage; --git-no-pbuilder
+</programlisting>
+ <para>
+ In order for all of the above to work you have to create a
+ base chroot first using &git-pbuilder;:
+ </para>
+<programlisting>
+ <command>git-pbuilder</command> create
+</programlisting>
+ <para>
+ This can later be updated using:
+ </para>
+<programlisting>
+ <command>git-pbuilder</command> update
+</programlisting>
+ </sect1>
+
+ <sect1 id="gbp.special.hacking">
+ <title>Working on random packages</title>
+ <para>
+ Whenever you need to work on an arbitrary &debian; package, you can check it
+ right into &git; with one command:
+<programlisting>
+ &gbp-import-dsc; apt:<filename>package</filename>
+ cd <filename>package</filename>
+ &gitcmd; branch debian
+</programlisting>
+ </para>
+ <para>
+ This uses <command>apt-get</command> to download the source package,
+ puts the orig tarball on the <option>upstream-branch</option> and the
+ &debian; changes on the <option>debian-branch</option> (by default
+ <emphasis>master</emphasis>). The second command
+ creates a branch called <emphasis>debian</emphasis>. Now you can easily
+ modify the package, revert changes you made, create other branches for
+ testing, see what changes you made, etc. When finished, just do</para>
+<programlisting>
+ &gitcmd; commit -a
+ &gitcmd; diff debian --
+</programlisting>
+ <para>
+ to get a nice patch that can be submitted to the &debian; BTS. You can also
+ fetch the source package from a URL:
+
+<programlisting>
+ &gbp-import-dsc; <filename>http://mentors.debian.net/debian/pool/main/i/ipsec-tools/ipsec-tools_0.7.3-9.dsc</filename>
+</programlisting>
+
+ The import works incrementally; you can import new versions on top of
+ already imported ones for e.g. easy review of changes.
+ </para>
+
+ </sect1>
+ <sect1 id="gbp.special.sloppytarball">
+ <title>Sloppy tarball creation</title>
+ <para>
+ By default &gbp-buildpackage; uses <filename>debian/changelog</filename> to detect
+ the upstream version and build the corrsponding tarball either via &pristine-tar; or
+ by using <command>git archive</command> directly. This ensures that the tarball matches
+ what's in the Debian archive already.
+ </para>
+ <para>
+ But there might be cases where you don't want to follow these
+ packaging practice and create a fresh <emphasis>dirty</emphasis>
+ tarball that contains additional changes. Such tarballs are not
+ suitable for upload into the archive but might be helpful in local testing.
+ </para>
+ <para>
+ Especially when getting started and when you first want to get a
+ package built and dive into &gbp-dch;, &git-pbuilder; and the 3.0
+ (quilt) format later to find out what exactly
+<programlisting>
+dpkg-source: info: local changes detected, the modified files are:
+ hello-debhelper/configure
+dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/hello-debhelper_2.8-1.diff.har2Xx
+dpkg-source: info: you can integrate the local changes with dpkg-source --commit
+</programlisting>
+means.
+ </para>
+ <para>
+ For that you can force &gbp-buildpackage; to create a tarball
+ from the <emphasis>debian-branch</emphasis> dropping
+ the <filename>debian/</filename> directory. This will give you a
+ tarball that is very close to your current working copy except
+ for the packaging.
+ </para>
+<programlisting>
+ &gbp-buildpackage; --git-ignore-new --git-force-create --git-upstream-tree=SLOPPY --git-no-pristine-tar
+</programlisting>
+ <para>
+ The important part is the <emphasis>SLOPPY</emphasis> above. The
+ other options are there to prevent &gbp-buildpackage; from using
+ &pristine-tar;, to force the creation of a new tarball and to
+ not abort if you have changes in your current working copy.
+
+ If you're still getting an error about <emphasis>unexpected
+ upstream changes</emphasis> make sure you have no uncommitted
+ changes in you workig copy (changes in
+ the <filename>debian/</filename> directory are o.k.) and no
+ files that are ignored by git
+ via <filename>.gitignore</filename>. A <command>git clean
+ -dfx</command> can help here.
+ </para>
+ <para>
+ Please don't use this tarball to upload to the Debian archive
+ since changes outside <filename>debian/</filename> need to be
+ represented by patches in <filename>debian/patches</filename>.
+ See the <command>dpkg-source</command> manpage for
+ details.
+ </para>
+ </sect1>
+
+ <sect1 id="gbp.special.pk4">
+ <title>Integrating with pk4</title>
+ <para>
+ &pk4; provides an easy way to fetch the sources of packages
+ currently installed on the system. In order to let pk4 provide
+ these packages as &git; repositories you can enable &gbp;'s
+ unpack hook:
+ </para>
+ <programlisting>
+mkdir -p ~/.config/pk4/hooks-enabled/unpack/
+ln -s /usr/share/pk4/hooks-available/unpack/gbp ~/.config/pk4/hooks-enabled/unpack/
+ </programlisting>
+ <para>
+ This will make sure packages are imported into a git respository after download.
+ </para>
+ </sect1>
+</chapter>
- <!ENTITY dhfirstname "<firstname>Guido</firstname>">
- <!ENTITY dhsurname "<surname>Guenther</surname>">
- <!ENTITY dhsection "<manvolnum>1</manvolnum>">
<!ENTITY dhconfsection "<manvolnum>5</manvolnum>">
+ <!ENTITY dhsection "<manvolnum>1</manvolnum>">
+ <!ENTITY rpm-mansection "<manvolnum>1</manvolnum>">
+
<!ENTITY dhemail "<email>agx@sigxcpu.org</email>">
- <!ENTITY dhusername "Guido Guenther">
- <!ENTITY gbp-buildpackage "<command>gbp buildpackage</command>">
- <!ENTITY gbp-import-orig "<command>gbp import-orig</command>">
- <!ENTITY gbp-import-dsc "<command>gbp import-dsc</command>">
- <!ENTITY gbp-import-dscs "<command>gbp import-dscs</command>">
- <!ENTITY gbp-config "<command>gbp config</command>">
- <!ENTITY gbp-dch "<command>gbp dch</command>">
+ <!ENTITY dhfirstname "<firstname>Guido</firstname>">
+ <!ENTITY dhsurname "<surname>Günther</surname>">
+ <!ENTITY dhusername "Guido Günther">
+ <!ENTITY rpm-email "<email>markus.lehtonen@linux.intel.com</email>">
+ <!ENTITY rpm-firstname "<firstname>Markus</firstname>">
+ <!ENTITY rpm-surname "<surname>Lehtonen</surname>">
+ <!ENTITY rpm-username "Markus Lehtonen">
+
+ <!ENTITY cowbuildercmd "<command>cowbuilder</command>">
+ <!ENTITY debuildcmd "<command>debuild</command>">
<!ENTITY gbp "<command>gbp</command>">
- <!ENTITY gbp-pull "<command>gbp pull</command>">
- <!ENTITY gbp-clone "<command>gbp clone</command>">
- <!ENTITY gbp-pq "<command>gbp pq</command>">
- <!ENTITY gbp-create-remote-repo "<command>gbp create-remote-repo</command>">
- <!ENTITY git-pbuilder "<command>git pbuilder</command>">
+ <!ENTITY gbp-builder-mock "<command>gbp-builder-mock</command>">
+ <!ENTITY gbp-buildpackage "<command>gbp buildpackage</command>">
+ <!ENTITY gbp-buildpackage-rpm "<command>gbp buildpackage-rpm</command>">
+ <!ENTITY gbp-clone "<command>gbp clone</command>">
+ <!ENTITY gbp-config "<command>gbp config</command>">
+ <!ENTITY gbp-create-remote-repo "<command>gbp create-remote-repo</command>">
+ <!ENTITY gbp-dch "<command>gbp dch</command>">
+ <!ENTITY gbp-export-orig "<command>gbp export-orig</command>">
+ <!ENTITY gbp-import-dsc "<command>gbp import-dsc</command>">
+ <!ENTITY gbp-import-dscs "<command>gbp import-dscs</command>">
+ <!ENTITY gbp-import-orig "<command>gbp import-orig</command>">
+ <!ENTITY gbp-import-ref "<command>gbp import-ref</command>">
+ <!ENTITY gbp-import-srpm "<command>gbp import-srpm</command>">
+ <!ENTITY gbp-pq "<command>gbp pq</command>">
+ <!ENTITY gbp-pq-export "<command>gbp pq <option>export</option></command>">
+ <!ENTITY gbp-pq-import "<command>gbp pq <option>import</option></command>">
+ <!ENTITY gbp-pq-rebase "<command>gbp pq <option>rebase</option></command>">
+ <!ENTITY gbp-pq-rpm "<command>gbp pq-rpm</command>">
+ <!ENTITY gbp-pristine-tar "<command>gbp pristine-tar</command>">
+ <!ENTITY gbp-pull "<command>gbp pull</command>">
+ <!ENTITY gbp-push "<command>gbp push</command>">
+ <!ENTITY gbp-setup-gitattributes "<command>gbp setup-gitattributes</command>">
+ <!ENTITY gbp-rpm-ch "<command>gbp rpm-ch</command>">
+ <!ENTITY gbp-tag "<command>gbp tag</command>">
+ <!ENTITY gbp.conf "<filename>gbp.conf</filename>">
+ <!ENTITY git-pbuilder "<command>git-pbuilder</command>">
+ <!ENTITY git-qemubuilder "<command>git-pbuilder</command>">
<!ENTITY gitcmd "<command>git</command>">
<!ENTITY gitkcmd "<command>gitk</command>">
- <!ENTITY cowbuildercmd "<command>cowbuilder</command>">
<!ENTITY pbuildercmd "<command>pbuilder</command>">
<!ENTITY pdebuildcmd "<command>pdebuild</command>">
- <!ENTITY debuildcmd "<command>debuild</command>">
- <!ENTITY gbp.conf "<filename>gbp.conf</filename>">
+ <!ENTITY quilt "<command>quilt</command>">
+ <!ENTITY rpmbuild "<command>rpmbuild</command>">
+ <!ENTITY uscan "<command>uscan</command>">
+ <!ENTITY wget "<command>wget</command>">
- <!ENTITY rpm-firstname "<firstname>Markus</firstname>">
- <!ENTITY rpm-surname "<surname>Lehtonen</surname>">
- <!ENTITY rpm-email "<email>markus.lehtonen@linux.intel.com</email>">
- <!ENTITY rpm-username "Markus Lehtonen">
- <!ENTITY rpm-mansection "<manvolnum>1</manvolnum>">
- <!ENTITY gbp-buildpackage-rpm "<command>gbp buildpackage-rpm</command>">
- <!ENTITY gbp-import-orig-rpm "<command>gbp import-orig-rpm</command>">
- <!ENTITY gbp-import-srpm "<command>gbp import-srpm</command>">
- <!ENTITY gbp-pq-rpm "<command>gbp pq-rpm</command>">
- <!ENTITY gbp-rpm-ch "<command>gbp rpm-ch</command>">
- <!ENTITY rpmbuild "<command>rpmbuild</command>">
- <!ENTITY wget "<command>wget</command>">
+ <!ENTITY debian-branch "<option>debian-branch</option>">
+ <!ENTITY upstream-branch "<option>upstream-branch</option>">
- <!ENTITY debian "<productname>Debian</productname>">
- <!ENTITY git "<productname>Git</productname>">
+ <!ENTITY apt-get "<productname>apt-get</productname>">
+ <!ENTITY cowbuilder "<productname>Cowbuilder</productname>">
<!ENTITY dch "<productname>dch</productname>">
- <!ENTITY pbuilder "<productname>Pbuilder</productname>">
- <!ENTITY gitloaddirs "<productname>Git_load_dirs</productname>">
+ <!ENTITY debian "<productname>Debian</productname>">
<!ENTITY debuild "<productname>Debuild</productname>">
- <!ENTITY svn-buildpackage "<productname>svn-buildpackage</productname>">
- <!ENTITY gpg "<productname>GPG</productname>">
+ <!ENTITY dget "<productname>dget</productname>">
<!ENTITY dpkg-buildpackage "<productname>Dpkg-buildpackage</productname>">
<!ENTITY dpkg-source "<productname>Dpkg-source</productname>">
- <!ENTITY pristine-tar "<productname>pristine-tar</productname>">
- <!ENTITY apt-get "<productname>apt-get</productname>">
- <!ENTITY dget "<productname>dget</productname>">
- <!ENTITY lintian "<productname>lintian</productname>">
+ <!ENTITY git "<productname>Git</productname>">
+ <!ENTITY gitloaddirs "<productname>Git_load_dirs</productname>">
<!ENTITY gnu "<acronym>GNU</acronym>">
+ <!ENTITY gpg "<productname>GPG</productname>">
<!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
+ <!ENTITY lintian "<productname>lintian</productname>">
+ <!ENTITY mock "<productname>mock</productname>">
+ <!ENTITY pbuilder "<productname>Pbuilder</productname>">
+ <!ENTITY pk4 "<productname>pk4</productname>">
+ <!ENTITY pristine-tar "<productname>pristine-tar</productname>">
+ <!ENTITY svn-buildpackage "<productname>svn-buildpackage</productname>">
+
+ <!ENTITY changelog " <filename>debian/changelog</filename>">
+
+ <!ENTITY dep14 "<ulink url='https://dep-team.pages.debian.net/deps/dep14/'><citetitle>DEP-14</citetitle></ulink>">
+ <!ENTITY manual "<ulink url='https://honk.sigxcpu.org/piki/projects/git-buildpackage'>here</ulink>">
+ <!ENTITY pyformat "<ulink url='https://docs.python.org/2/library/stdtypes.html#string-formatting'><citetitle>Python format string</citetitle></ulink>">
+
+++ /dev/null
- <para>
- git-buildpackage, all associated scripts and programs, this manual,
- and all build scripts are Copyright © 2006-2014 Guido Guenther.
- </para>
- <para>
- 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; Version 2 of the License.
- </para>
-
- <para>
- 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.
- </para>
-
- <para>
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- </para>
--- /dev/null
+ <para>
+ git-buildpackage, all associated scripts and programs, this manual,
+ and all build scripts are Copyright © 2006-2017 Guido Günther.
+ </para>
+ <para>
+ 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; Version 2 of the License.
+ </para>
+
+ <para>
+ 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.
+ </para>
+
+ <para>
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, please see
+ <http://www.gnu.org/licenses/>
+ </para>
--- /dev/null
+body {
+ font-family: Verdana, "Bitstream Vera Sans", sans-serif;
+ font-size: large;
+}
+
+h1 {
+ font-weight: normal;
+ font-variant: small-caps;
+}
+
+h2, h3 {
+ font-weight: normal;
+}
+
+a {
+ color: #182C41 !important;
+ font-weight: normal;
+ transition: background-color 0.2s linear;
+}
+
+a:hover {
+ background-color: #eef;
+}
+
+a[name] {
+ background-color: #fff;
+}
+
+pre {
+ background: #eef;
+ border: solid 1px #aaf;
+ padding: 0.5em;
+}
+
+pre.programlisting .command, pre.programlisting .filename, pre.programlisting .option, pre.programlisting .replaceable {
+ background: none;
+}
+
+.command {
+ font-style: italic;
+ font-weight: normal;
+ padding: 1px;
+}
+
+.filename {
+ background: #eee;
+ padding: 1px;
+}
+
+.option {
+ background: rgba(150,150,150,0.2);
+ padding: 1px;
+}
+
+.replaceable {
+ background: rgba(150,150,150,0.2);
+ padding: 1px;
+}
+
+table.variablelist {
+ border: none;
+}
+
+.variablelist th,td {
+ border: solid 1px #ddd;
+}
+
+div.book div.toc {
+ background: url("gbp.svg") no-repeat;
+ background-position: center;
+}
+
+div .titlepage table p.title {
+ font-size: 300%;
+ font-weight: normal;
+ margin: 0.5em;
+}
+
+body.chapter table.navigation th {
+ font-weight: normal;
+ margin: 0.5em;
+}
+
+body.appendix table.navigation th {
+ font-weight: normal;
+ margin: 0.5em;
+}
+
+body.refentry table.navigation th {
+ font-weight: normal;
+ margin: 0.5em;
+}
+
+body.refentry code.option, body.refentry tt.replaceable, body.refentry tt.filename {
+ background: none;
+}
+
+table.warning {
+ border-style: solid;
+ border-width: 5px;
+ border-collapse: collapse;
+ background: rgba(252, 175, 62, 0.1);
+ border-color: rgba(252, 175, 62, 0.2);
+}
+
+table.warning td {
+ border-width: 2px;
+ border-color: rgba(252, 175, 62, 0.2);
+}
+
+table.footnotes td {
+ border: none;
+}
+
+div.mediaobject {
+ background: #f5f5f5;
+ border-width: 2px;
+ border-color: lightgrey;
+ border-style: solid;
+}
+
+div.mediaobject img {
+ margin-left: auto;
+ margin-right: auto;
+ display: block;
+ padding: 5px 0px 0px 0px;
+}
+
+div.mediaobject p {
+ text-align: center;
+ font-style: italic;
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="127.27471mm"
+ height="121.55948mm"
+ viewBox="0 0 127.27471 121.55948"
+ version="1.1"
+ id="svg4919"
+ inkscape:version="0.92.0 r15299"
+ sodipodi:docname="gbp-greyscale.svg">
+ <title
+ id="title5724">Git-buildpackage Logo</title>
+ <defs
+ id="defs4913">
+ <filter
+ style="color-interpolation-filters:sRGB"
+ inkscape:label="Greyscale"
+ id="filter4703">
+ <feColorMatrix
+ values="0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0 0 0 1 0 "
+ id="feColorMatrix4701" />
+ </filter>
+ <radialGradient
+ r="5"
+ fy="41.5"
+ fx="5"
+ cy="41.5"
+ cx="5"
+ gradientTransform="matrix(0.990017,0,0,1.1,32.1147,-5.15)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3718-7"
+ xlink:href="#linearGradient3681"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient3681"
+ inkscape:collect="always">
+ <stop
+ id="stop3683"
+ offset="0"
+ style="stop-color:black;stop-opacity:1;" />
+ <stop
+ id="stop3685"
+ offset="1"
+ style="stop-color:black;stop-opacity:0;" />
+ </linearGradient>
+ <radialGradient
+ r="5"
+ fy="41.5"
+ fx="5"
+ cy="41.5"
+ cx="5"
+ gradientTransform="matrix(0.99001,0,0,1.1,-14.88523,-86.15)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3720-36"
+ xlink:href="#linearGradient3681"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientTransform="matrix(1.179548,0,0,1,-4.219389,0)"
+ y2="34.999718"
+ x2="17.554192"
+ y1="46.000275"
+ x1="17.554192"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3722-5"
+ xlink:href="#linearGradient3703"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient3703">
+ <stop
+ id="stop3705"
+ offset="0"
+ style="stop-color:black;stop-opacity:0;" />
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0.5"
+ id="stop3711" />
+ <stop
+ id="stop3707"
+ offset="1"
+ style="stop-color:black;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4210"
+ id="linearGradient5912"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,1.329903,0,-8.66441)"
+ x1="24.990499"
+ y1="49.424099"
+ x2="23.451571"
+ y2="14.38251" />
+ <linearGradient
+ id="linearGradient4210">
+ <stop
+ style="stop-color:#eaba6f;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop4212" />
+ <stop
+ style="stop-color:#b97a1b;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop4214" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="45.934479"
+ x2="43.00663"
+ y1="30.554907"
+ x1="23.451576"
+ id="linearGradient4565-1"
+ xlink:href="#linearGradient4559"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient4559"
+ inkscape:collect="always">
+ <stop
+ id="stop4561"
+ offset="0"
+ style="stop-color:#ffffff;stop-opacity:1;" />
+ <stop
+ id="stop4563"
+ offset="1"
+ style="stop-color:#ffffff;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="17.4375"
+ x2="26.5625"
+ y1="17.5"
+ x1="35.1875"
+ id="linearGradient4538-3"
+ xlink:href="#linearGradient3681"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="19"
+ x2="23.9375"
+ y1="19"
+ x1="28.0625"
+ id="linearGradient4766-9"
+ xlink:href="#linearGradient4559"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="11.473516"
+ x2="30.007845"
+ y1="7.1424866"
+ x1="23.157747"
+ id="linearGradient4776-0"
+ xlink:href="#linearGradient4770"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient4770"
+ inkscape:collect="always">
+ <stop
+ id="stop4772"
+ offset="0"
+ style="stop-color:#fcf3e6;stop-opacity:1;" />
+ <stop
+ id="stop4774"
+ offset="1"
+ style="stop-color:#fcf3e6;stop-opacity:0;" />
+ </linearGradient>
+ <filter
+ style="color-interpolation-filters:sRGB"
+ inkscape:label="Greyscale"
+ id="filter4699">
+ <feColorMatrix
+ values="0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0 0 0 1 0 "
+ id="feColorMatrix4697" />
+ </filter>
+ <filter
+ style="color-interpolation-filters:sRGB"
+ inkscape:label="Greyscale"
+ id="filter4695">
+ <feColorMatrix
+ values="0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0 0 0 1 0 "
+ id="feColorMatrix4693" />
+ </filter>
+ <filter
+ style="color-interpolation-filters:sRGB"
+ inkscape:label="Greyscale"
+ id="filter4691">
+ <feColorMatrix
+ values="0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0 0 0 1 0 "
+ id="feColorMatrix4689" />
+ </filter>
+ <filter
+ style="color-interpolation-filters:sRGB"
+ inkscape:label="Greyscale"
+ id="filter4687">
+ <feColorMatrix
+ values="0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0 0 0 1 0 "
+ id="feColorMatrix4685" />
+ </filter>
+ <filter
+ style="color-interpolation-filters:sRGB"
+ inkscape:label="Greyscale"
+ id="filter4683">
+ <feColorMatrix
+ values="0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0 0 0 1 0 "
+ id="feColorMatrix4681" />
+ </filter>
+ <filter
+ style="color-interpolation-filters:sRGB"
+ inkscape:label="Greyscale"
+ id="filter4679">
+ <feColorMatrix
+ values="0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0.21 0.72 0.072 0 0 0 0 0 1 0 "
+ id="feColorMatrix4677" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="52.745428"
+ inkscape:cy="200.19578"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata4916">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title>Git-buildpackage Logo</dc:title>
+ <dc:date>2017-02-05</dc:date>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Guido Günther</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <dc:rights>
+ <cc:Agent>
+ <dc:title></dc:title>
+ </cc:Agent>
+ </dc:rights>
+ <cc:license
+ rdf:resource="https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-37.614072,-80.242321)">
+ <g
+ id="g5718">
+ <g
+ style="opacity:0.4;filter:url(#filter4703)"
+ transform="matrix(2.8665475,0,0,2.3453609,33.88756,91.335301)"
+ id="g3713-0">
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:1;fill:url(#radialGradient3718-7);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.20000052;stroke-opacity:1"
+ d="M 37.064781,35 H 42 v 11 h -4.935219 z"
+ id="rect1907-9" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="scale(-1)"
+ style="opacity:1;fill:url(#radialGradient3720-36);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.20000052;stroke-opacity:1"
+ d="M -9.9351835,-46 H -5 v 11 h -4.9351835 z"
+ id="rect3689-63" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:1;fill:url(#linearGradient3722-5);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.20000052;stroke-opacity:1"
+ d="M 9.9351835,35 H 37.064782 V 46 H 9.9351835 Z"
+ id="rect3693-85" />
+ </g>
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ sodipodi:nodetypes="ccccccccccccc"
+ id="rect3115-6"
+ d="M 11.76152,11.650434 23,10.962934 l 0.03125,0.6875 h 11.73537 c 1.342971,0 2.174135,0.505422 2.736635,1.894444 l 1.9375,5.830122 v 20.618876 c 0,1.326522 -1.081164,2.394444 -2.424135,2.394444 H 9.8865199 c -1.3429709,0 -2.4241352,-1.067922 -2.4241352,-2.394444 V 19.375 l 1.875,-5.955122 c 0.375,-1.076522 1.0811643,-1.769444 2.4241353,-1.769444 z"
+ style="color:#000000;display:block;overflow:visible;visibility:visible;fill:url(#linearGradient5912);fill-opacity:1;fill-rule:nonzero;stroke:#a0670c;stroke-width:1.00000083;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ style="color:#000000;display:block;overflow:visible;visibility:visible;opacity:0.50549454;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient4565-1);stroke-width:1.00000095;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ d="m 12.492646,12.612816 h 21.566315 c 1.258979,0 2.03816,0.473773 2.56548,1.775816 l 1.816325,5.465046 V 39.55642 c 0,1.243457 -0.638546,1.869507 -1.897524,1.869507 h -26.30833 c -1.2589786,0 -1.7725248,-0.68855 -1.7725248,-1.932007 V 19.853678 L 10.220121,14.27146 c 0.351547,-1.009112 1.013546,-1.658644 2.272525,-1.658644 z"
+ id="path3847-1"
+ sodipodi:nodetypes="ccccccccccc"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ sodipodi:nodetypes="ccccccccc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path4740-1"
+ d="m 8.375,19.875 14.6875,0.375 -0.03783,-4.687168 c 0,0 6.559069,-0.156768 6.559069,-0.156768 0,0 -6.565647,-0.218175 -6.565647,-0.218175 L 23,13.125 22.710804,13.093243 22.625,19 Z"
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.50549454;fill:#000000;fill-opacity:0.75568183;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ sodipodi:nodetypes="cccccc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path4742-5"
+ d="M 8.5,19.8125 22.625,19.03125 22.75,12.125 22.28125,18.53125 9.3125,19.4375 Z"
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#f5ddb8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ sodipodi:nodetypes="cccccc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path4744-9"
+ d="M 22.3125,18.5625 8,19.6875 l 1.875,-6.25 c 0.499807,-0.989872 1.396594,-1.384276 2.5625,-1.375 l 10.34375,-0.625 z"
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#dcbd8e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ sodipodi:nodetypes="ccccc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path4746-8"
+ d="m 23,13.125 v 5.9375 l 14.6875,0.0625 -2.222881,-5.929687 z"
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.42857145;fill:url(#linearGradient4538-3);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ sodipodi:nodetypes="cccccc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path4748-4"
+ d="M 39.3125,19.375 24.75,12.625 24.5,4.9375 36.07369,11.644276 c 0.430764,0.31509 0.903173,0.75525 1.17631,1.293224 z"
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#c68b31;fill-opacity:1;fill-rule:evenodd;stroke:#a0670c;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path4758-8"
+ d="m 23,19 v 1 h 15 l -0.4375,-1 z"
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.23076926;fill:url(#linearGradient4766-9);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path4768-1"
+ d="m 25.190679,12.246913 -0.176777,-6.4081549 9.987884,5.7894369 -9.501748,-5.2149127 0.176777,5.5242717 3.49134,2.165515 z"
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:url(#linearGradient4776-0);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ inkscape:connector-curvature="0" />
+ <path
+ transform="matrix(2.8665446,0,0,2.8665446,33.88757,70.227331)"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path4528-0"
+ d="m 23,19 -0.0625,-3.4375 6.875,-0.125 0.375,0.25 -7,0.0625 z"
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.10989009;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;filter:url(#filter4703)"
+ inkscape:connector-curvature="0" />
+ <rect
+ id="minus-7"
+ width="18.184086"
+ height="6.0613618"
+ x="67.35537"
+ y="142.2375"
+ style="fill:none;stroke:#030000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4699)" />
+ <use
+ style="fill:none;stroke:#030000;stroke-opacity:1;filter:url(#filter4695)"
+ xlink:href="#minus-7"
+ transform="translate(24.24545,-1.8e-5)"
+ id="use5-6"
+ x="0"
+ y="0"
+ width="100%"
+ height="100%" />
+ <use
+ style="fill:none;stroke:#030000;stroke-opacity:1;filter:url(#filter4691)"
+ xlink:href="#minus-7"
+ transform="translate(48.4909,-1.8e-5)"
+ id="use7-3"
+ x="0"
+ y="0"
+ width="100%"
+ height="100%" />
+ <path
+ id="plus-1"
+ d="m 73.41672,153.12009 v 6.06128 h -6.06137 v 6.06141 h 6.06137 v 6.0614 h 6.06137 v -6.0614 h 6.06135 v -6.06141 h -6.06135 v -6.06128 z"
+ inkscape:connector-curvature="0"
+ style="fill:#c00000;fill-opacity:1;stroke:#00e400;stroke-width:0.00000148;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0;filter:url(#filter4687)" />
+ <use
+ style="fill:#c00000;fill-opacity:1;stroke:#00e400;stroke-width:0.00000049;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0;filter:url(#filter4683)"
+ xlink:href="#plus-1"
+ transform="translate(24.24545,2e-6)"
+ id="use10-7"
+ x="0"
+ y="0"
+ width="100%"
+ height="100%" />
+ <use
+ style="fill:#c00000;fill-opacity:1;stroke:#00e400;stroke-width:0.00000049;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0;filter:url(#filter4679)"
+ xlink:href="#plus-1"
+ transform="translate(48.4909,2e-6)"
+ id="use12-5"
+ x="0"
+ y="0"
+ width="100%"
+ height="100%" />
+ </g>
+ </g>
+</svg>
+++ /dev/null
-<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
-<!ENTITY dbstyle PUBLIC "-//Gtk//DOCUMENT Gtk-doc HTML Stylesheet//EN" CDATA DSSSL>
-]>
-
-<style-sheet>
-<style-specification use="gtk">
-<style-specification-body>
-
-;; Don't split up the doc as much.
-(define (chunk-element-list)
- (list (normalize "preface")
- (normalize "chapter")
- (normalize "appendix")
- (normalize "article")
- (normalize "glossary")
- (normalize "bibliography")
- (normalize "index")
- (normalize "colophon")
- (normalize "setindex")
- (normalize "reference")
- (normalize "refentry")
- (normalize "part")
- (normalize "book") ;; just in case nothing else matches...
- (normalize "set") ;; sets are definitely chunks...
- ))
-
-</style-specification-body>
-</style-specification>
-<external-specification id="gtk" document="dbstyle">
-</style-sheet>
-
-<!--
-# arch-tag: web stylesheet for documentation
--->
+++ /dev/null
-<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
-<!ENTITY dbstyle PUBLIC "-//GtkViaAlcove//DOCUMENT Gtk-doc HTML Stylesheet//EN" CDATA DSSSL>
-]>
-
-<style-sheet>
-<style-specification use="gtk">
-<style-specification-body>
-
-;; Don't split up the doc as much.
-(define (chunk-element-list)
- (list (normalize "preface")
- (normalize "chapter")
- (normalize "appendix")
- (normalize "article")
- (normalize "glossary")
- (normalize "bibliography")
- (normalize "index")
- (normalize "colophon")
- (normalize "setindex")
- (normalize "reference")
- (normalize "refentry")
- (normalize "part")
- (normalize "book") ;; just in case nothing else matches...
- (normalize "set") ;; sets are definitely chunks...
- ))
-
-</style-specification-body>
-</style-specification>
-<external-specification id="gtk" document="dbstyle">
-</style-sheet>
-
-<!--
-# arch-tag: web stylesheet for documentation
--->
+++ /dev/null
-<!DOCTYPE set PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
-[
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % VERSION SYSTEM "version.ent">
- %VERSION;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
- <!ENTITY % MANPAGES.RPM SYSTEM "manpages/manpages-rpm.ent">
- %MANPAGES.RPM;
- <!ENTITY % CHAPTERS SYSTEM "chapters/chapters.ent">
- %CHAPTERS;
- <!ENTITY % CHAPTERS.RPM SYSTEM "chapters/chapters-rpm.ent">
- %CHAPTERS.RPM;
- <!ENTITY book.debian SYSTEM "manual.sgml">
- <!ENTITY book.rpm SYSTEM "manual-rpm.sgml">
- <!ENTITY gbp.copyright SYSTEM "copyright.sgml">
-]>
-
-<set id="index">
- <setinfo>
- <title>Building Packages with git-buildpackage suite</title>
- <subtitle>Version: &gbp-version;</subtitle>
- </setinfo>
-
- &book.debian;
- &book.rpm;
-</set>
-
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
-[
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages-rpm.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage-rpm Manual</title>
-&man.gbp.buildpackage.rpm;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.buildpackage;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.clone;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.config;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.create.remote.repo;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.dch;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.importdsc;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.importdscs;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages-rpm.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage-rpm Manual</title>
-&man.gbp.import.orig.rpm;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.importorig;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages-rpm.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage-rpm Manual</title>
-&man.gbp.import.srpm;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages-rpm.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage-rpm Manual</title>
-&man.gbp.pq.rpm;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.pq;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp.pull;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages-rpm.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage-rpm Manual</title>
-&man.gbp.rpm.ch;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>gbp.conf Manual</title>
-&man.gbp.conf;
-</reference>
+++ /dev/null
-<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
- <!ENTITY % COMMON SYSTEM "common.ent">
- %COMMON;
- <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
- %MANPAGES;
-]>
-
-<reference>
-<title>git-buildpackage Manual</title>
-&man.gbp;
-</reference>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+ <!ENTITY % COMMON SYSTEM "common.ent">
+ %COMMON;
+ <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
+ %MANPAGES;
+]>
+
+<reference>
+<title>git-buildpackage Manual</title>
+&man.gbp;
+&man.gbp.buildpackage;
+&man.gbp.buildpackage.rpm;
+&man.gbp.clone;
+&man.gbp.conf;
+&man.gbp.config;
+&man.gbp.config-files;
+&man.gbp.create.remote.repo;
+&man.gbp.dch;
+&man.gbp.exportorig;
+&man.gbp.importdsc;
+&man.gbp.importdscs;
+&man.gbp.importorig;
+&man.gbp.importref;
+&man.gbp.import.srpm;
+&man.gbp.pq;
+&man.gbp.pq.rpm;
+&man.gbp.pristine.tar;
+&man.gbp.pull;
+&man.gbp.push;
+&man.gbp.rpm.ch;
+&man.gbp.setup.gitattributes;
+&man.gbp.tag;
+</reference>
+++ /dev/null
-<refentry id="man.gbp.buildpackage.rpm">
- <refentryinfo>
- <address>
- &rpm-email;
- </address>
- <author>
- &rpm-firstname;
- &rpm-surname;
- </author>
- </refentryinfo>
- <refmeta><refentrytitle>gbp-buildpackage-rpm</refentrytitle>
- &rpm-mansection;
- </refmeta>
- <refnamediv>
- <refname>git-buildpackage-rpm</refname>
- <refname>gbp-buildpackage-rpm</refname>
- <refpurpose>Build RPM packages from a Git repository</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-buildpackage-rpm;
- <arg><option>--git-[no-]ignore-new</option></arg>
- <arg><option>--git-[no-]ignore-untracked</option></arg>
- <arg><option>--git-tag</option></arg>
- <arg><option>--git-verbose</option></arg>
- <arg><option>--git-color=</option><replaceable>[auto|on|off]</replaceable></arg>
- <arg><option>--git-color-scheme=</option><replaceable>COLOR_SCHEME</replaceable></arg>
- <arg><option>--git-notify=</option><replaceable>[auto|on|off]</replaceable></arg>
- <arg><option>--git-tmp-dir</option>=<replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-vendor</option>=<replaceable>VENDOR</replaceable></arg>
- <arg><option>--git-upstream-branch=</option><replaceable>TREEISH</replaceable></arg>
- <arg><option>--git-packaging-branch=</option><replaceable>BRANCH_NAME</replaceable></arg>
- <arg><option>--git-pq-branch=</option><replaceable>BRANCH_NAME</replaceable></arg>
- <arg><option>--git-ignore-branch</option></arg>
- <arg><option>--git-[no-]submodules</option></arg>
- <arg><option>--git-builder=</option><replaceable>BUILD_CMD</replaceable></arg>
- <arg><option>--git-cleaner=</option><replaceable>CLEAN_CMD</replaceable></arg>
- <arg><option>--git-[no-]sign-tags</option></arg>
- <arg><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable></arg>
- <arg><option>--git-posttag=</option><replaceable>COMMAND</replaceable></arg>
- <arg><option>--git-postbuild=</option><replaceable>COMMAND</replaceable></arg>
- <arg><option>--git-postexport=</option><replaceable>COMMAND</replaceable></arg>
- <arg><option>--git-prebuild=</option><replaceable>COMMAND</replaceable></arg>
- <arg><option>--git-[no-]build</option></arg>
- <arg><option>--git-[no-]hooks</option></arg>
- <arg><option>--git-packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
- <arg><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
- <arg><option>--git-force-create</option></arg>
- <arg><option>--git-no-create-orig</option></arg>
- <arg><option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable></arg>
- <arg><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-compression-level=</option><replaceable>LEVEL</replaceable></arg>
- <arg><option>--git-orig-prefix=</option><replaceable>PREFIX</replaceable></arg>
- <arg><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-rpmbuild-builddir</option>=<replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-rpmbuild-buidrootdir</option>=<replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-rpmbuild-rpmdir</option>=<replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-rpmbuild-sourcedir</option>=<replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-rpmbuild-specdir</option>=<replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-rpmbuild-srpmdir</option>=<replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-export=</option><replaceable>TREEISH</replaceable></arg>
- <arg><option>--git-export-only</option></arg>
- <arg><option>--git-packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-spec-file=</option><replaceable>FILEPATH</replaceable></arg>
- <arg><option>--git-[no-]pristine-tar</option></arg>
- <arg><option>--git-[no-]pristine-tar-commit</option></arg>
- <arg><option>--git-tag-only</option></arg>
- <arg><option>--git-retag</option></arg>
- <arg><option>--git-[no-]patch-export</option></arg>
- <arg><option>--git-patch-export-rev=</option><replaceable>TREEISH</replaceable></arg>
- <arg><option>--git-patch-export-compress=</option><replaceable>THRESHOLD</replaceable></arg>
- <arg><option>--git-patch-export-ignore-path=</option><replaceable>REGEX</replaceable></arg>
- <arg><option>--git-patch-export-squash-until=</option><replaceable>COMMITISH</replaceable></arg>
- <arg><option>--git-[no-]patch-numbers</option></arg>
- <arg><option>--git-spec-vcs-tag</option>=<replaceable>TAG_FORMAT</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-buildpackage-rpm; is used to build RPM packages from a &git;
- repository. It is an RPM counterpart for the &gbp-buildpackage; tool that
- is designed for building Debian packages.
- </para>
- <para>
- &gbp-buildpackage-rpm; will, in order:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Verify that it is being executed from the proper location.
- </para>
- </listitem>
- <listitem>
- <para>
- Verify that the repository doesn't contain any uncommitted source
- changes.
- </para>
- </listitem>
- <listitem>
- <para>
- Verify that it is being executed from the correct branch.
- </para>
- </listitem>
- <listitem>
- <para>
- Export packaging files to a separate build area.
- </para>
- </listitem>
- <listitem>
- <para>
- Create an orig source tarball if it doesn't exist.
- </para>
- </listitem>
- <listitem>
- <para>
- Call <application>rpmbuild</application>(1) (or the application
- specified via <option>--git-builder</option>), passing along all
- command line arguments that don't start with --git-.
- </para>
- </listitem>
- <listitem>
- <para>
- (Optionally) tag the tree after a successful build.
- </para>
- </listitem>
- <listitem>
- <para>
- (Optionally) call a post build hook - e.g. to run
- <productname>rpmlint</productname>.
- </para>
- </listitem>
- <listitem>
- <para>
- (Optionally) call a post tag hook - e.g. to push the results to a
- remote repository after creating the tag.
- </para>
- </listitem>
- </itemizedlist>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- <varlistentry>
- <term><option>--git-[no-]ignore-new</option>
- </term>
- <listitem>
- <para>
- Don't abort if there are uncommitted changes in the source tree or
- the current branch doesn't match the
- <replaceable>PACKAGING-BRANCH</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]ignore-untracked</option>
- </term>
- <listitem>
- <para>
- Don't abort if there are untracked files in the source tree.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-tag</option>
- </term>
- <listitem>
- <para>
- Add a git tag after a successful build.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-builder=<replaceable>BUILD_CMD</replaceable></option>
- </term>
- <listitem>
- <para>
- Use <replaceable>BUILD_CMD</replaceable> instead of
- <command>rpmbuild -ba</command>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-cleaner=<replaceable>CLEAN_CMD</replaceable></option>
- </term>
- <listitem>
- <para>
- Use <replaceable>CLEAN_CMD</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-verbose</option>
- </term>
- <listitem>
- <para>
- Verbose execution
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-color=</option><replaceable>[auto|on|off]</replaceable>
- </term>
- <listitem>
- <para>
- Whether to use colored output.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-color-scheme=</option><replaceable>COLOR_SCHEME</replaceable>
- </term>
- <listitem>
- <para>
- Colors to use in output (when color is enabled). The format for
- COLOR_SCHEME is
- '<debug>:<info>:<warning>:<error>'.
- Numerical values and color names are accepted, empty fields imply
- the default color. For example --git-color-scheme='cyan:34::' would
- show debug messages in cyan, info messages in blue and other messages
- in default (i.e. warning and error messages in red).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-notify=</option><replaceable>[auto|on|off]</replaceable>
- </term>
- <listitem>
- <para>
- Whether to send a desktop notification after the build.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-tmp-dir</option>=<replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Base directory under which temporary directories are created.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-vendor</option>=<replaceable>VENDOR</replaceable>
- </term>
- <listitem>
- <para>
- Distribution vendor name.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-upstream-branch</option>=<replaceable>BRANCH_NAME</replaceable>
- </term>
- <listitem>
- <para>
- Branch to build the orig tarball from if
- <option>--git-upstream-tree</option> is set to
- <replaceable>BRANCH</replaceable>. Default is
- <replaceable>upstream</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-packaging-branch</option>=<replaceable>BRANCH_NAME</replaceable>
- </term>
- <listitem>
- <para>
- If you're not on this branch when invoking &gbp-buildpackage-rpm; it
- will fail. Default is <replaceable>master</replaceable>. This is done
- to make sure you don't accidentally release from a topic branch. Not
- being on this branch will be ignored when using
- <option>--git-ignore-new</option>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-pq-branch</option>=<replaceable>BRANCH_NAME</replaceable>
- </term>
- <listitem>
- <para>
- Name (format string) of the patch-queue/development branch. This
- makes building easier when working with separate packaging and
- development branches.
- </para>
- <para>
- If <option>--git-patch-export</option> is enabled and
- &gbp-buildpackage-rpm; detects that the current branch has a
- patch-queue/development branch it exports the patches from there
- instead of the tip of the current branch (unless
- <option>--git-patch-export-rev</option> is defined, of course).
- Similarly, if the current branch is a patch-queue/development branch
- &gbp-buildpackage-rpm; will automatically enable patch-export and
- export packaging files from the packaging branch instead of the
- current branch (unless <option>--git-export</option>) is defined.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-ignore-branch</option>
- </term>
- <listitem>
- <para>
- Don't check if the current branch matches
- <replaceable>PACKAGING-BRANCH</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]submodules</option>
- </term>
- <listitem>
- <para>
- Include git submodules in the orig tarball.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]sign-tags</option>
- </term>
- <listitem>
- <para>
- GPG sign all created tags.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable>
- </term>
- <listitem>
- <para>
- Use this keyid for gpg signing tags.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-posttag=</option><replaceable>COMMAND</replaceable>
- </term>
- <listitem>
- <para>
- Excecute <replaceable>COMMAND</replaceable> after tagging a new
- version.
- </para>
- <para>
- Exported environment variables are: <envar>GBP_TAG</envar> (the name
- of the generated tag), <envar>GBP_BRANCH</envar> (the branch the
- package was build from) and <envar>GBP_SHA1</envar> (the sha1 of the
- commit the tag was created at).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-postbuild=</option><replaceable>COMMAND</replaceable>
- </term>
- <listitem>
- <para>
- Execute <replaceable>COMMAND</replaceable> after successful
- build.
- </para>
- <para>
- Exported environment variables are: <envar>GBP_CHANGES_FILE</envar>
- (the name of the generated changes file),
- <envar>GBP_BUILD_DIR</envar> (the build dir).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-postexport=</option><replaceable>COMMAND</replaceable>
- </term>
- <listitem>
- <para>
- Execute <replaceable>COMMAND</replaceable> after exporting the source
- tree.
- </para>
- <para>
- Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
- repository the package is being built from),
- <envar>GBP_TMP_DIR</envar> (the temporary directory where the sources
- have been initially exported).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-prebuild=</option><replaceable>COMMAND</replaceable>
- </term>
- <listitem>
- <para>
- Execute <replaceable>COMMAND</replaceable> from the build directory
- before calling <application>rpmbuild</application> or the application
- specified via <option>--git-builder</option>.
- </para>
- <para>
- Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
- repository the package is being built from),
- <envar>GBP_BUILD_DIR</envar> (the build dir).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]build</option>
- </term>
- <listitem>
- <para>
- Enable builder. Note: <option>--git-no-build</option> causes the
- postbuild hook to be disabled, too.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]hooks</option>
- </term>
- <listitem>
- <para>
- Enable running all (cleaner, postexport, prebuild, postbuild, and
- posttag) hooks. Note: the <option>--git-builder</option> command is
- not affected by this option.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Use this tag format when tagging released versions of the package.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Use this tag format when looking for tags of upstream versions,
- default is <replaceable>upstream/%(version)s</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-force-create</option>
- </term>
- <listitem>
- <para>
- Force creation of an orig tarball (overwriting a pre-existing one if
- present).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-no-create-orig</option>
- </term>
- <listitem>
- <para>
- Don't try to create any orig tarball.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Export the packaging files from the current branch head (or the
- treeish object given via <option>--git-export</option> to
- <replaceable>DIRECTORY</replaceable> before building.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-rpmbuild-builddir</option>=<replaceable>DIRECTORY</replaceable>
- </term>
- <term><option>--git-rpmbuild-buildrootdir</option>=<replaceable>DIRECTORY</replaceable>
- </term>
- <term><option>--git-rpmbuild-rpmdir</option>=<replaceable>DIRECTORY</replaceable>
- </term>
- <term><option>--git-rpmbuild-sourcedir</option>=<replaceable>DIRECTORY</replaceable>
- </term>
- <term><option>--git-rpmbuild-specdir</option>=<replaceable>DIRECTORY</replaceable>
- </term>
- <term><option>--git-rpmbuild-srpmdir</option>=<replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Build subdirectory options for rpmbuild builder. Of these
- <option>--git-rpmbuild-sourcedir</option> and
- <option>--git-rpmbuild-specdir</option> also affects where
- &gbp-buildpackage-rpm; exports the packaging files under the export
- directory.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-export=</option><replaceable>TREEISH</replaceable>
- </term>
- <listitem>
- <para>
- Instead of exporting the current branch head, export the treeish
- object <replaceable>TREEISH</replaceable>. The special name
- <replaceable>INDEX</replaceable> exports the current index,
- <replaceable>WC.TRACKED</replaceable> exports all files tracked by
- Git in the current working copy as is,
- <replaceable>WC.UNTRACKED</replaceable> exports all untracked files
- too whereas <replaceable>WC</replaceable> (or
- <replaceable>WC.IGNORED</replaceable>) exports all files in the
- current working directory, even ignored files.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-export-only</option>
- </term>
- <listitem>
- <para>
- Only export packaging files without running builder.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-packaging-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Subdirectory that contains the RPM packaging files.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-spec-file=</option><replaceable>FILEPATH</replaceable>
- </term>
- <listitem>
- <para>
- Relative path to the spec file to use. Special value
- <replaceable>auto</replaceable> causes &gbp-buildpackage-rpm; to
- search and guess. Other values cause the
- <option>--git-packaging-dir</option> option to be ignored: the
- directory of the spec file is used, instead.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable>
- </term>
- <listitem>
- <para>
- How to find the upstream sources used to generate the tarball.
- <replaceable>TAG</replaceable> looks at a tag corresponding to the
- version in the changelog. <replaceable>BRANCH</replaceable> looks at
- the upstream branch given via the
- <option>--git-upstream-branch</option> option. Other values are
- interpreted as treeishs.
- </para>
- <para>
- This doesn't have any effect if <option>--git-pristine-tar</option>
- is being used.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Search for original tarballs in <replaceable>DIRECTORY</replaceable>
- instead of generating them.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-compression-level=</option><replaceable>LEVEL</replaceable>
- </term>
- <listitem>
- <para>
- Specifies the upstream tarball compression level if an upstream
- tarball needs to be built.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-orig-prefix=</option><replaceable>PREFIX</replaceable>
- </term>
- <listitem>
- <para>
- Prefix (directory) to be used when generating tarballs. Special value
- <replaceable>auto</replaceable> causes &gbp-buildpackage-rpm; to
- guess the prefix.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-tag-only</option>
- </term>
- <listitem>
- <para>
- Don't build, only tag and run post-tag hooks.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-retag</option>
- </term>
- <listitem>
- <para>
- Don't fail tag operations if a tag with the same version already
- exists, but, overwrite the existing tag, instead.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-pristine-tar</option>
- </term>
- <listitem>
- <para>
- Use pristine-tar when generating the upstream tarball if it doesn't
- exist.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-pristine-tar-commit</option>
- </term>
- <listitem>
- <para>
- Commit the pristine-tar delta to the pristine-tar branch if a new
- tarball was generated and the pristine-tar data isn't already there.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]patch-export</option>
- </term>
- <listitem>
- <para>
- Create patches from the commits between the upstream version and
- export-treeish. That is, after exporting packaging files (from the
- pacakging directory) &gbp-buildpackage-rpm; creates one patch per
- commit (similar to git-format-patch) and updates the spec file in the
- export dir. You use <option>--git-patch-export-rev</option> to
- specify the tip commit of the patch series.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-patch-export-rev=</option><replaceable>TREEISH</replaceable>
- </term>
- <listitem>
- <para>
- Use <replaceable>TREEISH</replaceable> as the tip commit of the patch
- series instead of the default - i.e. treeish from which the packaging
- files are exported (which is defined with
- <option>--git-export</option>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-patch-export-compress=</option><replaceable>THRESHOLD</replaceable>
- </term>
- <listitem>
- <para>
- Compress (auto-generated) patches larger than given
- <replaceable>THRESHOLD</replaceable> bytes. Special value 0 disabled
- patch compression.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-patch-export-ignore-path=</option><replaceable>REGEX</replaceable>
- </term>
- <listitem>
- <para>
- Exclude changes to path(s) matching <replaceable>REGEX</replaceable>
- in patch generation.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-patch-export-squash-until=</option><replaceable>COMMITISH</replaceable>
- </term>
- <listitem>
- <para>
- Squash commits up to the given <replaceable>COMMITISH</replaceable>
- into one monolitic diff. Could be used if one wants to squash commits
- from an upstream release up to a stable update into a single diff
- (commits on top of the stable would generate one patch per commit as
- usual). The format is '<commit_ish>[:<filename_base>]',
- i.e. commitish optionally followed by a colon and the desired
- filename base for the diff (suffix '.diff' is automatically added by
- &gbp-buildpackage-rpm;). Magic word 'HEAD' translates to the
- patch-export-treeish when given as the squash-point. This allows one
- to configure gbp to always squash all commits into one monolithic
- diff.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]patch-numbers</option>
- </term>
- <listitem>
- <para>
- Whether the patch files should start with a number or not.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-spec-vcs-tag</option>=<replaceable>TAG_FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- &gbp-buildpackage-rpm; always automatically sets/updates the 'VCS:'
- tag in the spec file after exporting. This option defines the format
- string for the 'VCS:' tag. An empty value causes no 'VCS:' tag to be
- inserted and possible old 'VCS:' tag to be removed. Otherwise, the
- old 'VCS:' tag is updated or a new 'VCS:' tag is added if one does
- not exist. In the format string '%(tagname)s' expands to the long tag
- name (from git-describe) and '%(commit)s' expans to the sha1 of the
- exported commit.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>EXAMPLES</title>
- <para>
- Only build a source RPM with &rpmbuild;
- </para>
- <screen>
- &gbp-buildpackage-rpm; -bs
- </screen>
- <para>
- Build an RPM package with &rpmbuild; on a custom branch with the uncommitted
- changes included.
- </para>
- <screen>
- &gbp-buildpackage-rpm; --git-ignore-branch --git-export=WC.UNTRACKED
- </screen>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- <para>
- All options in the config files are specified without the 'git-' prefix.
- </para>
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.import.srpm">,
- <xref linkend="man.gbp.import.orig.rpm">,
- <xref linkend="man.gbp.rpm.ch">,
- <xref linkend="man.gbp.pq.rpm">,
- <citerefentry>
- <refentrytitle>rpmbuild</refentrytitle>
- <manvolnum>8</manvolnum>
- </citerefentry>,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &rpm-username; &rpm-email;
- </para>
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.buildpackage.rpm">
+ <refentryinfo>
+ <address>
+ &rpm-email;
+ </address>
+ <author>
+ &rpm-firstname;
+ &rpm-surname;
+ </author>
+ </refentryinfo>
+ <refmeta><refentrytitle>gbp-buildpackage-rpm</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-buildpackage-rpm</refname>
+ <refpurpose>Build RPM packages from a Git repository</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-buildpackage-rpm;
+ <arg><option>--git-[no-]ignore-new</option></arg>
+ <arg><option>--git-tag</option></arg>
+ <arg><option>--git-verbose</option></arg>
+ <arg><option>--git-color=</option>[auto|on|off]</arg>
+ <arg><option>--git-color-scheme=</option><replaceable>COLOR_SCHEME</replaceable></arg>
+ <arg><option>--git-notify=</option>[auto|on|off]</arg>
+ <arg><option>--git-tmp-dir</option>=<replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--git-vendor</option>=<replaceable>VENDOR</replaceable></arg>
+ <arg><option>--git-native</option>[auto|on|off]</arg>
+ <arg><option>--git-upstream-branch=</option><replaceable>TREEISH</replaceable></arg>
+ <arg><option>--git-packaging-branch=</option><replaceable>BRANCH_NAME</replaceable></arg>
+ <arg><option>--git-ignore-branch</option></arg>
+ <arg><option>--git-[no-]submodules</option></arg>
+ <arg><option>--git-builder=</option><replaceable>BUILD_CMD</replaceable></arg>
+ <arg><option>--git-cleaner=</option><replaceable>CLEAN_CMD</replaceable></arg>
+ <arg><option>--git-[no-]sign-tags</option></arg>
+ <arg><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable></arg>
+ <arg><option>--git-posttag=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-postbuild=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-postexport=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-prebuild=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-preexport=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-[no-]build</option></arg>
+ <arg><option>--git-[no-]hooks</option></arg>
+ <arg><option>--git-packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
+ <arg><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
+ <arg><option>--git-force-create</option></arg>
+ <arg><option>--git-no-create-orig</option></arg>
+ <arg><option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable></arg>
+ <arg><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--git-compression-level=</option><replaceable>LEVEL</replaceable></arg>
+ <arg><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--git-export=</option><replaceable>TREEISH</replaceable></arg>
+ <arg><option>--git-packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--git-spec-file=</option><replaceable>FILEPATH</replaceable></arg>
+ <arg><option>--git-export-sourcedir</option>=<replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--git-export-specdir</option>=<replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--git-[no-]pristine-tar</option></arg>
+ <arg><option>--git-[no-]pristine-tar-commit</option></arg>
+ <arg><option>--git-tag-only</option></arg>
+ <arg><option>--git-retag</option></arg>
+ <arg><option>--git-mock</option></arg>
+ <arg><option>--git-dist</option>=<replaceable>DISTRIBUTION</replaceable></arg>
+ <arg><option>--git-arch</option>=<replaceable>ARCHITECTURE</replaceable></arg>
+ <arg><option>--git-mock-options</option>=<replaceable>OPTIONS</replaceable></arg>
+ <arg><option>--git-mock-root</option>=<replaceable>ROOT</replaceable></arg>
+ <arg><option>--git-spec-vcs-tag</option>=<replaceable>TAG_FORMAT</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-buildpackage-rpm; is used to build RPM packages from a &git;
+ repository. It is an RPM counterpart for the &gbp-buildpackage; tool that
+ is designed for building Debian packages.
+ </para>
+ <para>
+ &gbp-buildpackage-rpm; will, in order:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Verify that it is being executed from the proper location.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Verify that the repository doesn't contain any uncommitted source
+ changes.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Verify that it is being executed from the correct branch.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Export packaging files to a separate build area.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Create an orig source tarball if it doesn't exist.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Call <application>rpmbuild</application>(1) (or the application
+ specified via <option>--git-builder</option>), passing along all
+ command line arguments that don't start with --git-.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) tag the tree after a successful build.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) call a post build hook - e.g. to run
+ <productname>rpmlint</productname>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) call a post tag hook - e.g. to push the results to a
+ remote repository after creating the tag.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ <varlistentry>
+ <term><option>--git-[no-]ignore-new</option>
+ </term>
+ <listitem>
+ <para>
+ Don't abort if there are uncommitted changes in the source tree or
+ the current branch doesn't match the
+ <replaceable>PACKAGING-BRANCH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-tag</option>
+ </term>
+ <listitem>
+ <para>
+ Add a git tag after a successful build.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-builder=<replaceable>BUILD_CMD</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ Use <replaceable>BUILD_CMD</replaceable> instead of
+ <command>rpmbuild -ba</command>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-cleaner=<replaceable>CLEAN_CMD</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ Use <replaceable>CLEAN_CMD</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-verbose</option>
+ </term>
+ <listitem>
+ <para>
+ Verbose execution
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-color=</option>[auto|on|off]
+ </term>
+ <listitem>
+ <para>
+ Whether to use colored output.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-color-scheme=</option><replaceable>COLOR_SCHEME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Colors to use in output (when color is enabled). The format for
+ COLOR_SCHEME is
+ '<debug>:<info>:<warning>:<error>'.
+ Numerical values and color names are accepted, empty fields imply
+ the default color. For example --git-color-scheme='cyan:34::' would
+ show debug messages in cyan, info messages in blue and other messages
+ in default (i.e. warning and error messages in red).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-notify=</option>[auto|on|off]
+ </term>
+ <listitem>
+ <para>
+ Whether to send a desktop notification after the build.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-tmp-dir</option>=<replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Base directory under which temporary directories are created.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-vendor</option>=<replaceable>VENDOR</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Distribution vendor name.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-native=</option>[auto|on|off]
+ </term>
+ <listitem>
+ <para>
+ Define the 'nativity' of a package. The default value
+ <replaceable>auto</replaceable> makes &gbp-buildpackage-rpm; to
+ guess. Guessing is based on the existence of upstream branch.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-upstream-branch</option>=<replaceable>BRANCH_NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Branch to build the orig tarball from if
+ <option>--git-upstream-tree</option> is set to
+ <replaceable>BRANCH</replaceable>. Default is
+ <replaceable>upstream</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-packaging-branch</option>=<replaceable>BRANCH_NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ If you're not on this branch when invoking &gbp-buildpackage-rpm; it
+ will fail. Default is <replaceable>master</replaceable>. This is done
+ to make sure you don't accidentally release from a topic branch. Not
+ being on this branch will be ignored when using
+ <option>--git-ignore-new</option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-ignore-branch</option>
+ </term>
+ <listitem>
+ <para>
+ Don't check if the current branch matches
+ <replaceable>PACKAGING-BRANCH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-[no-]submodules</option>
+ </term>
+ <listitem>
+ <para>
+ Include git submodules in the orig tarball.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-[no-]sign-tags</option>
+ </term>
+ <listitem>
+ <para>
+ GPG sign all created tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this keyid for gpg signing tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-posttag=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> after tagging a new
+ version.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_TAG</envar> (the name
+ of the generated tag), <envar>GBP_BRANCH</envar> (the branch the
+ package was built from) and <envar>GBP_SHA1</envar> (the sha1 of the
+ commit the tag was created at).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-postbuild=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> after successful
+ build.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_CHANGES_FILE</envar>
+ (the name of the generated changes file),
+ <envar>GBP_BUILD_DIR</envar> (the build dir).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-preexport=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> before exporting the source
+ tree.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
+ repository the package is being built from),
+ <envar>GBP_TMP_DIR</envar> (the temporary directory where the sources
+ have been initially exported).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-postexport=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> after exporting the source
+ tree.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
+ repository the package is being built from),
+ <envar>GBP_TMP_DIR</envar> (the temporary directory where the sources
+ have been initially exported).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-prebuild=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> from the build directory
+ before calling <application>rpmbuild</application> or the application
+ specified via <option>--git-builder</option>.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
+ repository the package is being built from),
+ <envar>GBP_BUILD_DIR</envar> (the build dir).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-[no-]build</option>
+ </term>
+ <listitem>
+ <para>
+ Enable builder. Note: <option>--git-no-build</option> causes the
+ postbuild hook to be disabled, too.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-[no-]hooks</option>
+ </term>
+ <listitem>
+ <para>
+ Enable running all (cleaner, preexport, postexport, prebuild, postbuild, and
+ posttag) hooks. Note: the <option>--git-builder</option> command is
+ not affected by this option.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when tagging released versions of the package.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when looking for tags of upstream versions,
+ default is <replaceable>upstream/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-force-create</option>
+ </term>
+ <listitem>
+ <para>
+ Force creation of an orig tarball (overwriting a pre-existing one if
+ present).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-no-create-orig</option>
+ </term>
+ <listitem>
+ <para>
+ Don't try to create any orig tarball.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Export the packaging files from the current branch head (or the
+ treeish object given via <option>--git-export</option> to
+ <replaceable>DIRECTORY</replaceable> before building.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-export-sourcedir</option>=<replaceable>DIRECTORY</replaceable>
+ </term>
+ <term><option>--git-export-specdir</option>=<replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Subdirectories under export directory where packaging files are
+ exported. The default build options of rpmbuild builder are also
+ adjusted accordingly.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-export=</option><replaceable>TREEISH</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Instead of exporting the current branch head, export the treeish
+ object <replaceable>TREEISH</replaceable>. The special name
+ <replaceable>INDEX</replaceable> exports the current index,
+ <replaceable>WC</replaceable>) exports all files in the
+ current working directory.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-packaging-dir=</option><replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Subdirectory that contains the RPM packaging files.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-spec-file=</option><replaceable>FILEPATH</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Relative path to the spec file to use. Special value
+ <replaceable>auto</replaceable> causes &gbp-buildpackage-rpm; to
+ search and guess. Other values cause the
+ <option>--git-packaging-dir</option> option to be ignored: the
+ directory of the spec file is used, instead.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable>
+ </term>
+ <listitem>
+ <para>
+ How to find the upstream sources used to generate the tarball.
+ <replaceable>TAG</replaceable> looks at a tag corresponding to the
+ version in the changelog. <replaceable>BRANCH</replaceable> looks at
+ the upstream branch given via the
+ <option>--git-upstream-branch</option> option. Other values are
+ interpreted as treeishs.
+ </para>
+ <para>
+ This doesn't have any effect if <option>--git-pristine-tar</option>
+ is being used.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Search for original tarballs in <replaceable>DIRECTORY</replaceable>
+ instead of generating them.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-compression-level=</option><replaceable>LEVEL</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Specifies the upstream tarball compression level if an upstream
+ tarball needs to be built.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-tag-only</option>
+ </term>
+ <listitem>
+ <para>
+ Don't build, only tag and run post-tag hooks.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-retag</option>
+ </term>
+ <listitem>
+ <para>
+ Don't fail tag operations if a tag with the same version already
+ exists, but, overwrite the existing tag, instead.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-pristine-tar</option>
+ </term>
+ <listitem>
+ <para>
+ Use pristine-tar when generating the upstream tarball if it doesn't
+ exist.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-pristine-tar-commit</option>
+ </term>
+ <listitem>
+ <para>
+ Commit the pristine-tar delta to the pristine-tar branch if a new
+ tarball was generated and the pristine-tar data isn't already there.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-mock</option>
+ </term>
+ <listitem>
+ <para>
+ Use &mock; to build the rpms by invoking &gbp-builder-mock;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-dist</option>
+ </term>
+ <listitem>
+ <para>
+ Build for this distribution when using &mock; (e.g.: epel-6).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-arch</option>
+ </term>
+ <listitem>
+ <para>
+ Build for this architecture when using mock, default is to build
+ for the current host architecture.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-mock-root</option>
+ </term>
+ <listitem>
+ <para>
+ The mock root to use. Defaults
+ to <replaceable>DIST</replaceable>-<replaceable>ARCH</replaceable>
+ from above.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-mock-options</option>
+ </term>
+ <listitem>
+ <para>
+ Additional options to pass to mock. Default is to pass no
+ additional options.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-spec-vcs-tag</option>=<replaceable>TAG_FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ &gbp-buildpackage-rpm; always automatically sets/updates the 'VCS:'
+ tag in the spec file after exporting. This option defines the format
+ string for the 'VCS:' tag. An empty value causes no 'VCS:' tag to be
+ inserted and possible old 'VCS:' tag to be removed. Otherwise, the
+ old 'VCS:' tag is updated or a new 'VCS:' tag is added if one does
+ not exist. In the format string '%(tagname)s' expands to the long tag
+ name (from git-describe) and '%(commit)s' expans to the sha1 of the
+ exported commit.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>
+ Only build a source RPM with &rpmbuild;
+ </para>
+ <screen>
+ &gbp-buildpackage-rpm; -bs
+ </screen>
+ <para>
+ Build an RPM package with &rpmbuild; on a custom branch with the uncommitted
+ changes included.
+ </para>
+ <screen>
+ &gbp-buildpackage-rpm; --git-ignore-branch --git-export=WC
+ </screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ <para>
+ All options in the config files are specified without the 'git-' prefix.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.import.srpm"/>,
+ <xref linkend="man.gbp.pq.rpm"/>,
+ <xref linkend="man.gbp.rpm.ch"/>,
+ <citerefentry>
+ <refentrytitle>rpmbuild</refentrytitle>
+ <manvolnum>8</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>mock</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &rpm-username; &rpm-email;
+ </para>
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.buildpackage">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta><refentrytitle>gbp-buildpackage</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>git-buildpackage</refname>
- <refname>gbp-buildpackage</refname>
- <refpurpose>Build Debian packages from a Git repository</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-buildpackage;
- <arg><option>--git-[no-]ignore-new</option></arg>
- <arg><option>--git-tag</option></arg>
- <arg><option>--git-verbose</option></arg>
- <arg><option>--git-color=</option><replaceable>[auto|on|off]</replaceable></arg>
- <arg><option>--git-color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable></arg>
- <arg><option>--git-notify=</option><replaceable>[auto|on|off]</replaceable></arg>
- <arg><option>--git-upstream-branch=</option><replaceable>TREEISH</replaceable></arg>
- <arg><option>--git-debian-branch=</option><replaceable>BRANCH_NAME</replaceable></arg>
- <arg><option>--git-ignore-branch</option></arg>
- <arg><option>--git-[no-]submodules</option></arg>
- <arg><option>--git-builder=</option><replaceable>BUILD_CMD</replaceable></arg>
- <arg><option>--git-cleaner=</option><replaceable>CLEAN_CMD</replaceable></arg>
- <arg><option>--git-[no-]pbuilder</option></arg>
- <arg><option>--git-[no-]qemubuilder</option></arg>
- <arg><option>--git-dist=</option><replaceable>DIST</replaceable></arg>
- <arg><option>--git-arch=</option><replaceable>ARCH</replaceable></arg>
- <arg><option>--git-[no-]pbuilder-autoconf</option></arg>
- <arg><option>--git-pbuilder-options</option>=<replaceable>PBUILDER_OPTIONS</replaceable></arg>
- <arg><option>--git-[no-]sign-tags</option></arg>
- <arg><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable></arg>
- <arg><option>--git-posttag=</option><replaceable>COMMAND</replaceable></arg>
- <arg><option>--git-postbuild=</option><replaceable>COMMAND</replaceable></arg>
- <arg><option>--git-postexport=</option><replaceable>COMMAND</replaceable></arg>
- <arg><option>--git-prebuild=</option><replaceable>COMMAND</replaceable></arg>
- <arg><option>--git-[no-]build</option></arg>
- <arg><option>--git-[no-]hooks</option></arg>
- <arg><option>--git-debian-tag=</option><replaceable>tag-format</replaceable></arg>
- <arg><option>--git-upstream-tag=</option><replaceable>tag-format</replaceable></arg>
- <arg><option>--git-debian-tag-msg=</option><replaceable>tag-msg-format</replaceable></arg>
- <arg><option>--git-force-create</option></arg>
- <arg><option>--git-no-create-orig</option></arg>
- <arg><option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable></arg>
- <arg><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-compression=</option><replaceable>TYPE</replaceable></arg>
- <arg><option>--git-compression-level=</option><replaceable>LEVEL</replaceable></arg>
- <arg><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--git-export=</option><replaceable>TREEISH</replaceable></arg>
- <arg><option>--git-[no-]pristine-tar</option></arg>
- <arg><option>--git-[no-]pristine-tar-commit</option></arg>
- <arg><option>--git-[no-]-purge</option></arg>
- <arg><option>--git-dont-purge</option></arg>
- <arg><option>--git-tag-only</option></arg>
- <arg><option>--git-retag</option></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-buildpackage; is used to build Debian source and .deb packages from
- a &git; repository.
- </para>
- <para>
- &gbp-buildpackage; will, in order:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Verify that it is being executed from the proper location.
- </para>
- </listitem>
- <listitem>
- <para>
- Verify that the repository doesn't contain any uncommitted source
- changes.
- </para>
- </listitem>
- <listitem>
- <para>
- Verify that it is being executed from the correct branch.
- </para>
- </listitem>
- <listitem>
- <para>
- (Optionally) export the source tree to a separate build area
- </para>
- </listitem>
- <listitem>
- <para>
- Build an orig tarball if it doesn't exist.
- </para>
- </listitem>
- <listitem>
- <para>
- Call <application>debuild</application>(1) (or the application
- specified via <option>--git-builder</option>) with arguments
- instructing it to ignore &git; meta-data in the diff.gz, passing along
- all arguments given to &gbp-buildpackage; that don't start with --git-.
- </para>
- </listitem>
- <listitem>
- <para>
- (Optionally) tag the tree after a successful build
- </para>
- </listitem>
- <listitem>
- <para>
- (Optionally) call a post build hook - e.g. to run &lintian;
- </para>
- </listitem>
- <listitem>
- <para>
- (Optionally) call a post tag hook - e.g. to push the results to a
- remote repository after creating the tag
- </para>
- </listitem>
- </itemizedlist>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- <varlistentry>
- <term><option>--git-[no-]ignore-new</option>
- </term>
- <listitem>
- <para>
- Don't abort if there are uncommitted changes in the source tree or
- the current branch doesn't match the
- <replaceable>DEBIAN-BRANCH</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-tag</option>
- </term>
- <listitem>
- <para>
- Add a git tag after a successful build.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-builder=<replaceable>BUILD_CMD</replaceable></option>
- </term>
- <listitem>
- <para>
- Use <replaceable>BUILD_CMD</replaceable> instead of
- <command>debuild -i -I</command>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-cleaner=<replaceable>CLEAN_CMD</replaceable></option>
- </term>
- <listitem>
- <para>
- Use <replaceable>CLEAN_CMD</replaceable> instead of
- <command>debuild clean</command>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-pbuilder</option>
- </term>
- <listitem>
- <para>
- Build package using <command>git-pbuilder</command>. Note that this
- overwrites any <option>--git-builder</option> and
- <option>--git-cleaner</option> options.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-qemubuilder</option>
- </term>
- <listitem>
- <para>
- Build package using <command>git-pbuilder</command> with
- <command>qemubuilder</command>. Note that this overwrites any
- <option>--git-builder</option> and <option>--git-cleaner</option>
- options.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-dist=<replaceable>DIST</replaceable></option>
- </term>
- <listitem>
- <para>
- Build for distribution <replaceable>DIST</replaceable> when using
- <command>--git-pbuilder</command>. If unset build for the unstable
- distribution.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-arch=<replaceable>ARCH</replaceable></option>
- </term>
- <listitem>
- <para>
- Build for architecture <replaceable>ARCH</replaceable> when using
- <command>--git-pbuilder</command>. If unset no architecture is passed
- to <command>git-pbuilder</command>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-pbuilder-autoconf</option>
- </term>
- <listitem>
- <para>
- Whether to try to autoconfigure <command>git-pbuilder</command> or to
- rely on the settings in .pbuilderrc. See the
- <command>git-pbuilder</command> manpage for details.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-pbuilder-options</option>
- </term>
- <listitem>
- <para>
- Options to pass to pbuilder
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-verbose</option>
- </term>
- <listitem>
- <para>
- verbose execution
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-color=</option><replaceable>[auto|on|off]</replaceable>
- </term>
- <listitem>
- <para>
- Whether to use colored output.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-notify=</option><replaceable>[auto|on|off]</replaceable>
- </term>
- <listitem>
- <para>
- Whether to send a desktop notification after the build.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable>
- </term>
- <listitem>
- <para>
- Colors to use in output (when color is enabled). The format for
- COLOR_SCHEME is
- '<debug>:<info>:<warning>:<error>'.
- Numerical values and color names are accepted, empty fields imply
- the default color. For example --git-color-scheme='cyan:34::' would
- show debug messages in cyan, info messages in blue and other messages
- in default (i.e. warning and error messages in red).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-upstream-branch</option>=<replaceable>BRANCH_NAME</replaceable>
- </term>
- <listitem>
- <para>
- Branch to build the orig tarball from if
- <option>--git-upstream-tree</option> is set to
- <replaceable>BRANCH</replaceable>. Default is
- <replaceable>upstream</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-debian-branch</option>=<replaceable>BRANCH_NAME</replaceable>
- </term>
- <listitem>
- <para>
- If you're not on this branch when invoking &gbp-buildpackage; it will
- fail. Default is <replaceable>master</replaceable>. This is done to
- make sure you don't accidentally release from a topic branch. Not
- being on this branch will be ignored when using
- <option>--git-ignore-new</option>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-ignore-branch</option>
- </term>
- <listitem>
- <para>
- Don't check if the current branch matches
- <replaceable>DEBIAN-BRANCH</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]sign-tags</option>
- </term>
- <listitem>
- <para>
- GPG sign all created tags
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]submodules</option>
- </term>
- <listitem>
- <para>
- Include git submodules in the orig tarball.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable>
- </term>
- <listitem>
- <para>
- use this keyid for gpg signing tags
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-posttag=</option><replaceable>COMMAND</replaceable>
- </term>
- <listitem>
- <para>
- excecute <replaceable>COMMAND</replaceable> after tagging a new
- version.
- </para>
- <para>
- Exported environment variables are: <envar>GBP_TAG</envar> (the name
- of the generated tag), <envar>GBP_BRANCH</envar> (the branch the
- package was build from) and <envar>GBP_SHA1</envar> (the sha1 of the
- commit the tag was created at).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-postbuild=</option><replaceable>COMMAND</replaceable>
- </term>
- <listitem>
- <para>
- execute <replaceable>COMMAND</replaceable> after successful
- build.
- </para>
- <para>
- Exported environment variables are: <envar>GBP_CHANGES_FILE</envar>
- (the name of the generated changes file),
- <envar>GBP_BUILD_DIR</envar> (the build dir).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-postexport=</option><replaceable>COMMAND</replaceable>
- </term>
- <listitem>
- <para>
- execute <replaceable>COMMAND</replaceable> after exporting the source
- tree - valid only if --git-export-dir has been specified.
- </para>
- <para>
- Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
- repository the package is being built from),
- <envar>GBP_TMP_DIR</envar> (the temporary directory where the sources
- have been initially exported).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-prebuild=</option><replaceable>COMMAND</replaceable>
- </term>
- <listitem>
- <para>
- execute <replaceable>COMMAND</replaceable> from the build directory
- before calling <application>debuild</application> or the application
- specified via <option>--git-builder</option>.
- </para>
- <para>
- Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
- repository the package is being built from),
- <envar>GBP_BUILD_DIR</envar> (the build dir).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]build</option>
- </term>
- <listitem>
- <para>
- Enable builder. Note: <option>--git-no-build</option> causes the
- postbuild hook to be disabled, too.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-[no-]hooks</option>
- </term>
- <listitem>
- <para>
- Enable running all (cleaner, postexport, prebuild, postbuild, and
- posttag) hooks. Note: the <option>--git-builder</option> command is
- not affected by this option.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-debian-tag=</option><replaceable>TAG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- use this tag format when tagging Debian versions, default is
- <replaceable>debian/%(version)s</replaceable>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- use this tag format when looking for tags of upstream versions,
- default is <replaceable>upstream/%(version)s</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-debian-tag-msg=</option><replaceable>tag-msg-format</replaceable>
- </term>
- <listitem>
- <para>use this tag message format when signing Debian versions,
- default is <replaceable>%(pkg)s Debian release %(version)s</replaceable></para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-force-create</option>
- </term>
- <listitem>
- <para>
- Force creation of an orig tarball (overwriting a pre-existing one if
- present)
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-no-create-orig</option>
- </term>
- <listitem>
- <para>
- Don't try to create any orig tarball
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-overlay</option>
- </term>
- <listitem>
- <para>
- Extract orig tarball when using export-dir option (analog to
- mergeWithUpstream in svn-bp)
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Export the current branch head (or the treeish object given via
- <option>--git-export</option> to <replaceable>DIRECTORY</replaceable>
- before building.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-export=</option><replaceable>TREEISH</replaceable>
- </term>
- <listitem>
- <para>
- Instead of exporting the current branch head, export the treeish
- object <replaceable>TREEISH</replaceable>. The special name
- <replaceable>INDEX</replaceable> exports the current index whereas
- the special name <replaceable>WC</replaceable> exports the current
- working copy as is.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable>
- </term>
- <listitem>
- <para>
- How to find the upstream sources used to generate the tarball.
- <replaceable>TAG</replaceable> looks at a tag corresponding to the
- version in the changelog. <replaceable>BRANCH</replaceable> looks at
- the upstream branch given via the
- <option>--git-upstream-branch</option> option. Other values are
- interpreted as treeishs.
- </para>
- <para>
- This doesn't have any effect if <option>--git-pristine-tar</option>
- is being used.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Search for original tarballs in <replaceable>DIRECTORY</replaceable>
- instead of generating them
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-compression=</option><replaceable>TYPE</replaceable>
- </term>
- <listitem>
- <para>
- Specifies the upstream tarball compression type. This will be used to
- locate and build the upstream tarball if necessary. The default is
- <replaceable>auto</replaceable> which derives the compression type
- from the pristine-tar branch if available and falls back to gzip
- otherwise. Other options are <replaceable>gzip</replaceable>,
- <replaceable>bzip2</replaceable>, <replaceable>lzma</replaceable> and
- <replaceable>xz</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-compression-level=</option><replaceable>LEVEL</replaceable>
- </term>
- <listitem>
- <para>
- Specifies the upstream tarball compression level if an upstream
- tarball needs to be built.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git[-no]-purge</option>
- </term>
- <listitem>
- <para>
- Purge (remove) temporary build directory after build
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-dont-purge</option>
- </term>
- <listitem>
- <para>
- Deprecated, use --git-no-purge instead.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-tag-only</option>
- </term>
- <listitem>
- <para>
- don't build, only tag and run post-tag hooks
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-retag</option>
- </term>
- <listitem>
- <para>
- don't fail tag operations if a tag with the same version already
- exists
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-pristine-tar</option>
- </term>
- <listitem>
- <para>
- Use pristine-tar when generating the upstream tarball if it doesn't
- exist.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-pristine-tar-commit</option>
- </term>
- <listitem>
- <para>
- Commit the pristine-tar delta to the pristine-tar branch if a new
- tarball was generated and the pristine-tar data isn't already there.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>EXAMPLES</title>
- <para>
- Build a Debian package using &git-pbuilder; which in turn invokes
- &cowbuildercmd;. Instruct cowbuilder to build within a Wheezy chroot for
- i386.
- </para>
- <screen>
- &gbp-buildpackage; --git-pbuilder --git-arch=i386 --git-dist=wheezy
- </screen>
- <para>
- Note that the above needs a &cowbuildercmd; chroot already. This can be
- created using:
- </para>
- <screen>
- DIST=wheezy ARCH=i386 &git-pbuilder; create
- </screen>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- <para>
- All options in the config files are specified without the 'git-' prefix.
- </para>
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.import.dsc">,
- <xref linkend="man.gbp.import.dscs">,
- <xref linkend="man.gbp.import.orig">,
- <xref linkend="man.gbp.dch">,
- <citerefentry>
- <refentrytitle>git-pbuilder</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>cowbuilder</refentrytitle>
- <manvolnum>8</manvolnum>
- </citerefentry>,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &dhusername; &dhemail;
- </para>
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.buildpackage">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta><refentrytitle>gbp-buildpackage</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-buildpackage</refname>
+ <refpurpose>Build &debian; packages from a &git; repository</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-buildpackage;
+ <arg><option>--git-[no-]ignore-new</option></arg>
+ <arg><option>--git-tag</option></arg>
+ <arg><option>--git-verbose</option></arg>
+ <arg><option>--git-color=</option>[auto|on|off]</arg>
+ <arg><option>--git-color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable></arg>
+ <arg><option>--git-notify=</option>[auto|on|off]</arg>
+ <arg><option>--git-upstream-branch=</option><replaceable>TREEISH</replaceable></arg>
+ <arg><option>--git-debian-branch=</option><replaceable>BRANCH_NAME</replaceable></arg>
+ <arg><option>--git-ignore-branch</option></arg>
+ <arg><option>--git-[no-]submodules</option></arg>
+ <arg><option>--git-builder=</option><replaceable>BUILD_CMD</replaceable></arg>
+ <arg><option>--git-cleaner=</option><replaceable>CLEAN_CMD</replaceable></arg>
+ <arg><option>--git-[no-]overlay</option></arg>
+ <arg><option>--git-[no-]pbuilder</option></arg>
+ <arg><option>--git-[no-]qemubuilder</option></arg>
+ <arg><option>--git-dist=</option><replaceable>DIST</replaceable></arg>
+ <arg><option>--git-arch=</option><replaceable>ARCH</replaceable></arg>
+ <arg><option>--git-[no-]pbuilder-autoconf</option></arg>
+ <arg><option>--git-pbuilder-options</option>=<replaceable>PBUILDER_OPTIONS</replaceable></arg>
+ <arg><option>--git-[no-]sign-tags</option></arg>
+ <arg><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable></arg>
+ <arg><option>--git-preexport=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-postexport=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-prebuild=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-postbuild=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-posttag=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--git-[no-]hooks</option></arg>
+ <arg><option>--git-debian-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--git-debian-tag-msg=</option><replaceable>tag-msg-format</replaceable></arg>
+ <arg><option>--git-upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--git-force-create</option></arg>
+ <arg><option>--git-no-create-orig</option></arg>
+ <arg><option>--git-upstream-signatures=</option>[auto|on|off]</arg>
+ <arg><option>--git-upstream-tree=</option><replaceable>[BRANCH|SLOPPY|TAG|TREEISH]</replaceable></arg>
+ <arg><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--git-compression=</option><replaceable>TYPE</replaceable></arg>
+ <arg><option>--git-compression-level=</option><replaceable>LEVEL</replaceable></arg>
+ <arg rep='repeat'><option>--git-component=</option><replaceable>component</replaceable></arg>
+ <arg><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--git-export=</option><replaceable>TREEISH</replaceable></arg>
+ <arg><option>--git-[no-]pristine-tar</option></arg>
+ <arg><option>--git-[no-]pristine-tar-commit</option></arg>
+ <arg><option>--git-[no-]-purge</option></arg>
+ <arg><option>--git-tag-only</option></arg>
+ <arg><option>--git-retag</option></arg>
+ <arg rep="repeat"><option>OPTION_PASSED_TO_BUILD_CMD</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-buildpackage; is used to build &debian; source and .deb packages from
+ a &git; repository.
+ </para>
+ <para>
+ &gbp-buildpackage; will, in order:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Verify that it is being executed from the proper location.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Verify that the repository doesn't contain any uncommitted source
+ changes.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Verify that it is being executed from the correct branch.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) run a clean command specified
+ with <option>--git-cleaner</option>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) export the source tree to a separate build area.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Build an orig tarball if it doesn't exist. Optionally using &pristine-tar;.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) call a pre build hook.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Call <application>debuild</application>(1) or &cowbuilder;
+ (via <option>--git-pbuilder</option>) or the application
+ specified via <option>--git-builder</option> passing along
+ all arguments given to &gbp-buildpackage; on the command
+ line that don't start with --git-.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) tag the current commit after a successful build.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) call a post build hook - e.g. to run &lintian;.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) call a post tag hook - e.g. to push the results to a
+ remote repository after creating the tag.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <para>
+ All options are prefixed with <option>git-</option> to
+ distinguish options for &gbp-buildpackage; from options passed
+ to the <replaceable>BUILD_CMD</replaceable>:
+ </para>
+ <refsect2>
+ <title>Upstream tarball creation options</title>
+ <para>When &gbp-buildpackage; doesn't find a suitable upstream
+ tarball it will create one either using &pristine-tar;
+ or <command>git archive</command>. These options determine how the tarball is created:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>--git-pristine-tar</option>
+ </term>
+ <listitem>
+ <para>
+ Use pristine-tar when generating the upstream tarball if
+ it doesn't exist. If this mode is enabled
+ the <option>--git-upstream-tag</option>, <option>--git-upstream-tree</option>
+ options have no effect when creating tarballs.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when looking for tags of upstream
+ versions to build the upstream tarballs. Default
+ is <replaceable>upstream/%(version)s</replaceable>. This
+ must be set correctly if you don't want to pass any
+ other options. The default matches what
+ &gbp-import-orig; uses to create tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-upstream-tree=</option><replaceable>[BRANCH|SLOPPY|TAG|TREEISH]</replaceable>
+ </term>
+ <listitem>
+ <para>
+ How to find the upstream sources used to generate the tarball.
+ <replaceable>TAG</replaceable> (the default) looks at a tag corresponding to the
+ version in the changelog. <replaceable>BRANCH</replaceable> looks at
+ the upstream branch given via the
+ <option>--git-upstream-branch</option> option. The <replaceable>SLOPPY</replaceable>
+ option looks at the debian branch given via
+ the <option>--git-debian-branch</option> and drops
+ the <filename>debian/</filename> dir.
+ </para>
+ <para>
+ Other values are interpreted as treeishs.
+ </para>
+ <para>
+ This doesn't have any effect if <option>--git-pristine-tar</option>
+ is being used.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-upstream-branch</option>=<replaceable>BRANCH_NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Branch to build the orig tarball from if
+ <option>--git-upstream-tree</option> is set to
+ <replaceable>BRANCH</replaceable>. Default is
+ <replaceable>upstream</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Search for upstream tarballs in <replaceable>DIRECTORY</replaceable>
+ instead of generating them. If a tarball is not found here it
+ will be generated nevertheless.
+ <replaceable>DIRECTORY</replaceable> can contain a version format
+ substitution pattern, eg: <replaceable>foo-%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-component=</option><replaceable>COMPONENT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ When generating tarballs create an additional upstream
+ tarball of directory <replaceable>COMPONENT</replaceable>
+ in the source tree. Using additional upstream tarballs is
+ a feature of the 3.0 (quilt) source format. See
+ the <command>dpkg-source</command> manpage for details. Note that the
+ <replaceable>--git-pristine-tar-commit</replaceable>
+ option is currently incompatible with this option.
+ </para>
+ <para>
+ This is considered an experimental feature and might
+ change incompatibly.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-pristine-tar-commit</option>
+ </term>
+ <listitem>
+ <para>
+ Commit the pristine-tar delta to the pristine-tar branch if a new
+ tarball was generated and the pristine-tar data isn't already there.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-force-create</option>
+ </term>
+ <listitem>
+ <para>
+ Force creation of an upstream tarball (overwriting a pre-existing one if
+ present).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-no-create-orig</option>
+ </term>
+ <listitem>
+ <para>
+ Don't try to create any upstream tarballs or to create
+ symlinks to existing tarballs in <option>tarball-dir</option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-upstream-signatures=</option>[auto|on|off]
+ </term>
+ <listitem>
+ <para>
+ Whether to export the upstream tarball with signatures.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-[no-]submodules</option>
+ </term>
+ <listitem>
+ <para>
+ Include &git; submodules in the orig tarball if present.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-compression=</option><replaceable>TYPE</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Specifies the upstream tarball compression type. This will be used to
+ locate and build the upstream tarball if necessary. The default is
+ <replaceable>auto</replaceable> which derives the compression type
+ from the pristine-tar branch if available and falls back to gzip
+ otherwise. Other options are <replaceable>gzip</replaceable>,
+ <replaceable>bzip2</replaceable>, <replaceable>lzma</replaceable> and
+ <replaceable>xz</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-compression-level=</option><replaceable>LEVEL</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Specifies the upstream tarball compression level if an upstream
+ tarball needs to be built.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+ <refsect2>
+ <title>Package build options</title>
+ <para>&gbp-buildpackage; can invoke different types of builders
+ to produce the source and binary packages. These options
+ determine which builder is invoked and how.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>--git-builder=<replaceable>BUILD_CMD</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ Use <replaceable>BUILD_CMD</replaceable> instead of
+ <command>debuild -i -I</command>. If you want to use
+ &cowbuilder; or &pbuilder; see
+ the <option>--git-pbuilder</option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-cleaner=<replaceable>CLEAN_CMD</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ Use <replaceable>CLEAN_CMD</replaceable> to clean the
+ source tree before the build. The default
+ is <command>/bin/true</command> (no cleaning).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-pbuilder</option>
+ </term>
+ <listitem>
+ <para>
+ Build the package using <command>git-pbuilder</command> (which
+ uses <command>cowbuilder</command> by default). Note that this overwrites
+ any <option>--git-builder</option> and
+ <option>--git-cleaner</option> options.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-qemubuilder</option>
+ </term>
+ <listitem>
+ <para>
+ Build package using <command>git-pbuilder</command> with
+ <command>qemubuilder</command>. Note that this overwrites any
+ <option>--git-builder</option> and <option>--git-cleaner</option>
+ options.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-dist=<replaceable>DIST</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ Build for distribution <replaceable>DIST</replaceable>
+ when using &git-pbuilder; (either
+ via <option>--git-pbuilder</option>, <option>--git-qemubuilder</option>
+ or the corresponding configuration file options). If
+ unset build for the unstable distribution. The special
+ value <symbol>DEP14</symbol> will set the distribution to
+ build for from the branch name. I.e. if you're starting
+ the build from a branch named
+ <replaceable>debian/wheezy-backports</replaceable> the
+ distribution is set
+ to <replaceable>wheezy-backports</replaceable>. If the
+ branch is named <replaceable>downstream/sid</replaceable>
+ the distribution is set
+ to <replaceable>downstream_sid</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-arch=<replaceable>ARCH</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ Build for architecture <replaceable>ARCH</replaceable>
+ when using &git-pbuilder; (either
+ via <option>--git-pbuilder</option>, <option>--git-qemubuilder</option>
+ or the corresponding configuration file options). If
+ unset no architecture is passed
+ to <command>git-pbuilder</command>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-pbuilder-autoconf</option>
+ </term>
+ <listitem>
+ <para>
+ Whether to try to autoconfigure &git-pbuilder; or to rely on
+ the settings in .pbuilderrc. See the &git-pbuilder; manpage
+ for details. Only takes effect when using &git-pbuilder;
+ (either via <option>--git-pbuilder</option>, <option>--git-qemubuilder</option>
+ or the corresponding configuration file options).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-pbuilder-options</option>
+ </term>
+ <listitem>
+ <para>
+ Options to pass to pbuilder when building via &git-pbuilder; (either
+ via <option>--git-pbuilder</option>, <option>--git-qemubuilder</option>
+ or the corresponding configuration file options). It does so by
+ using the <envar>GIT_PBUILDER_OPTIONS</envar> environment
+ variable to pass options to &git-pbuilder;.
+ </para>
+ <para>
+ As an example, to tell pbuilder to use an alternate
+ .pbuilderrc file, you may run &gbp-buildpackage; with
+ <option>--git-pbuilder-options=<replaceable>"--configfile
+ /tmp/my/pbuilderrc"</replaceable></option>. See
+ <citerefentry>
+ <refentrytitle>pbuilder</refentrytitle>
+ <manvolnum>8</manvolnum>
+ </citerefentry>
+ for more options to pass through here.
+ </para>
+ <para>
+ If unset the <envar>GIT_PBUILDER_OPTIONS</envar> environment
+ variable will be left untouched.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-notify=</option>[auto|on|off]
+ </term>
+ <listitem>
+ <para>
+ Whether to send a desktop notification after the
+ build. This needs python3-notify2 installed.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+ <refsect2>
+ <title>Hook options</title>
+ <para>
+ Hooks allow you to run arbitrary commands at different stages of the
+ build. These options configure what will be run:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>--git-preexport=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> before exporting the source
+ tree. Valid only if --git-export-dir has been specified.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
+ repository the package is being built from),
+ <envar>GBP_BUILD_DIR</envar> (the build dir).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-postexport=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> after exporting the source
+ tree. Valid only if --git-export-dir has been specified. The working
+ directory of this hook is the toplevel directory of
+ the exported source tree.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
+ repository the package is being built from),
+ <envar>GBP_TMP_DIR</envar> (the temporary directory where the sources
+ have been initially exported).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-prebuild=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> from the build directory
+ before calling <application>debuild</application> or the application
+ specified via <option>--git-builder</option>.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
+ repository the package is being built from),
+ <envar>GBP_BUILD_DIR</envar> (the build dir).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-postbuild=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> after successful
+ build. The working directory of this hook is the
+ directory the package was built in.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_CHANGES_FILE</envar>
+ (the name of the generated changes file),
+ <envar>GBP_BUILD_DIR</envar> (the build dir).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-posttag=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> after tagging a new
+ version. The working directory of this hook is the
+ toplevel directory of the &git; repository.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_TAG</envar> (the name
+ of the generated tag), <envar>GBP_BRANCH</envar> (the branch the
+ package was built from) and <envar>GBP_SHA1</envar> (the sha1 of the
+ commit the tag was created at).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-[no-]hooks</option>
+ </term>
+ <listitem>
+ <para>
+ Enable running all (cleaner, preexport, postexport, prebuild, postbuild, and
+ posttag) hooks. Note: the <option>--git-builder</option> command is
+ not affected by this option.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+ <refsect2>
+ <title>Tagging options</title>
+ <variablelist>
+ <varlistentry>
+ <term><option>--git-tag</option>
+ </term>
+ <listitem>
+ <para>
+ Add a git tag after a successful build. It tags the
+ currently checked out commit except when you're on a
+ patch-queue branch. In that case the corresponding debian
+ branch is tagged.
+ </para>
+ <para>
+ This is a command line only option that cannot be
+ specified via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-[no-]sign-tags</option>
+ </term>
+ <listitem>
+ <para>
+ GPG sign all created tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this keyid for gpg signing tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-debian-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when tagging &debian; versions, default is
+ <replaceable>debian/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-debian-tag-msg=</option><replaceable>tag-msg-format</replaceable>
+ </term>
+ <listitem>
+ <para>Use this tag message format when signing &debian; versions,
+ default is <replaceable>%(pkg)s Debian release %(version)s</replaceable></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-retag</option>
+ </term>
+ <listitem>
+ <para>
+ Don't fail tag operations if a tag with the same version
+ already exists. This is a command line only option that
+ cannot be specified via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-tag-only</option>
+ </term>
+ <listitem>
+ <para>
+ Don't build, only tag and run post-tag hooks. This is a
+ command line only option that cannot be specified via
+ &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+ <refsect2>
+ <title>Build area options</title>
+ <para>
+ &gbp-buildpackage; can export the source tree to a different
+ build-area before performing the build. This options specify
+ if and how this is done:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Export the current branch head (or the treeish object given via
+ <option>--git-export</option> to <replaceable>DIRECTORY</replaceable>
+ before building. If unset the source will not be
+ exported before starting the build.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-export=</option><replaceable>TREEISH</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Instead of exporting the current branch head, export the treeish
+ object <replaceable>TREEISH</replaceable>. The special name
+ <replaceable>INDEX</replaceable> exports the current index whereas
+ the special name <replaceable>WC</replaceable> exports the current
+ working copy as is.
+ </para>
+ <para>
+ Note that using <replaceable>WC</replaceable> enables the
+ <option>--git-ignore-branch</option>
+ and <option>--git-ignore-new</option> options as well
+ since when exporting the working copy there's no point in
+ enforcing any branch or modification checks.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git[-no]-purge</option>
+ </term>
+ <listitem>
+ <para>
+ Purge (remove) temporary build area after build. This is
+ the default but it can be turned off for e.g. debugging
+ purposes.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-[no-]overlay</option>
+ </term>
+ <listitem>
+ <para>
+ Extract upstream tarball from <option>tarball-dir</option> when
+ using the <option>export-dir</option> option (in analogy to
+ mergeWithUpstream in svn-bp). Also remove debian/ if
+ contained in the upstream tarball in case of 2.0 and 3.0
+ source formats.
+ </para>
+ <para>
+ This option allows one to keep only the debian/ dir in the version
+ control system.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+ <refsect2>
+ <title>Safety options</title>
+ <para>
+ In order to make sure what you build is what you upload
+ &gbp-buildpackage; performs several safety checks. These
+ options allow one to configure and disable them:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>--git-debian-branch</option>=<replaceable>BRANCH_NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ If you're not on this branch when invoking &gbp-buildpackage; it will
+ fail. Default is <replaceable>master</replaceable>. This is done to
+ make sure you don't accidentally release from a topic branch. Not
+ being on this branch will be ignored when using
+ <option>--git-ignore-new</option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-ignore-branch</option>
+ </term>
+ <listitem>
+ <para>
+ Don't check if the current branch matches
+ <replaceable>DEBIAN-BRANCH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-[no-]ignore-new</option>
+ </term>
+ <listitem>
+ <para>
+ Don't abort if there are uncommitted changes in the source tree or
+ the current branch doesn't match the
+ <replaceable>DEBIAN-BRANCH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+ <refsect2>
+ <title>Color and verbosity options</title>
+ <variablelist>
+ <varlistentry>
+ <term><option>--git-verbose</option>
+ </term>
+ <listitem>
+ <para>
+ Verbose execution. Useful for debugging and bug reports.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-color=</option>[auto|on|off]
+ </term>
+ <listitem>
+ <para>
+ Whether to use colored output.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Colors to use in output (when color is enabled). The format for
+ COLOR_SCHEME is
+ '<debug>:<info>:<warning>:<error>'.
+ Numerical values and color names are accepted, empty fields imply
+ the default color. For example --git-color-scheme='cyan:34::' would
+ show debug messages in cyan, info messages in blue and other messages
+ in default (i.e. warning and error messages in red).
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>
+ Build a &debian; package using &git-pbuilder; which in turn invokes
+ &cowbuildercmd;. Instruct cowbuilder to build within a Wheezy chroot for
+ i386.
+ </para>
+ <screen>
+ &gbp-buildpackage; --git-pbuilder --git-arch=i386 --git-dist=wheezy
+ </screen>
+ <para>
+ Note that the above needs a &cowbuildercmd; chroot already. This can be
+ created using:
+ </para>
+ <screen>
+ DIST=wheezy ARCH=i386 &git-pbuilder; create
+ </screen>
+ <para>
+ To export the source tree without performing any build you can use:
+ </para>
+ <screen>
+ gbp buildpackage --git-export-dir=/where/to/export --git-builder=/bin/true --git-no-pbuilder --git-no-hooks --git-no-purge
+ </screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ <para>
+ All options in the config files must be specified without the 'git-'
+ prefix. So
+ e.g. <option>--git-debian-branch</option>=<replaceable>debian/sid</replaceable>
+ becomes in &gbp.conf;:
+ </para>
+ <programlisting>
+ [buildpackage]
+ debian-branch = debian/sid
+ </programlisting>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.import.dsc"/>,
+ <xref linkend="man.gbp.import.dscs"/>,
+ <xref linkend="man.gbp.import.orig"/>,
+ <xref linkend="man.gbp.dch"/>,
+ <citerefentry>
+ <refentrytitle>git-pbuilder</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>cowbuilder</refentrytitle>
+ <manvolnum>8</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>dpkg-source</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>git-submodule</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &dhusername; &dhemail;
+ </para>
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.clone">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-clone</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>gbp-clone</refname>
-
- <refpurpose>Clone a repository from remote</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-clone;
-
- &man.common.options.synopsis;
- <arg><option>--all</option></arg>
- <arg><option>--[no-]pristine-tar</option></arg>
- <group>
- <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--packaging-branch=</option><replaceable>branch_name</replaceable></arg>
- </group>
- <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--depth=</option><replaceable>depth</replaceable></arg>
- <arg choice="plain"><replaceable>remote_uri</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-clone; clones a remote repository and sets up tracking branches for
- the <emphasis>debian</emphasis>, <emphasis>upstream</emphasis> and
- <emphasis>pristine-tar</emphasis> branches. This way you can easily update
- later using &gbp-pull;.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
-
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--all</option>
- </term>
- <listitem>
- <para>Track all branches, not only <replaceable>debian</replaceable>
- and <replaceable>upstream</replaceable>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>The branch in the Git repository the Debian package is being
- developed on, default is <replaceable>master</replaceable>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>The branch the packaging is being maintained on.
- Alternative to the <emphasis>--debian-branch</emphasis> option.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>The branch in the &git; repository the upstream sources are put
- onto. Default is <replaceable>upstream</replaceable>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--depth</option>=<replaceable>depth</replaceable>
- </term>
- <listitem>
- <para>Git history depth, for creating shallow git clones.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--pristine-tar</option>
- </term>
- <listitem>
- <para>Track pristine tar branch.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage">,
- <xref linkend="man.gbp.pull">,
- <xref linkend="man.gbp.conf">
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
-
- <para>&dhusername; &dhemail;</para>
-
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.clone">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-clone</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-clone</refname>
+
+ <refpurpose>Clone a repository from remote</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-clone;
+
+ &man.common.options.synopsis;
+ <arg><option>--all</option></arg>
+ <arg><option>--[no-]pristine-tar</option></arg>
+ <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--depth=</option><replaceable>depth</replaceable></arg>
+ <arg><option>--reference=</option><replaceable>repository</replaceable></arg>
+ <arg><option>--postclone=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--[no-]hooks</option></arg>
+ <arg><option>--defuse-gitattributes=</option><replaceable>[auto|on|off]</replaceable></arg>
+ <arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg>
+ <arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg>
+ <arg><option>--[no-]aliases</option></arg>
+ <arg><option>--[no-]add-upstream-vcs</option></arg>
+ <arg choice="plain"><replaceable>repository</replaceable></arg>
+ <arg><replaceable>directory</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-clone; clones a remote repository and sets up tracking branches for
+ the <emphasis>debian</emphasis>, <emphasis>upstream</emphasis> and
+ <emphasis>pristine-tar</emphasis> branches. This way you can easily update
+ later using &gbp-pull;.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--all</option>
+ </term>
+ <listitem>
+ <para>Track all branches, not only <replaceable>debian</replaceable>
+ and <replaceable>upstream</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>The branch in the Git repository the Debian package is being
+ developed on, default is <replaceable>master</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>The branch in the &git; repository the upstream sources are put
+ onto. Default is <replaceable>upstream</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--depth</option>=<replaceable>depth</replaceable>
+ </term>
+ <listitem>
+ <para>Git history depth, for creating shallow git clones.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--reference</option>=<replaceable>repository</replaceable>
+ </term>
+ <listitem>
+ <para>Local repository to use as alternate instead of re-copying data from remote repository.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--pristine-tar</option>
+ </term>
+ <listitem>
+ <para>Track pristine tar branch.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]hooks</option></term>
+ <listitem>
+ <para>
+ Enable running hooks.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--postclone=</option><replaceable>COMMAND</replaceable></term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> after cloning the source
+ from the remote.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
+ repository the package is being built from).
+ </para>
+ <para>Note that if you clone a repository that contains a
+ hook configuration in <filename>debian/gbp.conf</filename>
+ this hook will not be run automatically to prevent execution
+ of untrusted code.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--defuse-gitattributes=</option><option>[auto|on|off]</option></term>
+ <listitem>
+ <para>
+ Disable Git attributes that may interfere with building packages. Works
+ by updating <filename>.git/info/attributes</filename> to override attributes
+ in the upstream sources which may cause files to be transformed on checkout.
+ More specifically, a new macro attribute is defined, <symbol>[attr]dgit-defuse-attrs</symbol>,
+ which is then applied to <filename>*</filename> together with <symbol>export-subst</symbol>
+ and <symbol>export-ignore</symbol>. This is done to be compatible with <command>dgit</command>
+ and <command>git-deborig</command> which disable Git attributes this way.
+ </para>
+ <para>
+ If set to <replaceable>auto</replaceable>, first check whether there
+ are any <filename>.gitattributes</filename> files in the upstream source,
+ and act only if there are some. If set to <replaceable>on</replaceable>,
+ unconditionally there are some. If set to <replaceable>off</replaceable>,
+ does nothing.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--repo-email=</option><option>[GIT|DEBIAN]</option></term>
+ <listitem>
+ <para>
+ When set to <option>DEBIAN</option>
+ use the <envar>DEBEMAIL</envar> environment variable to set the
+ user.email &git; configuration otherwise use &git;'s
+ defaults.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--repo-user=</option><option>[GIT|DEBIAN]</option></term>
+ <listitem>
+ <para>
+ When set to <option>DEBIAN</option>
+ use the <envar>DEBUSER</envar> environment variable to set the
+ user.name &git; configuration otherwise use &git;'s
+ defaults.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]aliases</option>
+ </term>
+ <listitem>
+ <para>
+ Whether to expand gbp specific aliases for remote repos like <symbol>salsa:</symbol>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]add-upstream-vcs</option>
+ </term>
+ <listitem>
+ <para>
+ Whether to add the upstream git repository as additional remote. The repositor url is read from
+ <filename>debian/upstream/meta</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><replaceable>repository</replaceable></term>
+ <listitem>
+ <para>
+ The (possibly remote) repository to clone from. This is
+ usually a &git; URL but some shortcuts are supported (see below).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><replaceable>directory</replaceable></term>
+ <listitem>
+ <para>
+ The directory to clone to.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>
+ Clone a repository and setup a tracking branch for pristine-tar
+ as well:
+ </para>
+ <screen>
+ &gbp-clone; --pristine-tar git://honk.sigxcpu.org/git/git-buildpackage.git</screen>
+ <para>
+ Clone from the <emphasis>Git-Vcs</emphasis> URL of a package:
+ </para>
+ <screen>
+ &gbp-clone; vcs-git:libvirt
+ &gbp-clone; vcsgit:libvirt</screen>
+ <para>
+ Clone a repository from salsa (Debian's code hosting):
+ </para>
+ <screen>
+ &gbp-clone; salsa:agx/git-buildpackage</screen>
+ <para>
+ Clone from a github repository:
+ </para>
+ <screen>
+ &gbp-clone; github:agx/git-buildpackage</screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.pull"/>,
+ <xref linkend="man.gbp.setup.gitattributes"/>,
+ <xref linkend="man.gbp.conf"/>,
+ <citerefentry>
+ <refentrytitle>gitattributes</refentrytitle>
+ <manvolnum>5</manvolnum>
+ </citerefentry>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+
+ <para>&dhusername; &dhemail;</para>
+
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.config">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-config</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>gbp-config</refname>
-
- <refpurpose>Query configuration values</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-config;
-
- &man.common.options.synopsis;
- <group choice='req'>
- <arg choice="plain"><replaceable>command.option</replaceable></arg>
- <arg choice="plain"><replaceable>command</replaceable></arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-config; prints values from the configuration files. It interpolates the
- value for <replaceable>option</replaceable> of
- <replaceable>command</replaceable>.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
- </variablelist>
- </refsect1>
- <refsect1>
- <title>EXIT CODES</title>
- <para>
- When &gbp-config; finishes it indicates success or failure with its exit code:
- </para>
- <variablelist>
- <varlistentry>
- <term><option>0</option></term>
- <listitem>
- <para>Success.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>1</option></term>
- <listitem>
- <para>Failed to parse command line</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>2</option></term>
- <listitem>
- <para>The value did not exist</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>EXAMPLES</title>
- <para>Print the value <option>upstream-branch</option> that &gbp-buildpackage;
- would use:</para>
- <screen>
- $ gbp config buildpackage.upstream-branch
- buildpackage.upstream-branch=upstream
- </screen>
- <para>Print the values of all of &gbp-buildpackage;s options</para>
- <screen>
- $ gbp config buildpackage
- buildpackage.upstream-branch=upstream
- buildpackage.debian-branch=master
- ...
- </screen>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.conf">
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
-
- <para>&dhusername; &dhemail;</para>
-
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.config">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-config</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-config</refname>
+
+ <refpurpose>Query configuration values</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-config;
+
+ &man.common.options.synopsis;
+ <group choice='req'>
+ <arg choice="plain"><replaceable>command.option</replaceable></arg>
+ <arg choice="plain"><replaceable>command</replaceable></arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-config; prints values from the configuration files. It interpolates the
+ value for <replaceable>option</replaceable> of
+ <replaceable>command</replaceable>.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXIT CODES</title>
+ <para>
+ When &gbp-config; finishes, it indicates success or failure with its exit code:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>0</option></term>
+ <listitem>
+ <para>Success.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>1</option></term>
+ <listitem>
+ <para>Failed to parse command line</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>2</option></term>
+ <listitem>
+ <para>The value did not exist</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>Print the value <option>upstream-branch</option> that &gbp-buildpackage;
+ would use:</para>
+ <screen>
+ $ gbp config buildpackage.upstream-branch
+ buildpackage.upstream-branch=upstream</screen>
+ <para>Print the values of all of &gbp-buildpackage; options</para>
+ <screen>
+ $ gbp config buildpackage
+ buildpackage.upstream-branch=upstream
+ buildpackage.debian-branch=master
+ ...</screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.conf"/>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+
+ <para>&dhusername; &dhemail;</para>
+
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.create.remote.repo">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-create-remote-repo</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>gbp-create-remote-repo</refname>
-
- <refpurpose>Create remote repositories</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-create-remote-repo;
- &man.common.options.synopsis;
- <arg><option>--remote-url-pattern=</option><replaceable>url-pattern</replaceable></arg>
- <arg><option>--remote-name=</option><replaceable>name</replaceable></arg>
- <arg><option>--template-dir=</option><replaceable>directory</replaceable></arg>
- <arg><option>--remote-config=</option><replaceable>config</replaceable></arg>
- <arg><option>--[no-]pristine-tar</option></arg>
- <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--[no-]track</option></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-create-remote-repo; creates a repository at a remote location via ssh
- and pushes the local repository into it. It then sets up remote branch
- tracking so you can use &gbp-pull; to update your repository from there.
- </para>
- <para>
- Before performing any action on the remote location it will print the
- remote URL and ask for confirmation.
- </para>
- <para>
- Note: By default the remote repositories are created in the <systemitem
- class="groupname">collab-maint</systemitem> repository on <systemitem
- class="systemname">git.debian.org</systemitem>.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--remote-url-pattern</option>=<replaceable>pattern</replaceable>
- </term>
- <listitem>
- <para>Where to create the remote repository. The part
- <replaceable>%(pkg)s</replaceable> will be replaced by the package name.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--remote-name</option>=<replaceable>name</replaceable>
- </term>
- <listitem>
- <para>What name git will use when refering to that repository, e.g.
- 'origin'.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--template-dir</option>=<replaceable>directory</replaceable>
- </term>
- <listitem>
- <para>Template directory to pass to <command>git init</command> on the remote
- side. This can be used to customize the remote repository, e.g. to set up hooks.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--remote-config</option>=<replaceable>config</replaceable>
- </term>
- <listitem>
- <para>Name of a config file section in <filename>gbp.conf</filename>
- that specifies the above paramters. See <xref linkend="man.gbp.conf">
- manpage for details.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>The branch in the Git repository the Debian package is being
- developed on, default is <replaceable>master</replaceable>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>The branch in the &git; repository the upstream sources are put
- onto. Default is <replaceable>upstream</replaceable>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--pristine-tar</option>
- </term>
- <listitem>
- <para>Whether to push the pristine tar branch.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]track</option>
- </term>
- <listitem>
- <para>Whether to set up branch tracking for the debian, upstream and
- pristine-tar branches.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage">,
- <xref linkend="man.gbp.pull">,
- <xref linkend="man.gbp.conf">
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
-
- <para>&dhusername; &dhemail;</para>
-
- </refsect1>
-</refentry>
-
-<!-- LocalWords: ssh
- -->
--- /dev/null
+<refentry id="man.gbp.create.remote.repo">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-create-remote-repo</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-create-remote-repo</refname>
+
+ <refpurpose>Create remote repositories</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-create-remote-repo;
+ &man.common.options.synopsis;
+ <arg><option>--remote-url-pattern=</option><replaceable>url-pattern</replaceable></arg>
+ <arg><option>--remote-name=</option><replaceable>name</replaceable></arg>
+ <arg><option>--template-dir=</option><replaceable>directory</replaceable></arg>
+ <arg><option>--remote-config=</option><replaceable>config</replaceable></arg>
+ <arg><option>--[no-]pristine-tar</option></arg>
+ <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--[no-]track</option></arg>
+ <arg><option>--[no-]bare</option></arg>
+ <group choice="opt">
+ <arg><replaceable>create</replaceable></arg>
+ <arg><replaceable>list</replaceable></arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-create-remote-repo; creates a repository at a remote location via ssh
+ and pushes the local repository into it. It then sets up remote branch
+ tracking so you can use &gbp-pull; to update your repository from there.
+ </para>
+ <para>
+ Before performing any action on the remote location, it will print the
+ remote URL and ask for confirmation.
+ </para>
+ <para>
+ Note: By default, the remote repositories are created in the <systemitem
+ class="groupname">collab-maint</systemitem> repository on <systemitem
+ class="systemname">git.debian.org</systemitem>.
+ </para>
+ <para>
+ When invoked with <option>list</option> it lists the available
+ remote config templates.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--remote-url-pattern</option>=<replaceable>pattern</replaceable>
+ </term>
+ <listitem>
+ <para>Where to create the remote repository. The part
+ <replaceable>%(pkg)s</replaceable> will be replaced by the package name.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--remote-name</option>=<replaceable>name</replaceable>
+ </term>
+ <listitem>
+ <para>What name git will use when referring to that repository, e.g.
+ 'origin'.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--template-dir</option>=<replaceable>directory</replaceable>
+ </term>
+ <listitem>
+ <para>Template directory to pass to <command>git init</command> on the remote
+ side. This can be used to customize the remote repository, e.g. to set up hooks.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--remote-config</option>=<replaceable>config</replaceable>
+ </term>
+ <listitem>
+ <para>Name of a config file section in <filename>gbp.conf</filename>
+ that specifies the above parameters. See <xref linkend="man.gbp.conf"/>
+ manpage for details.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>The branch in the &git; repository the &debian; package is being
+ developed on, default is <replaceable>master</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>The branch in the &git; repository the upstream sources are put
+ onto. Default is <replaceable>upstream</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--pristine-tar</option>
+ </term>
+ <listitem>
+ <para>Whether to push the pristine tar branch.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]track</option>
+ </term>
+ <listitem>
+ <para>Whether to set up branch tracking for the debian, upstream and
+ pristine-tar branches.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]bare</option>
+ </term>
+ <listitem>
+ <para>Whether to the remote repository should be a bare
+ repository (this is the default).</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.pull"/>,
+ <xref linkend="man.gbp.conf"/>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+
+ <para>&dhusername; &dhemail;</para>
+
+ </refsect1>
+</refentry>
+
+<!-- LocalWords: ssh
+ -->
+++ /dev/null
-<refentry id="man.gbp.dch">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-dch</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>git-dch;</refname>
- <refname>gbp-dch;</refname>
- <refpurpose>Generate the Debian changelog from git commit messages</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-dch;
- &man.common.options.synopsis;
- <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg>
- <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
- <arg><option>--ignore-branch</option></arg>
- <group>
- <arg><option>--snapshot</option></arg>
- <arg><option>--release</option></arg>
- </group>
- <group>
- <arg><option>--auto</option></arg>
- <arg><option>--since=</option><replaceable>commitish</replaceable></arg>
- </group>
- <arg><option>--new-version=</option><replaceable>version</replaceable></arg>
- <group>
- <arg><option>--bpo</option></arg>
- <arg><option>--nmu</option></arg>
- <arg><option>--qa</option></arg>
- <arg><option>--team</option></arg>
- </group>
- <arg><option>--distribution=</option><replaceable>name</replaceable></arg>
- <arg><option>--force-distribution</option></arg>
- <arg><option>--urgency=</option><replaceable>level</replaceable></arg>
- <arg><option>--[no-]full</option></arg>
- <arg><option>--[no-]meta</option></arg>
- <arg><option>--meta-closes=bug-close-tags</option></arg>
- <arg><option>--snapshot-number=</option><replaceable>expression</replaceable></arg>
- <arg><option>--id-length=</option><replaceable>number</replaceable></arg>
- <arg><option>--git-log=</option><replaceable>git-log-options</replaceable></arg>
- <arg><option>--[no-]git-author</option></arg>
- <arg><option>--[no-]multimaint</option></arg>
- <arg><option>--[no-]multimaint-merge</option></arg>
- <arg><option>--spawn-editor=[always|snapshot|release]</option></arg>
- <arg><option>--commit-msg=</option><replaceable>msg-format</replaceable></arg>
- <arg><option>--commit</option></arg>
- <arg><option>--customizations=</option><replaceable>customization-file</replaceable></arg>
- <arg choice="plain"><replaceable>[path1 path2]</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-dch; reads git commit messages and generates the Debian changelog from
- it. If no arguments are given &gbp-dch; starts from the last tagged Debian
- package version up to the current tip of the current branch. If the
- distribution of the topmost section in
- <filename>debian/changelog</filename> is <emphasis>UNRELEASED</emphasis>
- the changelog entries will be inserted into this section. Otherwise a new
- section will be created.
- </para>
- <para>
- If <option>--auto</option> is given &gbp-dch; tries to guess the
- last &git; commit documented in the changelog - this only works in snapshot
- mode. Otherwise <option>--since</option> can be used to tell &gbp-dch;
- at which point it should start in the &git; history.
- </para>
- <para>
- The additional path arguments can be used to restrict the repository paths
- &gbp-dch; looks at. Setting <replaceable>path</replaceable> to
- <emphasis>debian/</emphasis> is a good choice if upstream uses &git; and
- all Debian packaging changes are restricted to the
- <replaceable>debian/</replaceable> subdir. In more sophisticated cases
- (like backports) you can use <option>--git-log</option> to restrict the
- generated changelog entries further. E.g. by using
- <option>--git-log=</option><replaceable>"--author=Foo Bar"</replaceable>.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the Git repository the Debian package is being
- developed on, default is <replaceable>master</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--ignore-branch</option>
- </term>
- <listitem>
- <para>
- Don't check if the current branch matches
- <replaceable>debian-branch</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--debian-tag=</option><replaceable>tag-format</replaceable>
- </term>
- <listitem>
- <para>
- tag format used, when tagging debian versions,
- default is <replaceable>debian/%(version)s</replaceable>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--since=</option><replaceable>committish</replaceable>
- </term>
- <listitem>
- <para>
- Start reading commit messages at
- <replaceable>committish</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--auto</option>,
- <option>-a</option></term>
- <listitem>
- <para>
- Guess the last commit documented in the changelog from the
- snapshot banner (or from the last tag if no snapshot banner exists).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]meta</option></term>
- <listitem>
- <para>
- Parse meta tags like <option>Closes:</option>,
- <option>Thanks:</option> and <option>Git-Dch:</option>. See META TAGS
- below.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--meta-closes=</option><replaceable>bug-close-tags</replaceable>
- </term>
- <listitem>
- <para>
- What meta tags to look for to generate bug-closing changelog entries.
- The default is 'Closes|LP' to support Debian and Launchpad.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]full</option>
- </term>
- <listitem>
- <para>
- Include the full commit message in the changelog output.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--snapshot</option>,
- <option>-S</option></term>
- <listitem>
- <para>
- Create a snapshot release entry. This adds a snapshot release
- number and a warning banner to the changelog entry. The release
- version number is being auto incremented with every new snapshot
- release to avoid packages downgrades during snapshot testing.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--snapshot-number=</option><replaceable>expression</replaceable>
- </term>
- <listitem>
- <para>
- Python expression that gets eval()ed to the new snapshot number.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--release</option>,
- <option>-R</option></term>
- <listitem>
- <para>
- Remove any snapshot release banners and version suffixes, set
- the current distribution to <replaceable>unstable</replaceable> and
- open the changelog for final tweaking.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--new-version=</option><replaceable>version</replaceable>,
- <option>-N</option> <replaceable>version</replaceable>
- </term>
- <listitem>
- <para>
- Add a new changelog section with version
- <replaceable>newversion</replaceable>. Together with
- <option>--snapshot</option> the snapshot number will be appended to
- <replaceable>newversion</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--team</option>
- </term>
- <listitem>
- <para>
- Create a Team upload changelog entry.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--bpo</option>
- </term>
- <listitem>
- <para>
- Increment the Debian release number for an upload to backports, and
- add a backport upload changelog comment.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--nmu</option>
- </term>
- <listitem>
- <para>
- Increment the Debian release number for a non-maintainer upload.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--qa</option>
- </term>
- <listitem>
- <para>
- Increment the Debian release number for a Debian QA Team upload, and
- add a QA upload changelog comment.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--distribution=</option><replaceable>name</replaceable>
- </term>
- <listitem>
- <para>
- Set the distribution field to <replaceable>name</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--force-distribution</option>
- </term>
- <listitem>
- <para>
- Force the distribution specified with <option>--distribution</option>
- to be used, even if it doesn't match the list of known distributions.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--urgency=</option><replaceable>level</replaceable>
- </term>
- <listitem>
- <para>
- Set the urgency field to <replaceable>level</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-log=</option><replaceable>git-log-options</replaceable>
- </term>
- <listitem>
- <para>
- Options passed on verbatim to git-log(1).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--id-length=</option><replaceable>N</replaceable>
- </term>
- <listitem>
- <para>
- Include <replaceable>N</replaceable> digits of the commit id in the
- changelog entry. Default is to not include any commit ids at all.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--ignore-regex=</option><replaceable>regex</replaceable>
- </term>
- <listitem>
- <para>
- Ignore commit lines matching <replaceable>regex</replaceable>
- when generating the changelog.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-author</option>
- </term>
- <listitem>
- <para>
- Use user.name and user.email from
- <application>git-config</application>(1) for changelog trailer.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]multimaint-merge</option>
- </term>
- <listitem>
- <para>
- Merge commits by maintainer.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--spawn-editor=<replaceable>[always|snapshot|release]</replaceable></option>
- </term>
- <listitem>
- <para>
- Whether to spawn an editor: always, when doing snapshots or when
- doing a release.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--commit-msg=</option><replaceable>msg-format</replaceable>
- </term>
- <listitem>
- <para>
- use this format string for the commit message when committing the
- generated changelog file (when <option>--commit</option> is given).
- Default is
- <replaceable>Update changelog for %(version)s release</replaceable>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--commit</option>
- </term>
- <listitem>
- <para>
- Commit the generated changelog.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--customizations=</option><replaceable>customization-file</replaceable>
- </term>
- <listitem>
- <para>
- Load Python code from <replaceable>customization-file</replaceable>.
- At the moment, the only useful thing the code can do is define a
- custom format_changelog_entry() function.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--customizations=</option><replaceable>customization-file</replaceable>
- </term>
- <listitem>
- <para>
- Load Python code from <replaceable>customization-file</replaceable>.
- At the moment, the only useful thing the code can do is define a
- custom format_changelog_entry() function.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>Snapshot mode</title>
- <para>
- Snapshot mode can be used for quick test and install cycles without
- having to worry about version numbers or changelog entries.
- </para>
- <para>
- When using <option>--snapshot</option> or <option>-S</option> &gbp-dch;
- uses a pseudo header in the Debian changelog to remember the last git
- commit it added a changelog entry for. It also sets a version number
- ending in
- <replaceable>~<snaspshotnumber>.gbp<commitid></replaceable>.
- It automatically increments the snapshot number on subsequent invocations
- of &gbp-dch; <option>-S</option> so that later snapshots automatically
- have a higher version number. To leave snapshot mode invoke &gbp-dch;
- with the <option>--release</option> option. This removes the pseudo
- header and unmangles the version number so the released version has a
- higher version number than the snapshots.
- </para>
- </refsect1>
- <refsect1>
- <title>META TAGS</title>
- <para>
- Additional to the above options the formatting of the commit message
- in <filename>debian/changelog</filename> can be modified by special tags
- (called Meta Tags)
- given in the git commit message. Meta Tag processing can be activated via
- the <option>--meta</option> option. The tags must start at the first column of
- a commit message but can appear on any line.
- They are of the form <option>Tagname</option>:
- <replaceable>value</replaceable>. Valid Meta Tags are:
- </para>
- <variablelist>
- <varlistentry>
- <term><option>Git-Dch</option>: <replaceable>action</replaceable>
- </term>
- <listitem>
- <para>
- Supported actions are: <replaceable>Ignore</replaceable> which will
- ignore this commit when generating
- <filename>debian/changelog</filename>,
- <replaceable>Short</replaceable> which will only use the description
- (the first line) of the commit message when generating the changelog
- entry (useful when <option>--full</option> is given) and
- <replaceable>Full</replaceable> which will use the full commit
- message when generating the changelog entry (useful when
- <option>--full</option> is not given).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>Thanks</option>: <replaceable>msg</replaceable>
- </term>
- <listitem>
- <para>
- Add a thanks message after the commit message.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>Closes</option>: <replaceable>bugnumber</replaceable>
- </term>
- <listitem>
- <para>
- Indicate in the <filename>debian/changelog</filename> that the bug
- was closed by this commit. See the <option>--meta-closes</option> on
- how to extend this for other bugtrackers.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>
- The following git commit message:
- </para>
- <screen>
- Document meta tags
-
- so one doesn't have to consult the manual
-
- Git-Dch: Short
- Closes: #636088
- Thanks: Raphaël Hertzog for the suggestion
- </screen>
- <para>
- Results in this <filename>debian/changelog</filename> entry:
- </para>
- <screen>
- * Document meta tags.
- Thanks to Raphaël Hertzog for the suggestion (Closes: #636088)
- </screen>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage">,
- <xref linkend="man.gbp.import.dsc">,
- <xref linkend="man.gbp.import.dscs">,
- <xref linkend="man.gbp.import.orig">,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- <ulink url="https://honk.sigxcpu.org/cl2vcs">
- <citetitle>Cl2vcs</citetitle></ulink>,
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &dhusername; &dhemail;
- </para>
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.dch">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-dch</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-dch</refname>
+ <refpurpose>Generate the &debian; changelog from git commit messages</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-dch;
+ &man.common.options.synopsis;
+ <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--ignore-branch</option></arg>
+ <group>
+ <arg><option>-s</option> <replaceable>commitish</replaceable></arg>
+ <arg><option>--since=</option><replaceable>commitish</replaceable></arg>
+ </group>
+ <group>
+ <group>
+ <arg><option>-S</option></arg>
+ <arg><option>--snapshot</option></arg>
+ </group>
+ <group>
+ <arg><option>-R</option></arg>
+ <arg><option>--release</option></arg>
+ </group>
+ </group>
+ <group>
+ <arg><option>-N</option> <replaceable>version</replaceable></arg>
+ <arg><option>--new-version=</option><replaceable>version</replaceable></arg>
+ </group>
+ <group>
+ <arg><option>--bpo</option></arg>
+ <arg><option>--nmu</option></arg>
+ <arg><option>--qa</option></arg>
+ <arg><option>--security</option></arg>
+ <arg><option>--team</option></arg>
+ <arg><option>--local=</option><replaceable>suffix</replaceable></arg>
+ </group>
+ <arg><option>--distribution=</option><replaceable>name</replaceable></arg>
+ <arg><option>--force-distribution</option></arg>
+ <group>
+ <arg><option>-U</option> <replaceable>level</replaceable></arg>
+ <arg><option>--urgency=</option><replaceable>level</replaceable></arg>
+ </group>
+ <arg><option>--[no-]full</option></arg>
+ <arg><option>--[no-]meta</option></arg>
+ <arg><option>--meta-closes=bug-close-tags</option></arg>
+ <arg><option>--meta-closes-bugnum=bug-number-format</option></arg>
+ <arg><option>--snapshot-number=</option><replaceable>expression</replaceable></arg>
+ <arg><option>--id-length=</option><replaceable>number</replaceable></arg>
+ <arg><option>--git-log=</option><replaceable>git-log-options</replaceable></arg>
+ <arg><option>--[no-]git-author</option></arg>
+ <arg><option>--[no-]multimaint</option></arg>
+ <arg><option>--[no-]multimaint-merge</option></arg>
+ <arg><option>--spawn-editor=[always|never|snapshot|release]</option></arg>
+ <arg><option>--commit-msg=</option><replaceable>msg-format</replaceable></arg>
+ <group>
+ <arg><option>-c</option></arg>
+ <arg><option>--commit</option></arg>
+ </group>
+ <arg><option>--customizations=</option><replaceable>customization-file</replaceable></arg>
+ <arg><option>--postedit=</option><replaceable>COMMAND</replaceable></arg>
+ <arg rep='repeat'><option>--dch-opt=</option><replaceable>dch-options</replaceable></arg>
+ <arg><option>--verbose</option></arg>
+ <arg choice="plain"><replaceable><optional>path1 path2</optional></replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-dch; reads git commit messages and generates the &debian;
+ changelog from it. It starts at a given commit specified by the
+ <option>--since</option> option up to the current
+ <emphasis>HEAD</emphasis>. For each commit found it adds the
+ commit message to the changelog. If <option>--since</option> is
+ not given the commit to start from is determined by the
+ following rules (first one matches):
+ </para>
+
+ <orderedlist numeration="arabic">
+ <listitem><para>The start commit is read from the snapshot banner (see below for
+ details)</para></listitem>
+ <listitem><para>If the topmost version of the
+ <filename>debian/changelog</filename> is alread tagged. Use the commit
+ the tag points to as start commit.</para></listitem>
+ <listitem><para>The last commit that modified <filename>debian/changelog</filename> is
+ used as start commit.</para></listitem>
+ </orderedlist>
+ <para>
+ This is called automatic mode.
+ </para>
+ <para>
+ If the distribution of the topmost section in
+ <filename>debian/changelog</filename> is
+ <emphasis>UNRELEASED</emphasis>, the changelog entries will be
+ inserted into this section. Otherwise a new section will be
+ created.
+ </para>
+ <para>
+ If one ore more paths are given as arguments &gbp-dch; will only
+ include changes in <filename>debian/changelog</filename> that
+ affect these paths. E.g. using
+ <emphasis>debian/</emphasis> is a good choice if upstream uses
+ &git; and you don't want the upstream history to end up in
+ <filename>debian/changelog</filename>.
+ </para>
+ <para>
+ To restrict the selected changes even further you can use
+ use the <option>--git-log</option> option which is passed
+ on verbatim to <command>git log</command>. E.g. by using
+ <option>--git-log=</option><replaceable>"--author=Foo
+ Bar"</replaceable>.
+ </para>
+ <para>
+ The above relies on the <option>--debian-branch</option> option
+ pointing to the current branch and
+ <option>--upstream-branch</option> pointing to the corresponding
+ upstream branch in order to find the right merge points of these
+ branches. Furthermore &gbp-dch; must be able to identify git
+ tags from upstream and Debian version numbers. If you're not
+ using the defaults check the <option>--upstream-tag</option> and
+ <option>--debian-tag</option> options and make sure they match
+ the tags created by e.g. &gbp-import-orig; (when using tarballs)
+ or upstream's tagging pattern (when using upstream's git
+ directly).
+ </para>
+ <para>
+ If not changelog exists yet it is created and the version number
+ is derived from the last upstream tag if found.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the Git repository the Debian package is being
+ developed on, default is <replaceable>master</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Branch to determine the upstream version from.
+ Default is <replaceable>upstream</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when looking for tags of upstream versions,
+ default is <replaceable>upstream/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--ignore-branch</option>
+ </term>
+ <listitem>
+ <para>
+ Don't check if the current branch matches
+ <replaceable>debian-branch</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-tag=</option><replaceable>tag-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Tag format used, when tagging debian versions,
+ default is <replaceable>debian/%(version)s</replaceable>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--since=</option><replaceable>committish</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Start reading commit messages at
+ <replaceable>committish</replaceable>.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--auto</option>,
+ <option>-a</option></term>
+ <listitem>
+ <para>
+ This option is ignored for compatibility with older
+ versions. It used to trigger automatic mode.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]meta</option></term>
+ <listitem>
+ <para>
+ Parse meta tags like <option>Closes:</option>,
+ <option>Thanks:</option> and <option>Gbp-Dch:</option>. See META TAGS
+ below.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--meta-closes=</option><replaceable>bug-close-tags</replaceable>
+ </term>
+ <listitem>
+ <para>
+ What meta tags to look for to generate bug-closing changelog entries.
+ The default is <literal>'Closes|LP'</literal> to support Debian and Launchpad.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--meta-closes-bugnum=</option><replaceable>bug-number-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ What regular expression should be used to parse out the bug number.
+ The default is <literal>'(?:bug|issue)?\#?\s?\d+'</literal>. Note: the regex should
+ suppress all portions of the bug number that are not wanted using
+ <literal>"(?:)"</literal>, see Python regex manual for details.
+ </para>
+ <para>
+ Example:
+ <option>--meta-closes-bugnum=</option><literal>"(?:bug)?\s*ex-\d+"</literal>
+
+ would match all of the following:
+ <screen>
+ Possible Txt Match? Result
+ ------------ ------ ------
+ bug EX-12345 Y EX-12345
+ ex-01273 Y ex-01273
+ bug ex-1ab Y ex-1
+ EX--12345 N</screen>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]full</option>
+ </term>
+ <listitem>
+ <para>
+ Include the full commit message in the changelog output.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--snapshot</option>,
+ <option>-S</option></term>
+ <listitem>
+ <para>
+ Create a snapshot release entry. It uses a snapshot
+ release number which is smaller than the final release
+ number and adds a warning banner to the changelog
+ entry. The version number is being auto incremented with
+ every new snapshot release.
+ </para>
+ <para>
+ The snapshot banner is also used by &gbp-dch; to determine which
+ entries are already in the changelog. This prevents duplicated
+ entries in <filename>debian/changelog</filename> when you did
+ not commit the changelog yet.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--snapshot-number=</option><replaceable>expression</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Python expression that gets eval()ed to the new snapshot number.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--release</option>,
+ <option>-R</option></term>
+ <listitem>
+ <para>
+ Remove any snapshot release banners and version suffixes
+ (if any), set the current distribution to
+ <replaceable>unstable</replaceable>, and open the
+ changelog for final tweaking. This option can't be set
+ via &gbp.conf;. It's usually used to finalize the
+ changelog before making a release.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--new-version=</option><replaceable>version</replaceable>,
+ <option>-N</option> <replaceable>version</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Add a new changelog section with version
+ <replaceable>newversion</replaceable>. Together with
+ <option>--snapshot</option>, the snapshot number will be appended to
+ <replaceable>newversion</replaceable>.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--team</option>
+ </term>
+ <listitem>
+ <para>
+ Create a Team upload changelog entry.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--bpo</option>
+ </term>
+ <listitem>
+ <para>
+ Increment the Debian release number for an upload to backports, and
+ add a backport upload changelog comment.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--nmu</option>
+ </term>
+ <listitem>
+ <para>
+ Increment the Debian release number for a non-maintainer upload.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--qa</option>
+ </term>
+ <listitem>
+ <para>
+ Increment the Debian release number for a Debian QA Team upload, and
+ add a QA upload changelog comment.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--security</option>
+ </term>
+ <listitem>
+ <para>
+ Increment the Debian release number for a Debian Security
+ Team non-maintainer upload, and add a "Security Team
+ upload" changelog comment.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--local=</option><replaceable>suffix</replaceable>,
+ <option>-l</option> <replaceable>suffix</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Increment the Debian release number for a local build
+ using the specified suffix.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--distribution=</option><replaceable>name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Set the distribution field to <replaceable>name</replaceable>.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--force-distribution</option>
+ </term>
+ <listitem>
+ <para>
+ Force the distribution specified with <option>--distribution</option>
+ to be used, even if it doesn't match the list of known distributions.
+ This option can't be set via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--urgency=</option><replaceable>level</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Set the urgency field to <replaceable>level</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-log=</option><replaceable>git-log-options</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Options passed on verbatim to git-log(1).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--id-length=</option><replaceable>N</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Include <replaceable>N</replaceable> digits of the commit id in the
+ changelog entry. Default is to not include any commit ids at all.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--ignore-regex=</option><replaceable>regex</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Ignore commit lines matching <replaceable>regex</replaceable>
+ when generating the changelog.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-author</option>
+ </term>
+ <listitem>
+ <para>
+ Use user.name and user.email from
+ <application>git-config</application>(1) for changelog trailer.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]multimaint-merge</option>
+ </term>
+ <listitem>
+ <para>
+ Merge commits by maintainer.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--spawn-editor=<replaceable>[always|never|snapshot|release]</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ Whether to spawn an editor: always, never, when doing snapshots or when
+ doing a release.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--commit-msg=</option><replaceable>msg-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this format string for the commit message when committing the
+ generated changelog file (when <option>--commit</option> is given).
+ Default is
+ <replaceable>Update changelog for %(version)s release</replaceable>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--commit</option>
+ </term>
+ <listitem>
+ <para>
+ Commit the generated changelog.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--customizations=</option><replaceable>customization-file</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Load Python code from <replaceable>customization-file</replaceable>.
+ At the moment, the only useful thing the code can do is define a
+ custom format_changelog_entry() function.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--postedit=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Run<replaceable>COMMAND</replaceable> after changes to the changelog
+ file have been finalized, That is, after dch has been run and
+ possible text editor has been exited, but, before changes are
+ (possibly) committed to git.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--dch-opt=</option><replaceable>dch-option</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Pass option to &dch; verbatim. Note that &gbp-dch; invokes &dch;
+ multiple times and the option is passed to all invocations so not all
+ &dch; options make sense here. Options may also conflict
+ with options picked by &gbp-dch;.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Snapshot mode</title>
+ <para>
+ Snapshot mode can be used for quick test and install cycles without
+ having to worry about version numbers or changelog entries.
+ </para>
+ <para>
+ When using <option>--snapshot</option> or <option>-S</option>, &gbp-dch;
+ uses a pseudo header in the Debian changelog to remember the last git
+ commit it added a changelog entry for. It also sets a version number
+ ending in
+ <replaceable>~<snaspshotnumber>.gbp<commitid></replaceable>.
+ It automatically increments the snapshot number on subsequent invocations
+ of &gbp-dch; <option>-S</option> so that later snapshots automatically
+ have a higher version number. To leave snapshot mode, invoke &gbp-dch;
+ with the <option>--release</option> option. This removes the pseudo
+ header and unmangles the version number so the released version has a
+ higher version number than the snapshots.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>META TAGS</title>
+ <para>
+ Additional to the above options, the formatting of the commit message
+ in <filename>debian/changelog</filename> can be modified by special tags
+ (called Meta Tags)
+ given in the git commit message. Meta Tag processing can be activated via
+ the <option>--meta</option> option. The tags must start at the first column of
+ a commit message but can appear on any line.
+ They are of the form <option>Tagname</option>:
+ <replaceable>value</replaceable>. Valid Meta Tags are:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <option>Gbp-Dch</option>: <replaceable>action</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Supported actions are: <replaceable>Ignore</replaceable>
+ which will ignore this commit when
+ generating <filename>debian/changelog</filename>,
+ <replaceable>Short</replaceable> which will only use the
+ description (the first line) of the commit message when
+ generating the changelog entry (useful
+ when <option>--full</option> is given), and
+ <replaceable>Full</replaceable> which will use the full
+ commit message when generating the changelog entry (useful
+ when <option>--full</option> is not given).
+ </para>
+ <para>
+ In addition to <option>Gbp-Dch</option>, the
+ deprecated <option>Git-Dch</option> is still supported.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>Thanks</option>: <replaceable>msg</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Add a thanks message after the commit message.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>Closes</option>: <replaceable>bugnumber</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Indicate in the <filename>debian/changelog</filename> that the bug
+ was closed by this commit. See the <option>--meta-closes</option> on
+ how to extend this for other bugtrackers.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ The following git commit message:
+ </para>
+ <screen>
+ Document meta tags
+
+ so one doesn't have to consult the manual
+
+ Gbp-Dch: Short
+ Closes: #636088
+ Thanks: Raphaël Hertzog for the suggestion</screen>
+ <para>
+ Results in this <filename>debian/changelog</filename> entry:
+ </para>
+ <screen>
+ * Document meta tags.
+ Thanks to Raphaël Hertzog for the suggestion (Closes: #636088)</screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.import.dsc"/>,
+ <xref linkend="man.gbp.import.dscs"/>,
+ <xref linkend="man.gbp.import.orig"/>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ <ulink url="https://honk.sigxcpu.org/cl2vcs">
+ <citetitle>Cl2vcs</citetitle></ulink>,
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &dhusername; &dhemail;
+ </para>
+ </refsect1>
+</refentry>
--- /dev/null
+<refentry id="man.gbp.export.orig">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta><refentrytitle>gbp-export-orig</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-export-orig</refname>
+ <refpurpose>Export upstream tarballs from a &git; repository</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-export-orig;
+ <arg><option>--verbose</option></arg>
+ <arg><option>--color=</option>[auto|on|off]</arg>
+ <arg><option>--color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable></arg>
+ <arg><option>--upstream-branch=</option><replaceable>BRANCH_NAME</replaceable></arg>
+ <arg><option>--[no-]submodules</option></arg>
+ <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable></arg>
+ <arg><option>--tarball-dir=</option><replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--force-create</option></arg>
+ <arg><option>--compression=</option><replaceable>TYPE</replaceable></arg>
+ <arg><option>--compression-level=</option><replaceable>LEVEL</replaceable></arg>
+ <arg rep='repeat'><option>--component=</option><replaceable>component</replaceable></arg>
+ <arg><option>--[no-]pristine-tar</option></arg>
+ <arg><option>--[no-]pristine-tar-commit</option></arg>
+ <arg><option>--upstream-signatures=</option>[auto|on|off]</arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-export-orig; is used to export upstream tarballs from a
+ &git; repository. Usually upstream tarballs are created by
+ &gbp-buildpackage; when needed but if you don't want to perform
+ a build you can use this command.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ <varlistentry>
+ <term><option>--verbose</option>
+ </term>
+ <listitem>
+ <para>
+ verbose execution
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--color=</option>[auto|on|off]
+ </term>
+ <listitem>
+ <para>
+ Whether to use colored output.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Colors to use in output (when color is enabled). The format for
+ COLOR_SCHEME is
+ '<debug>:<info>:<warning>:<error>'.
+ Numerical values and color names are accepted, empty fields imply
+ the default color. For example --color-scheme='cyan:34::' would
+ show debug messages in cyan, info messages in blue and other messages
+ in default (i.e. warning and error messages in red).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>BRANCH_NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Branch to build the orig tarball from if
+ <option>--upstream-tree</option> is set to
+ <replaceable>BRANCH</replaceable>. Default is
+ <replaceable>upstream</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]submodules</option>
+ </term>
+ <listitem>
+ <para>
+ Include git submodules in the orig tarball.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when looking for tags of upstream versions,
+ default is <replaceable>upstream/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--force-create</option>
+ </term>
+ <listitem>
+ <para>
+ Force creation of an orig tarball (overwriting a pre-existing one if
+ present).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tree=</option><replaceable>[BRANCH|TAG|TREEISH]</replaceable>
+ </term>
+ <listitem>
+ <para>
+ How to find the upstream sources used to generate the tarball.
+ <replaceable>TAG</replaceable> (the default) looks at a tag corresponding to the
+ version in the changelog. <replaceable>BRANCH</replaceable> looks at
+ the upstream branch given via the
+ <option>--upstream-branch</option> option.
+ </para>
+ <para>
+ Other values are interpreted as treeishs.
+ </para>
+ <para>
+ This doesn't have any effect if <option>--pristine-tar</option>
+ is being used.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--tarball-dir=</option><replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Search for original tarballs in <replaceable>DIRECTORY</replaceable>
+ instead of generating them.
+ <replaceable>DIRECTORY</replaceable> can contain a version format
+ substitution pattern, eg: <replaceable>foo-%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--compression=</option><replaceable>TYPE</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Specifies the upstream tarball compression type. This will be used to
+ locate and build the upstream tarball if necessary. The default is
+ <replaceable>auto</replaceable> which derives the compression type
+ from the pristine-tar branch if available and falls back to gzip
+ otherwise. Other options are <replaceable>gzip</replaceable>,
+ <replaceable>bzip2</replaceable>, <replaceable>lzma</replaceable> and
+ <replaceable>xz</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--compression-level=</option><replaceable>LEVEL</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Specifies the upstream tarball compression level if an upstream
+ tarball needs to be built.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--component=</option><replaceable>COMPONENT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ When generating tarballs create an additional original
+ tarball of directory <replaceable>COMPONENT</replaceable>
+ in the source tree. Using additional original tarballs is
+ a feature of the 3.0 (quilt) source format. See
+ the <command>dpkg-source</command> manpage for details. Note that the
+ <replaceable>--pristine-tar-commit</replaceable>
+ option is currently incompatible with this option.
+ </para>
+ <para>
+ This is considered an experimental feature and might
+ change incompatibly.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--pristine-tar</option>
+ </term>
+ <listitem>
+ <para>
+ Use pristine-tar when generating the upstream tarball if it doesn't
+ exist.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--pristine-tar-commit</option>
+ </term>
+ <listitem>
+ <para>
+ Commit the pristine-tar delta to the pristine-tar branch if a new
+ tarball was generated and the pristine-tar data isn't already there.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-signatures=</option>[auto|on|off]
+ </term>
+ <listitem>
+ <para>
+ Whether to export with upstream signatures.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>
+ Generate an upstream tarball of the version currently referenced
+ in the changelog using &pristine-tar;:
+ </para>
+ <screen>
+ &gbp-export-orig; --pristine-tar
+ </screen>
+ <para>
+ Same as above but generate and additional tarball for
+ directory <filename>foo</filename>.
+ </para>
+ <screen>
+ &gbp-export-orig; --pristine-tar --component=foo
+ </screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.import.orig"/>,
+ <xref linkend="man.gbp.pristine.tar"/>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &dhusername; &dhemail;
+ </para>
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.import.dsc">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-import-dsc</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>git-import-dsc</refname>
- <refname>gbp-import-dsc</refname>
- <refpurpose>Import Debian packages into a Git repository</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-import-dsc;
- &man.common.options.synopsis;
- <arg><option>--allow-same-versions</option></arg>
- <arg><option>--author-date-is-committer-date</option></arg>
- <arg><option>--author-is-committer</option></arg>
- <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg>
- <arg><option>--download</option></arg>
- <arg><option>--filter=</option><replaceable>pattern</replaceable></arg>
- <arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg>
- <arg><option>--[no-]create-missing-branches</option></arg>
- <arg><option>--[no-]pristine-tar</option></arg>
- <arg><option>--[no-]sign-tags</option></arg>
- <arg><option>--skip-debian-tag=</option></arg>
- <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
- <arg choice="plain"><replaceable>debian-source.dsc</replaceable></arg>
- </cmdsynopsis>
- <cmdsynopsis>
- &gbp-import-dsc;
- <arg><option>options</option></arg>
- <arg choice="req"><option>--download</option></arg>
- <arg><option>--[no-]allow-unauthenticated</option></arg>
- <group choice="plain">
- <arg><replaceable>URL</replaceable></arg>
- <arg><replaceable>source-package</replaceable></arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-import-dsc; imports a Debian source package into a &git; repository,
- notes the package version in the commit logs, and commits the change. All
- information, including package name, version, Debian diffs, and upstream
- source is automatically detected from the source package.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the &git; repository the upstream sources are put
- onto. Default is <replaceable>upstream</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the &git; repository the debian sources are put
- onto. Default is <replaceable>master</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]sign-tags</option>
- </term>
- <listitem>
- <para>
- GPG sign all created tags
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--keyid=</option><replaceable>gpg-keyid</replaceable>
- </term>
- <listitem>
- <para>
- use this keyid for gpg signing tags
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--debian-tag=</option><replaceable>tag-format</replaceable>
- </term>
- <listitem>
- <para>
- use this tag format when tagging Debian versions,
- default is <replaceable>debian/%(version)s</replaceable>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-tag=</option><replaceable>tag-format</replaceable>
- </term>
- <listitem>
- <para>
- use this tag format when tagging upstream versions,
- default is <replaceable>upstream/%(version)s</replaceable>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--skip-debian-tag</option>
- </term>
- <listitem>
- <para>
- Don't create Debian tag after importing the Debian patch. This can be
- useful if you already created a package but want to further work on
- it after importing it into git.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--filter=</option><replaceable>pattern</replaceable>
- </term>
- <listitem>
- <para>
- filter out files glob-matching pattern. Can be given multiple times.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--pristine-tar</option>
- </term>
- <listitem>
- <para>
- generate pristine-tar delta file
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--download</option>
- </term>
- <listitem>
- <para>
- Download the source package instead of looking for it in the local
- file system. The argument can either be a
- <replaceable>source-package</replaceable> name or an
- <replaceable>URL</replaceable>. The former uses &apt-get; to download
- the source while the later uses &dget;.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--allow-unauthenticated</option>
- </term>
- <listitem>
- <para>
- Whether to skip signature verification on downloads.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--allow-same-version</option>
- </term>
- <listitem>
- <para>
- Allow to import a package with the same debian version.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--author-is-committer</option>
- </term>
- <listitem>
- <para>
- When importing the Debian patch, use the author identity as
- committer identity.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--author-date-is-committer-date</option>
- </term>
- <listitem>
- <para>
- When importing the Debian patch, use the author date as
- committer date.
- <warning>
- <para>
- Git will subtly misbehave if the committer date of a commit is not
- later than or equal to all its parents.
- </para>
- </warning>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]create-missing-branches</option>
- </term>
- <listitem>
- <para>
- Create missing upstream and debian branch if missing.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
-
- <para>
- <xref linkend="man.gbp.import.dscs">,
- <xref linkend="man.gbp.buildpackage">,
- <xref linkend="man.gbp.import.orig">,
- <xref linkend="man.gbp.dch">,
- <citerefentry>
- <refentrytitle>apt-get</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>dget</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &dhusername; &dhemail;
- </para>
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.import.dsc">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-import-dsc</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-import-dsc</refname>
+ <refpurpose>Import &debian; packages into a &git; repository</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-import-dsc;
+ &man.common.options.synopsis;
+ <arg><option>--allow-same-versions</option></arg>
+ <arg><option>--author-date-is-committer-date</option></arg>
+ <arg><option>--author-is-committer</option></arg>
+ <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg rep='repeat'><option>--filter=</option><replaceable>pattern</replaceable></arg>
+ <arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg>
+ <arg><option>--[no-]create-missing-branches</option></arg>
+ <arg><option>--[no-]pristine-tar</option></arg>
+ <arg><option>--[no-]sign-tags</option></arg>
+ <arg><option>--skip-debian-tag</option></arg>
+ <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--upstream-vcs-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg>
+ <arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg>
+ <arg choice="plain"><replaceable>debian-source.dsc</replaceable></arg>
+ <arg choice="opt"><replaceable>target</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ &gbp-import-dsc;
+ <arg><option>options</option></arg>
+ <arg><option>--[no-]allow-unauthenticated</option></arg>
+ <group choice="plain">
+ <arg><replaceable>URL</replaceable></arg>
+ </group>
+ <arg choice="opt"><replaceable>target</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-import-dsc; imports a &debian; source package into a &git; repository,
+ notes the package version in the commit logs, and commits the change. All
+ information, including package name, version, &debian; modifications and upstream
+ source, is automatically detected from the source package. After
+ import the repository can be used with the other &gbp; tools.
+ </para>
+ <para>
+ If the command is run from within an existing &git; repository, it will import
+ into it; if not, a new repository named as the Debian source package is
+ created. You can override the location of the new repository by specifying
+ the optional <replaceable>target</replaceable> argument.
+ </para>
+ <para>
+ When given a <replaceable>URL</replaceable> &gbp-import-dsc;
+ will download the source package prior to importing it. &dget;
+ is used for all schemes except for the special
+ scheme <replaceable>apt:///</replaceable> which uses &apt-get;
+ (and therefore needs <replaceable>deb-src</replaceable>
+ entries in your <filename>/etc/apt/sources.list</filename>).
+ The later can be abbreviated by using the pseudo URL
+ <replaceable>apt:</replaceable>.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the &git; repository the upstream sources are put
+ onto. Default is <replaceable>upstream</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the &git; repository the debian sources are put
+ onto. Default is <replaceable>master</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]sign-tags</option>
+ </term>
+ <listitem>
+ <para>
+ GPG sign all created tags
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--keyid=</option><replaceable>gpg-keyid</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this keyid for gpg signing tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-tag=</option><replaceable>tag-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when tagging &debian; versions,
+ default is <replaceable>debian/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tag=</option><replaceable>tag-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when tagging upstream versions,
+ default is <replaceable>upstream/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-vcs-tag</option>=<replaceable>tag-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Add <replaceable>tag-format</replaceable> as additional parent to the
+ commit of the upstream tarball. Useful when upstream uses git and you
+ want to link to its revision history. The
+ <replaceable>tag-format</replaceable> can be a pattern similar to
+ what <option>--upstream-tag</option> supports.
+ </para>
+ <para>
+ The default is to not add upstream tags as additional
+ parents since this requires additional setup to have the upstream
+ sources in the same repository.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--skip-debian-tag</option>
+ </term>
+ <listitem>
+ <para>
+ Don't create &debian; tag after importing the &debian; patch. This can be
+ useful if you already created a package but want to further work on
+ it after importing it into git.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--filter=</option><replaceable>pattern</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Filter out files glob-matching
+ <option><replaceable>pattern</replaceable></option> from
+ upstream tarballs and the debian tarball of 3.0(quilt)
+ packages. Note that the <emphasis>.diff.gz</emphasis> of 1.0
+ source format packages is currently not filtered.
+ </para>
+ <para>
+ This option can be given multiple times.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--pristine-tar</option>
+ </term>
+ <listitem>
+ <para>
+ Generate pristine-tar delta file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--allow-unauthenticated</option>
+ </term>
+ <listitem>
+ <para>
+ Whether to skip signature verification on
+ downloads. Passed on verbatim to &dget; and &apt-get;
+ respectively. Use with care.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--allow-same-version</option>
+ </term>
+ <listitem>
+ <para>
+ Allow one to import a package with the same debian version.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--author-is-committer</option>
+ </term>
+ <listitem>
+ <para>
+ When importing the &debian; patch, use the author identity as
+ committer identity.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--author-date-is-committer-date</option>
+ </term>
+ <listitem>
+ <para>
+ When importing the &debian; patch, use the author date as
+ committer date.
+ <warning>
+ <para>
+ &git; will subtly misbehave if the committer date of a commit is not
+ later than or equal to all its parents.
+ </para>
+ </warning>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]create-missing-branches</option>
+ </term>
+ <listitem>
+ <para>
+ Create upstream and debian branch if missing.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--repo-user=</option><option>[GIT|DEBIAN]</option></term>
+ <listitem>
+ <para>
+ When set to <option>DEBIAN</option>
+ use the <envar>DEBUSER</envar> environment variable to set the
+ user.name &git; configuration otherwise use &git;'s
+ defaults. Only affects newly created repos.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--repo-email=</option><option>[GIT|DEBIAN]</option></term>
+ <listitem>
+ <para>
+ When set to <option>DEBIAN</option>
+ use the <envar>DEBEMAIL</envar> environment variable to set the
+ user.email &git; configuration otherwise use &git;'s
+ defaults. Only affects newly created repos.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>
+ Download and import a source package from a URL:
+ </para>
+ <screen>
+ &gbp-import-dsc; http://http.debian.net/debian/pool/main/h/hello/hello_2.10-1.dsc
+ </screen>
+ <para>
+ Download and import a source package via <command>apt-get
+ source</command> from unstable:
+ </para>
+ <screen>
+ &gbp-import-dsc; apt:hello/sid
+ </screen>
+ <para>
+ Import a source package in the local file system:
+ </para>
+ <screen>
+ &gbp-import-dsc; ../hello_2.10-1.dsc
+ </screen>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+
+ <para>
+ <xref linkend="man.gbp.import.dscs"/>,
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.import.orig"/>,
+ <xref linkend="man.gbp.dch"/>,
+ <citerefentry>
+ <refentrytitle>apt-get</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>sources.list</refentrytitle>
+ <manvolnum>5</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>dget</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &dhusername; &dhemail;
+ </para>
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.import.dscs">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-import-dscs</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>git-import-dscs</refname>
- <refname>gbp-import-dscs</refname>
- <refpurpose>Import multiple versions of a Debian source packages into a Git repository</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-import-dscs;
- <arg><option>options</option></arg>
- <arg><option>git-import-dsc options</option></arg>
- <arg choice="plain"><replaceable>pkg_1.dsc</replaceable></arg>
- <arg choice="plain"><replaceable>pkg_2.dsc</replaceable></arg>
- <arg choice="plain"><replaceable>...</replaceable></arg>
- </cmdsynopsis>
-
- <para>or</para>
-
- <cmdsynopsis>
- &gbp-import-dscs;
- <arg choice="req">--debsnap</arg>
- <arg><option>options</option></arg>
- <arg><option>git-import-dsc options</option></arg>
- <arg choice="req"><replaceable>package</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-import-dscs; imports several versions of a Debian source package into
- a &git; repository. To do so it sorts the packages by their versions first
- and then imports them via calling &gbp-import-dsc; on each package.
- </para>
-
- <para>
- If the current directory isn't a &git; repository already the repository is
- created in a subdir of the current working directory, named after the first
- imported package, otherwise the &git; repository in the current working
- directory is being used. This allows for incremental imports.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- <varlistentry>
- <term><option>--debsnap</option>
- </term>
- <listitem>
- <para>Fetch snapshots from snapshots.debian.org using debsnap.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--ignore-repo-config</option>
- </term>
- <listitem>
- <para>Ignore <filename>gbp.conf</filename> files stored in the git
-repository itself. This can be useful to ignore branch informations and other
-options shipped in the package source.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>
- All other options are passed on verbatim to &gbp-import-dsc;.
- </para>
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
-
- <para>
- <xref linkend="man.gbp.import.dsc">,
- <xref linkend="man.gbp.buildpackage">,
- <xref linkend="man.gbp.import.orig">,
- <xref linkend="man.gbp.dch">,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
-
- <para>&dhusername; &dhemail;</para>
-
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.import.dscs">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-import-dscs</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-import-dscs</refname>
+ <refpurpose>Import multiple versions of a Debian source packages into a Git repository</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-import-dscs;
+ <arg><option>options</option></arg>
+ <arg><option>gbp import-dsc options</option></arg>
+ <arg choice="plain"><replaceable>pkg_1.dsc</replaceable></arg>
+ <arg choice="plain"><replaceable>pkg_2.dsc</replaceable></arg>
+ <arg choice="plain"><replaceable>...</replaceable></arg>
+ </cmdsynopsis>
+
+ <para>or</para>
+
+ <cmdsynopsis>
+ &gbp-import-dscs;
+ <arg choice="req">--debsnap</arg>
+ <arg><option>options</option></arg>
+ <arg><option>gbp import-dsc options</option></arg>
+ <arg choice="req"><replaceable>package</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-import-dscs; imports several versions of a Debian source package into
+ a &git; repository. To do so, it sorts the packages by their versions first,
+ and then imports them via calling &gbp-import-dsc; on each package.
+ </para>
+
+ <para>
+ If the current directory isn't a &git; repository already, the repository is
+ created in a subdir of the current working directory, named after the first
+ imported package, otherwise the &git; repository in the current working
+ directory is being used. This allows for incremental imports.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ <varlistentry>
+ <term><option>--debsnap</option>
+ </term>
+ <listitem>
+ <para>Fetch snapshots from snapshots.debian.org using debsnap.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--ignore-repo-config</option>
+ </term>
+ <listitem>
+ <para>Ignore <filename>gbp.conf</filename> files stored in the git
+repository itself. This can be useful to ignore branch information and other
+options shipped in the package source.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ All other options are passed on verbatim to &gbp-import-dsc;.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+
+ <para>
+ <xref linkend="man.gbp.import.dsc"/>,
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.import.orig"/>,
+ <xref linkend="man.gbp.dch"/>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+
+ <para>&dhusername; &dhemail;</para>
+
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.import.orig.rpm">
- <refentryinfo>
- <address>
- &rpm-email;
- </address>
- <author>
- &rpm-firstname;
- &rpm-surname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-import-orig-rpm</refentrytitle>
- &rpm-mansection;
- </refmeta>
- <refnamediv>
- <refname>git-import-orig-rpm</refname>
- <refname>gbp-import-orig-rpm</refname>
- <refpurpose>Import an upstream source into a git repository.</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-import-orig-rpm;
-
- &man.common.options.synopsis;
- <arg><option>--vendor</option>=<replaceable>VENDOR</replaceable></arg>
- <arg><option>--upstream-version=</option><replaceable>VERSION</replaceable></arg>
- <arg><option>--[no-]merge</option></arg>
- <arg><option>--upstream-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
- <arg><option>--packaging-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
- <arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--[no-]create-missing-branches</option></arg>
- <arg><option>--upstream-vcs-tag=</option><replaceable>TAG-NAME</replaceable></arg>
- <arg><option>--[no-]sign-tags</option></arg>
- <arg><option>--keyid=</option><replaceable>GPG-KEYID</replaceable></arg>
- <arg><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
- <arg><option>--filter=</option><replaceable>PATTERN</replaceable></arg>
- <arg><option>--[no-]pristine-tar</option></arg>
- <arg><option>--[no-]filter-pristine-tar</option></arg>
- <arg><option>--pristine-tarball-name=<replaceable>FILENAME</replaceable></option></arg>
- <arg><option>--orig-prefix=<replaceable>PREFIX</replaceable></option></arg>
- <arg><option>--postimport=<replaceable>CMD</replaceable></option></arg>
- <arg><option>--[no-]interactive</option></arg>
- <group choice="plain">
- <arg choice="plain"><replaceable>UPSTREAM-SOURCE</replaceable></arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-import-orig-rpm; is an basically identical to the &gbp-import-orig;
- tool, with only some rpm-specific functionality added and some
- Debian-specific functionality removed.
- </para>
- <para>
- &gbp-import-orig-rpm; imports <replaceable>UPSTREAM-SOURCE</replaceable>
- into the &git; repository. <replaceable>UPSTREAM-SOURCE</replaceable> can
- either be a gzip, bzip2, lzma or xz compressed tar archive, a zip archive
- or an already unpacked source tree. If it is already of the form
- <replaceable>package-name-version.tar.gz</replaceable>, the version
- information is read from the tarball's filename otherwise it can be given
- on the command line via <option>--upstream-version</option>. If the source
- package name or version can't be determined &gbp-import-orig-rpm; will
- prompt for it unless <option>--no-interactive</option> is given.
- </para>
- <para>
- &gbp-import-orig-rpm; tries to download the archive from a remote server if
- a remote URL is given. In addition, if no
- <replaceable>UPSTREAM-SOURCE</replaceable> is given &gbp-import-orig-rpm;
- takes the archive URI from the spec file - this makes it possible to import
- a new upstream version just by bumping the version number in the spec file
- and running &gbp-import-orig-rpm; (assuming that the spec file contains
- a full URL for the archive and its filename automatically follows the
- package version e.g. by using the %{version} macro, of course).
- </para>
- <para>
- The sources are placed on the upstream branch (default:
- <replaceable>upstream</replaceable>) and tagged.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--vendor</option>=<replaceable>VENDOR</replaceable>
- </term>
- <listitem>
- <para>
- Distribution vendor name.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-version</option>=<replaceable>VERSION</replaceable></term>
- <term><option>-u</option><replaceable>VERSION</replaceable></term>
- <listitem>
- <para>
- The upstream version number.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--merge</option></term>
- <listitem>
- <para>
- Merge the upstream branch to the packaging branch after import.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-branch</option>=<replaceable>BRANCH-NAME</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the Git repository the upstream sources are put
- onto. Default is <replaceable>upstream</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-branch</option>=<replaceable>BRANCH-NAME</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the Git repository the package is being developed on,
- default is <replaceable>master</replaceable>. After importing the new
- sources on the upstream branch, &gbp-import-orig-rpm; will try to
- merge the new version onto this branch.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Subdirectory that contains the RPM packaging files.
- &gbp-import-orig-rpm; uses this to try to find a spec file which, in
- turn, is used to get the upstream source archive URI if one is not
- specified on the command line.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]create-missing-branches</option>
- </term>
- <listitem>
- <para>
- Create missing upstream branch if it does not exist.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-vcs-tag</option>=<replaceable>TAG-NAME</replaceable>
- </term>
- <listitem>
- <para>
- Add <replaceable>TAG-NAME</replaceable> as additional parent to the
- commit of the upstream tarball. Useful when upstream uses git and you
- want to link to it's revision history.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]sign-tags</option>
- </term>
- <listitem>
- <para>
- GPG sign all created tags.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--keyid=</option><replaceable>GPG-KEYID</replaceable>
- </term>
- <listitem>
- <para>
- Use this keyid for gpg signing tags.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Use this tag format when tagging upstream versions,
- default is <replaceable>upstream/%(version)s</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--import-msg=</option><replaceable>MSG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Use this format string for the commit message when importing upstream
- versions, default is
- <replaceable>Imported Upstream version %(version)s</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--filter=</option><replaceable>PATTERN</replaceable>
- </term>
- <listitem>
- <para>
- Filter out files glob-matching pattern. Can be given multiple times.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]pristine-tar</option>
- </term>
- <listitem>
- <para>
- Generate <command>pristine-tar</command> delta file.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]filter-pristine-tar</option>
- </term>
- <listitem>
- <para>
- If using a filter also filter the files out of the tarball
- passed to <command>pristine-tar</command>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--pristine-tarball-name=</option><replaceable>FILENAME</replaceable>
- </term>
- <listitem>
- <para>
- Filename to record to pristine-tar. This does not alter the tarball
- content, just the filename with which the tarball can be checked out
- with pristine-tar.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--orig-prefix=</option><replaceable>PREFIX</replaceable>
- </term>
- <listitem>
- <para>
- Prefix (directory) to be used when importing sources into
- pristine-tar. Only takes effect when <option>--pristine-tar</option>
- is used. Special value <replaceable>auto</replaceable> causes &gbp-import-orig-rpm; to guess
- the prefix when importing unpacked sources, or, not to change the
- prefix when importing source archives.
- </para>
- <note>
- <para>
- Using this option will alter the source archive that is imported to
- pristine-tar! That is, pristine-tar does not produce and identical
- copy of the original tarball (but the mangled tarball, instead).
- </para>
- </note>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--postimport=<replaceable>CMD</replaceable></option></term>
- <listitem>
- <para>
- Run <replaceable>CMD</replaceable> after the import.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]interactive</option></term>
- <listitem>
- <para>
- Run command interactively, i.e. ask package name and version if
- needed.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>EXAMPLES</title>
- <para>
- Download and import a new upstream version using the informantion from the
- spec file
- </para>
- <screen>
- &gbp-import-orig-rpm;
- </screen>
- <para>
- After manually downloading an upstream import it
- </para>
- <screen>
- &gbp-import-orig-rpm; ../upstream-tarball-0.1.tar.gz
- </screen>
- <para>
- Import unpacked sources
- </para>
- <screen>
- &gbp-import-orig-rpm; --orig-prefix=upstream-0.1 ../upstream/
- </screen>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage">,
- <xref linkend="man.gbp.import.srpm">,
- <xref linkend="man.gbp.rpm.ch">,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &rpm-username; &rpm-email;
- </para>
- </refsect1>
-</refentry>
+++ /dev/null
-<refentry id="man.gbp.import.orig">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-import-orig</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>git-import-orig</refname>
- <refname>gbp-import-orig</refname>
- <refpurpose>Import an upstream source into a git repository</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-import-orig;
-
- &man.common.options.synopsis;
- <arg><option>--upstream-version=</option><replaceable>version</replaceable></arg>
- <arg><option>--[no-]merge</option></arg>
- <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--[no-]create-missing-branches</option></arg>
- <arg><option>--upstream-vcs-tag=</option><replaceable>tag_name</replaceable></arg>
- <arg><option>--[no-]sign-tags</option></arg>
- <arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg>
- <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
- <arg><option>--filter=</option><replaceable>pattern</replaceable></arg>
- <arg><option>--[no-]pristine-tar</option></arg>
- <arg><option>--[no-]filter-pristine-tar</option></arg>
- <arg><option>--[no-]symlink-orig</option></arg>
- <arg><option>--postimport=cmd</option></arg>
- <arg><option>--[no-]interactive</option></arg>
- <group choice="plain">
- <arg choice="plain"><replaceable>upstream-source</replaceable></arg>
- <arg><option>--uscan</option></arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-import-orig; imports <replaceable>upstream-source</replaceable> into
- the &git; repository. <replaceable>upstream-source</replaceable> can either
- be a gzip, bzip2, lzma or xz compressed tar archive, a zip archive or an
- already unpacked source tree. If it is already of the form
- <replaceable>package-name_version.orig.tar.gz</replaceable>, the version
- information is read from the tarball's filename otherwise it can be given
- on the command line via <option>--upstream-version</option>. If the source
- package name or version can't be determined &gbp-import-orig; will prompt
- for it unless <option>--no-interactive</option> is given.
- </para>
- <para>
- The sources are placed on the upstream branch (default:
- <replaceable>upstream</replaceable>), tagged and merged onto the debian
- branch (default: <replaceable>master</replaceable>).
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--upstream-version</option>=<replaceable>version</replaceable></term>
- <term><option>-u</option><replaceable>version</replaceable></term>
- <listitem>
- <para>
- The upstream version number
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]merge</option></term>
- <listitem>
- <para>
- Merge the upstream branch to the debian branch after import
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the Git repository the upstream sources are put
- onto. Default is <replaceable>upstream</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the Git repository the Debian package is being
- developed on, default is <replaceable>master</replaceable>. After
- importing the new sources on the upstream branch, &gbp-import-orig;
- will try to merge the new version onto this branch.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]create-missing-branches</option>
- </term>
- <listitem>
- <para>
- Create missing upstream branch if it does not exist.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-vcs-tag</option>=<replaceable>tag_name</replaceable>
- </term>
- <listitem>
- <para>
- Add <replaceable>tag_name</replaceable> as additional parent to the
- commit of the upstream tarball. Useful when upstream uses git and you
- want to link to it's revision history.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]sign-tags</option>
- </term>
- <listitem>
- <para>
- GPG sign all created tags
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--keyid=</option><replaceable>gpg-keyid</replaceable>
- </term>
- <listitem>
- <para>
- use this keyid for gpg signing tags
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-tag=</option><replaceable>tag-format</replaceable>
- </term>
- <listitem>
- <para>
- use this tag format when tagging upstream versions,
- default is <replaceable>upstream/%(version)s</replaceable>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--import-msg=</option><replaceable>msg-format</replaceable>
- </term>
- <listitem>
- <para>
- use this format string for the commit message when importing upstream
- versions, default is
- <replaceable>Imported Upstream version %(version)s</replaceable>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--filter=</option><replaceable>pattern</replaceable>
- </term>
- <listitem>
- <para>
- filter out files glob-matching pattern. Can be given multiple times.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]pristine-tar</option>
- </term>
- <listitem>
- <para>
- generate <command>pristine-tar</command> delta file
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]filter-pristine-tar</option>
- </term>
- <listitem>
- <para>
- if using a filter also filter the files out of the tarball
- passed to <command>pristine-tar</command>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]symlink-orig</option></term>
- <listitem>
- <para>
- Whether to create and keep a symlink from the upstream tarball
- to a Debian policy conformant upstream tarball name located in
- <filename class="directory">../</filename>.
- </para>
- <para>
- This is a good idea if not using <command>pristine-tar</command>
- since it avoids creating a new tarball with a different md5sum.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--postimport=<replaceable>cmd</replaceable></option></term>
- <listitem>
- <para>
- run <replaceable>cmd</replaceable> after the import.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--uscan</option></term>
- <listitem>
- <para>
- Use uscan to fetch new upstream version.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]interactive</option></term>
- <listitem>
- <para>
- Run command interactively, i.e. ask package name and version if
- needed.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]interactive</option></term>
- <listitem>
- <para>
- Run command interactively, i.e. ask package name and version if
- needed.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>EXAMPLES</title>
- <para>
- Download and import a new upstream version using the informantion from <filename>debian/watch</filename>
- </para>
- <screen>
- &gbp-import-orig; --uscan
- </screen>
- <para>
- After downloading an upstream tarball by hand import it
- </para>
- <screen>
- &gbp-import-orig; ../upstream-tarball-0.1.tar.gz
- </screen>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage">,
- <xref linkend="man.gbp.import.dsc">,
- <xref linkend="man.gbp.import.dscs">,
- <xref linkend="man.gbp.dch">,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &dhusername; &dhemail;
- </para>
- </refsect1>
-</refentry>
-<!-- LocalWords: xz lzma bzip gzip tarball
- -->
--- /dev/null
+<refentry id="man.gbp.import.orig">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-import-orig</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-import-orig</refname>
+ <refpurpose>Import an upstream source into a git repository</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-import-orig;
+
+ &man.common.options.synopsis;
+ <arg><option>--upstream-version=</option><replaceable>version</replaceable></arg>
+ <arg><option>--[no-]merge</option></arg>
+ <arg><option>--merge-mode=</option><replaceable>[auto|merge|replace]</replaceable></arg>
+ <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--upstream-vcs-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--[no-]sign-tags</option></arg>
+ <arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg>
+ <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg rep='repeat'><option>--filter=</option><replaceable>pattern</replaceable></arg>
+ <arg rep='repeat'><option>--component=</option><replaceable>component</replaceable></arg>
+ <arg><option>--[no-]pristine-tar</option></arg>
+ <arg><option>--[no-]filter-pristine-tar</option></arg>
+ <arg><option>--[no-]symlink-orig</option></arg>
+ <arg><option>--postimport=cmd</option></arg>
+ <arg><option>--postunpack=cmd</option></arg>
+ <arg><option>--[no-]interactive</option></arg>
+ <arg><option>--[no-]rollback</option></arg>
+ <arg><option>--upstream-signatures=</option>[auto|on|off]</arg>
+ <group choice="plain">
+ <arg choice="plain"><replaceable>filename</replaceable></arg>
+ <arg choice="plain"><replaceable>url</replaceable></arg>
+ <arg><option>--uscan</option></arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-import-orig; imports upstream sources into a &git;
+ repository. It can import from three sources:
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ <replaceable>filename</replaceable>: A file in the local
+ file system. Gzip, bzip2, lzma and xz compressed tar
+ archives, zip archives and already unpacked source trees are
+ supported.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <replaceable>url</replaceable>: The tarball is downloaded
+ from a <replaceable>http</replaceable>
+ or <replaceable>https</replaceable> <replaceable>url</replaceable>.
+ This needs the python3-request package installed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>--uscan</option>: The latest upstream or specified version is
+ fetched via &uscan; relying on <filename>debian/watch</filename>.
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ If the tarballs name is already of the form
+ <replaceable>package-name_version.orig.tar.gz</replaceable>, the
+ version information is determined from the tarball's filename,
+ otherwise it can be given on the command line
+ via <option>--upstream-version</option>. If the source package
+ name or version can't be determined, &gbp-import-orig; will
+ prompt for it unless <option>--no-interactive</option> is given.
+ </para>
+ <para>
+ The sources are placed on the upstream branch (default:
+ <replaceable>upstream</replaceable>), tagged and merged onto the
+ debian branch (default: <replaceable>master</replaceable>). This
+ is either done using plain <command>git merge</command>
+ or by creating a new tree that consists of the new
+ upstream version plus the <filename>debian/</filename>
+ directory. The later is used for source format 3.0
+ (quilt) packages since direct modifications of the upstream
+ sources are not allowed in that format and so a 1:1 replacement
+ of the upstream sources is almost always desired. It can
+ be tweaked via the <option>--merge-mode</option>.
+ </para>
+ <para>In case of an error &gbp-import-orig; will rollback (undo)
+ all changes it has done to the repository (see
+ the <option>--rollback</option> option).
+ </para>
+ <para>
+ Note that for projects using multiple tarballs the name of the
+ additional components needs to be specified via the
+ <option>--component</option> command line option or via
+ <filename>gbp.conf</filename> (see below for details).
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--upstream-version</option>=<replaceable>version</replaceable></term>
+ <term><option>-u</option><replaceable>version</replaceable></term>
+ <listitem>
+ <para>
+ The upstream version number. With <option>--uscan</option>, passed to
+ uscan as <option>--download-debversion</option>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]merge</option></term>
+ <listitem>
+ <para>
+ Merge the upstream branch to the &debian; branch after import
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--merge-mode=</option><replaceable>[auto|merge|replace]</replaceable></term>
+ <listitem>
+ <para>
+ How to fold the newly imported upstream source to the
+ &debian; packaging branch after import.
+ </para>
+ <para>
+ <replaceable>merge</replaceable> does a
+ &git; <command>merge</command> leaving you on your own in
+ case of merge conflict resolution.
+ </para>
+ <para>
+ <replaceable>replace</replaceable> mode on the
+ other hand makes the head of the &debian; packaging branch
+ identical to the newly imported tree but preserves the
+ content of the <filename>debian/</filename> directory
+ while keeping the current head as well as the newly
+ imported tree as parents of the generated commit. This is
+ similar to a <option>theirs</option> merge strategy while
+ preserving <filename>debian/</filename>.
+ </para>
+ <para>
+ The default is <replaceable>auto</replaceable> which
+ uses <replaceable>replace</replaceable> for 3.0 (quilt) packages
+ and <replaceable>merge</replaceable> otherwise.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the &git; repository the upstream sources are put
+ onto. Default is <replaceable>upstream</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the &git; repository the &debian; package is being
+ developed on, default is <replaceable>master</replaceable>. After
+ importing the new sources on the upstream branch, &gbp-import-orig;
+ will try to merge the new version onto this branch.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-vcs-tag</option>=<replaceable>tag-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Add <replaceable>tag-format</replaceable> as additional parent to the
+ commit of the upstream tarball. Useful when upstream uses git and you
+ want to link to its revision history. The
+ <replaceable>tag-format</replaceable> can be a pattern similar to
+ what <option>--upstream-tag</option> supports.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]sign-tags</option>
+ </term>
+ <listitem>
+ <para>
+ GPG sign all created tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--keyid=</option><replaceable>gpg-keyid</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this <option><replaceable>keyid</replaceable></option>
+ for gpg signing tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tag=</option><replaceable>tag-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when tagging upstream versions,
+ default is <replaceable>upstream/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--import-msg=</option><replaceable>msg-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this format string for the commit message when importing upstream
+ versions, default is
+ <replaceable>New upstream version %(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--filter=</option><replaceable>pattern</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Filter out files glob-matching
+ <option><replaceable>pattern</replaceable></option>. This
+ option can be given multiple times.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--component=</option><replaceable>COMPONENT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ When importing the upstream tarball also look for an additional tarball
+ with component name <replaceable>COMPONENT</replaceable>. E.g. in
+ <filename>hello-debhelper_1.0.orig-foo.tar.gz</filename>
+ the component would be <replaceable>foo</replaceable>. The additional
+ tarball is expected to be in the same directory than the upstream tarball
+ and to use the same compression type. You also need to specify the components
+ when using <option>--uscan</option>.
+ </para>
+ <para>
+ Using additional original tarballs is a feature of the 3.0
+ (quilt) source format. See
+ the <command>dpkg-source</command> manpage for
+ details. This is currently considered an experimental
+ feature and might change incompatibly.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]pristine-tar</option>
+ </term>
+ <listitem>
+ <para>
+ Generate <command>pristine-tar</command> delta file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]filter-pristine-tar</option>
+ </term>
+ <listitem>
+ <para>
+ If using a filter, also filter the files out of the tarball
+ passed to <command>pristine-tar</command>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]symlink-orig</option></term>
+ <listitem>
+ <para>
+ Whether to create and keep a symlink from the upstream tarball
+ to a &debian; policy conformant upstream tarball name located in
+ <filename class="directory">../</filename>.
+ </para>
+ <para>
+ This is a good idea if not using <command>pristine-tar</command>
+ since it avoids creating a new tarball with a different md5sum.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--postimport=<replaceable>cmd</replaceable></option></term>
+ <listitem>
+ <para>
+ Run <replaceable>cmd</replaceable> after the import. The
+ hook gets the following environment variables passed:
+ <variablelist>
+ <varlistentry>
+ <term><envar>GBP_BRANCH</envar></term>
+ <listitem><para>
+ The name of the Debian packaging branch
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_TAG</envar></term>
+ <listitem><para>
+ The name of the just created upstream tag
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_UPSTREAM_VERSION</envar></term>
+ <listitem><para>
+ The just imported upstream version
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_DEBIAN_VERSION</envar></term>
+ <listitem><para>
+ The Debian version of the package with a Debian
+ revision of '-1'
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--postunpack=<replaceable>cmd</replaceable></option></term>
+ <listitem>
+ <para>
+ Run <replaceable>cmd</replaceable> after the import. This can be useful
+ to e.g. convert or remove certain files prior to the import.
+ The hook gets passed the following environment variables:
+ <variablelist>
+ <varlistentry>
+ <term><envar>GBP_TMP_DIR</envar></term>
+ <listitem><para>
+ The temporary directory the tarballs are unapcked into.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_SOURCES_DIR</envar></term>
+ <listitem><para>
+ The temporary directory where the unpacked sources are.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_GIT_DIR</envar></term>
+ <listitem><para>
+ The directory of the git repository where the tarball
+ will be imported into.
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--uscan</option></term>
+ <listitem>
+ <para>
+ Use &uscan; to fetch new upstream version. The version can be
+ specified with <option>--upstream-version</option>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]interactive</option></term>
+ <listitem>
+ <para>
+ Run command interactively, i.e. ask package name and version if
+ needed.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]rollback</option></term>
+ <listitem>
+ <para>
+ Rollback changes in case of an error.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-signatures=</option>[auto|on|off]</term>
+ <listitem>
+ <para>
+ Whether upstream signatures should be imported as well (when
+ using pristine-tar). <emphasis>off</emphasis> turns this
+ off completely while <emphasis>on</emphasis> always tries to
+ import a signature (which can be useful if you want to fail if
+ e.g. &uscan; did not fetch a signature). The default
+ <emphasis>auto</emphasis> means to import a signature file if
+ present but do nothing otherwise.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>
+ Download and import a new upstream version using the information from <filename>debian/watch</filename>
+ </para>
+ <screen>
+ &gbp-import-orig; --uscan</screen>
+ <para>
+ Fetch tarball from an URL
+ </para>
+ <screen>
+ &gbp-import-orig; https://debian.example.com/sid/upstream-tarball-0.1.tar.gz</screen>
+ <para>
+ Import a local tarball
+ </para>
+ <screen>
+ &gbp-import-orig; ../upstream-tarball-0.1.tar.gz</screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.import.dsc"/>,
+ <xref linkend="man.gbp.import.dscs"/>,
+ <xref linkend="man.gbp.dch"/>,
+ <xref linkend="man.gbp.conf"/>,
+ <citerefentry>
+ <refentrytitle>uscan</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &dhusername; &dhemail;
+ </para>
+ </refsect1>
+</refentry>
+<!-- LocalWords: xz lzma bzip gzip tarball
+ -->
--- /dev/null
+<refentry id="man.gbp.import.ref">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-import-ref</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-import-ref</refname>
+ <refpurpose>Update upstream sources when using &git; only</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-import-ref;
+
+ &man.common.options.synopsis;
+ <arg><option>--upstream-version=</option><replaceable>version</replaceable></arg>
+ <arg><option>--merge-mode=</option><replaceable>[auto|merge|replace]</replaceable></arg>
+ <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--upstream-tag=</option><replaceable>tag_format</replaceable></arg>
+ <arg><option>--upstream-tree=</option><replaceable>[BRANCH|VERSION|commit-id]</replaceable></arg>
+ <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--[no-]sign-tags</option></arg>
+ <arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg>
+ <arg><option>--postimport=cmd</option></arg>
+ <arg><option>--[no-]rollback</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-import-ref; merges upstream git commits onto your &debian-branch;
+ You can either specify a branch to merge, give an upstream
+ version or specify the commit id directly. If no tag exists for the imported
+ commit it will be automatically created.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--upstream-version</option>=<replaceable>version</replaceable></term>
+ <term><option>-u</option><replaceable>version</replaceable></term>
+ <listitem>
+ <para>
+ The upstream version to merge. The upstream tag to use will be determined via
+ the <option>--upstream-tag</option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--merge-mode=</option><replaceable>[auto|merge|replace]</replaceable></term>
+ <listitem>
+ <para>
+ How to fold the upstream commits onto the
+ &debian; packaging branch.
+ </para>
+ <para>
+ <replaceable>merge</replaceable> does a
+ &git; <command>merge</command> leaving you on your own in
+ case of merge conflict resolution.
+ </para>
+ <para>
+ <replaceable>replace</replaceable> mode on the
+ other hand makes the head of the &debian; packaging branch
+ identical to the newly imported tree but preserves the
+ content of the <filename>debian/</filename> directory
+ while keeping the current head as well as the newly
+ imported tree as parents of the generated commit. This is
+ similar to a <option>theirs</option> merge strategy while
+ preserving <filename>debian/</filename>.
+ </para>
+ <para>
+ The default is <replaceable>auto</replaceable> which
+ uses <replaceable>replace</replaceable> for 3.0 (quilt) packages
+ and <replaceable>merge</replaceable> otherwise.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the &git; repository the upstream sources are
+ on. Default is <replaceable>upstream</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tag=</option><replaceable>tag-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when looking up upstream tags,
+ default is <replaceable>upstream/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tree=</option><replaceable>[BRANCH|VERSION|commit-id]</replaceable>
+ </term>
+ <listitem>
+ <para>
+ What to merge into the &debian-branch;.
+ <replaceable>BRANCH</replaceable> merges from the upstream branch.
+ <replaceable>VERSION</replaceable> (the default) looks for a tag determined from the given
+ upstream version number via the <option>--upstream-version</option> option.
+ </para>
+ <para>
+ Other values are interpreted as git commit id to merge from.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the &git; repository the &debian; package is being
+ developed on, default is <replaceable>master</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]sign-tags</option>
+ </term>
+ <listitem>
+ <para>
+ GPG sign all created tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--keyid=</option><replaceable>gpg-keyid</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this <option><replaceable>keyid</replaceable></option>
+ for gpg signing tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--import-msg=</option><replaceable>msg-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this format string for the commit message when importing upstream
+ versions, default is
+ <replaceable>New upstream version %(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--postimport=<replaceable>cmd</replaceable></option></term>
+ <listitem>
+ <para>
+ Run <replaceable>cmd</replaceable> after the import. The
+ hook gets the following environment variables passed:
+ <variablelist>
+ <varlistentry>
+ <term><envar>GBP_BRANCH</envar></term>
+ <listitem><para>
+ The name of the Debian packaging branch
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_TAG</envar></term>
+ <listitem><para>
+ The name of the just created upstream tag
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_UPSTREAM_VERSION</envar></term>
+ <listitem><para>
+ The just imported upstream version
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_DEBIAN_VERSION</envar></term>
+ <listitem><para>
+ The Debian version of the package with a Debian
+ revision of '-1'
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]rollback</option></term>
+ <listitem>
+ <para>
+ Rollback changes in case of an error.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>
+ Merge commits from the &upstream-branch; into the &debian-branch;
+ creating a tag for the version <replaceable>0.0~git20180524</replaceable>:
+ </para>
+ <screen>
+ &gbp-import-ref; --upstream-tree=BRANCH -u0.0~git20180524</screen>
+ <para>
+ Merge commits from the the tag corresponding to version <replaceable>1.0</replaceable>:
+ </para>
+ <screen>
+ &gbp-import-ref; --upstream-tree=VERSION -u1.0</screen>
+ <para>
+ Merge commits given by a SHA1 creating a tag for the version
+ <replaceable>0.0~git20180524</replaceable>
+ </para>
+ <screen>
+ &gbp-import-ref; --upstream-tree=c4398912c -u0.0~git20180524</screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.import.dsc"/>,
+ <xref linkend="man.gbp.import.dscs"/>,
+ <xref linkend="man.gbp.dch"/>,
+ <xref linkend="man.gbp.conf"/>,
+ <citerefentry>
+ <refentrytitle>uscan</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &dhusername; &dhemail;
+ </para>
+ </refsect1>
+</refentry>
+<!-- LocalWords: xz lzma bzip gzip tarball
+-->
+++ /dev/null
-<refentry id="man.gbp.import.srpm">
- <refentryinfo>
- <address>
- &rpm-email;
- </address>
- <author>
- &rpm-firstname;
- &rpm-surname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-import-srpm</refentrytitle>
- &rpm-mansection;
- </refmeta>
- <refnamediv>
- <refname>git-import-srpm</refname>
- <refname>gbp-import-srpm</refname>
- <refpurpose>Import source RPM packages into a Git repository</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-import-srpm;
- &man.common.options.synopsis;
- <arg><option>--vendor</option>=<replaceable>VENDOR</replaceable></arg>
- <arg><option>--allow-same-versions</option></arg>
- <arg><option>--author-is-committer</option></arg>
- <arg><option>--packaging-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
- <arg><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
- <arg><option>--download</option></arg>
- <arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--[no-]patch-import</option></arg>
- <arg><option>--filter=</option><replaceable>PATTERN</replaceable></arg>
- <arg><option>--keyid=</option><replaceable>GPG-KEYID</replaceable></arg>
- <arg><option>--[no-]create-missing-branches</option></arg>
- <arg><option>--[no-]pristine-tar</option></arg>
- <arg><option>--[no-]sign-tags</option></arg>
- <arg><option>--upstream-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
- <arg><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
- <arg><option>--native</option></arg>
- <arg choice="plain"><replaceable>SRPM</replaceable></arg>
- </cmdsynopsis>
- <cmdsynopsis>
- &gbp-import-srpm;
- <arg><option>options</option></arg>
- <arg choice="req"><option>--download</option></arg>
- <group choice="plain">
- <arg><replaceable>URL</replaceable></arg>
- <arg><replaceable>SRC.RPM</replaceable></arg>
- <arg><replaceable>DIRECTORY</replaceable></arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-import-srpm; imports an RPM source package into a &git; repository,
- notes the package version in the commit logs, and commits the change. All
- information, including package name, version and upstream source is
- automatically detected from the source package. The tool supports importing
- both archived (src.rpm files) or unpacked (directory) source RPMs.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--vendor</option>=<replaceable>VENDOR</replaceable>
- </term>
- <listitem>
- <para>
- Distribution vendor name.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-branch</option>=<replaceable>BRANCH-NAME</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the &git; repository the upstream sources are put
- onto. Default is <replaceable>upstream</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-branch</option>=<replaceable>BRANCH-NAME</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the &git; repository the packaging files are put
- onto. Default is <replaceable>master</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]sign-tags</option>
- </term>
- <listitem>
- <para>
- GPG sign all created tags.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--keyid=</option><replaceable>GPG-KEYID</replaceable>
- </term>
- <listitem>
- <para>
- Use this keyid for gpg signing tags.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Use this tag format when tagging released versions,
- default is <replaceable>%(vendor)s/%(version)s</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Use this tag format when tagging upstream versions,
- default is <replaceable>upstream/%(version)s</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-packaging-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Subdirectory where to put the RPM packaging files.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]patch-import</option>
- </term>
- <listitem>
- <para>
- Import patches to the packaging branch. That is, apply and commit all
- patches (that are not marked for manual maintenance) into the
- packaging branch after importing other packaging files. The patch
- files are automatically removed from the packaging directory and the
- spec file if all patches are successufully applied. This option is
- ignored if <option>--orphan-packaging</option> is used.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--filter=</option><replaceable>PATTERN</replaceable>
- </term>
- <listitem>
- <para>
- Filter out files glob-matching pattern. Can be given multiple times.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--pristine-tar</option>
- </term>
- <listitem>
- <para>
- Generate pristine-tar delta file.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--download</option>
- </term>
- <listitem>
- <para>
- Download the source package instead of looking for it in the local
- file system. The argument can either be a plain package name or an
- URI. The former uses <command>yumdownloader</command> to download the
- source while the later uses &wget;.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--allow-same-version</option>
- </term>
- <listitem>
- <para>
- Allow to re-import a package with an already existing version. This
- will not re-import the upstream sources - only packaging files will
- be re-imported.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--author-is-committer</option>
- </term>
- <listitem>
- <para>
- Use the author identity as the comitter when importing upstream
- sources and packaging files.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]create-missing-branches</option>
- </term>
- <listitem>
- <para>
- Create missing upstream and/or packaging branch if missing.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--orphan-packaging</option>
- </term>
- <listitem>
- <para>
- Import packaging files into an orphan branch that will not be based
- on the upstream branch. Useful if you want to maintain (non-native)
- package using the 'orphan-packaging' model. This option have no
- effect if <option>--native</option> is used.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--native</option>
- </term>
- <listitem>
- <para>
- Treat the package as native package. No separate upstream branch or
- upstream tags will be created.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
-
- <para>
- <xref linkend="man.gbp.buildpackage.rpm">,
- <xref linkend="man.gbp.import.orig.rpm">,
- <xref linkend="man.gbp.rpm.ch">,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &rpm-username; &rpm-email;
- </para>
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.import.srpm">
+ <refentryinfo>
+ <address>
+ &rpm-email;
+ </address>
+ <author>
+ &rpm-firstname;
+ &rpm-surname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-import-srpm</refentrytitle>
+ &rpm-mansection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-import-srpm</refname>
+ <refpurpose>Import source RPM packages into a Git repository</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-import-srpm;
+ &man.common.options.synopsis;
+ <arg><option>--vendor</option>=<replaceable>VENDOR</replaceable></arg>
+ <arg><option>--allow-same-versions</option></arg>
+ <arg><option>--author-is-committer</option></arg>
+ <arg><option>--packaging-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
+ <arg><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
+ <arg><option>--skip-packaging-tag</option></arg>
+ <arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--filter=</option><replaceable>PATTERN</replaceable></arg>
+ <arg><option>--keyid=</option><replaceable>GPG-KEYID</replaceable></arg>
+ <arg><option>--[no-]create-missing-branches</option></arg>
+ <arg><option>--[no-]pristine-tar</option></arg>
+ <arg><option>--[no-]sign-tags</option></arg>
+ <arg><option>--upstream-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
+ <arg><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
+ <arg><option>--upstream-vcs-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
+ <arg><option>--native</option></arg>
+ <arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg>
+ <arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg>
+ <group choice="plain">
+ <arg><replaceable>SRPM</replaceable></arg>
+ <arg><replaceable>DIRECTORY</replaceable></arg>
+ </group>
+ <arg choice="opt"><replaceable>target</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ &gbp-import-srpm;
+ <arg><option>options</option></arg>
+ <group choice="plain">
+ <arg><replaceable>URL</replaceable></arg>
+ </group>
+ <arg choice="opt"><replaceable>target</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-import-srpm; imports an RPM source package into a &git; repository,
+ notes the package version in the commit logs, and commits the change. All
+ information, including package name, version and upstream source is
+ automatically detected from the source package but you can override the
+ location of the new repository by optionally specifying the
+ <replaceable>target</replaceable> argument. The tool supports importing
+ both archived (src.rpm files) or unpacked (directory) source RPMs. It also imports
+ from http(s)-URLs.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--vendor</option>=<replaceable>VENDOR</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Distribution vendor name.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>BRANCH-NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the &git; repository the upstream sources are put
+ onto. Default is <replaceable>upstream</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--packaging-branch</option>=<replaceable>BRANCH-NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the &git; repository the packaging files are put
+ onto. Default is <replaceable>master</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]sign-tags</option>
+ </term>
+ <listitem>
+ <para>
+ GPG sign all created tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--keyid=</option><replaceable>GPG-KEYID</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this keyid for gpg signing tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when tagging released versions,
+ default is <replaceable>%(vendor)s/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--skip-packaging-tag</option>
+ </term>
+ <listitem>
+ <para>
+ Do not create packaging tag after importing the packaging files.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when tagging upstream versions,
+ default is <replaceable>upstream/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-vcs-tag</option>=<replaceable>TAG-NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Add <replaceable>TAG-FORMAT</replaceable> as an additional parent of the
+ commit of the upstream tarball. Useful when upstream uses git and you
+ want to link to its revision history.
+ <replaceable>TAG-FORMAT</replaceable> can be a pattern similar to
+ what <option>--upstream-tag</option> supports.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-packaging-dir=</option><replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Subdirectory where to put the RPM packaging files.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--filter=</option><replaceable>PATTERN</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Filter out files glob-matching pattern. Can be given multiple times.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--pristine-tar</option>
+ </term>
+ <listitem>
+ <para>
+ Generate pristine-tar delta file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--allow-same-version</option>
+ </term>
+ <listitem>
+ <para>
+ Allow one to re-import a package with an already existing version.
+ This will not re-import the upstream sources - only packaging files
+ will be re-imported.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--author-is-committer</option>
+ </term>
+ <listitem>
+ <para>
+ Use the author identity as the committer when importing upstream
+ sources and packaging files.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]create-missing-branches</option>
+ </term>
+ <listitem>
+ <para>
+ Create missing upstream and/or packaging branch if missing.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--orphan-packaging</option>
+ </term>
+ <listitem>
+ <para>
+ Import packaging files into an orphan branch that will not be based
+ on the upstream branch. Useful if you want to maintain (non-native)
+ package using the 'orphan-packaging' model. This option have no
+ effect if <option>--native</option> is used.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--native</option>
+ </term>
+ <listitem>
+ <para>
+ Treat the package as native package. No separate upstream branch or
+ upstream tags will be created.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--repo-user=</option><option>[GIT|DEBIAN]</option></term>
+ <listitem>
+ <para>
+ When set to <option>DEBIAN</option>
+ use the <envar>DEBUSER</envar> environment variable to set the
+ user.name &git; configuration otherwise use &git;'s
+ defaults. Only affects newly created repos.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--repo-email=</option><option>[GIT|DEBIAN]</option></term>
+ <listitem>
+ <para>
+ When set to <option>DEBIAN</option>
+ use the <envar>DEBEMAIL</envar> environment variable to set the
+ user.email &git; configuration otherwise use &git;'s
+ defaults. Only affects newly created repos.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+
+ <para>
+ <xref linkend="man.gbp.buildpackage.rpm"/>,
+ <xref linkend="man.gbp.pq.rpm"/>,
+ <xref linkend="man.gbp.rpm.ch"/>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &rpm-username; &rpm-email;
+ </para>
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.pq.rpm">
- <refentryinfo>
- <address>
- &rpm-email;
- </address>
- <author>
- &rpm-firstname;
- &rpm-surname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-pq-rpm</refentrytitle>
- &rpm-mansection;
- </refmeta>
- <refnamediv>
- <refname>gbp-pq-rpm</refname>
- <refpurpose>Manage patches and development branches in Git</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-pq-rpm;
- &man.common.options.synopsis;
- <arg><option>--vendor</option>=<replaceable>VENDOR</replaceable></arg>
- <arg><option>--packaging-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
- <arg><option>--pq-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
- <arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--spec-file=</option><replaceable>FILEPATH</replaceable></arg>
- <arg><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
- <arg><option>--force</option></arg>
- <arg><option>--import-files=</option><replaceable>FILES</replaceable></arg>
- <arg><option>--export-rev=</option><replaceable>TREEISH</replaceable></arg>
- <arg><option>--patch-export-compress=</option><replaceable>THRESHOLD</replaceable></arg>
- <arg><option>--patch-export-ignore-path=</option><replaceable>REGEX</replaceable></arg>
- <arg><option>--patch-export-squash-until=</option><replaceable>COMMITISH</replaceable></arg>
- <arg><option>--[no-]patch-numbers</option></arg>
- <arg><option>--new-packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--retain-history</option></arg>
- <group choice="plain">
- <arg><option>drop</option></arg>
- <arg><option>export</option></arg>
- <arg><option>import</option></arg>
- <arg><option>rebase</option></arg>
- <arg><option>switch</option></arg>
- <arg><option>convert</option></arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-pq-rpm; helps in managing patches and development branch(es) for
- packages that are maintained with &gbp;. It designed to be used for
- packages that are maintained using the "orphan-packaging" model.
- &gbp-pq-rpm; has multiple subcommands, or actions, for working with the
- branches and patches.
- </para>
- <para>
- &gbp-pq-rpm; makes it easy to do source code development on a separate
- development branch (patch-queue branch in Debian git-buildpackage terms).
- For example, if the packaging files would be stored in
- <replaceable>master</replaceable> the associated development branch would
- be <replaceable>development/master</replaceable>.
- </para>
- </refsect1>
- <refsect1>
- <title>ACTIONS</title>
- <variablelist>
- <varlistentry>
- <term><option>import</option>
- </term>
- <listitem>
- <para>
- Create a development (patch-queue) branch by applying all patches
- from the packaging branch on top of the upstream version. The patches
- must apply without fuzz.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>export</option>
- </term>
- <listitem>
- <para>
- Export patches from the development branch into the packaging branch.
- It generates patches (one-per-commit) from the development branch and
- updates the spec file accordingly. It doesn't automatically commit
- the changes though - they need to verified and committed manually.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>rebase</option>
- </term>
- <listitem>
- <para>
- Switch to the development branch and rebase it against the current
- upstream version (indicated in the spec file of the associated
- packaging branch).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>drop</option>
- </term>
- <listitem>
- <para>
- Drop (delete) the development branch associated to the current
- branch. For example, you're on branch <replaceable>foo</replaceable>
- this would drop branch <replaceable>development/foo</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>apply</option>
- </term>
- <listitem>
- <para>
- Add a single patch to the development branch - similar to using
- <command>git-am</command>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>switch</option>
- </term>
- <listitem>
- <para>
- Switch between the development branch and the associated packaging
- branch.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>convert</option>
- </term>
- <listitem>
- <para>
- Convert a package from the "joint-packaging" maintenance model and
- git-layout to the "orphan-packaging" model. It takes the content of
- the packaging directory, auto-generates patches and puts these into a
- new orphan packaging branch. You can use the
- <option>--retain-history</option> to try to preserve as much of the
- git history as possible. Converting is a one-time action - conversion
- back to the "joint-packaging" model is not supported (yet).
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--vendor</option>=<replaceable>VENDOR</replaceable>
- </term>
- <listitem>
- <para>
- Distribution vendor name.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-branch</option>=<replaceable>BRANCH-NAME</replaceable>
- </term>
- <listitem>
- <para>
- Branch the packaging files are being maintained on. Only relevant if
- a invariable/single development (pq-branch) is defined with
- <option>--pq-branch</option>, in which case this is used as the
- "base" branch.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--pq-branch</option>=<replaceable>BRANCH_NAME</replaceable>
- </term>
- <listitem>
- <para>
- Name (format string) of the development (patch-queue) branch. The
- following string fields are accepted: "%(branch)s" (the base branch,
- i.e. the packaging branch that the development branch is associated
- to), "%(upstreamversion)s" (the upstream version), "%(release)s" (the
- rpm patchlevel, i.e. Release), "%(version)s" (full rpm package
- version).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Subdirectory that contains the RPM packaging files.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--spec-file=</option><replaceable>FILEPATH</replaceable>
- </term>
- <listitem>
- <para>
- Relative path to the spec file to use. Special value
- <replaceable>auto</replaceable> causes &gbp; to search and guess.
- Other values cause the <option>--packaging-dir</option> option to be
- ignored: the directory of the spec file is used, instead.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Use this tag format when looking for tags of upstream versions,
- default is <replaceable>upstream/%(version)s</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--force</option></term>
- <listitem>
- <para>
- Import even if the development (patch-queue) branch already exists.
- Only valid for the import action.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--import-files=</option><replaceable>FILES</replaceable>
- </term>
- <listitem>
- <para>
- Comma-separated list of additional file(s) to import from packaging
- branch. These will appear as one monolithic patch in the development
- (patch-queue) branch. By default, the local gbp conf files are
- imported in order to try to ensure that gbp sees the same settings on
- the development (pq) branch as on the packaging branch.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--export-rev=</option><replaceable>TREEISH</replaceable>
- </term>
- <listitem>
- <para>
- Export patches from <replaceable>TREEISH</replaceable> instead of the
- default which is HEAD of the development (patch-queue) branch.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--patch-export-compress=</option><replaceable>THRESHOLD</replaceable>
- </term>
- <listitem>
- <para>
- Compress patches larger than given
- <replaceable>THRESHOLD</replaceable> bytes. Special value 0 disabled
- patch compression.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--patch-export-ignore-path=</option><replaceable>REGEX</replaceable>
- </term>
- <listitem>
- <para>
- Exclude changes to path(s) matching <replaceable>REGEX</replaceable>
- in patch generation.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--patch-export-squash-until=</option><replaceable>COMMITISH</replaceable>
- </term>
- <listitem>
- <para>
- Squash commits up to the given <replaceable>COMMITISH</replaceable>
- into one monolitic diff. Could be used if one wants to squash commits
- from an upstream release up to a stable update into a single diff
- (commits on top of the stable would generate one patch per commit as
- usual). The format is '<commit_ish>[:<filename_base>]',
- i.e. commitish optionally followed by a colon and the desired
- filename base for the diff (suffix '.diff' is automatically added by
- &gbp;). Magic word 'HEAD' translates to the patch-export-treeish when
- given as the squash-point. This allows one to configure gbp to
- always squash all commits into one monolithic diff.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]patch-numbers</option>
- </term>
- <listitem>
- <para>
- Whether the patch files should start with a number or not.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--new-packaging-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Directory where packaging files are put in the new orphan packaging
- branch after convert. If <option>--new-packaging-dir=</option> is not
- defined, <replaceable>packaging-dir</replaceable> is used.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--retain-history</option>
- </term>
- <listitem>
- <para>
- Try to preserve as much history as possible when converting. That is,
- for each commit in the old branch create one corresponding commit in
- the new orphan packaging branch. However, commits that will not
- generate any changes are skipped (i.e. no empty commits are
- generated) - these are caused e.g. by changes in files that are
- ignored by patch-generation.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>META TAGS</title>
- <para>
- When exporting patches from a patch-queue branch &gbp-pq-rpm; will look at
- the commit message for special tags it recognizes. All tags need to start
- at the first column and require at least one whitespace after the colon.
- </para>
- <variablelist>
- <varlistentry>
- <term><option>Gbp-Rpm: Ignore</option>
- </term>
- <listitem>
- <para>
- Ignores the commit, no patch is generated out of it.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>Gbp-Rpm: If <expression></option>
- </term>
- <listitem>
- <para>
- Conditional patch. Put patch inside "%if <expression>" in the
- spec file.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>Gbp-Rpm: IfArch<expression></option>
- </term>
- <listitem>
- <para>
- Conditional patch. Put patch inside "%ifarch <expression>" in
- the spec file.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>
- For example, the following commit message:
- </para>
- <screen>
- Fix around a problem in Fedora
-
- which is not applicable elsewhere.
-
- Gbp-Rpm: If 0%{?fedora}
- </screen>
- <para>
- Will result something like this in the spec file:
- </para>
- <screen>
- # 0001-Fix-around-a-problem-in-Fedora.patch
- %if 0%{?fedora}
- %patch0 -p1
- %endif
- </screen>
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage.rpm">,
- <xref linkend="man.gbp.conf">
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &rpm-username; &rpm-email;
- </para>
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.pq.rpm">
+ <refentryinfo>
+ <address>
+ &rpm-email;
+ </address>
+ <author>
+ &rpm-firstname;
+ &rpm-surname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-pq-rpm</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-pq-rpm</refname>
+ <refpurpose>Manage patches and development branches in Git</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-pq-rpm;
+ &man.common.options.synopsis;
+ <arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--spec-file=</option><replaceable>FILEPATH</replaceable></arg>
+ <arg><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
+ <arg><option>--abbrev=</option><replaceable>num</replaceable></arg>
+ <arg><option>--force</option></arg>
+ <arg><option>--[no-]drop</option></arg>
+ <arg><option>--[no-]patch-numbers</option></arg>
+ <group choice="plain">
+ <arg><option>drop</option></arg>
+ <arg><option>export</option></arg>
+ <arg><option>import</option></arg>
+ <arg><option>rebase</option></arg>
+ <arg><option>switch</option></arg>
+ <arg><option>apply</option></arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-pq-rpm; helps in managing patches and development branch(es) for
+ packages that are maintained with &gbp;. It designed to be used for
+ packages that are maintained using the "orphan-packaging" model.
+ &gbp-pq-rpm; has multiple subcommands, or actions, for working with the
+ branches and patches.
+ </para>
+ <para>
+ &gbp-pq-rpm; makes it easy to do source code development on a separate
+ development branch (patch-queue branch in Debian git-buildpackage terms).
+ For example, if the packaging files would be stored in
+ <replaceable>master</replaceable> the associated development branch would
+ be <replaceable>development/master</replaceable>.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>ACTIONS</title>
+ <variablelist>
+ <varlistentry>
+ <term><option>import</option>
+ </term>
+ <listitem>
+ <para>
+ Create a development (patch-queue) branch by applying all patches
+ from the packaging branch on top of the upstream version. The patches
+ must apply without fuzz.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>export</option>
+ </term>
+ <listitem>
+ <para>
+ Export patches from the development branch into the packaging branch.
+ It generates patches (one-per-commit) from the development branch and
+ updates the spec file accordingly. It doesn't automatically commit
+ the changes though - they need to verified and committed manually.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>rebase</option>
+ </term>
+ <listitem>
+ <para>
+ Switch to the development branch and rebase it against the current
+ upstream version (indicated in the spec file of the associated
+ packaging branch).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>drop</option>
+ </term>
+ <listitem>
+ <para>
+ Drop (delete) the development branch associated to the current
+ branch. For example, you're on branch <replaceable>foo</replaceable>
+ this would drop branch <replaceable>development/foo</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>apply</option>
+ </term>
+ <listitem>
+ <para>
+ Add a single patch to the development branch - similar to using
+ <command>git-am</command>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>switch</option>
+ </term>
+ <listitem>
+ <para>
+ Switch between the development branch and the associated packaging
+ branch.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+ <varlistentry>
+ <term><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Subdirectory that contains the RPM packaging files.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--spec-file=</option><replaceable>FILEPATH</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Relative path to the spec file to use. Special value
+ <replaceable>auto</replaceable> causes &gbp; to search and guess.
+ Other values cause the <option>--packaging-dir</option> option to be
+ ignored: the directory of the spec file is used, instead.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when looking for tags of upstream versions,
+ default is <replaceable>upstream/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--abbrev=</option><replaceable>NUM</replaceable>
+ </term>
+ <listitem>
+ <para>
+ When exporting a patch queue abbreviate commit, instead of showing the
+ full 40-byte hexadecimal object name in header lines, show only a
+ partial prefix of length <replaceable>NUM</replaceable>. This is
+ useful when existing patches were not generated by &gbp-pq;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--force</option></term>
+ <listitem>
+ <para>
+ Import even if the development (patch-queue) branch already exists.
+ Only valid for the import action.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]drop</option></term>
+ <listitem>
+ <para>
+ Whether to drop (delete) the patch queue branch after a successful
+ export.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]patch-numbers</option>
+ </term>
+ <listitem>
+ <para>
+ Whether the patch files should start with a number or not.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>META TAGS</title>
+ <para>
+ When exporting patches from a patch-queue branch &gbp-pq-rpm; will look at
+ the commit message for special tags it recognizes. All tags need to start
+ at the first column and require at least one whitespace after the colon.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>Gbp-Rpm: Ignore</option>
+ </term>
+ <listitem>
+ <para>
+ Ignores the commit, no patch is generated out of it.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>Gbp-Rpm: If <expression></option>
+ </term>
+ <listitem>
+ <para>
+ Conditional patch. Put patch inside "%if <expression>" in the
+ spec file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>Gbp-Rpm: IfArch<expression></option>
+ </term>
+ <listitem>
+ <para>
+ Conditional patch. Put patch inside "%ifarch <expression>" in
+ the spec file.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ For example, the following commit message:
+ </para>
+ <screen>
+ Fix around a problem in Fedora
+
+ which is not applicable elsewhere.
+
+ Gbp-Rpm: If 0%{?fedora}
+ </screen>
+ <para>
+ Will result something like this in the spec file:
+ </para>
+ <screen>
+ # 0001-Fix-around-a-problem-in-Fedora.patch
+ %if 0%{?fedora}
+ %patch0 -p1
+ %endif
+ </screen>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage.rpm"/>,
+ <xref linkend="man.gbp.import.srpm"/>,
+ <xref linkend="man.gbp.conf"/>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &rpm-username; &rpm-email;
+ </para>
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.pq">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-pq</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>gbp-pq</refname>
- <refpurpose>Manage quilt patches on patch queue branches in git</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-pq;
- &man.common.options.synopsis;
- <arg><option>--[no-]patch-numbers</option></arg>
- <arg><option>--topic=</option><replaceable>topic</replaceable></arg>
- <arg><option>--time-machine=</option><replaceable>num</replaceable></arg>
- <arg><option>--[no-]drop</option></arg>
- <arg><option>--force</option></arg>
- <group choice="plain">
- <arg><option>drop</option></arg>
- <arg><option>export</option></arg>
- <arg><option>import</option></arg>
- <arg><option>rebase</option></arg>
- <arg><option>switch</option></arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-pq; helps one to manage quilt patches in Debian packages that are
- maintained with &gbp;. This is especially useful with packages using the
- 3.0 (quilt) source format. With &gbp-pq; you can maintain the quilt patches
- that should be applied to a package on a separate branch called patch-queue
- branch. So if your Debian package lives on
- <replaceable>master</replaceable> the associated patch-queue branch will be
- called <replaceable>patch-queue/master</replaceable>.
- </para>
- <para>
- See <ulink url="https://honk.sigxcpu.org/piki/development/debian_packages_in_git/"></ulink>
- for example workflows.
- </para>
- </refsect1>
- <refsect1>
- <title>ACTIONS</title>
- <variablelist>
- <varlistentry>
- <term><option>import</option>
- </term>
- <listitem>
- <para>
- Create a patch queue branch from quilt patches in debian/patches/
- that are listed in debian/patches/series. The patches must apply
- without fuzz.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>export</option>
- </term>
- <listitem>
- <para>
- Export the patches on the patch-queue branch associated to the
- current branch into a quilt patch series in debian/patches/ and
- update the series file.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>rebase</option>
- </term>
- <listitem>
- <para>
- Switch to the patch-queue branch associated to the current branch and
- rebase it against the current branch.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>drop</option>
- </term>
- <listitem>
- <para>
- Drop (delete) the patch queue associated to the current branch. So if
- you're on branch <replaceable>foo</replaceable> this would drop
- branch <replaceable>patch-queue/foo</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>apply</option>
- </term>
- <listitem>
- <para>
- Add a single patch to the patch-queue similar to using
- <command>git-am</command>. Use <option>--topic</option> if you want
- the patch to appear in a separate subdir when exporting the patch queue
- using <option>export</option>. This can be used to separate upstream
- pathes from debian specific patches.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>switch</option>
- </term>
- <listitem>
- <para>
- Switch to the patch-queue branch if on the base branch and switch
- to base branch if on patch-queue branch.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--[no-]patch-numbers</option>
- </term>
- <listitem>
- <para>
- Whether the patch files should start with a number or not.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--topic=</option><replaceable>topic</replaceable>
- </term>
- <listitem>
- <para>
- Topic to use when importing a single patch
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--time-machine=</option><replaceable>NUM</replaceable>
- </term>
- <listitem>
- <para>
- When importing a patch queue fails, go back commit by commit on the
- current branch to check if the patch-queue applies there. Do this at
- most <replaceable>NUM</replaceable> times. This can be useful if the
- patch-queue doesn't apply to the current branch HEAD anymore, e.g.
- after importing a new upstream version.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]drop</option></term>
- <listitem>
- <para>Whether to drop (delete) the patch queue branch after
- a succesful export</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--force</option></term>
- <listitem>
- <para>In case of import even import if the branch already
- exists</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>TAGS</title>
- <para>
- When exporting patches from a patch-queue branch &gbp-pq; will look at the
- patch header for special tags it recognizes. All tags need to start at the
- first column and require at least one whitespace after the colon.
- </para>
- <variablelist>
- <varlistentry>
- <term><option>Gbp[-Pq]: Ignore</option>
- </term>
- <listitem>
- <para>
- Ignores the commit, no patch is generated out of it.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>Gbp[-Pq]: Topic</option> <replaceable>topic</replaceable>
- </term>
- <listitem>
- <para>
- Moves the patch into a subdir called <replaceable>topic</replaceable>
- when running <screen>&gbp-pq; export</screen> This allows for some
- structure below <filename>debian/patches</filename>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>Gbp-Pq-Topic:</option> <replaceable>topic</replaceable>
- </term>
- <listitem>
- <para>
- Deprecated: use <option>Gbp[-Pq]: Topic</option>
- <replaceable>topic</replaceable> instead.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage">,
- <citerefentry>
- <refentrytitle>dpkg-source</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>quilt</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <xref linkend="man.gbp.conf">
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &dhusername; &dhemail;
- </para>
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.pq">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-pq</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-pq</refname>
+ <refpurpose>Manage quilt patches on patch queue branches in git</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-pq;
+ &man.common.options.synopsis;
+ <arg><option>--[no-]patch-numbers</option></arg>
+ <arg><option>--patch-num-format=</option><replaceable>format</replaceable></arg>
+ <arg><option>--[no-]renumber</option></arg>
+ <arg><option>--topic=</option><replaceable>topic</replaceable></arg>
+ <arg><option>--time-machine=</option><replaceable>num</replaceable></arg>
+ <arg><option>--[no-]drop</option></arg>
+ <arg><option>--abbrev=</option><replaceable>num</replaceable></arg>
+ <arg><option>--force</option></arg>
+ <arg><option>--commit</option></arg>
+ <arg><option>--meta-closes=bug-close-tags</option></arg>
+ <arg><option>--meta-closes-bugnum=bug-number-format</option></arg>
+ <arg><option>--pq-from=</option><replaceable>[DEBIAN|TAG]</replaceable></arg>
+ <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--[no-]ignore-new</option></arg>
+ <group choice="plain">
+ <arg><option>drop</option></arg>
+ <arg><option>export</option></arg>
+ <arg><option>import</option></arg>
+ <arg><option>rebase</option></arg>
+ <arg><option>switch</option></arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-pq; helps one to manage quilt patches in &debian; packages that are
+ maintained with &gbp;. This is especially useful with packages using the
+ 3.0 (quilt) source format. With &gbp-pq;, you can maintain the quilt patches
+ that should be applied to a package on a separate branch called patch-queue
+ branch. So if your &debian; package lives on
+ <replaceable>master</replaceable>, the associated patch-queue branch will be
+ called <replaceable>patch-queue/master</replaceable>.
+ </para>
+ <para>
+ See <ulink url="https://honk.sigxcpu.org/piki/development/debian_packages_in_git/"></ulink>
+ for example workflows.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>ACTIONS</title>
+ <variablelist>
+ <varlistentry>
+ <term><option>import</option>
+ </term>
+ <listitem>
+ <para>
+ Create a patch queue branch from quilt patches in debian/patches/
+ that are listed in debian/patches/series. The patches must apply
+ without fuzz.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>export</option>
+ </term>
+ <listitem>
+ <para>
+ Export the patches on the patch-queue branch associated to the
+ current branch into a quilt patch series in debian/patches/ and
+ update the series file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>rebase</option>
+ </term>
+ <listitem>
+ <para>
+ Switch to the patch-queue branch associated to the current branch and
+ rebase it against the current branch.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>drop</option>
+ </term>
+ <listitem>
+ <para>
+ Drop (delete) the patch queue associated to the current branch. So if
+ you're on branch <replaceable>foo</replaceable>, this would drop
+ branch <replaceable>patch-queue/foo</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>apply</option>
+ </term>
+ <listitem>
+ <para>
+ Add a single patch to the patch-queue similar to using
+ <command>git-am</command>. Use <option>--topic</option> if you want
+ the patch to appear in a separate subdir when exporting the patch queue
+ using <option>export</option>. This can be used to separate upstream
+ patches from &debian; specific patches.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>switch</option>
+ </term>
+ <listitem>
+ <para>
+ Switch to the patch-queue branch if on the base branch and switch
+ to base branch if on patch-queue branch.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--[no-]patch-numbers</option>
+ </term>
+ <listitem>
+ <para>
+ Whether or not the patch files should be prefixed with a number.
+ The default is to export patches with patch numbers. Note,
+ however, that this normally affects patches whose names are
+ automatically generated, and has no effect on exporting patches
+ which have a <option>Gbp[-Pq]: Name</option> tag, since the
+ name specified is preserved unless the <option>--renumber</option>
+ option is used.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--patch-num-format=</option><replaceable>format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The format specifier for patch number prefixes. The default format is '%04d-'.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]renumber</option>
+ </term>
+ <listitem>
+ <para>
+ Whether or not to renumber patches exported from the patch queue,
+ instead of preserving numbers specified in
+ <option>Gbp-Pq: Name</option> tags. The default is not to renumber
+ patches. Useful when patches need to be renamed for the sake of
+ uniformity. For example, using <option>--renumber</option> with
+ <option>--no-patch-num</option> will strip all numeric prefixes from
+ exported patches.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--topic=</option><replaceable>topic</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Topic to use when importing a single patch
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--time-machine=</option><replaceable>NUM</replaceable>
+ </term>
+ <listitem>
+ <para>
+ When importing a patch queue fails, go back commit-by-commit on the
+ current branch to check if the patch-queue applies there. Do this at
+ most <replaceable>NUM</replaceable> times. This can be useful if the
+ patch-queue doesn't apply to the current branch HEAD anymore, e.g.
+ after importing a new upstream version.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]drop</option></term>
+ <listitem>
+ <para>Whether to automatically drop (delete) the patch queue branch after
+ a successful export</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--abbrev=</option><replaceable>NUM</replaceable>
+ </term>
+ <listitem>
+ <para>
+ When exporting a patch queue abbreviate commit, instead of showing the
+ full 40-byte hexadecimal object name in header lines, show only a
+ partial prefix of length <replaceable>NUM</replaceable>. This is
+ useful when existing patches were not generated by &gbp-pq;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--force</option></term>
+ <listitem>
+ <para>In case of <option>import</option>, import even if the
+ patch-queue branch already exists and overwrite its
+ content with <filename>debian/patches</filename>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--commit</option></term>
+ <listitem>
+ <para>
+ In case of <option>export</option>, commit
+ <filename>debian/patches</filename>the changes to &git; after
+ exporting the patches.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--meta-closes=</option><replaceable>bug-close-tags</replaceable>
+ </term>
+ <listitem>
+ <para>
+ What meta tags to look for to generate a commit message when
+ using <option>export</option> <option>--commit</option>.
+ The default is <literal>'Closes|LP'</literal> to support Debian and Launchpad.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--meta-closes-bugnum=</option><replaceable>bug-number-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ What regular expression should be used to parse out the
+ bug number when using
+ <option>export</option> <option>--commit</option>. The
+ default is <literal>'(?:bug|issue)?\#?\s?\d+'</literal>.
+ See <xref linkend="man.gbp.dch"/> for details.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--pq-from=</option><replaceable>[DEBIAN|TAG]</replaceable>
+ </term>
+ <listitem>
+ <para>
+ How to find the starting point for the patch queue base. The options are DEBIAN, that will use the Debian branch as the base for the patch queue branch, and TAG, that will use the corresponding upstream tag as a base for the patch queue branch.
+ </para>
+ <para>
+ This is only needed if your upstream branch is not merged in the Debian branch.
+ The default is <replaceable>DEBIAN</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when looking for tags of upstream versions,
+ default is <replaceable>upstream/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]ignore-new</option>
+ </term>
+ <listitem>
+ <para>
+ Don't abort if there are uncommitted changes in the source tree or
+ the current branch doesn't match the
+ <replaceable>DEBIAN-BRANCH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>TAGS</title>
+ <para>
+ When exporting patches from a patch-queue branch, &gbp-pq; will look at the
+ patch header for special tags it recognizes. All tags need to start at the
+ first column and require at least one whitespace after the colon.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>Gbp[-Pq]: Ignore</option>
+ </term>
+ <listitem>
+ <para>
+ Ignores the commit, no patch is generated out of it.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>Gbp[-Pq]: Name</option> <replaceable>name</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The name to use for the patch when running
+ <screen>&gbp-pq; export</screen>
+ If unset, it will be formatted like
+ <command>git am</command> would format it.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>Gbp[-Pq]: Topic</option> <replaceable>topic</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Moves the patch into a subdir called <replaceable>topic</replaceable>
+ when running <screen>&gbp-pq; export</screen> This allows for some
+ structure below <filename>debian/patches</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>Gbp-Pq-Topic:</option> <replaceable>topic</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Deprecated: use <option>Gbp[-Pq]: Topic</option>
+ <replaceable>topic</replaceable> instead.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <citerefentry>
+ <refentrytitle>dpkg-source</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>quilt</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <xref linkend="man.gbp.conf"/>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &dhusername; &dhemail;
+ </para>
+ </refsect1>
+</refentry>
--- /dev/null
+<refentry id="man.gbp.pristine.tar">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-pristine-tar</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-pristine-tar</refname>
+ <refpurpose>Manage pristine-tar commits in a git repository</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-pristine-tar;
+
+ &man.common.options.synopsis;
+ <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg rep='repeat'><option>--component=</option><replaceable>component</replaceable></arg>
+ <group choice="plain">
+ <arg><option>commit</option></arg>
+ </group>
+ <group choice="plain">
+ <arg choice="plain"><replaceable>filename</replaceable></arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-pristine-tar; adds the pristine-tar commit for a given
+ upstream tarball to a &git; repository. This can be useful if a
+ original tarball has been already imported and the pristine-tar
+ commits should be added at a later time or if you're tracking
+ upstream git and want to create pristine-tar commits
+ nevertheless.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+ <varlistentry>
+ <term><option>--upstream-tag=</option><replaceable>tag-format</replaceable>
+ </term>
+ <listitem>
+ <para>
+ use this tag format when tagging upstream versions,
+ default is <replaceable>upstream/%(version)s</replaceable>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--component=</option><replaceable>COMPONENT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ When creating the pristine-tar commits also look for an additional tarball
+ with component name <replaceable>COMPONENT</replaceable>. E.g. in
+ <filename>hello-debhelper_1.0.orig-foo.tar.gz</filename>
+ the component name would be <replaceable>foo</replaceable>. The additional
+ tarball is expected to be in the same directory than the upstream tarball
+ and to use the same compression type. This option can be
+ given multiple times to add multiple additional tarballs.
+ </para>
+ <para>
+ Using additional original tarballs is a feature of the 3.0
+ (quilt) source format. See
+ the <command>dpkg-source</command> manpage for
+ details. This is currently considered an experimental
+ feature and might change incompatibly.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>Add pristine-tar commits for an upstream tarball:</para>
+ <screen>
+ &gbp-pristine-tar; commit ../upstream-tarball-0.1.tar.gz</screen>
+ <para>Same as above with an additional
+ tarball <filename>../upstream-tarball-foo-0.1.tar.gz:</filename></para>
+ <screen>
+ &gbp-pristine-tar; --component-tarball=foo commit ../upstream-tarball-0.1.tar.gz</screen>
+</refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.import.orig"/>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &dhusername; &dhemail;
+ </para>
+ </refsect1>
+</refentry>
+<!-- LocalWords: xz lzma bzip gzip tarball
+ -->
+++ /dev/null
-<refentry id="man.gbp.pull">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-pull</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>gbp-pull</refname>
-
- <refpurpose>Safely update a repository from remote</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-pull;
-
- &man.common.options.synopsis;
- <arg><option>--force=</option><replaceable>[merge|clean]</replaceable></arg>
- <arg><option>--all</option></arg>
- <arg><option>--redo-pq</option></arg>
- <arg><option>--[no-]pristine-tar</option></arg>
- <arg><option>--ignore-branch</option></arg>
- <group>
- <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--packaging-branch=</option><replaceable>branch_name</replaceable></arg>
- </group>
- <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
- <arg><option>--depth=</option><replaceable>depth</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-pull; updates the <emphasis>debian</emphasis>,
- <emphasis>upstream</emphasis> and <emphasis>pristine-tar</emphasis>
- branches from a remote repository in one go. It checks if the update is safe (would
- result in a <emphasis>fast-forward</emphasis> merge) and aborts otherwise.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
-
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--force=</option><replaceable>[merge|clean]</replaceable></term>
- <listitem>
- <para>Force a branch update even if this results in a non fast
- forward update.
- <emphasis>merge</emphasis> does a git-merge.
- <emphasis>clean</emphasis> checks out a clean copy from upstream.
- <warning><para>using <emphasis>clean</emphasis>
- makes you lose your modifications.</para></warning></para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--all</option></term>
- <listitem>
- <para>Update all remote-tracking branches that have identical name in the
- remote repository.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--redo-pq</option></term>
- <listitem>
- <para>also rebuild the corresponding patch-queue using &gbp-pq;.
- <warning><para>This drops the patch-queue branch if it exists.</para></warning></para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--ignore-branch</option>
- </term>
- <listitem>
- <para>Don't care if we're on a branch or in detached head state.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>The branch in the Git repository the Debian package is being
- developed on, default is <replaceable>master</replaceable>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>The branch the packaging is being maintained on.
- Alternative to the <emphasis>--debian-branch</emphasis> option.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
- </term>
- <listitem>
- <para>The branch in the &git; repository the upstream sources are put
- onto. Default is <replaceable>upstream</replaceable>.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--depth</option>=<replaceable>depth</replaceable>
- </term>
- <listitem>
- <para>Git history depth, for deepening shallow git clones.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--pristine-tar</option>
- </term>
- <listitem>
- <para>Whether to update the pristine-tar branch too.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>EXIT CODES</title>
- <para>
- When &gbp-pull; finishes it indicates success or failure with it's exit code:
- </para>
- <variablelist>
- <varlistentry>
- <term><option>0</option></term>
- <listitem>
- <para>Success.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>1</option></term>
- <listitem>
- <para>An error occured during the pull, see the printed error message for details.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>2</option></term>
- <listitem>
- <para>At least one branch couldn't be fast forwarded.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage">,
- <xref linkend="man.gbp.clone">,
- <xref linkend="man.gbp.pq">,
- <xref linkend="man.gbp.conf">
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
-
- <para>&dhusername; &dhemail;</para>
-
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.pull">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-pull</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-pull</refname>
+
+ <refpurpose>Safely update a repository from remote</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-pull;
+
+ &man.common.options.synopsis;
+ <arg><option>--force</option></arg>
+ <arg><option>--all</option></arg>
+ <arg><option>--redo-pq</option></arg>
+ <arg><option>--[no-]pristine-tar</option></arg>
+ <arg><option>--ignore-branch</option></arg>
+ <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--track-missing</option></arg>
+ <arg><option>--depth=</option><replaceable>depth</replaceable></arg>
+ <arg><replaceable>repository</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-pull; updates the <emphasis>debian</emphasis>,
+ <emphasis>upstream</emphasis> and <emphasis>pristine-tar</emphasis>
+ branches from remote repositories in one go. It checks if the update is safe (would
+ result in a <emphasis>fast-forward</emphasis> merge) and aborts otherwise.
+ </para>
+ <para>
+ If given on the command line the changes are fetched from the
+ given repository otherwise the default
+ for <replaceable>repository</replaceable> is read from
+ the <replaceable>remote</replaceable> configuration for each
+ branch (in git's configuration).
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--force</option></term>
+ <listitem>
+ <para>Force a branch update even if this results in a non fast
+ forward update. <warning><para>Forcing a branch update
+ makes you lose your modifications.</para></warning></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--all</option></term>
+ <listitem>
+ <para>Update all remote-tracking branches that have identical name in the
+ remote repository.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--redo-pq</option></term>
+ <listitem>
+ <para>Also rebuild the corresponding patch-queue using &gbp-pq;.
+ <warning><para>This drops the patch-queue branch if it exists.</para></warning></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--ignore-branch</option>
+ </term>
+ <listitem>
+ <para>Don't care if we're on a branch or in detached head state.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>The branch in the Git repository the Debian package is being
+ developed on, default is <replaceable>master</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
+ </term>
+ <listitem>
+ <para>The branch in the &git; repository the upstream sources are put
+ onto. Default is <replaceable>upstream</replaceable>.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--track-missing</option></term>
+ <listitem>
+ <para>
+ If a branch is missing in the local repository try to
+ fetch it from the remote side and (if it exists) fetch it and set up
+ branch tracking for it. This ensures that branches that are added at a
+ later point to the remote side (e.g.
+ <replaceable>pristine-tar</replaceable>) are picked up automatically.
+ Note that it's not an error for the branch to not exist on the remote
+ side.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--depth</option>=<replaceable>depth</replaceable>
+ </term>
+ <listitem>
+ <para>Git history depth, for deepening shallow git clones.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--pristine-tar</option>
+ </term>
+ <listitem>
+ <para>Whether to update the pristine-tar branch too.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXIT CODES</title>
+ <para>
+ When &gbp-pull; finishes, it indicates success or failure with its exit code:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>0</option></term>
+ <listitem>
+ <para>Success.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>1</option></term>
+ <listitem>
+ <para>An error occurred during the pull, see the printed error message for details.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>2</option></term>
+ <listitem>
+ <para>At least one branch couldn't be fast forwarded.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.clone"/>,
+ <xref linkend="man.gbp.pq"/>,
+ <xref linkend="man.gbp.conf"/>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+
+ <para>&dhusername; &dhemail;</para>
+
+ </refsect1>
+</refentry>
--- /dev/null
+<refentry id="man.gbp.push">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-push</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-push</refname>
+
+ <refpurpose>Push &debian; packaging changes to a &git; remote</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-push;
+
+ &man.common.options.synopsis;
+ <arg><option>--ignore-branch</option></arg>
+ <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
+ <arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--[no-]pristine-tar</option></arg>
+ <arg><option>--dry-run</option></arg>
+ <arg><replaceable>repository</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-push; pushes your local changes to a remote repository. It
+ is best run after uploading a &debian; package to the archive to
+ update you &debian-branch;, &upstream-branch;, &pristine-tar;
+ branch and corresponding tags. It will in order
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Verify that it is being executed from the &debian-branch;.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Determine the debian tag from <filename>debian/changelog</filename>
+ and add it the list of things to push if the changelog does not indicate
+ an unreleased package.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Determine the upstream tag from <filename>debian/changelog</filename>
+ and add it to the list of things to push if it's not a native package.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Determine if the tags correspond to the branch tips of the corresponding
+ upstream and debian branches. If so, these branches will be added to the list
+ of things to push. If not the changes will only be pushed up to the commit
+ that is referenced by the corresponding tag.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Determine if the pristine-tar branch needs to be pushed and if so adds it
+ to the list of things to push.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Finally, if not in dry-run mode, pushes the above changes to the remote side.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ If a <replaceable>remote</replaceable> is given on the command line
+ the changes are pushed to the given remote repository. By
+ default it will push to the current branchs remote and fall
+ back to <emphasis>origin</emphasis>.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+ <varlistentry>
+ <term><option>--ignore-branch</option></term>
+ <listitem>
+ <para>
+ Don't fail if the &debian-branch; does not match the currently checked out
+ branach and push the current branch instead.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable></term>
+ <listitem>
+ <para>
+ The branch in the Git repository the Debian package is being
+ developed on. If set to the empty value the branch will not be pushed.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-tag=</option><replaceable>TAG-FORMAT</replaceable></term>
+ <listitem>
+ <para>
+ Use this tag format when looking for tags corresponding to a &debian;
+ version. Default is <replaceable>debian/%(version)s</replaceable>.
+ If set to the empty value the tag will not be pushed.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable></term>
+ <listitem>
+ <para>
+ The branch in the &git; repository the upstream sources are put
+ onto. If set to the empty value the branch will not be pushed.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></term>
+ <listitem>
+ <para>
+ Use this tag format when looking for tags of upstream
+ versions. Default
+ is <replaceable>upstream/%(version)s</replaceable>.
+ If set to the empty value the tag will not be pushed.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--pristine-tar</option></term>
+ <listitem>
+ <para>Whether to update the pristine-tar branch too.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--dry-run</option></term>
+ <listitem>
+ <para>
+ Pass the <option>--dry-run</option> to &gitcmd; <option>push</option>. So don't
+ push anything, only check if things are pushable.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.clone"/>,
+ <xref linkend="man.gbp.pull"/>,
+ <xref linkend="man.gbp.conf"/>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+
+ <para>&dhusername; &dhemail;</para>
+
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.rpm.ch">
- <refentryinfo>
- <address>
- &rpm-email;
- </address>
- <author>
- &rpm-firstname;
- &rpm-surname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp-rpm-ch</refentrytitle>
- &rpm-mansection;
- </refmeta>
- <refnamediv>
- <refname>git-rpm-ch;</refname>
- <refname>gbp-rpm-ch;</refname>
- <refpurpose>Generate the RPM changelog from git commit messages</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp-rpm-ch;
- &man.common.options.synopsis;
- <arg><option>--vendor</option>=<replaceable>VENDOR</replaceable></arg>
- <arg><option>--packaging-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
- <arg><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
- <arg><option>--ignore-branch</option></arg>
- <arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
- <arg><option>--changelog-file=</option><replaceable>FILEPATH</replaceable></arg>
- <arg><option>--spec-file=</option><replaceable>FILEPATH</replaceable></arg>
- <group>
- <arg><option>--all</option></arg>
- <arg><option>--message=</option><replaceable>MESSAGE</replaceable></arg>
- <arg><option>--since=</option><replaceable>COMMITISH</replaceable></arg>
- </group>
- <arg><option>--meta-bts=</option><replaceable>META_TAGS</replaceable></arg>
- <arg><option>--no-release</option></arg>
- <arg><option>--[no-]git-author</option></arg>
- <arg><option>--[no-]full</option></arg>
- <arg><option>--id-length=</option><replaceable>NUMBER</replaceable></arg>
- <arg><option>--changelog-revision=</option><replaceable>REV-FORMAT</replaceable></arg>
- <arg><option>--git-log=</option><replaceable>GIT-LOG-OPTIONS</replaceable></arg>
- <arg><option>--spawn-editor=<replaceable>[always|release|no]</replaceable></option></arg>
- <arg><option>--editor-cmd=</option><replaceable>EDITOR</replaceable></arg>
- <arg><option>--commit</option></arg>
- <arg><option>--tag</option></arg>
- <arg><option>--retag</option></arg>
- <arg><option>--[no-]sign-tags</option></arg>
- <arg><option>--keyid=</option><replaceable>GPG-KEYID</replaceable></arg>
- <arg><option>--customizations=</option><replaceable>CUSTOMIZATION-FILE</replaceable></arg>
- <arg choice="plain"><replaceable>[PATH1 PATH2]</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp-rpm-ch; reads git commit messages up to the current tip of the current
- branch and updates the RPM changelog from them.
- </para>
- <para>
- By default, &gbp-rpm-ch; tries to guess the last &git; commit documented in
- the changelog. Alternatively, <option>--since</option> can be used to
- tell &gbp-rpm-ch; at which point it should start in the &git; history, or,
- <option>--all</option> to use all commits from the &git; history.
- </para>
- <para>
- The additional path arguments can be used to restrict the repository paths
- &gbp-rpm-ch; looks at. For even more detailed control, you can use
- <option>--git-log</option> to restrict the generated changelog entries
- further. E.g. by using
- <option>--git-log=</option><replaceable>"--author=Foo Bar"</replaceable>.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- &man.common.options.description;
-
- <varlistentry>
- <term><option>--vendor</option>=<replaceable>VENDOR</replaceable>
- </term>
- <listitem>
- <para>
- Distribution vendor name.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-branch</option>=<replaceable>BRANCH-NAME</replaceable>
- </term>
- <listitem>
- <para>
- The branch in the Git repository the package is being developed on,
- default is <replaceable>master</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--ignore-branch</option>
- </term>
- <listitem>
- <para>
- Don't check if the current branch matches
- <replaceable>PACKAGING-BRANCH</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Tag format used, when tagging releases,
- default is <replaceable>%(vendor)s/%(version)s</replaceable>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable>
- </term>
- <listitem>
- <para>
- Subdirectory that contains the RPM packaging files.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--changelog-file=</option><replaceable>FILEPATH</replaceable>
- </term>
- <listitem>
- <para>
- Relative path to the changelog file to use. Special value
- <replaceable>auto</replaceable> causes &gbp; to guess,
- <replaceable>SPEC</replaceable> uses the spec file,
- <replaceable>CHANGES</replaceable> uses a separate changelog file
- (name derived spec file name with .spec suffix replaced by .changes).
- Guessing logic is simple: use separate changelog file if it is found,
- otherwise use the spec file.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--spec-file=</option><replaceable>FILEPATH</replaceable>
- </term>
- <listitem>
- <para>
- Relative path to the spec file to use. Special value
- <replaceable>auto</replaceable> causes &gbp; to search and guess.
- Other values cause the <option>--packaging-dir</option> option to be
- ignored: the directory of the spec file is used, instead.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--all</option>
- </term>
- <listitem>
- <para>
- Use all commits from the Git history, overrides
- <option>--since</option>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--since=</option><replaceable>COMMITTISH</replaceable>
- </term>
- <listitem>
- <para>
- Start reading commit messages at
- <replaceable>COMMITTISH</replaceable>.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--meta-bts=</option><replaceable>META_TAGS</replaceable>
- </term>
- <listitem>
- <para>
- Meta tags in the commit messages that are interpreted as bug tracking
- system related references. The recognized bts references are added in
- the generated changelog entries. See the META TAGS section below for
- more information. The bts meta tag tracking feature can be disabled
- by defining an empty string.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--no-release</option>
- </term>
- <listitem>
- <para>
- Do not create a new changelog section, just update the last
- changelog section.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]full</option>
- </term>
- <listitem>
- <para>
- Include the full commit message in the changelog output.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-log=</option><replaceable>GIT-LOG-OPTIONS</replaceable>
- </term>
- <listitem>
- <para>
- Options passed on verbatim to git-log(1).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--id-length=</option><replaceable>N</replaceable>
- </term>
- <listitem>
- <para>
- Include <replaceable>N</replaceable> digits of the commit id in the
- changelog entry. Default is to not include any commit ids at all.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--changelog-revision=</option><replaceable>REV-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Format string to use for revision field in the changelog header. The
- following string fields are accepted:
- <replaceable>%(upstreamversion)s</replaceable> the upstream version;
- <replaceable>%(release)s</replaceable> the rpm patchlevel, i.e.
- Release; <replaceable>%(version)s</replaceable> full rpm package
- version; <replaceable>%(tagname)s</replaceable> tag/commit, i.e.
- basically what <command>git-describe</command> would give.
- If empty or not defined the default from packaging policy is used.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--ignore-regex=</option><replaceable>REGEX</replaceable>
- </term>
- <listitem>
- <para>
- Ignore commit lines matching <replaceable>REGEX</replaceable>
- when generating the changelog.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--git-author</option>
- </term>
- <listitem>
- <para>
- Use user.name and user.email from
- <application>git-config</application>(1) for the changelog header.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--spawn-editor=<replaceable>[always|release|no]</replaceable></option>
- </term>
- <listitem>
- <para>
- Whether to spawn an editor: always, when doing a release or never.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--editor-cmd=<replaceable>EDITOR</replaceable></option>
- </term>
- <listitem>
- <para>
- The editor to use for editing the changelog.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--message=<replaceable>MESSAGE</replaceable></option>
- </term>
- <listitem>
- <para>
- Text to use for new changelog entries. Git history and the commit
- messages, including <option>--since</option> and
- <option>--all</option> options are ignored in this case.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--commit</option>
- </term>
- <listitem>
- <para>
- Commit changes to git after modifying changelog. Importantly, in
- addition to the changelog modifications all other staged changes are
- committed, too, making it possible to update other files in the same
- commit.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--commit-msg=</option><replaceable>MSG-FORMAT</replaceable>
- </term>
- <listitem>
- <para>
- Format string for the commit message when committing changes
- (when <option>--commit</option> is given).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--tag</option>
- </term>
- <listitem>
- <para>
- Commit the changes and create a packaging (release) tag. Similarly to
- <option>--commit</option>, all staged changes are committed to git
- before creating the tag. This option makes it possible to create a
- release and correctly document the the tag name in the rpm changelog
- (by using %(tagname)s in the <option>--changelog-revision</option>
- string).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--retag</option>
- </term>
- <listitem>
- <para>
- Don't fail tag operations if a tag with the same version already
- exists, but, overwrite the existing tag, instead.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--[no-]sign-tags</option>
- </term>
- <listitem>
- <para>
- GPG sign all created tags.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--keyid=</option><replaceable>GPG-KEYID</replaceable>
- </term>
- <listitem>
- <para>
- Use this keyid for gpg signing tags.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--customizations=</option><replaceable>CUSTOMIZATION-FILE</replaceable>
- </term>
- <listitem>
- <para>
- Load Python code from <replaceable>CUSTOMIZATION-FILE</replaceable>.
- At the moment, the only useful thing the code can do is define a
- custom ChangelogEntryFormatter class.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>META TAGS</title>
- <para>
- Additional to the above options the formatting of the new changelog entries
- (one-per-commit) in the changelog can be modified by special tags (called
- Meta Tags) given in the git commit message. The tags must start at the
- first column of a commit message but can appear on any line. They are of
- the form <option>Tagname</option>: <replaceable>VALUE</replaceable>. Valid
- Meta Tags are:
- </para>
- <variablelist>
- <varlistentry>
- <term><option>Git-Rpm-Ch</option>: <replaceable>ACTION</replaceable>
- </term>
- <listitem>
- <para>
- Supported actions are: <replaceable>Ignore</replaceable> which will
- ignore this commit when generating new changelog entries.
- <replaceable>Short</replaceable> which will only use the description
- (the first line) of the commit message when generating the changelog
- entry (useful when <option>--full</option> is given) and
- <replaceable>Full</replaceable> which will use the full commit
- message when generating the changelog entry (useful when
- <option>--full</option> is not given).
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>[Close|Closes|...]</option>: <replaceable>BUGNUMBER</replaceable>
- </term>
- <listitem>
- <para>
- Indicate in the changelog entry that bug
- <replaceable>BUGNUMBER</replaceable> was addressed in this commit.
- The bts meta tags recognized by &gbp-rpm-ch; is actually defined by
- the <option>--meta-bts</option> option.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>
- The following git commit message:
- </para>
- <screen>
- Document meta tags
-
- so one doesn't have to consult the manual
-
- Git-Rpm-Ch: Short
- Closes: #636088
- </screen>
- <para>
- Results in this changelog entry:
- </para>
- <screen>
- - Document meta tags (Closes: #636088)
- </screen>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage.rpm">,
- <xref linkend="man.gbp.import.srpm">,
- <xref linkend="man.gbp.import.orig.rpm">,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- <ulink url="https://honk.sigxcpu.org/cl2vcs">
- <citetitle>Cl2vcs</citetitle></ulink>,
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>
- &rpm-username; &rpm-email;
- </para>
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.rpm.ch">
+ <refentryinfo>
+ <address>
+ &rpm-email;
+ </address>
+ <author>
+ &rpm-firstname;
+ &rpm-surname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp-rpm-ch</refentrytitle>
+ &rpm-mansection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-rpm-ch;</refname>
+ <refpurpose>Generate the RPM changelog from git commit messages</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-rpm-ch;
+ &man.common.options.synopsis;
+ <arg><option>--tmp-dir</option>=<replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--vendor</option>=<replaceable>VENDOR</replaceable></arg>
+ <arg><option>--packaging-branch=</option><replaceable>BRANCH-NAME</replaceable></arg>
+ <arg><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg>
+ <arg><option>--ignore-branch</option></arg>
+ <arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg>
+ <arg><option>--changelog-file=</option><replaceable>FILEPATH</replaceable></arg>
+ <arg><option>--spec-file=</option><replaceable>FILEPATH</replaceable></arg>
+ <arg><option>--since=</option><replaceable>COMMITISH</replaceable></arg>
+ <arg><option>--no-release</option></arg>
+ <arg><option>--[no-]git-author</option></arg>
+ <arg><option>--[no-]full</option></arg>
+ <arg><option>--id-length=</option><replaceable>NUMBER</replaceable></arg>
+ <arg><option>--ignore-regex=</option><replaceable>REGEX</replaceable></arg>
+ <arg><option>--changelog-revision=</option><replaceable>REV-FORMAT</replaceable></arg>
+ <arg><option>--git-log=</option><replaceable>GIT-LOG-OPTIONS</replaceable></arg>
+ <arg><option>--spawn-editor=<replaceable>[always|release|no]</replaceable></option></arg>
+ <arg><option>--editor-cmd=</option><replaceable>EDITOR</replaceable></arg>
+ <arg><option>--customizations=</option><replaceable>CUSTOMIZATION-FILE</replaceable></arg>
+ <arg choice="plain"><replaceable>[PATH1 PATH2]</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-rpm-ch; reads git commit messages up to the current tip of the current
+ branch and updates the RPM changelog from them.
+ </para>
+ <para>
+ By default, &gbp-rpm-ch; tries to guess the last &git; commit documented in
+ the changelog. Alternatively, <option>--since</option> can be used to
+ tell &gbp-rpm-ch; at which point it should start in the &git; history, or,
+ <option>--all</option> to use all commits from the &git; history.
+ </para>
+ <para>
+ The additional path arguments can be used to restrict the repository paths
+ &gbp-rpm-ch; looks at. For even more detailed control, you can use
+ <option>--git-log</option> to restrict the generated changelog entries
+ further. E.g. by using
+ <option>--git-log=</option><replaceable>"--author=Foo Bar"</replaceable>.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+
+ <varlistentry>
+ <term><option>--git-tmp-dir</option>=<replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Base directory under which temporary directories are created.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--vendor</option>=<replaceable>VENDOR</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Distribution vendor name.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--packaging-branch</option>=<replaceable>BRANCH-NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ The branch in the Git repository the package is being developed on,
+ default is <replaceable>master</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--ignore-branch</option>
+ </term>
+ <listitem>
+ <para>
+ Don't check if the current branch matches
+ <replaceable>PACKAGING-BRANCH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Tag format used, when tagging releases,
+ default is <replaceable>%(vendor)s/%(version)s</replaceable>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Subdirectory that contains the RPM packaging files.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--changelog-file=</option><replaceable>FILEPATH</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Relative path to the changelog file to use. Special value
+ <replaceable>auto</replaceable> causes &gbp; to guess,
+ <replaceable>SPEC</replaceable> uses the spec file,
+ <replaceable>CHANGES</replaceable> uses a separate changelog file
+ (name derived spec file name with .spec suffix replaced by .changes).
+ Guessing logic is simple: use separate changelog file if it is found,
+ otherwise use the spec file.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--spec-file=</option><replaceable>FILEPATH</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Relative path to the spec file to use. Special value
+ <replaceable>auto</replaceable> causes &gbp; to search and guess.
+ Other values cause the <option>--packaging-dir</option> option to be
+ ignored: the directory of the spec file is used, instead.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--since=</option><replaceable>COMMITTISH</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Start reading commit messages at
+ <replaceable>COMMITTISH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--no-release</option>
+ </term>
+ <listitem>
+ <para>
+ Do not create a new changelog section, just update the last
+ changelog section.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]full</option>
+ </term>
+ <listitem>
+ <para>
+ Include the full commit message in the changelog output.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--git-log=</option><replaceable>GIT-LOG-OPTIONS</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Options passed on verbatim to git-log(1).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--id-length=</option><replaceable>N</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Include <replaceable>N</replaceable> digits of the commit id in the
+ changelog entry. Default is to not include any commit ids at all.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--ignore-regex=</option><replaceable>REGEX</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Ignore lines in commit message matching
+ <replaceable>REGEX</replaceable> when generating the changelog.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--changelog-revision=</option><replaceable>REV-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Format string to use for revision field in the changelog header. The
+ following string fields are accepted:
+ <replaceable>%(upstreamversion)s</replaceable> the upstream version;
+ <replaceable>%(release)s</replaceable> the rpm patchlevel, i.e.
+ Release; <replaceable>%(version)s</replaceable> full rpm package
+ version; <replaceable>%(tagname)s</replaceable> tag/commit, i.e.
+ basically what <command>git-describe</command> would give.
+ If empty or not defined the default from packaging policy is used.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--ignore-regex=</option><replaceable>REGEX</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Ignore commit lines matching <replaceable>REGEX</replaceable>
+ when generating the changelog.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]git-author</option>
+ </term>
+ <listitem>
+ <para>
+ Use user.name and user.email from
+ <application>git-config</application>(1) for the changelog header.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--spawn-editor=<replaceable>[always|release|no]</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ Whether to spawn an editor: always, when doing a release or never.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--editor-cmd=<replaceable>EDITOR</replaceable></option>
+ </term>
+ <listitem>
+ <para>
+ The editor to use for editing the changelog.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--customizations=</option><replaceable>CUSTOMIZATION-FILE</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Load Python code from <replaceable>CUSTOMIZATION-FILE</replaceable>.
+ At the moment, the only useful thing the code can do is define a
+ custom ChangelogEntryFormatter class.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>META TAGS</title>
+ <para>
+ Additional to the above options the formatting of the new changelog entries
+ (one-per-commit) in the changelog can be modified by special tags (called
+ Meta Tags) given in the git commit message. The tags must start at the
+ first column of a commit message but can appear on any line. They are of
+ the form <option>Tagname</option>: <replaceable>VALUE</replaceable>. Valid
+ Meta Tags are:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><option>Git-Rpm-Ch</option>: <replaceable>ACTION</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Supported actions are: <replaceable>Ignore</replaceable> which will
+ ignore this commit when generating new changelog entries.
+ <replaceable>Short</replaceable> which will only use the description
+ (the first line) of the commit message when generating the changelog
+ entry (useful when <option>--full</option> is given) and
+ <replaceable>Full</replaceable> which will use the full commit
+ message when generating the changelog entry (useful when
+ <option>--full</option> is not given).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>[Close|Closes|...]</option>: <replaceable>BUGNUMBER</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Indicate in the changelog entry that bug
+ <replaceable>BUGNUMBER</replaceable> was addressed in this commit.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ The following git commit message:
+ </para>
+ <screen>
+ Document meta tags
+
+ so one doesn't have to consult the manual
+
+ Git-Rpm-Ch: Short
+ Closes: #636088
+ </screen>
+ <para>
+ Results in this changelog entry:
+ </para>
+ <screen>
+ - Document meta tags (Closes: #636088)
+ </screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage.rpm"/>,
+ <xref linkend="man.gbp.import.srpm"/>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ <ulink url="https://honk.sigxcpu.org/cl2vcs">
+ <citetitle>Cl2vcs</citetitle></ulink>,
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &rpm-username; &rpm-email;
+ </para>
+ </refsect1>
+</refentry>
--- /dev/null
+<refentry id="man.gbp.setup.gitattributes">
+ <refentryinfo>
+ <address>
+ <email>andrew@shadura.me</email>
+ </address>
+ <author>
+ <firstname>Andrej</firstname>
+ <surname>Shadura</surname>
+ </author>
+ </refentryinfo>
+ <refmeta><refentrytitle>gbp-setup-gitattributes</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-setup-gitattributes</refname>
+ <refpurpose>Set up &git; attributes for packaging</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-setup-gitattributes;
+
+ &man.common.options.synopsis;
+ <arg><option>--[no-]dgit-defuse-attrs</option></arg>
+ <arg><option>--all</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-setup-gitattributes; sets up <filename>.git/info/attributes</filename> in the current
+ &git; repository to sane defaults most suitable for packaging work. At the moment, this
+ amounts to making sure no transformations happen during checkout, commit or export. More
+ attributes may be added in future, by default all known settings are applied.
+ </para>
+ <para>
+ Upstream sources may ship <filename>.gitattributes</filename> files enabling certain
+ transformations to the committed source, usually to make working with files in different
+ encodings more convenient for the upstream authors. For Debian packaging, it is necessary
+ to override these attributes, since they cause often unwanted conversion of files (e.g.
+ line endings, encodings and some others). Working with such source tree is confusing,
+ since the working tree differs from the Git history (and sometimes from the source tarball),
+ and can lead to errors.
+ </para>
+ <para>
+ By default, &gbp-clone; tries to detect the usage of <filename>.gitattributes</filename> in the
+ upstream source and disables the Git attributes only when necessary.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+ <varlistentry>
+ <term><option>--[no-]dgit-defuse-attrs</option>
+ </term>
+ <listitem>
+ <para>
+ <option>Disables all transforming attributes for all files. This is done by
+ defining a macro attribute <symbol>[attr]dgit-defuse-attrs</symbol> and applying it
+ to <filename>*</filename> together with <symbol>export-subst</symbol> and
+ <symbol>export-ignore</symbol>.</option>
+ </para>
+ <para>
+ This method is compatible with <command>dgit</command> and <command>git-deborig</command>
+ which use this macro attribute. Older versions of <command>dgit</command> use an incomplete
+ preset missing some attributes; if such is found, it is replaced by an updated definition.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--all</option>
+ </term>
+ <listitem>
+ <para>
+ Apply all known &git; attribute settings. This is the default.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.clone"/>,
+ <xref linkend="man.gbp.push"/>,
+ <xref linkend="man.gbp.conf"/>,
+ <citerefentry>
+ <refentrytitle>gitattributes</refentrytitle>
+ <manvolnum>5</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>dgit</refentrytitle>
+ <manvolnum>7</manvolnum>
+ </citerefentry>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ Andrej Shadura <email>andrew@shadura.me</email>
+ </para>
+ </refsect1>
+</refentry>
--- /dev/null
+<refentry id="man.gbp.tag">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta><refentrytitle>gbp-tag</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>gbp-tag</refname>
+ <refpurpose>Tag a &debian; packages in a &git; repository</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp-tag;
+
+ &man.common.options.synopsis;
+ <arg><option>--ignore-branch</option></arg>
+ <arg><option>--[no-]ignore-new</option></arg>
+ <arg><option>--[no-]sign-tags</option></arg>
+ <arg><option>--keyid=</option><replaceable>GPG-KEYID</replaceable></arg>
+ <arg><option>--debian-branch=</option><replaceable>BRANCH_NAME</replaceable></arg>
+ <arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg>
+ <arg><option>--debian-tag-msg=</option><replaceable>tag-msg-format</replaceable></arg>
+ <arg><option>--posttag=</option><replaceable>COMMAND</replaceable></arg>
+ <arg><option>--retag</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp-tag; tags the current head commit appropriately. It will in order:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Verify that it is being executed from the Debian branch.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Verify that the repository doesn't contain any uncommitted source
+ changes.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Create a git tag using the information from <filename>debian/changelog</filename>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ (Optionally) call a post tag hook.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ &man.common.options.description;
+ <varlistentry>
+ <term><option>--posttag=</option><replaceable>COMMAND</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Execute <replaceable>COMMAND</replaceable> after creating the tag.
+ </para>
+ <para>
+ Exported environment variables are: <envar>GBP_TAG</envar> (the name
+ of the generated tag), <envar>GBP_BRANCH</envar> (the branch the
+ package was built from) and <envar>GBP_SHA1</envar> (the sha1 of the
+ commit the tag was created at).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]sign-tags</option>
+ </term>
+ <listitem>
+ <para>
+ GPG sign all created tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--keyid=</option><replaceable>GPG-KEYID</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this keyid for gpg signing tags.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-tag=</option><replaceable>TAG-FORMAT</replaceable>
+ </term>
+ <listitem>
+ <para>
+ Use this tag format when tagging &debian; versions, default is
+ <replaceable>debian/%(version)s</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-tag-msg=</option><replaceable>tag-msg-format</replaceable>
+ </term>
+ <listitem>
+ <para>Use this tag message format when signing &debian; versions,
+ default is <replaceable>%(pkg)s Debian release %(version)s</replaceable></para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--retag</option>
+ </term>
+ <listitem>
+ <para>
+ Don't fail tag operations if a tag with the same version
+ already exists. This is a command line only option that
+ cannot be specified via &gbp.conf;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--debian-branch</option>=<replaceable>BRANCH_NAME</replaceable>
+ </term>
+ <listitem>
+ <para>
+ If you're not on this branch when invoking &gbp-tag; it will
+ fail. Default is <replaceable>master</replaceable>. This is done to
+ make sure you don't accidentally tag on the wrong branch. Not
+ being on this branch will be ignored when using
+ <option>--ignore-branch</option>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--ignore-branch</option>
+ </term>
+ <listitem>
+ <para>
+ Don't check if the current branch matches
+ <replaceable>DEBIAN-BRANCH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--[no-]ignore-new</option>
+ </term>
+ <listitem>
+ <para>
+ Don't abort if there are uncommitted changes in the source tree or
+ the current branch doesn't match the
+ <replaceable>DEBIAN-BRANCH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>
+ Create a tag with the current defaults
+ </para>
+ <screen>
+ &gbp-tag;
+ </screen>
+ <para>
+ Create using a more upstreamish tag format:
+ </para>
+ <screen>
+ &gbp-tag; --debian-tag='v%(version)s'
+ </screen>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.push"/>,
+ <xref linkend="man.gbp.conf"/>,
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>
+ &dhusername; &dhemail;
+ </para>
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp.conf">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp.conf</refentrytitle>
- &dhconfsection;
- </refmeta>
- <refnamediv>
- <refname>&gbp.conf;</refname>
- <refpurpose>Gbp configuration file</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <variablelist>
- <varlistentry>
- <term>/etc/git-buildpackage/gbp.conf</term>
- <listitem><para>system wide</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>~/.gbp.conf</term>
- <listitem><para>per user</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>.gbp.conf</term>
- <listitem><para>per branch, can be published with the
- repository (deprecated)</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>debian/gbp.conf</term>
- <listitem><para>per branch, can be published with the
- repository</para></listitem>
- </varlistentry>
- <varlistentry>
- <term>.git/gbp.conf</term>
- <listitem><para>per repository</para></listitem>
- </varlistentry>
- </variablelist>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- The <filename>gbp.conf</filename> provides default global options and specific options
- for &gbp; commands. All have the same format and are parsed in the above order. The
- file consists of several sections, one for each command. Comments start with a hash sign
- (<option>#</option>). The generic file syntax is:
- </para>
-<programlisting>
- [DEFAULT]
- # This is section for global settings. Affects all commands
- key = value
-
- [<command>]
- # Specific sections for each command, like &gbp-buildpackage;
- key = value
-
- [remote-config <name>]
- # Specific sections for a remote configuration. This can be used several
- # times to set up remote configuration for gbp-create-remote-repo
- key = value
-</programlisting>
-<para>
-For backwards compatibility sections starting with <filename>git-</filename> or
-<filename>gbp-</filename> are still supported.
-</para>
-
-<para>
-
-<option>key=value</option> pairs of the command sections reflect the command line
-options and their settings. For example <xref linkend="man.gbp.buildpackage">
-manualpage contains the <option>--git-export-dir</option>=<parameter>diirectory</parameter>
-option which can be turned into configuration file setting by dropping the
-<option>--git</option> prefix with:
-</para>
-
-<programlisting>
- [buildpackage]
- export-dir = directory
-</programlisting>
-
-<para>
-Notice that some option can take Python like lists.
-For example the <xref linkend="man.gbp.import.orig"> commmand has the
-<option>--filter</option>=<parameter>pattern</parameter> option which can
-be truned into a configuration file option like this:
-</para>
-
-<programlisting>
- [import-orig]
- filter = [ '.svn', '.hg' ]
-</programlisting>
-
-<para>
-Boolean options can be either <option>True</option> or <option>False</option>. For example
-<xref linkend="man.gbp.import.orig">; has the <option>--pristine-tar</option> and
-<option>--no-pristine-tar</option> options which translate to:
-</para>
-<programlisting>
- [import-orig]
- pristine-tar = True
-</programlisting>
-
-<para>and</para>
-
-<programlisting>
- [import-orig]
- pristine-tar = False
-</programlisting>
-<para>respectively.</para>
-<note>
-<para>
-To see the current set of values that would be applied after parsing the
-configuration files run the command with <option>--help</option> and check it's
-output.
-</para>
-</note>
-<note>
-<para>
- <command>gbp import-dscs</command> and <command>git-pbuilder</command>
-can't be configured via gbp.conf.
-</para>
-</note>
-
-<para>
-<xref linkend="man.gbp.create.remote.repo"> can additionally parse remote site
-configurations from <filename>gbp.conf</filename>. For example a configration like:
-</para>
-
-<programlisting>
-[remote-config pkg-libvirt]
-# Location of the repository
-remote-url-pattern = ssh://git.debian.org/git/pkg-libvirt/%(pkg)s
-# Template dir to passed to git-init
-template-dir = /srv/alioth.debian.org/chroot/home/groups/pkg-libvirt/git-template
-</programlisting>
-
-<para>
-Can be used to create remote repositories for the pkg-libvirt project using:
-</para>
-
-<programlisting>
-gbp-create-remote-repo --remote-config=pkg-libvirt
-</programlisting>
-
-<para>
-This can be useful if you're often creating new remote repositores for
-different projects.
-</para>
-
- </refsect1>
- <refsect1>
- <title>EXAMPLES</title>
-<para>
-An example set up for packaging work:
-</para>
-
-<programlisting>
- # $HOME/.gbp.conf
-
- [DEFAULT]
- pristine-tar = True
- cleaner = fakeroot debian/rules clean
-
- [buildpackage]
- export-dir = ../build-area/
-
- [import-orig]
- dch = False
- filter = .svn
- filter = .hg
- filter = .bzr
- filter = CVS
- filter = debian/*
- filter = */debian/*
- filter-pristine-tar = True
-
- [import-dsc]
- filter = [
- 'CVS',
- '.cvsignore',
- '.hg',
- '.hgignore'
- '.bzr',
- '.bzrignore',
- '.gitignore'
- ]
-
- # End of file
-</programlisting>
-</refsect1>
-
-<refsect1>
- <title>ENVIRONMENT</title>
- <variablelist>
- <varlistentry>
- <term>GBP_CONF_FILES</term>
- <listitem><para>Colon separated list of files to parse. The default is
-the above list of configuration files.</para></listitem>
- </varlistentry>
- </variablelist>
-</refsect1>
-
-<refsect1>
- <title>FILES</title>
- <para>
- See See <filename>/etc/git-buildpackage/gbp.conf</filename> for an example.
- </para>
-</refsect1>
-
-<refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.clone">,
- <xref linkend="man.gbp.create.remote.repo">,
- <xref linkend="man.gbp.pq">,
- <xref linkend="man.gbp.pull">,
- <xref linkend="man.gbp.dch">,
- <xref linkend="man.gbp.import.dsc">,
- <xref linkend="man.gbp.import.orig">,
- <xref linkend="man.gbp.buildpackage">,
- <ulink url="file:///usr/share/doc/git-buildpackage/manual-html/index.html">
- <citetitle>The Git-Buildpackage Manual</citetitle></ulink>
- </para>
-</refsect1>
-<refsect1>
- <title>AUTHORS</title>
- <para>&dhusername; &dhemail;</para>
- <para>This manual page is based on a POD version by Jari Aalto <email>jari.aalto@cante.net</email>.
- Released under license GNU GPL version 2 or (at your option) any later.
- version.
- </para>
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp.conf">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp.conf</refentrytitle>
+ &dhconfsection;
+ </refmeta>
+ <refnamediv>
+ <refname>&gbp.conf;</refname>
+ <refpurpose>Gbp configuration file</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <variablelist>
+ <varlistentry>
+ <term>
+ /etc/git-buildpackage/gbp.conf
+ </term>
+ <listitem>
+ <para>
+ system wide
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ ~/.gbp.conf
+ </term>
+ <listitem>
+ <para>
+ per user
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ .gbp.conf
+ </term>
+ <listitem>
+ <para>
+ per branch, can be published with the repository
+ (deprecated)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ debian/gbp.conf
+ </term>
+ <listitem>
+ <para>
+ per branch, can be published with the repository
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ .git/gbp.conf
+ </term>
+ <listitem>
+ <para>
+ per repository
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ The <filename>gbp.conf</filename> configuration files provide
+ default global options and specific options for individual &gbp;
+ commands. All files have the same format as described below and
+ are parsed in the above order from top to bottom with increasing
+ precedence. Non existing files will be skipped.
+ </para>
+ <para>
+ Each file consists of either zero or one default section, and
+ zero or one sections for each &gbp; command. Additionally, there
+ can be an arbitrary number of
+ <option>remote-config</option> sections. Comments start with a
+ hash sign (<option>#</option>). The overall layout is:
+ </para>
+ <programlisting>
+ [DEFAULT]
+ # This section is for global settings. Affects all commands.
+ # Options set here have the lowest priority.
+ key = value
+
+ [<command>]
+ # Specific sections for each command, like <command>buildpackage</command>
+ # Options set here have lower priority than command line options
+ key = value
+
+ [remote-config <name>]
+ # Specific sections for a remote configuration. This can be used several
+ # times to set up remote configuration for <command>gbp create-remote-repo</command>
+ key = value
+ </programlisting>
+ <para>
+ The sections for each command are named like the command (without &gbp;) surrounded
+ by square brackets (e.g. <option>[buildpackage]</option>).
+ For backwards compatibility, command sections starting with <filename>git-</filename> or
+ <filename>gbp-</filename> are also supported but will provoke a warning when parsed by
+ &gbp;.
+ </para>
+
+ <para>
+ The keys in the
+ <option>key</option>=<parameter>value</parameter> pairs are named
+ like the command-line options of the corresponding command (with the
+ '--' stripped off) and can hold the same values, but see below for
+ details. In case of &gbp-buildpackage; and &gbp-buildpackage-rpm;
+ the key needs '--git-' instead of '--' stripped off.
+ </para>
+ <para>
+ For example,
+ the <xref linkend="man.gbp.buildpackage"/> manual page documents
+ the <option>--git-export-dir</option>=<parameter>directory</parameter>
+ option which can be turned into configuration file setting by
+ dropping the
+ <option>--git-</option> prefix:
+ </para>
+
+ <programlisting>
+ [buildpackage]
+ export-dir = directory
+ </programlisting>
+
+ <para>
+ Options that can be repeated on the command line take Python-like
+ lists in the config file. For example,
+ the <xref linkend="man.gbp.import.orig"/> command has the
+ <option>--filter</option>=<parameter>pattern</parameter> option
+ which can be turned into a configuration file option like this:
+ </para>
+
+ <programlisting>
+ [import-orig]
+ filter = [ '.svn', '.hg' ]
+ </programlisting>
+
+ <para>
+ Boolean options can be either <option>True</option> or <option>False</option>. For example,
+ <xref linkend="man.gbp.import.orig"/> has the <option>--pristine-tar</option> and
+ <option>--no-pristine-tar</option> options which translate to:
+ </para>
+ <programlisting>
+ [import-orig]
+ pristine-tar = True
+ </programlisting>
+
+ <para>and</para>
+
+ <programlisting>
+ [import-orig]
+ pristine-tar = False
+ </programlisting>
+ <para>respectively.</para>
+
+ <refsect2>
+ <title>Remote site configuration</title>
+ <para>
+ <xref linkend="man.gbp.create.remote.repo"/> can additionally parse remote site
+ configurations from <filename>gbp.conf</filename>. For example, a configuration like:
+ </para>
+
+ <programlisting>
+ [remote-config pkg-libvirt]
+ # Location of the repository
+ remote-url-pattern = ssh://git.debian.org/git/pkg-libvirt/%(pkg)s
+ # Template dir to passed to git-init
+ template-dir = /srv/alioth.debian.org/chroot/home/groups/pkg-libvirt/git-template
+ </programlisting>
+
+ <para>
+ can be used to create remote repositories for the pkg-libvirt project using:
+ </para>
+
+ <programlisting>
+ gbp-create-remote-repo --remote-config=pkg-libvirt
+ </programlisting>
+
+ <para>
+ This can be useful if you're often creating new remote repositories for
+ different projects.
+ </para>
+ </refsect2>
+
+ <refsect2>
+ <title>Notes</title>
+ <note>
+ <para>
+ To see the current set of values that would be applied after parsing the
+ configuration files, use <xref linkend="man.gbp.config"/>.
+ </para>
+ </note>
+
+ <note>
+ <para>
+ <command>gbp import-dscs</command> and <command>git-pbuilder</command>
+ can't be configured via <filename>gbp.conf</filename>.
+ </para>
+ </note>
+ </refsect2>
+
+ </refsect1>
+ <refsect1>
+ <title>EXAMPLES</title>
+ <para>
+ An example set up for packaging work:
+ </para>
+
+ <programlisting>
+ # $HOME/.gbp.conf
+
+ [DEFAULT]
+ pristine-tar = True
+ cleaner = fakeroot debian/rules clean
+
+ [buildpackage]
+ export-dir = ../build-area/
+
+ [import-orig]
+ dch = False
+ filter = [
+ '.svn',
+ '.hg',
+ '.bzr',
+ 'CVS',
+ 'debian/*',
+ '*/debian/*'
+ ]
+ filter-pristine-tar = True
+
+ [import-dsc]
+ filter = [
+ 'CVS',
+ '.cvsignore',
+ '.hg',
+ '.hgignore'
+ '.bzr',
+ '.bzrignore',
+ '.gitignore'
+ ]
+
+ # End of file
+ </programlisting>
+ </refsect1>
+
+ <refsect1>
+ <title>ENVIRONMENT</title>
+ <para>
+ The following environment variables can be used to modify &gbp;'s
+ configuration file handling:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><envar>GBP_CONF_FILES</envar></term>
+ <listitem>
+ <para>
+ A colon separated list of configuration files to parse. If
+ unset or empty the default list of files is parsed (see above).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_DISABLE_SECTION_DEPRECATION</envar></term>
+ <listitem>
+ <para>
+ When set to a non-empty value don't print a deprecation
+ warning in case &gbp; encounters a section starting with
+ <emphasis>git-</emphasis> or <emphasis>gbp-</emphasis>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><envar>GBP_DISABLE_GBP_CONF_DEPRECATION</envar></term>
+ <listitem>
+ <para>
+ When set to a non-empty value don't print a deprecation
+ warning in case &gbp; encounters a configuration file in
+ a deprecated location.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>FILES</title>
+ <para>
+ See <filename>/etc/git-buildpackage/gbp.conf</filename> for an example.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.config"/>,
+ <xref linkend="man.gbp.clone"/>,
+ <xref linkend="man.gbp.create.remote.repo"/>,
+ <xref linkend="man.gbp.pq"/>,
+ <xref linkend="man.gbp.pull"/>,
+ <xref linkend="man.gbp.dch"/>,
+ <xref linkend="man.gbp.import.dsc"/>,
+ <xref linkend="man.gbp.import.orig"/>,
+ <xref linkend="man.gbp.buildpackage"/>,
+ <ulink url="file:///usr/share/doc/git-buildpackage/manual-html/index.html">
+ <citetitle>The Git-Buildpackage Manual</citetitle></ulink>
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHORS</title>
+ <para>&dhusername; &dhemail;</para>
+ <para>This manual page is based on a POD version by Jari Aalto <email>jari.aalto@cante.net</email>.
+ Released under license GNU GPL version 2 or (at your option) any later.
+ version.
+ </para>
+ </refsect1>
+</refentry>
+++ /dev/null
-<refentry id="man.gbp">
- <refentryinfo>
- <address>
- &dhemail;
- </address>
- <author>
- &dhfirstname;
- &dhsurname;
- </author>
- </refentryinfo>
- <refmeta>
- <refentrytitle>gbp</refentrytitle>
- &dhsection;
- </refmeta>
- <refnamediv>
- <refname>&gbp;</refname>
- <refpurpose>Maintain Debian packages in Git</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- &gbp;
- <group choice='req'>
- <arg><option>--help</option></arg>
- <arg><option>--version</option></arg>
- <arg><option>--list-cmds</option></arg>
- <arg><option>command</option><arg choice='opt' rep='repeat'><option>args</option></arg></arg>
- </group>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- &gbp; is used to maintain Debian source packages in the &git; version control system.
- </para>
- </refsect1>
- <refsect1>
- <title>OPTIONS</title>
- <variablelist>
- <varlistentry>
- <term><option>--help</option>
- </term>
- <listitem>
- <para>Print help</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--version</option>
- </term>
- <listitem>
- <para>Print the programs version</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>--list-cmds</option>
- </term>
- <listitem>
- <para>List all available commands</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>GBP COMMANDS</title>
- <para>
- These are the possible commands. For possible arguments to these commands please
- see the corresponding man pages.
- </para>
- <variablelist>
- <varlistentry>
- <term>buildpackage
- </term>
- <listitem>
- <para>Build source and binary packages from a &git; repository</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <variablelist>
- <varlistentry>
- <term>import-orig
- </term>
- <listitem>
- <para>Import a new upstream version into a &git; repository</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <variablelist>
- <varlistentry>
- <term>import-dsc
- </term>
- <listitem>
- <para>Import a Debian source package into a &git; repository</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <variablelist>
- <varlistentry>
- <term>import-dscs
- </term>
- <listitem>
- <para>Import several Debian source packages into a &git; repository, sorted
- by version number</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <variablelist>
- <varlistentry>
- <term>dch
- </term>
- <listitem>
- <para>Generate the <filename>debian/changelog</filename> from &git; commit history</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <variablelist>
- <varlistentry>
- <term>pq
- </term>
- <listitem>
- <para>Manage <filename>debian/patches</filename> using &git; <option>rebase</option></para>
- </listitem>
- </varlistentry>
- </variablelist>
- <variablelist>
- <varlistentry>
- <term>pull
- </term>
- <listitem>
- <para>Update a &git; repository from a remote</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <variablelist>
- <varlistentry>
- <term>clone
- </term>
- <listitem>
- <para>Clone a &git; repository from a remote and set up the necessary branch tracking.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <variablelist>
- <varlistentry>
- <term>create-remote-repo
- </term>
- <listitem>
- <para>Create a remote &git; repository</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- &man.gbp.config-files;
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>
- <xref linkend="man.gbp.buildpackage">,
- <xref linkend="man.gbp.import.dsc">,
- <xref linkend="man.gbp.import.dscs">,
- <xref linkend="man.gbp.import.orig">,
- <xref linkend="man.gbp.dch">,
- <xref linkend="man.gbp.pq">,
- <xref linkend="man.gbp.create.remote.repo">,
- <xref linkend="man.gbp.pull">,
- <xref linkend="man.gbp.clone">,
- <citerefentry>
- <refentrytitle>git-pbuilder</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <xref linkend="man.gbp.conf">,
- &man.seealso.common;
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
-
- <para>&dhusername; &dhemail;</para>
-
- </refsect1>
-</refentry>
--- /dev/null
+<refentry id="man.gbp">
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>gbp</refentrytitle>
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>&gbp;</refname>
+ <refpurpose>Maintain &debian; packages in &git;</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ &gbp;
+ <group choice='req'>
+ <arg><option>--help</option></arg>
+ <arg><option>--version</option></arg>
+ <arg><option>--list-cmds</option></arg>
+ <arg><option>command</option><arg choice='opt' rep='repeat'><option>args</option></arg></arg>
+ </group>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ &gbp; is used to maintain &debian; source packages in the &git; version control system.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+ <variablelist>
+ <varlistentry>
+ <term><option>--help</option>
+ </term>
+ <listitem>
+ <para>Print help</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--version</option>
+ </term>
+ <listitem>
+ <para>Print the programs version</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--list-cmds</option>
+ </term>
+ <listitem>
+ <para>List all available commands</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>GBP COMMANDS</title>
+ <para>
+ These are the possible commands. For possible arguments to these commands, please
+ see the corresponding man pages.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>buildpackage
+ </term>
+ <listitem>
+ <para>Build source and binary packages from a &git; repository</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>import-orig
+ </term>
+ <listitem>
+ <para>Import a new upstream version into a &git; repository</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>export-orig
+ </term>
+ <listitem>
+ <para>Recreate upstream tarballs from a &git; repository</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>import-dsc
+ </term>
+ <listitem>
+ <para>Import a &debian; source package into a &git; repository</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>import-dscs
+ </term>
+ <listitem>
+ <para>Import several &debian; source packages into a &git; repository, sorted
+ by version number</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>dch
+ </term>
+ <listitem>
+ <para>Generate the <filename>debian/changelog</filename> from &git; commit history</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>pq
+ </term>
+ <listitem>
+ <para>Manage <filename>debian/patches</filename> using &git; <option>rebase</option></para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>pull
+ </term>
+ <listitem>
+ <para>Update a &git; repository from a remote</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>clone
+ </term>
+ <listitem>
+ <para>Clone a &git; repository from a remote and set up the necessary branch tracking.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>create-remote-repo
+ </term>
+ <listitem>
+ <para>Create a remote &git; repository</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>tag
+ </term>
+ <listitem>
+ <para>Tag a &debian; release in a &git; repository</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <variablelist>
+ <varlistentry>
+ <term>push
+ </term>
+ <listitem>
+ <para>Push packaging branches to a remote &git; repository</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ &man.gbp.config-files;
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>
+ <xref linkend="man.gbp.buildpackage"/>,
+ <xref linkend="man.gbp.clone"/>,
+ <xref linkend="man.gbp.create.remote.repo"/>,
+ <xref linkend="man.gbp.dch"/>,
+ <xref linkend="man.gbp.export.orig"/>,
+ <xref linkend="man.gbp.import.dsc"/>,
+ <xref linkend="man.gbp.import.dscs"/>,
+ <xref linkend="man.gbp.import.orig"/>,
+ <xref linkend="man.gbp.pq"/>,
+ <xref linkend="man.gbp.pristine.tar"/>,
+ <xref linkend="man.gbp.pull"/>,
+ <xref linkend="man.gbp.push"/>,
+ <xref linkend="man.gbp.tag"/>,
+ <citerefentry>
+ <refentrytitle>git-pbuilder</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <xref linkend="man.gbp.conf"/>,
+ &man.seealso.common;
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+
+ <para>&dhusername; &dhemail;</para>
+
+ </refsect1>
+</refentry>
<arg><option>--version</option></arg>
<arg><option>--help</option></arg>
<arg><option>--verbose</option></arg>
- <arg><option>--color=</option><replaceable>[auto|on|off]</replaceable></arg>
+ <arg><option>--color=</option>[auto|on|off]</arg>
<arg><option>--color-scheme=</option><replaceable>COLOR_SCHEME</replaceable></arg>
"
>
</listitem>
</varlistentry>
<varlistentry>
- <term><option>--color=</option><replaceable>[auto|on|off]</replaceable>
+ <term><option>--color=</option>[auto|on|off]
</term>
<listitem>
<para>
COLOR_SCHEME is
'<debug>:<info>:<warning>:<error>'.
Numerical values and color names are accepted, empty fields imply
- the default color. For example --git-color-scheme='cyan:34::' would
+ the default color. For example,
+ <option>--git-color-scheme=</option><literal>'cyan:34::'</literal> would
show debug messages in cyan, info messages in blue and other messages
in default (i.e. warning and error messages in red).
</para>
+++ /dev/null
- <title>CONFIGURATION FILES</title>
- <para>Several <filename>gbp.conf</filename> files are parsed
- to set defaults for the above commandline arguments. See the
- <xref linkend="man.gbp.conf"> manpage for details.</para>
--- /dev/null
+ <title>CONFIGURATION FILES</title>
+ <para>Several <filename>gbp.conf</filename> files are parsed
+ to set defaults for the above command-line arguments. See the
+ <xref linkend="man.gbp.conf"/> manpage for details.</para>
+++ /dev/null
- <citerefentry>
- <refentrytitle>rpmbuild</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>git</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>pristine-tar</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
+++ /dev/null
- <citerefentry>
- <refentrytitle>debuild</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>git</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <citerefentry>
- <refentrytitle>pristine-tar</refentrytitle>
- <manvolnum>1</manvolnum>
- </citerefentry>,
- <ulink url="file:///usr/share/doc/git-buildpackage/manual-html/index.html">
- <citetitle>The Git-Buildpackage Manual</citetitle></ulink>
--- /dev/null
+ <citerefentry>
+ <refentrytitle>debuild</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>git</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <citerefentry>
+ <refentrytitle>pristine-tar</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </citerefentry>,
+ <ulink url="file:///usr/share/doc/git-buildpackage/manual-html/index.html">
+ <citetitle>The Git-Buildpackage Manual</citetitle></ulink>
+++ /dev/null
-<!ENTITY man.gbp.buildpackage.rpm SYSTEM "gbp-buildpackage-rpm.sgml">
-<!ENTITY man.gbp.import.orig.rpm SYSTEM "gbp-import-orig-rpm.sgml">
-<!ENTITY man.gbp.import.srpm SYSTEM "gbp-import-srpm.sgml">
-<!ENTITY man.gbp.pq.rpm SYSTEM "gbp-pq-rpm.sgml">
-<!ENTITY man.gbp.rpm.ch SYSTEM "gbp-rpm-ch.sgml">
-<!ENTITY man.gbp.conf SYSTEM "gbp.conf.sgml">
-<!ENTITY man.gbp.config-files SYSTEM "man.conffiles.sgml">
-<!ENTITY man.seealso.common SYSTEM "man.seealso-rpm.sgml">
-<!ENTITY % COMMON.OPTIONS SYSTEM "man.common-options.ent">
-%COMMON.OPTIONS;
-<!ENTITY man.gbp.importorig SYSTEM "gbp-import-orig.sgml">
-<!ENTITY man.gbp.importdsc SYSTEM "gbp-import-dsc.sgml">
-<!ENTITY man.gbp.importdscs SYSTEM "gbp-import-dscs.sgml">
-<!ENTITY man.gbp.buildpackage SYSTEM "gbp-buildpackage.sgml">
-<!ENTITY man.gbp.config SYSTEM "gbp-config.sgml">
-<!ENTITY man.gbp.dch SYSTEM "gbp-dch.sgml">
-<!ENTITY man.gbp SYSTEM "gbp.sgml">
-<!ENTITY man.gbp.pull SYSTEM "gbp-pull.sgml">
-<!ENTITY man.gbp.clone SYSTEM "gbp-clone.sgml">
-<!ENTITY man.gbp.pq SYSTEM "gbp-pq.sgml">
-<!ENTITY man.gbp.create.remote.repo SYSTEM "gbp-create-remote-repo.sgml">
-<!ENTITY man.gbp.conf SYSTEM "gbp.conf.sgml">
-<!ENTITY man.gbp.config-files SYSTEM "man.conffiles.sgml">
-<!ENTITY man.seealso.common SYSTEM "man.seealso.sgml">
+<!ENTITY man.gbp SYSTEM "gbp.xml">
+<!ENTITY man.gbp.buildpackage SYSTEM "gbp-buildpackage.xml">
+<!ENTITY man.gbp.buildpackage.rpm SYSTEM "gbp-buildpackage-rpm.xml">
+<!ENTITY man.gbp.clone SYSTEM "gbp-clone.xml">
+<!ENTITY man.gbp.conf SYSTEM "gbp.conf.xml">
+<!ENTITY man.gbp.config SYSTEM "gbp-config.xml">
+<!ENTITY man.gbp.config-files SYSTEM "man.conffiles.xml">
+<!ENTITY man.gbp.create.remote.repo SYSTEM "gbp-create-remote-repo.xml">
+<!ENTITY man.gbp.dch SYSTEM "gbp-dch.xml">
+<!ENTITY man.gbp.exportorig SYSTEM "gbp-export-orig.xml">
+<!ENTITY man.gbp.import.srpm SYSTEM "gbp-import-srpm.xml">
+<!ENTITY man.gbp.importdsc SYSTEM "gbp-import-dsc.xml">
+<!ENTITY man.gbp.importdscs SYSTEM "gbp-import-dscs.xml">
+<!ENTITY man.gbp.importorig SYSTEM "gbp-import-orig.xml">
+<!ENTITY man.gbp.importref SYSTEM "gbp-import-ref.xml">
+<!ENTITY man.gbp.pq SYSTEM "gbp-pq.xml">
+<!ENTITY man.gbp.pq.rpm SYSTEM "gbp-pq-rpm.xml">
+<!ENTITY man.gbp.pristine.tar SYSTEM "gbp-pristine-tar.xml">
+<!ENTITY man.gbp.pull SYSTEM "gbp-pull.xml">
+<!ENTITY man.gbp.push SYSTEM "gbp-push.xml">
+<!ENTITY man.gbp.rpm.ch SYSTEM "gbp-rpm-ch.xml">
+<!ENTITY man.gbp.setup.gitattributes SYSTEM "gbp-setup-gitattributes.xml">
+<!ENTITY man.gbp.tag SYSTEM "gbp-tag.xml">
+<!ENTITY man.seealso.common SYSTEM "man.seealso.xml">
+
<!ENTITY % COMMON.OPTIONS SYSTEM "man.common-options.ent">
%COMMON.OPTIONS;
+++ /dev/null
-<book id="gbp-rpm">
- <bookinfo>
- <title>Building RPM Packages with git-buildpackage-rpm</title>
- <author><firstname>Markus</firstname> <surname>Lehtonen</surname></author>
- <address><email>markus.lehtonen@linux.intel.com</email></address>
- <subtitle>Version: &gbp-version;</subtitle>
- </bookinfo>
-
- &ch.intro-rpm;
- &ch.development-rpm;
- &ch.building-rpm;
-
- <appendix id="man.rpm.reference">
- <title>Command Reference</title>
- &man.gbp.buildpackage.rpm;
- &man.gbp.import.orig.rpm;
- &man.gbp.import.srpm;
- &man.gbp.pq.rpm;
- &man.gbp.rpm.ch;
- </appendix>
- <appendix id="gbp.rpm.copyleft">
- <title>Copyright</title>
- &gbp.copyright;
- </appendix>
-</book>
-
+++ /dev/null
-<book id="gbp">
- <bookinfo>
- <title>Building Debian Packages with git-buildpackage</title>
- <author>&dhfirstname; &dhsurname;</author>
- <address>&dhemail;</address>
- <subtitle>Version: &gbp-version;</subtitle>
- </bookinfo>
-
- &ch.intro;
- &ch.import;
- &ch.building;
- &ch.releases;
- &ch.cfgfile;
- &ch.special;
-
- <appendix id="man.reference">
- <title>Command Reference</title>
- &man.gbp;
- &man.gbp.buildpackage;
- &man.gbp.importdsc;
- &man.gbp.importdscs;
- &man.gbp.importorig;
- &man.gbp.dch;
- &man.gbp.clone;
- &man.gbp.config;
- &man.gbp.pull;
- &man.gbp.pq;
- &man.gbp.create.remote.repo;
- &man.gbp.conf;
- </appendix>
- <appendix id="gbp.copyleft">
- <title>Copyright</title>
- &gbp.copyright;
- </appendix>
-</book>
-
--- /dev/null
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+ <!ENTITY % COMMON SYSTEM "common.ent">
+ %COMMON;
+ <!ENTITY % VERSION SYSTEM "version.ent">
+ %VERSION;
+ <!ENTITY % MANPAGES SYSTEM "manpages/manpages.ent">
+ %MANPAGES;
+ <!ENTITY % CHAPTERS SYSTEM "chapters/chapters.ent">
+ %CHAPTERS;
+ <!ENTITY gbp.copyright SYSTEM "copyright.xml">
+]>
+
+<book id="gbp">
+ <bookinfo>
+ <title>Building Debian Packages with git-buildpackage</title>
+ <author>&dhfirstname; &dhsurname;</author>
+ <address>&dhemail;</address>
+ <subtitle>Version: &gbp-version;</subtitle>
+ </bookinfo>
+
+ &ch.intro;
+ &ch.import;
+ &ch.building;
+ &ch.patches;
+ &ch.releases;
+ &ch.cfgfile;
+ &ch.special;
+
+ <appendix id="man.reference">
+ <title>Command Reference</title>
+ &man.gbp;
+ &man.gbp.buildpackage;
+ &man.gbp.clone;
+ &man.gbp.config;
+ &man.gbp.create.remote.repo;
+ &man.gbp.dch;
+ &man.gbp.exportorig;
+ &man.gbp.importdsc;
+ &man.gbp.importdscs;
+ &man.gbp.importorig;
+ &man.gbp.importref;
+ &man.gbp.pq;
+ &man.gbp.pristine.tar;
+ &man.gbp.pull;
+ &man.gbp.push;
+ &man.gbp.tag;
+ &man.gbp.conf;
+ &man.gbp.buildpackage.rpm;
+ &man.gbp.import.srpm;
+ &man.gbp.pq.rpm;
+ &man.gbp.rpm.ch;
+ </appendix>
+ <appendix id="gbp.copyleft">
+ <title>Copyright</title>
+ &gbp.copyright;
+ </appendix>
+</book>
+
--- /dev/null
+#. type: Content of: <book><bookinfo><title>
+#: manual.xml:16
+msgid "Building Debian Packages with git-buildpackage"
+msgstr ""
+
+#. type: Content of: <book><bookinfo><address>
+#: manual.xml:18
+#, no-wrap
+msgid "&dhemail;"
+msgstr ""
+
+#. type: Content of: <book><bookinfo>
+#: manual.xml:17
+msgid ""
+"<author>&dhfirstname; &dhsurname;</author> <placeholder type=\"address\" id="
+"\"0\"/>"
+msgstr ""
+
+#. type: Content of: <book><bookinfo><subtitle>
+#: manual.xml:19
+msgid "Version: &gbp-version;"
+msgstr ""
+
+#. type: Content of: <book><appendix><title>
+#: manual.xml:31
+msgid "Command Reference"
+msgstr ""
+
+#. type: Content of: <book><appendix><title>
+#: manual.xml:55
+msgid "Copyright"
+msgstr ""
+
+#. type: Content of: <para>
+#: copyright.xml:2
+msgid ""
+"git-buildpackage, all associated scripts and programs, this manual, and all "
+"build scripts are Copyright © 2006-2017 Guido Gnther."
+msgstr ""
+
+#. type: Content of: <para>
+#: copyright.xml:6
+msgid ""
+"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; Version 2 of the License."
+msgstr ""
+
+#. type: Content of: <para>
+#: copyright.xml:12
+msgid ""
+"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."
+msgstr ""
+
+#. type: Content of: <para>
+#: copyright.xml:19
+msgid ""
+"You should have received a copy of the GNU General Public License along with "
+"this program; if not, please see <http://www.gnu.org/licenses/>"
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/building.xml:2
+msgid "Building Packages from the &git; Repository"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:4
+msgid ""
+"In order to build a &debian; package from the &git; repository, you use: "
+"&gbp-buildpackage;. This builds the upstream tarball (as will be described "
+"below) and invokes &debuild; to build the package. To use another build "
+"command, you can use the <option>--git-builder</option> option as described "
+"later in the manual, but &debuild; is nice since it can invoke "
+"<productname>lintian</productname>. During the development phase (when "
+"you're either not on the <emphasis>debian-branch</emphasis> or when you have "
+"uncommitted changes in your repository), you'll usually use:"
+msgstr ""
+
+#. type: Content of: <chapter><programlisting>
+#: chapters/building.xml:14
+#, no-wrap
+msgid "&gbp-buildpackage; <option>--git-ignore-new</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:16
+msgid ""
+"If &gbp-buildpackage; doesn't find a valid upstream tarball, it will create "
+"one by looking at the tag matching the upstream version. To change this "
+"behaviour, see the <option>--git-upstream-tree</option> option."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:20
+msgid ""
+"If you want to recreate the original tarball using the additional "
+"information from the <option>pristine-tar branch</option>, you have to "
+"specify the <option>--git-pristine-tar</option> option. This will make sure "
+"the upstream tarball matches exactly the one imported. Using this option is "
+"the recommended way of recreating the upstream tarball."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:26
+msgid ""
+"Once you're satisfied with the build and want to do a release, you commit "
+"all your changes and issue:"
+msgstr ""
+
+#. type: Content of: <chapter><programlisting>
+#: chapters/building.xml:29
+#, no-wrap
+msgid "&gbp-buildpackage; <option>--git-tag</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:31
+msgid ""
+"This will again build the &debian; package and tag the final result after "
+"extracting the current version from the changelog. If you want &gpg;-signed "
+"tags, you can use the <option>--git-sign</option> and <option>--git-keyid</"
+"option> options. To save typing, these option can be specified via the "
+"configuration files. You can furthermore change the tag format used when "
+"creating tags with the <option>debian-tag</option> option; the default is "
+"<replaceable>debian/<version></replaceable>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/building.xml:39
+msgid "Using a separate build dir"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:40
+msgid ""
+"Tools like &svn-buildpackage; use a separate build-area. To achieve a "
+"similar behaviour with &gbp-buildpackage;, use the <option>--git-export-dir</"
+"option> option:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/building.xml:43
+#, no-wrap
+msgid "&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area/</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:45
+msgid ""
+"This will export the head of the current branch to <replaceable>../build-"
+"area/package-version</replaceable> and build the package. If you don't want "
+"to export the current branch head, you can use <option>--git-export</option> "
+"to export any treeish object. Here are some examples:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/building.xml:51
+#, no-wrap
+msgid ""
+"&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>debian/0.4.3</replaceable>\n"
+"&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>etch</replaceable>\n"
+"&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>8caed309653d69b7ab440e3d35abc090eb4c6697</replaceable>\n"
+"&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>INDEX</replaceable>\n"
+"&gbp-buildpackage; <option>--git-export-dir</option>=<replaceable>../build-area</replaceable> <option>--git-export</option>=<replaceable>WC</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:57
+msgid ""
+"The special argument <replaceable>INDEX</replaceable> exports the state of "
+"the current index, which can be used to include staged but uncommitted "
+"changes in the build. Whereas the special argument <replaceable>WC</"
+"replaceable> exports the current working copy as is."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/building.xml:64
+#, no-wrap
+msgid ""
+"[buildpackage]\n"
+"# use a build area relative to the git repository\n"
+"export-dir=../build-area\n"
+"# to use the same build area for all packages use an absolute path:\n"
+"#export-dir=/home/debian-packages/build-area\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:61
+msgid ""
+"If you want to default to build in a separate build area, you can specify "
+"the directory to use in the <filename>gbp.conf</filename> file. "
+"<placeholder type=\"programlisting\" id=\"0\"/> &gbp-buildpackage; will "
+"cleanup the build-area after a successful build. If you want to keep the "
+"build tree, use <replaceable>--git-no-purge</replaceable>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/building.xml:75
+msgid "Invoking external programs"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:77
+msgid ""
+"Besides the commands for cleaning the package build dir (<option>cleaner</"
+"option>) and building the package (<option>builder</option>), you can also "
+"invoke hooks during the package build: immediately before a build "
+"(<option>prebuild</option>), after a successful build (<option>postbuild</"
+"option>), and after creating a tag (<option>posttag</option>). Typical "
+"applications are running <productname>lintian</productname> or pushing "
+"changes into a remote repository."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/building.xml:87
+msgid "Running lintian"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:93
+#, no-wrap
+msgid "&gbp-buildpackage; <option>--git-postbuild</option>=<replaceable>'lintian $GBP_CHANGES_FILE'</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:97
+#, no-wrap
+msgid "<option>postbuild</option>=<replaceable>lintian $GBP_CHANGES_FILE</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:88
+msgid ""
+"&gbp-buildpackage; exports several variables into the <option>posttag</"
+"option>'s environment (for details see the <xref linkend=\"man.gbp."
+"buildpackage\"/> manual page). To invoke &lintian;, we need to tell it "
+"where to find the changes file: <placeholder type=\"programlisting\" id="
+"\"0\"/> To call &lintian; automatically after each successful build, add: "
+"<placeholder type=\"programlisting\" id=\"1\"/> to your <filename>.gbp.conf</"
+"filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/building.xml:103
+msgid "Pushing into a remote repository"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:107
+#, no-wrap
+msgid "&gbp-buildpackage; <option>--git-tag</option> <option>--git-posttag</option>=<replaceable>\"git push && git push --tags\"</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:104
+msgid ""
+"If you want to push your changes automatically after a successful build and "
+"tag, you can use &gbp-buildpackage;'s posttag hook. A very simple invocation "
+"would look like this: <placeholder type=\"programlisting\" id=\"0\"/> This "
+"assumes you have set up a remote repository to push to in <filename>.git/"
+"config</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:117
+#, no-wrap
+msgid ""
+"#!/bin/sh -e\n"
+"#\n"
+"# gbp-posttag-push: post tag hook to push out the newly created tag and to\n"
+"# forward the remote branch to that position\n"
+"\n"
+"if ! REMOTE=$(git config --get branch.\"${GBP_BRANCH}\".remote); then\n"
+" REMOTE=origin\n"
+"fi\n"
+"\n"
+"if [ \"$GBP_TAG\" ]; then\n"
+" echo \"Pushing $GBP_TAG to $REMOTE\"\n"
+" git push \"$REMOTE\" \"$GBP_TAG\"\n"
+"else\n"
+" echo \"GBP_TAG not set.\"\n"
+" exit 1\n"
+"fi\n"
+"\n"
+"if [ \"$GBP_SHA1\" ] && [ \"$GBP_BRANCH\" ]; then\n"
+" git push \"$REMOTE\" \"$GBP_SHA1\":\"$GBP_BRANCH\"\n"
+"else\n"
+" echo \"GBP_SHA1 or GBP_BRANCH not set.\"\n"
+" exit 1\n"
+"fi\n"
+"echo \"done.\"\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:146
+#, no-wrap
+msgid "<option>posttag</option>=<replaceable>\"gbp-posttag-push\"</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:112
+msgid ""
+"Usually, you want to make sure you don't push out any unrelated changes into "
+"the remote repository. This is handled by the following hook which only "
+"pushes out the created tag to where you pulled from and also forwards the "
+"corresponding remote branch to that position: <placeholder type="
+"\"programlisting\" id=\"0\"/> <envar>GBP_TAG</envar>, <envar>GBP_SHA1</"
+"envar> and <envar>GBP_BRANCH</envar> are passed to the hook via the "
+"environment. To call this hook automatically upon tag creation, add: "
+"<placeholder type=\"programlisting\" id=\"1\"/> to your <filename>.gbp.conf</"
+"filename> and make sure <filename>gbp-push</filename> is somewhere in your "
+"<envar>$PATH</envar>. On &debian; systems, a more complete example can be "
+"found in <filename>/usr/share/doc/examples/git-buildpackage/examples/gbp-"
+"posttag-push</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/building.xml:155
+msgid "Running postexport hook"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:156
+msgid ""
+"&gbp-buildpackage; exports several variables into the <option>postexport</"
+"option>'s environment (for details see the <xref linkend=\"man.gbp."
+"buildpackage\"/> manual page). The motivation for the postexport action is "
+"to allow further adjustment of the sources prior to building the package. A "
+"typical use case scenario is to allow creating multiple source and binary "
+"packages from one &debian; branch, e.g. the bootstrap gcc and in the next "
+"stage the full gcc."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:165
+msgid ""
+"The postexport action postpones the creation of the upstream tarball, so "
+"that the metadata for creating it is already present in the exported source "
+"tree. The example postexport script below (<filename>crosstoolchain-expand."
+"sh</filename>) expands changelog, lintian override files, rules and control "
+"files according to an environment variable <envar>PKG_FLAVOR</envar>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:173
+msgid ""
+"Sample <filename>gbp.conf</filename> - enables source tree export by "
+"specifying the export directory:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/building.xml:177
+#, no-wrap
+msgid ""
+"[buildpackage]\n"
+"# use a build area relative to the git repository\n"
+"export-dir = ../build-area\n"
+"# disable the since the sources are being exported first\n"
+"cleaner =\n"
+"# post export script that handles expansion of &debian; specific files\n"
+"postexport = crosstoolchain-expand.sh\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:187
+msgid "Sample postexport script: <filename>crosstoolchain-expand.sh</filename>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/building.xml:189
+#, no-wrap
+msgid ""
+"#!/bin/sh\n"
+"#\n"
+"# Purpose: this script is intended for creating multiple source and\n"
+"# binary Debian packages from one source tree. It can be used in\n"
+"# conjunction with git-buildpackage that support a postexport hook\n"
+"#\n"
+"# A typical use is preparing a bootstrap gcc package that is needed\n"
+"# for building newlib and then preparing a full gcc package from the\n"
+"# same source tree. The user may specify the package flavor via\n"
+"# PKG_FLAVOR environmental variable. \n"
+"#\n"
+"#\n"
+"# The script expands/processes the following files:\n"
+"#\n"
+"# - changelog.tmpl is converted to standard Debian changelog\n"
+"#\n"
+"#\n"
+"# - all binary package lintian override template files are expanded\n"
+"# and renamed to the requested package flavor\n"
+"#\n"
+"# - source package lintian override template file is expanded and\n"
+"# renamed\n"
+"#\n"
+"# - rules.$PKG_FLAVOR and control.$PKG_FLAVOR are renamed to rules and\n"
+"# control resp.\n"
+"\n"
+"\n"
+"# the template string has been carefully chosen, so that\n"
+"# e.g. changelogs that refer to the source package can still be\n"
+"# processed by dch/git-dch resp.\n"
+"TMPL_STR=-XXXXXX\n"
+"\n"
+"# by default replace string for the template is empty\n"
+"REPLACE_STR=\n"
+"\n"
+"if [ -n \"$PKG_FLAVOR\" ]; then\n"
+" REPLACE_STR=-$PKG_FLAVOR\n"
+"fi\n"
+"\n"
+"REPLACE_EXPR=\"s/$TMPL_STR/$REPLACE_STR/g\"\n"
+"\n"
+"\n"
+"# actual processing of relevant files\n"
+"cd debian\n"
+"\n"
+"# expand the template changelog\n"
+"# remove the symlinked version\n"
+"rm changelog\n"
+"chglog_tmpl=changelog.tmpl\n"
+"[ -f \"$chglog_tmpl\" ] || {\n"
+" echo \"Missing changelog template (debian/$chglog_tmpl)\"\n"
+" exit 1\n"
+"}\n"
+"cat changelog.tmpl | sed -e \"$REPLACE_EXPR\" > changelog\n"
+"rm changelog.tmpl\n"
+"\n"
+"# process binary package lintian overrides - each override must match\n"
+"# its package name\n"
+"for f in *.lintian-overrides.tmpl; do\n"
+" outfile=${f%.tmpl}\n"
+" [ -f \"$f\" ] || {\n"
+"\techo \"Missing lintian override files for binary packages\"\n"
+"\texit 1\n"
+" }\n"
+" cat $f | sed -e \"$REPLACE_EXPR\" > ${outfile/$TMPL_STR/$REPLACE_STR}\n"
+" rm $f\n"
+"done\n"
+"\n"
+"# process the only source package lintian override\n"
+"source_lintian=source/lintian-overrides.tmpl\n"
+"cat $source_lintian | sed -e \"$REPLACE_EXPR\" > ${source_lintian%.tmpl}\n"
+"rm $source_lintian\n"
+"\n"
+"# rules and control file are package flavor specific\n"
+"[ -f rules.$PKG_FLAVOR ] && mv rules.$PKG_FLAVOR rules\n"
+"[ -f control.$PKG_FLAVOR ] && mv control.$PKG_FLAVOR control\n"
+"rm -f rules.* control.*\n"
+"\n"
+"exit 0\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/building.xml:271
+msgid "Running preexport hook"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:272
+msgid ""
+"&gbp-buildpackage; exports several variables into the <option>preexport</"
+"option>'s environment (for details see the <xref linkend=\"man.gbp."
+"buildpackage\"/> manual page). The motivation for the preexport action is to "
+"allow further actions before preparing and exporting the orig tarballs to "
+"the build directory. A usecase could be having the orig tarballs in a "
+"separate repository due to very large binary assets, that need to be checked "
+"out to the correct branch before creating the tarballs."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/cfgfile.xml:2
+msgid "Configuration Files"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:6 manpages/gbp.conf.xml:23
+msgid "/etc/git-buildpackage/gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:7
+msgid "system wide configuration"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:10 manpages/gbp.conf.xml:33
+msgid "~/.gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:11
+msgid "per user configuration"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:14 manpages/gbp.conf.xml:43
+msgid ".gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:15
+msgid "per repository/branch configuration (deprecated)"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:18 manpages/gbp.conf.xml:54
+msgid "debian/gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:19
+msgid "per repository/branch configuration"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:22 manpages/gbp.conf.xml:64
+msgid ".git/gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:23
+msgid "per (local) repository configuration"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:29
+msgid "[DEFAULT]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:31
+msgid "Options in this section apply to all &gbp; commands."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:35
+msgid "[buildpackage]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:36
+msgid ""
+"Options in this section apply to &gbp-buildpackage; only and override "
+"options from the [DEFAULT] section."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:40
+msgid "[import-orig]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:41
+msgid ""
+"Options in this section apply to &gbp-import-orig; only and override options "
+"from the [DEFAULT] section."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:45
+msgid "[import-dsc]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:46
+msgid ""
+"Options in this section apply to &gbp-import-dsc; only and override options "
+"from the [DEFAULT] section."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:50
+msgid "[dch]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:51
+msgid ""
+"Options in this section apply to &gbp-dch; only and override options from "
+"the [DEFAULT] section."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:55
+msgid "..."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:56
+msgid "Same for the other &gbp; commands"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/cfgfile.xml:3
+msgid ""
+"The configuration files are parsed in this order: <placeholder type="
+"\"variablelist\" id=\"0\"/> All have the same format. They consist of "
+"several sections, all of them are optional: <placeholder type=\"variablelist"
+"\" id=\"1\"/> The actual options in these sections are the command line "
+"options without the '--' prefix. So <option>--upstream-branch=</"
+"option><replaceable>dfsgfree</replaceable> would read:"
+msgstr ""
+
+#. type: Content of: <chapter><screen>
+#: chapters/cfgfile.xml:63
+#, no-wrap
+msgid ""
+" <option>upstream-branch</option>=<replaceable>dfsgfree</replaceable>\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/cfgfile.xml:66
+msgid ""
+"in the config file. In the special case of &gbp-buildpackage;, the stripped "
+"prefix is not '--' but '--git-'. Here's a more complete example:"
+msgstr ""
+
+#. type: Content of: <chapter><programlisting>
+#: chapters/cfgfile.xml:70
+#, no-wrap
+msgid ""
+" [DEFAULT]\n"
+" # the default build command\n"
+" builder=debuild -i\\.git -I.git\n"
+" # the default branch for upstream sources\n"
+" upstream-branch=upstream\n"
+" # the default branch for the debian patch\n"
+" debian-branch=master\n"
+"\n"
+" [buildpackage]\n"
+" upstream-branch=dfsgclean\n"
+" # Sign tags with GPG:\n"
+" sign-tags = True\n"
+" # Keyid to sign tags with\n"
+" #keyid = 0xdeadbeef\n"
+"\n"
+" [import-orig]\n"
+" upstream-branch=notdfsgclean\n"
+"\n"
+" [import-dsc]\n"
+" upstream-branch=notdfsgclean\n"
+"\n"
+" [dch]\n"
+" git-log=--no-merges\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/cfgfile.xml:95
+msgid "For more details, see the <xref linkend=\"man.gbp.conf\"/> manual page."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/cfgfile.xml:99
+msgid "Overriding Parsing Order"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/cfgfile.xml:114
+#, no-wrap
+msgid ""
+"\t$ cat <<EOF >~/.gbp.late.conf\n"
+"\t[DEFAULT]\n"
+"\texport-dir = ../build-area\n"
+"\ttarball-dir = ../tarballs\n"
+"\tEOF\n"
+"\n"
+"\t$ export GBP_CONF_FILES=~/.gbp.conf:debian/gbp.conf:~/.gbp.late.conf\n"
+"\t$ cd <mypkg>\n"
+"\t$ gbp config buildpackage.export-dir\n"
+"\t../build-area\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/cfgfile.xml:101
+msgid ""
+"The environment variable <envar>GBP_CONF_FILES</envar> can be used to "
+"override the order in which configuration files are parsed. The following "
+"example parses two configuration files in the users home directory "
+"(<filename>~/.gbp.conf</filename> and <filename>~/.gbp.late.conf</filename>) "
+"and in the debian directory (<filename>debian/gbp.conf</filename>). The "
+"file are parsed from left to right. Since <filename> ~/.gbp.late.conf</"
+"filename> is at the very end of the list it can be used to override "
+"configuration entries shipped by the package. This can be useful if packages "
+"set e.g. <option>export-dir</option> or <option>tarball-dir</option> and you "
+"perfer different locations: <placeholder type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/cfgfile.xml:131
+#, no-wrap
+msgid ""
+"\t$ export GBP_CONFI_FILES=/does/not/exist\n"
+"\t$ gbp config buildpackage.debian-branch\n"
+"\tmaster\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/cfgfile.xml:127
+msgid ""
+"If you want all configuration files to be skipped, set "
+"<envar>GBP_CONF_FILES</envar> to a non existing location. This way only "
+"default values and options from the command line will be used: <placeholder "
+"type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/import.xml:2
+msgid "Importing Sources"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:5
+msgid "Importing already existing &debian; packages"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:8
+#, no-wrap
+msgid " &gbp-import-dsc; package_0.1-1.dsc\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:6
+msgid ""
+"Importing an already existing &debian; package into a &git; repository is as "
+"easy as: <placeholder type=\"programlisting\" id=\"0\"/> This will create a "
+"new &git; repository named after the imported package, put the upstream "
+"sources onto the <option>upstream-branch</option> and the &debian; patch on "
+"the <option>debian-branch</option>. In case of a &debian; native package, "
+"only the <option>debian-branch</option> is being used. You can specify "
+"alternative branch names via the <option>--upstream-branch</option> and "
+"<option>--debian-branch</option> options, or via the <option>upstream-"
+"branch</option> and <option>debian-branch</option> options in the "
+"configuration file."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:20 chapters/import.xml:100
+msgid ""
+"If you want to be able to exactly recreate the original tarball (orig.tar."
+"gz) from &git;, you should also specify the <option>--pristine-tar</option> "
+"option. This is recommended."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:28
+#, no-wrap
+msgid ""
+" cd package/\n"
+" &gbp-import-dsc; package_0.1-2.dsc\n"
+" &gbp-import-dsc; package_0.1-3.dsc\n"
+" &gbp-import-dsc; package_0.2-1.dsc\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:25
+msgid ""
+"If you want to import further versions, you can change into your shiny new "
+"&git; repository and just continue with the same command: <placeholder type="
+"\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:37
+#, no-wrap
+msgid " &gbp-import-dscs; /path/to/history/package_*.dsc\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:35
+msgid ""
+"Or you can import all versions at once using &gbp-import-dscs;: <placeholder "
+"type=\"programlisting\" id=\"0\"/> This will create a &git; repository if "
+"necessary and import all versions sorted by version number."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:46
+#, no-wrap
+msgid " &gbp-import-dscs; --debsnap package\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:42
+msgid ""
+"You can also import all versions of a package known from the <ulink url="
+"\"http://snapshot.debian.org/\">snapshot.debian.org</ulink> service using "
+"the <option>--debsnap</option> option of &gbp-import-dscs;: <placeholder "
+"type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:52 chapters/patches.xml:181
+msgid "Importing a new upstream version"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:56
+#, no-wrap
+msgid ""
+" &gbp-import-orig; <filename>/path/to/package_0.2.orig.tar.gz</filename>\n"
+" &gbp-import-orig; <filename>/path/to/package_0.2.tar.bz2</filename>\n"
+" &gbp-import-orig; <filename>/path/to/package-0.2/</filename>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:53
+msgid ""
+"Change into your &git; repository (which can be empty), make sure it has all "
+"local modifications committed, and run either of: <placeholder type="
+"\"programlisting\" id=\"0\"/> This puts the upstream sources onto the "
+"<option>upstream-branch</option> and tags them accordingly (the default tag "
+"format is <replaceable>upstream/%(version)s</replaceable>)."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:65
+msgid ""
+"The result is then placed onto the <option>debian-branch</option>. The way "
+"this happens is determined by the <option>--merge-mode</option> option. The "
+"default mode <option>auto</option> replaces the upstream sources while "
+"preserving the <filename>debian/</filename> directory for 3.0 (quilt) "
+"packages. A &git; merge is used for all other source format versions."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:74
+msgid ""
+"You can again specify different branch names via the <option>--upstream-"
+"branch</option> and <option>--debian-branch</option> options."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:83
+#, no-wrap
+msgid " &gbp-import-orig; --uscan\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:78
+msgid ""
+"If you are using <filename>debian/watch</filename> to keep track of how to "
+"retrieve upstream sources, you can simply use the <option>--uscan</option> "
+"option to download and import the latest upstream version: <placeholder type="
+"\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:89
+#, no-wrap
+msgid " &gbp-import-orig; <option>--filter</option>=<replaceable>'CVS/*'</replaceable> <filename>/path/to/package_0.2.orig.tar.gz</filename>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:86
+msgid ""
+"You can also filter out content you don't want imported: <placeholder type="
+"\"programlisting\" id=\"0\"/> The <option>--filter</option> option can be "
+"used multiple times for more complex filtering."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:95
+msgid ""
+"If you expect a merge conflict, you can delay the merge to the "
+"<option>debian-branch</option> via the <option>--no-merge</option> option "
+"and pull in the changes from the <option>upstream-branch</option> later."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:104
+msgid ""
+"To customize the commit message used by &gbp-import-orig;, use the <option>--"
+"import-msg</option> option. This string is a &pyformat;, into which the "
+"<replaceable>version</replaceable> variable is interpolated. (i.e., use "
+"<replaceable>%(version)s</replaceable> in your message to get the imported "
+"upstream version)."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:113
+msgid "Recovering from errors"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:114
+msgid ""
+"In case of an error &gbp-import-orig; will by default rollback (undo) all "
+"changes it has done to the repository so far:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/import.xml:118
+#, no-wrap
+msgid ""
+"\t$ &gbp; import-orig --verbose --filter='CVS/*' --filter='.bzr/*' --filter='.hg/*' --filter='.svn/*' --upstream-version=1.9 ../gif2apng-1.9.tar.gz\n"
+"\tgbp:info: Importing '../gif2apng-1.9.tar.gz' to branch 'upstream' (filtering out [\"'CVS/*'\", \"'.bzr/*'\", \"'.hg/*'\", \"'.svn/*'\"])...\n"
+"\tgbp:info: Source package is gif2apng\n"
+"\tgbp:info: Upstream version is 1.9\n"
+"\tgbp:info: Merging to 'master'\n"
+"\tgbp:error: Automatic merge failed.\n"
+"\tgbp:error: Error detected, Will roll back changes.\n"
+"\tgbp:info: Rolling back branch upstream by resetting it to a6733c1f1e190ac0ed4774abc3466e9986a6df5e\n"
+"\tgbp:info: Rolling back branch pristine-tar by resetting it to 0ee24ac614c920e30af82d602882c2ee841c88e5\n"
+"\tgbp:info: Rolling back tag upstream/1.9 by deleting it\n"
+"\tgbp:info: Rolling back branch master by resetting it to ce99782336e83a56e8e579b3cdadf93b0c19e1a8\n"
+"\tgbp:info: Rolling back failed merge of upstream/1.9\n"
+"\tgbp:error: Rolled back changes after import error.\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:133
+msgid ""
+"In this case the import failed due to a merge conflict. Other reasons are "
+"running out of disk space, problems when generating the pristine-tar delta. "
+"If you don't want &gbp-import-orig; to undo changes made to the repository "
+"use the <option>--no-rollback</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:143
+msgid "Converting an existing &git; repository"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:145
+msgid ""
+"If the &git; repository wasn't created with &gbp-import-dsc;, you have to "
+"tell &gbp-buildpackage; and friends where to find the upstream sources."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:149
+msgid "Upstream sources on a branch"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:155
+#, no-wrap
+msgid " &gitcmd; branch -m theupstream-branch upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:160
+#, no-wrap
+msgid ""
+"<command>cat</command> <<EOF > <filename>.git/gbp.conf</filename>\n"
+"[DEFAULT]\n"
+"# this is the upstream-branch:\n"
+"upstream-branch=theupstream-branch\n"
+"EOF\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:151
+msgid ""
+"If the upstream sources are already on a separate branch, things are pretty "
+"simple. You can either rename that branch to the default <option>upstream-"
+"branch</option> name <emphasis>upstream</emphasis> with: <placeholder type="
+"\"programlisting\" id=\"0\"/> or you can tell &gbp-buildpackage; the name of "
+"the branch to use as <option>upstream-branch</option>: <placeholder type="
+"\"programlisting\" id=\"1\"/> If you then use &gbp-import-orig; to import "
+"new upstream sources, they will from now on end up on <emphasis>theupstream-"
+"branch</emphasis> and merged to the <option>debian-branch</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:172
+msgid "Upstream sources not on a branch"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:179
+#, no-wrap
+msgid " &gitcmd; branch upstream $(&gitcmd; log --format='%H' | tail -1)\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:174
+msgid ""
+"If you don't have an upstream branch but started your repository with only "
+"the upstream sources (not the &debian; patch), you can simply branch from "
+"that point. So use &gitkcmd; or &gitcmd;-log to locate the commit-id of that "
+"commit and create the upstream branch from there, e.g.: <placeholder type="
+"\"programlisting\" id=\"0\"/> The important thing here is that the "
+"<envar>COMMIT_ID</envar> specifies a point on the master branch that carried "
+"<emphasis>only</emphasis> the upstream sources and not the &debian; "
+"modifications. The above example assumes that this was the first commit to "
+"that repository."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><warning><para>
+#: chapters/import.xml:186
+msgid ""
+"There's currently no <emphasis>easy</emphasis> way to create the "
+"<option>upstream-branch</option> if you never had the upstream sources as a "
+"single commit. Using &gbp-import-orig; on such repositories might lead to "
+"unexpected merge results."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:190
+msgid ""
+"In order to fix this you can prepend the upstream sources as a single commit "
+"to your tree using &git;'s <ulink url=\"http://git.or.cz/gitwiki/GraftPoint"
+"\">grafts</ulink>. Afterwards you can simply create a branch as explained "
+"above and &gbp-import-orig; will work as expected."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:200
+#, no-wrap
+msgid ""
+" <command>git checkout</command> <option>--orphan</option> <replaceable>upstream</replaceable>\n"
+" <command>git rm</command> <option>-rf</option> <replaceable>.</replaceable>\n"
+" <command>git commit</command> <option>--allow-empty</option> <option>-m</option> <replaceable>'Initial upstream branch.'</replaceable>\n"
+" <command>git checkout</command> <option>-f</option> <replaceable>master</replaceable>\n"
+" # When not using 3.0 (quilt) with the default --merge-mode=auto\n"
+" <command>git merge</command> <option>--allow-unrelated-histories</option> <replaceable>upstream</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:195
+msgid ""
+"Alternatively, if you are only importing source from original tarballs (for "
+"instance when converting from a Subversion repository where the "
+"mergeWithUpstream was set for svn-buildpackage), you can create an empty "
+"upstream branch with the following commands: <placeholder type="
+"\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:212
+msgid "Starting a &debian; package from scratch"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:214
+msgid ""
+"So far, we assumed you already have a &debian; package to start with, but "
+"what if you want to start a new package? First, create an empty repository:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/import.xml:218
+#, no-wrap
+msgid ""
+" <command>mkdir</command> package-0.1\n"
+" <command>cd</command> package-0.1\n"
+" <command>git init</command>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:225
+#, no-wrap
+msgid ""
+" &gbp-import-orig; <option>-u</option> <replaceable>0.1</replaceable> <filename>../package-0.1.tar.gz</filename>\n"
+" <command>dh_make</command>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:222
+msgid ""
+"Then, you import the upstream sources, branch off the <option>upstream-"
+"branch</option> branch and add the &debian; files (e.g. via dh_make): "
+"<placeholder type=\"programlisting\" id=\"0\"/> That's it, you're done. If "
+"you want to publish your new repository, you can use &gbp-create-remote-"
+"repo;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:233
+msgid "When upstream uses Git"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:235
+msgid ""
+"If upstream uses &git; for development (and you don't want to ignore that "
+"fact entirely), there are at least three ways to handle packaging. The first "
+"one uses &git; exclusively and creates the upstream tarballs from the "
+"upstream tag while the second one still uses upstream tarballs but links "
+"your packaging &git; history with upstreams &git; history. The third one "
+"also uses a tarballs but does not link to the upstream history."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:245
+msgid "No upstream tarballs"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:246
+msgid ""
+"If upstream doesn't build upstream tarballs, or you don't care about them, "
+"the simplest way is to clone upstream's repository and create a separate "
+"packaging branch in there. You will not need &gbp-import-orig; at all with "
+"this workflow. &gbp-buildpackage; will handle creating the upstream tarballs "
+"needed for the Debian source package."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:254
+msgid ""
+"For that to work you need to tell &gbp; what the upstream tag format looks "
+"like. Therefore you either use the <option>--git-upstream-tag</option> "
+"command line option or the <option>upstream-tag</option> configuration file "
+"variable to specify upstream's tag format."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:262
+msgid ""
+"For example a common upstream format is to put a <replaceable>v</"
+"replaceable> in front of the version number. In this case, the "
+"configuration option would look like:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/import.xml:268
+#, no-wrap
+msgid ""
+"[DEFAULT]\n"
+"upstream-tag = v%(version)s\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:272
+msgid ""
+"<replaceable>version</replaceable> will be replaced by &gbp; with the "
+"upstream version number as determined from <filename>debian/changelog</"
+"filename>. The <replaceable>%()s</replaceable> might be familiar from "
+"&pyformat;s. The option was placed in the <emphasis>[DEFAULT]</emphasis> "
+"section instead of the <emphasis>[buildpackage]</emphasis> section of the "
+"configuration so other tools like &gbp-dch; make use of it too."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:283
+msgid ""
+"Some upstreams use other formats though and don't separate numbers by dots "
+"but rather by underscore(<replaceable>_</replaceable>), hyphen(<replaceable>-"
+"</replaceable>) or anything else. In order to cope with that you can use "
+"version mangling of these characters via substitution. The substitution "
+"works as follows:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/import.xml:292
+#, no-wrap
+msgid ""
+"[DEFAULT]\n"
+"upstream-tag = v%(version%.%_)s\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:296
+msgid ""
+"This means that each occurrence of <replaceable>.</replaceable> will be "
+"replaced by <replaceable>_</replaceable> in the upstream version number. For "
+"example the upstream version <replaceable>1.2.3</replaceable> as determined "
+"from the <filename>debian/changelog</filename> will be looked up as &git; "
+"tag <replaceable>v1_2_3</replaceable> by &gbp-buildpackage;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:306
+msgid ""
+"If you want the substitution to be the <replaceable>%</replaceable> "
+"character you have to escape it. E.g. <replaceable>%(version%-%\\%)s</"
+"replaceable> will replace <replaceable>-</replaceable> with <replaceable>%</"
+"replaceable>, transforming <replaceable>1-A.B.C</replaceable> to "
+"<replaceable>1%A.B.C</replaceable>. Only a single replacement is supported "
+"and it can only replace a single character."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><warning><para>
+#: chapters/import.xml:312
+msgid ""
+"Since some of the possible mangling characters like <replaceable>_</"
+"replaceable> and <replaceable>%</replaceable> are also used to denote epochs "
+"and tilde revisions these versions can't be reconstructed when mapping from "
+"&git; tags back to &debian; versions and will therefore break other tools "
+"like &gbp-dch;. So use version mangling with care. It's better to come up "
+"with a Debian compatible tag format upstream. See &dep14; for the currently "
+"used expansion rules for Debian version numbers."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:321
+msgid ""
+"If you're using &pristine-tar; you can make &gbp-buildpackage; commit the "
+"generated tarball back to the pristine-tar branch using the <option>--git-"
+"pristine-tar-commit</option> option or you can use &gbp-pristine-tar; after "
+"you've created the tarballs. This will make sure others building your "
+"package can exactly regenerate the tarball you created when building the "
+"&debian; package."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><title>
+#: chapters/import.xml:334
+msgid "Step by step"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para>
+#: chapters/import.xml:335
+msgid ""
+"To not make any assumptions about &gbp;'s configuration, the following steps "
+"have all options given in its long versions on the command line. You can add "
+"these to &gbp.conf; to save lots of typing."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para><programlisting>
+#: chapters/import.xml:344
+#, no-wrap
+msgid ""
+" <command>git clone</command> --no-checkout -o upstream git://git.example.com/libgbp.git\n"
+" <command>cd</command> libgbp\n"
+" <command>git checkout</command> -b debian/sid v1.0\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para>
+#: chapters/import.xml:340
+msgid ""
+"First, we clone the upstream repository. To avoid any ambiguities between "
+"the &debian; packaging repository and the upstream repository, we name the "
+"upstream repository <replaceable>upstream</replaceable> instead of the "
+"default <replaceable>origin</replaceable>. <placeholder type="
+"\"programlisting\" id=\"0\"/> The above makes sure we have "
+"<replaceable>debian/sid</replaceable> for the &debian; packaging. We didn't "
+"create any <replaceable>upstream/*</replaceable> branches; they're not "
+"needed for the packaging and only need to be kept up to date. We started the "
+"branch at the commit corresponding to the tag <replaceable>v1.0</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para><programlisting>
+#: chapters/import.xml:356
+#, no-wrap
+msgid " <command>gbp buildpackage</command> --git-pristine-tar --git-pristine-tar-commit --git-upstream-tag='v%(version)s' --git-debian-branch=debian/sid\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para><programlisting>
+#: chapters/import.xml:361
+#, no-wrap
+msgid ""
+" <command>git fetch</command> upstream\n"
+" <command>git merge</command> v1.1\n"
+" <command>gbp dch</command> --debian-branch=debian/sid --snapshot --auto debian/\n"
+" &gbp-buildpackage; --git-ignore-new --git-pristine-tar --git-pristine-tar-commit --git-upstream-tag='v%(version)s'\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para><programlisting>
+#: chapters/import.xml:371
+#, no-wrap
+msgid ""
+" <command>gbp dch</command> --release --auto --debian-branch=debian/sid\n"
+" <command>git commit</command> -m\"Release 1.1-1\" debian/changelog\n"
+" &gbp-buildpackage; --git-upstream-tag='v%(version)s' --git-debian-branch=debian/sid\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para>
+#: chapters/import.xml:353
+msgid ""
+"After adding the &debian; packaging, we build the package. This assumes "
+"you're using &pristine-tar; and upstream uses a version number format as "
+"described above: <placeholder type=\"programlisting\" id=\"0\"/> When "
+"updating to a new upstream version, we simply fetch from upstream and merge "
+"in the new tag. Afterwards, we update the changelog and build the package: "
+"<placeholder type=\"programlisting\" id=\"1\"/> Note that the above &gbp-"
+"dch; call makes sure we only pickup changes in the <filename>debian/</"
+"filename> directory. Since we told it to build a snapshot changelog entry "
+"and we hadn't commit the changelog yet, we need to tell &gbp-buildpackage; "
+"that the working directory is unclean via the <option>--git-ignore-new</"
+"option> option. Once everything looks good, commit the changelog and build "
+"a release version: <placeholder type=\"programlisting\" id=\"2\"/> If you "
+"want to share your repository with others, you can use &gbp-create-remote-"
+"repo; and &gbp-pull; as usual."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:381
+msgid "Upstream tarballs and linked upstream history"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:388
+#, no-wrap
+msgid " &gbp-import-orig; --upstream-vcs-tag=v0.0.1 foo_0.0.1.orig.tar.gz\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:382
+msgid ""
+"If you want to track upstream's &git; but continue to import the upstream "
+"tarballs, e.g. to make sure the tarball uploaded to &debian; has the same "
+"checksum as upstream's, you can use the <option>--upstream-vcs-tag</option> "
+"option when importing new tarballs with &gbp-import-orig;. Assuming you have "
+"the upstream source in your repository with a tag <replaceable>v0.0.1</"
+"replaceable>, you can use: <placeholder type=\"programlisting\" id=\"0\"/> "
+"to add upstream's tag as additional parent to the merge commit. See <ulink "
+"url=\"http://bugs.debian.org/664771\">#664771</ulink> for more details."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:396
+msgid "Upstream tarballs and separate upstream history"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:404
+#, no-wrap
+msgid ""
+" &gitcmd; remote add upstream https://upstream.example.com/upstream.git\n"
+" &gitcmd; fetch upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:398
+msgid ""
+"If you want to have upstream's &git; history available but don't want to "
+"link it to your packaging history you can simply keep it as a separate "
+"history. E.g. if you already have a &git; repository with your packaging, "
+"change into that repository and do: <placeholder type=\"programlisting\" id="
+"\"0\"/> This will pull in upstream's &git; history into your repo but since "
+"your packaging commits and upstreams commits have no common parents the two "
+"histories will stay nicely separated. Of course you can browse it and "
+"cherry-pick from it but any remote repos you push to will not get upstream's "
+"history by default unless you push any of upstream's refs."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><warning><para>
+#: chapters/import.xml:415
+msgid ""
+"Since &git; has a single tag namespace pushing changes with <command>git "
+"push --tags</command> will push upstream's tags (and therefore it's history) "
+"too so be sure to only push dedicated tag names."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:426
+msgid "Branch layout"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:428
+msgid ""
+"By default, &gbp; uses one branch to keep the &debian; packaging called "
+"<emphasis>master</emphasis> and a branch to keep the upstream packaging "
+"called <emphasis>upstream</emphasis>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:432
+msgid ""
+"This layout is simple to get started but falls short if one needs to "
+"maintain several versions of the package at the same time. Therefore the "
+"following the &dep14; layout is recommended:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><term>
+#: chapters/import.xml:439
+msgid "debian/<release>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><listitem><para>
+#: chapters/import.xml:443
+msgid ""
+"the &debian; packaging for a release <emphasis>jessie</emphasis>, "
+"<emphasis>stretch</emphasis>, <emphasis>sid</emphasis>, <emphasis>jessie</"
+"emphasis>, <emphasis>jessie-backports</emphasis>, <emphasis>jessie-security</"
+"emphasis> or <emphasis>experimental</emphasis>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><term>
+#: chapters/import.xml:451
+msgid "upstream/latest"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><listitem><para>
+#: chapters/import.xml:455
+msgid "the latest upstream sources."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><term>
+#: chapters/import.xml:461
+msgid "dfsg/latest"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><listitem><para>
+#: chapters/import.xml:465
+msgid ""
+"the DFSG-clean upstream sources in case the cleanup is done via a &git; "
+"merge from upstream to this branch."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:472
+msgid ""
+"In case &pristine-tar; is being used, there will be a single "
+"<emphasis>pristine-tar</emphasis> branch that keeps all binary deltas."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/intro.xml:2
+msgid "Introduction"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/intro.xml:4
+msgid ""
+"Welcome to git-buildpackage (short &gbp;), a system that integrates the "
+"<ulink url=\"http://www.debian.org/\">Debian</ulink> package build system "
+"with <ulink url=\"http://git.or.cz/\">Git</ulink>. The most recent version "
+"of this manual can be found &manual;."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/intro.xml:10
+msgid "This is what &gbp; can do for you:"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:12
+msgid "Initially import an existing &debian; package into &git;"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:13
+msgid ""
+"Incrementally import new versions of a Debian package into &git; e.g. for "
+"importing NMUs or to maintain downstream modifications"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:16
+msgid ""
+"Import new upstream versions from tarballs with optionally filters applied"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:17
+msgid "Recreate the upstream tarball from information stored in &git;"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:18
+msgid ""
+"Maintain a consistent branch and tag naming within a &git; repository, "
+"across repositories or across a team of developers"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:20
+msgid "Automatically sign generated tags"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:21
+msgid ""
+"Make sure you have committed all changes to the right branch before building "
+"and releasing"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:24
+msgid ""
+"Execute hooks at various points of the package build process e.g. to "
+"automatically push changes to remote repositories"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:28
+msgid "Integrate the build process with cowbuilder or other builders"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:29
+msgid "Export to a clean build area before building the package"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:30
+msgid "Generate debian/changelog automatically"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:31
+msgid "Manage your quilt patches when using 3.0 (quilt) source format"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/intro.xml:34
+msgid ""
+"All of this is (hopefully) being done without restricting the user to "
+"certain usage patterns."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/intro.xml:38
+msgid "Repository Layout and Terminology"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><footnote><para>
+#: chapters/intro.xml:40
+msgid "this, of course, has no meaning for &debian; native packages"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><footnote><para>
+#: chapters/intro.xml:45
+msgid "corresponding to the command line and config file options"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:39
+msgid ""
+"It is recommended to have the &debian; packaging on a separate branch than "
+"the upstream source <placeholder type=\"footnote\" id=\"0\"/>. This is "
+"necessary to be able to import and merge in new upstream versions via &gbp-"
+"import-orig;. To distinguish these two branches, the following terminology "
+"<placeholder type=\"footnote\" id=\"1\"/> is used:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><itemizedlist><listitem><para>
+#: chapters/intro.xml:49
+msgid ""
+"The <option>debian-branch</option> (the default branch name used in the "
+"&git; repository is <emphasis>master</emphasis>) holds your current "
+"development work. That's the branch you usually cut your releases from and "
+"the default branch new upstream releases are merged onto."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><itemizedlist><listitem><para>
+#: chapters/intro.xml:55
+msgid ""
+"The <option>upstream-branch</option> (the default branch name used in the "
+"&git; repository is <emphasis>upstream</emphasis>) holds the upstream "
+"releases. This can either be a branch you import to or a branch of an "
+"upstream &git; repository you pull from."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><itemizedlist><listitem><para>
+#: chapters/intro.xml:61
+msgid ""
+"The <option>pristine-tar branch</option> (the default branch name used in "
+"the &git; repository is <emphasis>pristine-tar</emphasis>) holds the "
+"necessary additional information to recreate the original tarball from the "
+"<option>upstream-branch</option>. In order to use this feature, you need to "
+"install the &pristine-tar; package."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><itemizedlist><listitem><para>
+#: chapters/intro.xml:68
+msgid ""
+"There can be one or more <option>patch-queue</option> branches. Every patch-"
+"queue branch is related to a <option>debian-branch</option>. If the "
+"<option>debian-branch</option> is called <emphasis>master</emphasis>, the "
+"corresponding patch-queue branch is called <emphasis>patch-queue/master</"
+"emphasis>. The patch-queue branch is the &debian; branch plus the contents "
+"of <emphasis>debian/patches</emphasis> applied. These branches are managed "
+"with &gbp-pq;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:79
+msgid ""
+"You're completely free to pick any repository layout; the branch names above "
+"are only &gbp;'s defaults. They can be changed at any point in time, and you "
+"can work with an arbitrary number of branches. For example, branches like "
+"<emphasis>nmu</emphasis>, <emphasis>backports</emphasis> or "
+"<emphasis>stable</emphasis> might (temporarily or permanently) become your "
+"<option>debian-branch</option>, and branches like <emphasis>dfsg</emphasis> "
+"or <emphasis>snapshots</emphasis> might become your <option>upstream-branch</"
+"option>—it doesn't matter if these branches are maintained with &gbp-"
+"import-orig; or not."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:91
+msgid ""
+"A recommended branch layout is described in <xref linkend=\"gbp.branch.naming"
+"\"/>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:94
+msgid ""
+"Since &gbp-buildpackage; only works with local &git;-repositories, you have "
+"to use <command>git push</command> in order to publish your changes to "
+"remote repositories like <ulink url=\"http://git.debian.org/\">git.debian."
+"org</ulink>; this can be automated with &gbp-buildpackage;'s <option>post-"
+"tag</option> hook."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/intro.xml:103
+msgid "Workflow"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:105
+msgid "A typical, simple workflow consists of the following steps:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:108
+msgid ""
+"Initially import a &debian; package via &gbp-import-dsc;. This imports the "
+"&debian; Package on the <option>debian-branch</option> and the upstream "
+"sources on the <option>upstream-branch</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:111
+msgid ""
+"Develop, test, commit changes. During this time, you can always build the "
+"package with &gbp-buildpackage;. In case you have uncommitted changes in "
+"your source tree, you can use the <option>--git-ignore-new</option> option."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:115
+msgid ""
+"Optionally you can create the &debian; changelog entries using &gbp-dch; and "
+"create snapshot releases for testing using its <option>--snapshot</option> "
+"option."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:118
+msgid ""
+"Once satisfied, you can build the final package with &gbp-buildpackage; "
+"<option>--git-tag</option>. This additionally creates a tag within &git; so "
+"you can switch back to that version later at any time. The format of the "
+"tags can be specified; tags can be &gpg; signed."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:123
+msgid ""
+"When a new upstream version is released and upstream isn't using &git;, you "
+"can import the new version via &gbp-import-orig; onto the <option>upstream-"
+"branch</option>. &gbp-import-orig; will by default try to merge the new "
+"upstream version onto the <option>debian-branch</option> (you can skip the "
+"merge with <option>--no-merge</option>). After resolving any potential "
+"conflicts, go back to the second step."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:131
+msgid ""
+"These steps will be explained in more details in the following sections."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/patches.xml:2
+msgid "Working with Patches"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:5
+msgid ""
+"&gbp-pq; can be used to manage patches that modify the upstream source "
+"inside <filename>debian/patches/</filename>. This is mostly intended for 3.0 "
+"(quilt) format source packages."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:12
+msgid ""
+"The basic idea is that patches are imported from your &debian-branch; to a "
+"patch-queue branch with one patch file in <filename>debian/patches/</"
+"filename> becoming one commit on the the patch-queue branch. The created "
+"branch will be named after the branch you imported from with <filename>patch-"
+"queue/</filename> prepended. So if you do your &debian; packaging on "
+"<filename>debian/sid</filename> and do a"
+msgstr ""
+
+#. type: Content of: <chapter><programlisting>
+#: chapters/patches.xml:22
+#, no-wrap
+msgid " &gbp-pq-import;\n"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:25
+msgid ""
+"then the newly created branch will be called <filename>patch-queue/debian/"
+"sid</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:29
+msgid ""
+"On the patch-queue branch you can work on the commits using familiar &git; "
+"commands (rebase, commit --amend, etc). When done, &gbp-pq; will be used to "
+"turn the commits on the patch-queue branch into patch in <filename>debian/"
+"patches/</filename> files again."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:37
+msgid ""
+"This workflow facilitates e.g. the cherry-picking of patches for stable "
+"releases, the forward-porting of patches to new upstream versions by using "
+"git rebase on the patch-queue branch (patches already applied upstream are "
+"detected automatically) as well as the reordering, dropping and renaming of "
+"patches without having to resort to &quilt;. The generated patches in "
+"<filename>debian/patches/</filename> have all the necessary information to "
+"forward them upstream since they use a format similar to <command>git-format-"
+"patch</command>."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:49
+msgid ""
+"The main drawback of this workflow is the lack of history on the patch-queue "
+"branch since it is frequently droppend and recreated. But there is full "
+"history on the your &debian-branch;, of course."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:56
+msgid ""
+"Also, beware that &gbp-pq; currently has incomplete support for <ulink url="
+"\"https://dep-team.pages.debian.net/deps/dep3/\">DEP3</ulink> headers. "
+"Initially, parsing with <command>git-mailinfo(1)</command> is attempted, "
+"which supports only the <computeroutput>From</computeroutput> and "
+"<computeroutput>Subject</computeroutput> fields. If neither of these are "
+"present, &gbp-pq; will attempt to convert the patch from DEP3 format into a "
+"<command>git-mailinfo(1)</command> compatible format. This involves first "
+"loading <computeroutput>From</computeroutput> using the "
+"<computeroutput>Author</computeroutput> field and <computeroutput>Subject</"
+"computeroutput> using the first line of the <computeroutput>Description</"
+"computeroutput> field. Then, any additional fields (such as "
+"<computeroutput>Origin</computeroutput> and <computeroutput>Forwarded</"
+"computeroutput>), and the remainder of the <computeroutput>Description</"
+"computeroutput> (if any), will be appended to the body."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/patches.xml:74
+msgid "Basic Workflow"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:77
+msgid ""
+"This example assumes you're working on a source 3.0 (quilt) format package "
+"with patches in <filename>debian/patches</filename> parseable by "
+"<command>git-quiltimport(1)</command>. The git branch currently checked out "
+"is named <filename>debian/sid</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:85
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-unapplied.png\" format=\"PNG\"/"
+"> </imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:90
+msgid "The &debian-branch; we start from."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:95
+msgid ""
+"Let's first create the patch-queue branch and import the contents of "
+"<filename>debian/patches</filename> onto it using &gbp-pq;"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:101
+#, no-wrap
+msgid ""
+" <command>cd <replaceable>REPO</replaceable></command>\n"
+" &gbp-pq; import\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/patches.xml:108
+#, no-wrap
+msgid ""
+" gbp:info: Trying to apply patches at 'aaa1011bfd5aa74fea43620aae94709de05f80be'\n"
+" gbp:info: 18 patches listed in 'debian/patches/series' imported on 'patch-queue/debian/sid'\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:106
+msgid ""
+"This will generate output like: <placeholder type=\"screen\" id=\"0\"/> What "
+"happened is that &gbp-pq; imported each patch file and switched you to the "
+"newly created patch-queue branch (<filename>patch-queue/debian/sid</"
+"filename>) automatically."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:117
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-applied.png\" format=\"PNG\"/> "
+"</imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:122
+msgid ""
+"The patch-queue branch with patches from <filename>debian/patches</filename> "
+"applied."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:129
+msgid ""
+"Now you can work on the patch-queue branch (add, remove, rebase, test) to "
+"get your patches into shape:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><itemizedlist><listitem><para>
+#: chapters/patches.xml:134
+msgid ""
+"To add what will later become a patch in <filename>debian/patches/</"
+"filename> simply make a commit. The first line of the commit message will "
+"become the patch name later. The following lines include the details of "
+"what the patch does."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><itemizedlist><listitem><para>
+#: chapters/patches.xml:143
+msgid ""
+"To remove or edit commits use git rebase -i . The git documentation explains "
+"how to work with git-rebase."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:151
+msgid ""
+"Once satisfied with the commits let's regenerate the patches in "
+"<filename>debian/patches/</filename> using &gbp-pq;. This will switch you "
+"back to the branch <filename>debian/sid</filename> and regenerate the "
+"patches using a method similar to <command>git-format-patch</command>:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:159
+#, no-wrap
+msgid " &gbp-pq; export\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:162
+msgid "You can now commit the result by using:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:164
+#, no-wrap
+msgid ""
+" &gitcmd; add debian/patches\n"
+" &gitcmd; commit\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:168
+msgid ""
+"If you don't want to commit the result by hand each time you can also pass "
+"<option>--commit</option> to the &gbp; <option>export</option> command above."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:174
+msgid ""
+"Next you can update <filename>debian/changelog</filename> (e.g. by running "
+"\"&gbp-dch; <option>-S</option> <option>-a</option>\") and build the package "
+"as usual."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:184
+msgid "To update your patches for a new upstream version one"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:189
+msgid ""
+"Imports the current patches onto the patch-queue branch (if not done "
+"already) using &gbp-pq-import;. This will allow you to rebase the patches on "
+"the new upstream version later."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:196
+msgid ""
+"Imports the new upstream version with &gbp-import-orig; <option>--uscan</"
+"option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:202
+msgid ""
+"Rebases the patches onto the new upstream version using &gbp-pq-rebase;. "
+"This will bring the patches up to date regarding the new upstream version. "
+"Patches already applied upstream can be dropped and remaining patches can be "
+"modified to apply to the new version."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:211
+msgid ""
+"Exports the patches to <filename>debian/patches</filename> using &gbp-pq-"
+"export;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:218
+msgid ""
+"But don't worry if you forgot to do so before importing the new version (or "
+"if another team member imported the version already)."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:223
+msgid ""
+"In this case you can make &gbp-pq; figure out where to apply the patches by "
+"using the <option>--time-machine=</option> option. The following command"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:229
+#, no-wrap
+msgid " &gbp-pq-import; --force --time-machine=10\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><footnote><para>
+#: chapters/patches.xml:236
+msgid ""
+"This is not necessarily your debian-branch; HEAD since the new upstream "
+"version might have changed so that the patches no longer apply cleanly there."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:233
+msgid ""
+"would drop your current patch-queue branch (if existent) and create a new "
+"one by going back in your commit history as far as 10 commits to find a "
+"place where your patches still apply <placeholder type=\"footnote\" id=\"0\"/"
+">. If it finds such a commit on your &debian-branch; it will create the "
+"patch-queue branch from there and switch you to that branch. You can now "
+"rework your patches to apply to the new upstream version by using &gbp-pq-"
+"rebase;:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:247
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-time-machine.png\" format=\"PNG"
+"\"/> </imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:252
+msgid "The patch-queue branch and &debian-branch; after importing the patches."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:259
+#, no-wrap
+msgid " &gbp-pq-rebase;\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:263
+msgid "or you can invoke &gitcmd; <option>rebase</option> directly:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:267
+#, no-wrap
+msgid " &gitcmd; rebase -i debian/sid\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:271
+msgid ""
+"Should the rebase fail (e.g. because the upstream source changed at the same "
+"place your patches modify the code) you can resolve this by using the "
+"options of &gitcmd; <option>rebase</option> (if you simply want to abort use "
+"&gitcmd; <option>rebase</option> <option>--abort</option>)."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:279
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-rebase.png\" format=\"PNG\"/> </"
+"imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:284
+msgid ""
+"The patch-queue branch after rebasing the patches. Patches that were merged "
+"upstream were dropped."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:291
+msgid "Once done you can export your commits to patch files again:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><programlisting>
+#: chapters/patches.xml:294 chapters/patches.xml:345
+#, no-wrap
+msgid " &gbp-pq-export; --commit\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:298
+msgid "The export will also switch you back to the &debian-branch;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:301
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-export.png\" format=\"PNG\"/> </"
+"imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:306
+msgid ""
+"The &debian-branch; after exporting the patches and committing the changes."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:312
+msgid ""
+"See this in action in a <ulink url=\"https://honk.sigxcpu.org/piki/projects/"
+"git-buildpackage/videos/gbp-pq-new-upstream-version.ogv\">short video</"
+"ulink>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/patches.xml:319
+msgid "Adding your first patch"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:322
+msgid ""
+"If a package doesn't have any patches yet, these are the steps to add your "
+"first patch:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para><programlisting>
+#: chapters/patches.xml:330
+#, no-wrap
+msgid " &gbp-pq-import;\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:327
+msgid ""
+"Launch an import. If there's nothing to import &gbp-pq; will just create an "
+"empty branch and switch your working copy to it: <placeholder type="
+"\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:336
+msgid ""
+"Create your first patch: edit files, test, commit your changes using "
+"<command>git commit</command>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:342
+msgid "To generate the new Quilt patch set use"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:348
+msgid ""
+"This will switch you back to your &debian-branch; branch, generate the "
+"patches and commit them right away to this branch."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:353
+msgid ""
+"Skip the <option>--commit</option> if you don't want to commit right away. "
+"If you want to pick the changelog message from the patch see <filename>/usr/"
+"share/doc/git-buildpackage/examples/gbp-add-patch</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/patches.xml:363
+msgid "Team maintenance"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:365
+msgid ""
+"The easiest way is to not push out any patch-queue/* branches at all. They "
+"can be recreated by any team member easily by using"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:369
+#, no-wrap
+msgid " &gbp-pq-import; --force\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:373
+msgid ""
+"The patch-queue branch can also be re-created when pulling (this will "
+"additionally drop your current patch-queue branch and recreate it from "
+"<filename>debian/patches</filename>):"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:377
+#, no-wrap
+msgid " &gbp-pull; --redo-pq\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:381
+msgid ""
+"Note that you can push out patch-queue branches. Other team members must "
+"just be aware that branches in the patch-queue/ namespace are being rebased "
+"frequently and therefore cause non fast-forward updates."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/releases.xml:2
+msgid "Releases and Snapshots"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/releases.xml:5
+msgid ""
+"The &changelog; gives the &debian; package a version number and keeps track "
+"of changes made to the package in a particular version. While the changelog "
+"can still be maintained by hand we can make use of &gbp-dch; to have our "
+"&git; commit messages end up in &changelog;. This avoids the double "
+"maintenance of the &git; commit history and the &debian; changelog. If you "
+"don't want a one to one mapping of changelog entries to &git; commits you're "
+"free to edit the changelog by hand at any point."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/releases.xml:16
+msgid ""
+"Not committing changelog entries with the actual modifications also has the "
+"advantage that the changelog won't cause any trouble when cherry-picking "
+"patches from different branches. It can be created when releasing the "
+"package or after performing several commits. Invocations of &dch; and &gbp-"
+"dch; can be mixed."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/releases.xml:24
+msgid "Maintaining <filename>debian/changelog</filename>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/releases.xml:26
+msgid "Creating &changelog; just before the release"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:28
+msgid ""
+"The simplest way is doing all the changes to the <option>debian-branch</"
+"option> without touching <filename>debian/changelog</filename> at all. Then, "
+"when done, do:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/releases.xml:33 chapters/releases.xml:115
+#, no-wrap
+msgid "&gbp-dch; <option>--release</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:36
+msgid ""
+"This will look up the latest released version in the changelog, increment "
+"the version in the &debian; changelog, generate changelog messages from the "
+"corresponding &git; commit id up to the branch head, and finally spawns an "
+"editor for final changelog editing."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/releases.xml:43
+msgid "Incrementally filling &changelog;"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/releases.xml:49
+#, no-wrap
+msgid "&gbp-dch;\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:45
+msgid ""
+"You can run &gbp-dch; without any options to make it add all commit messages "
+"since the last &debian; tag to a new UNRELEASED changelog section: "
+"<placeholder type=\"programlisting\" id=\"0\"/> You can then commit the "
+"<filename>debian/changelog</filename> to have your current changes recorded. "
+"Later invocations of &gbp-dch; will check when <filename>debian/changelog</"
+"filename> was last modified and not add these commits again. Upon your last "
+"call of &gbp-dch; before releasing the package add <option>--release</"
+"option> again to have the <emphasis>UNRELEASED</emphasis> distribution in "
+"the changelog turned into <emphasis>unstable</emphasis>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/releases.xml:64
+msgid "Creating snapshots with increasing version numbers"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:66
+msgid ""
+"The downside of the above methods is that you either have the version number "
+"of the last release in &changelog; or that you have a changelog entry with "
+"<emphasis>UNRELEASED</emphasis> that has the same version number for all "
+"commits you do during the development cycle of your package. Although this "
+"is common practice in &debian; it means that also all your test builds have "
+"the same version number which makes them hard to distinguish in e.g. "
+"continuous integration pipelines."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:77
+msgid ""
+"To address these shortcomings &gbp-dch; has a <option>--snapshot</option> "
+"option that can be used to create (unreleased) snapshots for intermediate "
+"testing with a version number that is lower than the one of the final "
+"package:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/releases.xml:83 chapters/releases.xml:103
+#, no-wrap
+msgid "&gbp-dch; <option>--snapshot</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:86
+msgid ""
+"will generate a snapshot release with a specially crafted version number and "
+"a warning in the changelog that this is a snapshot release:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/releases.xml:90
+#, no-wrap
+msgid ""
+"git-buildpackage (0.3.7~1.gbp470ce2) UNRELEASED; urgency=low\n"
+"\n"
+" ** SNAPSHOT build @470ce29ec7877705c844474a2fd89869aea0406d **\n"
+"\n"
+" * add support for automatic snapshot \n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:97
+msgid ""
+"During subsequent calls with <option>--snapshot</option>, this version "
+"number will continue to increase. Since the snapshot banner contains the "
+"commit id of the current branch HEAD, &gbp-dch; can figure out what to "
+"append to the changelog by itself (even without committing the changelog "
+"first): <placeholder type=\"programlisting\" id=\"0\"/> will fetch the "
+"commit id from &changelog; and add changelog entries from that point to the "
+"current HEAD—again auto incrementing the version number. If you don't "
+"want to start at that commit id, you can specify any id or tag with:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/releases.xml:109
+#, no-wrap
+msgid "&gbp-dch; <option>--since</option>=<replaceable>e76a6a180a57701ae4ae381f74523cacb3152780</replaceable> <option>--snapshot</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:112
+msgid ""
+"After testing, you can remove the snapshot header by a final &gbp-dch; call:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:118
+msgid ""
+"This will pick new commit if present and remove the specially crafted "
+"version number and the snapshot header. If you want finer control of what is "
+"being added you can again use the <option>--since</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/releases.xml:123
+msgid "Customizing snapshot numbers"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:124
+msgid ""
+"If the auto incrementing of the snapshot number doesn't suite your needs, "
+"you can give any Python expression that evaluates to a positive integer to "
+"calculate the new snapshot number:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/releases.xml:128
+#, no-wrap
+msgid ""
+"&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>1</replaceable>\n"
+"&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>'snapshot + 2'</replaceable>\n"
+"&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>'os.popen(\"git-log --pretty=oneline | wc -l\").readlines()[0]'</replaceable>\n"
+"&gbp-dch; <option>-S</option> <option>-a</option> <option>--snapshot-number</option>=<replaceable>`git-log --pretty=oneline debian/0.3.3 | wc -l`</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:134
+msgid ""
+"You can also add the snapshot-number calculation to <filename>gbp.conf</"
+"filename>:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/releases.xml:137
+#, no-wrap
+msgid ""
+"[DEFAULT]\n"
+"snapshot-number = os.popen(\"git-log --pretty=oneline | wc -l\").readlines()[0]\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/releases.xml:144
+msgid "Tuning commit messages"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:146
+msgid ""
+"You can use <option>--full</option> to include the full commit message in "
+"the changelog. If you want to tweak the formatting there's a <option>--"
+"customizations</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:155
+#, no-wrap
+msgid ""
+"New upstream version\n"
+"\n"
+"Closes: #1000\n"
+"Thanks: cool upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:162
+#, no-wrap
+msgid " * New upstream version (Closes: #1000) - thanks to cool upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:151
+msgid ""
+"Additionally, there are tags <option>Closes:</option> and <option>Thanks:</"
+"option> available to customize the commit message. Each tag has to start at "
+"the beginning of a single line. For example, the git commit message "
+"<placeholder type=\"screen\" id=\"0\"/> would result in a changelog entry: "
+"<placeholder type=\"screen\" id=\"1\"/> You can use the <option>Closes:</"
+"option> tag multiple times."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:167
+msgid ""
+"There are several tags to further customize what (and how) commit messages "
+"get included into the changelog:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:171
+msgid "To exclude a commit from the generated changelog, use:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:175
+#, no-wrap
+msgid "Gbp-Dch: Ignore\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:181
+#, no-wrap
+msgid ""
+"Set correct branchnames in debian/gbp.conf\n"
+"\n"
+"Gbp-Dch: Ignore\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:174
+msgid ""
+"<placeholder type=\"screen\" id=\"0\"/> This is e.g. useful if you're just "
+"fixing up a previous commit and couldn't amend it, or for other janitorial "
+"commits that really don't need to end up in the changelog. For example, the "
+"following git commit message <placeholder type=\"screen\" id=\"1\"/> will "
+"not show up in the generated changelog in any way."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:190
+#, no-wrap
+msgid "Gbp-Dch: Full\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:188
+msgid ""
+"To include the full commit message in the changelog, use: <placeholder type="
+"\"screen\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:196
+#, no-wrap
+msgid "Gbp-Dch: Short\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:194
+msgid ""
+"To only include the short description in the changelog and skip the body, "
+"use: <placeholder type=\"screen\" id=\"0\"/> The latter only takes effect "
+"when running &gbp-dch; with the <option>--full</option> option since "
+"including only the short description is the default."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:203
+msgid ""
+"Usually, changelog entries should correspond to a single &git; commit. In "
+"this case, it's convenient to include the commit id in the changelog entry. "
+"This has the advantage that it's easy for people to identify changes without "
+"having to write very extensive changelog messages—the link back to "
+"&git; can be automated via the <option>Vcs-Browser</option> and <option>Vcs-"
+"Git</option> fields in <filename>debian/control</filename>. See <ulink url="
+"\"https://honk.sigxcpu.org/cl2vcs\"> Cl2vcs</ulink> for how this looks."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:219
+#, no-wrap
+msgid " * [571bfd4] New upstream version (Closes: #1000) - thanks to cool upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:215
+msgid ""
+"The inclusion of the commit id can be done automatically via &gbp-dch;'s "
+"<option>--id-length</option> option. Using <option>--id-length</"
+"option>=<replaceable>7</replaceable> would change the above example to: "
+"<placeholder type=\"screen\" id=\"0\"/> This makes it much easier to see "
+"which commit actually fixed bug #1000."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/special.xml:2
+msgid "Special Use Cases"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:4
+msgid "Handling non-DFSG clean upstream sources"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:5
+msgid ""
+"If you have to handle non-DFSG clean upstream sources, you can use a "
+"different branch which you have to create once:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:9
+#, no-wrap
+msgid " &gitcmd; branch dfsg_clean upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:12
+msgid ""
+"This creates the <emphasis>dfsg_clean</emphasis> branch from the tip of a "
+"branch called <emphasis>upstream</emphasis>. Then, when importing a new "
+"upstream version, you import the new version on the <option>upstream-branch</"
+"option> (by default named <emphasis>upstream</emphasis>) as usual and just "
+"don't merge to the <emphasis>debian-branch</emphasis> (by default named "
+"<emphasis>master</emphasis>):"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:21
+#, no-wrap
+msgid ""
+" &gbp-import-orig; --no-merge <filename>/path/to/nondfsg-clean-package_10.4.orig.tar.gz</filename>\n"
+" &gitcmd; <option>tag</option> 10.4\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:25
+msgid ""
+"After the import, you can switch to the <emphasis>dfsg_clean</emphasis> "
+"branch and get the newly imported changes from the upstream branch:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:29
+#, no-wrap
+msgid ""
+" &gitcmd; <option>checkout</option> dfsg_clean\n"
+" &gitcmd; <option>pull</option> <filename>.</filename> upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:32
+msgid ""
+"Now make this checkout dfsg clean (preferably by a cleanup script), commit "
+"your changes and merge to your <option>debian-branch</option>:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:35
+#, no-wrap
+msgid ""
+" cleanup-script.sh\n"
+" &gitcmd; commit -a -m \"Make source dfsg clean\"\n"
+" &gitcmd; tag <replaceable>10.4.dfsg</replaceable>\n"
+" &gitcmd; checkout <replaceable>master</replaceable>\n"
+" &gitcmd; pull <replaceable>.</replaceable> <replaceable>dfsg_clean</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:44
+msgid "Importing NMUs"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:46
+msgid ""
+"First, create a branch that holds the NMUs from the tip of your "
+"<option>debian-branch</option> (default is <emphasis>master</emphasis>) once:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:50
+#, no-wrap
+msgid " &gitcmd; <option>branch</option> <replaceable>nmu</replaceable> <replaceable>master</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:53
+msgid ""
+"To import an NMU, change into the git repository and use &gbp-import-dsc;:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:56
+#, no-wrap
+msgid ""
+" &gitcmd; checkout <replaceable>master</replaceable>\n"
+" &gbp-import-dsc; <option>--debian-branch</option>=<replaceable>nmu</replaceable> <filename>/path/to/package_1.0-1nmu0.dsc</filename>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:60
+msgid ""
+"This will import the NMU onto the branched named <emphasis>nmu</emphasis> "
+"instead of the default <option>master</option>. This method can also be used "
+"to import \"old\" releases into the &git; repository when migrating to &git; "
+"from another VCS."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:68
+msgid "Building with &cowbuilder;"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:70
+msgid ""
+"&cowbuilder; is nice tool to build Debian packages in a defined "
+"environment. It makes sure all build-dependencies are specified correctly "
+"by building the package in a clean chroot. As its cousin &pbuilder; it can "
+"be extended via hooks to (e.g. run autopkg tests) but doesn't need a tarball "
+"unpacked but uses copy on write tree to speed up the build."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:79
+msgid ""
+"Since &cowbuilder; uses different command line arguments than &debuild; and "
+"&dpkg-buildpackage;, we can't simply pass the options to run it on the "
+"command line. To simplifiy the integration we use a separate helper named "
+"&git-pbuilder;. &gbp; has it's own command line option for this:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:86
+#, no-wrap
+msgid " &gbp-buildpackage; <option>--git-pbuilder</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:89
+msgid ""
+"This will set the build command to run &git-pbuilder; (which invokes "
+"&cowbuilder; by default) and the clean command to <command>/bin/true</"
+"command>. It also activates the parsing of several &git-pbuilder; related "
+"options like <option>--git-dist</option>, <option>--git-arch</option> and "
+"<option>--git-pbuilder-options</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:98
+msgid ""
+"We can make &git-pbuilder; usage the default by adding it to <filename>~/."
+"gbp.conf</filename>:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:102
+#, no-wrap
+msgid ""
+"cat <<EOF > <filename>~/.gbp.conf</filename>\n"
+"[DEFAULT]\n"
+"# We invoke cowbuilder via git-pbuilder. Arguments passed to &gbp-buildpackage;\n"
+"# will be passed to dpkg-buildpackage in the chroot\n"
+"pbuilder = True\n"
+"EOF\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/special.xml:115
+#, no-wrap
+msgid " &gbp-buildpackage; --git-pbuilder --git-dist=jessie\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:110
+msgid ""
+"<command>git-pbuilder</command> defaults to building a package for the "
+"<envar>sid</envar> distribution. If you want to build for another "
+"distribution, pass this in the <option>--git-dist</option> option: "
+"<placeholder type=\"programlisting\" id=\"0\"/> If you want to use "
+"<command>debuild</command> again (without modifying <filename>~/.gbp.conf</"
+"filename>), you can use:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:122
+#, no-wrap
+msgid " &gbp-buildpackage; --git-no-pbuilder\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:125
+msgid ""
+"In order for all of the above to work you have to create a base chroot first "
+"using &git-pbuilder;:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:129
+#, no-wrap
+msgid " <command>git-pbuilder</command> create\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:132
+msgid "This can later be updated using:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:135
+#, no-wrap
+msgid " <command>git-pbuilder</command> update\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:140
+msgid "Working on random packages"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/special.xml:145
+#, no-wrap
+msgid ""
+" &gbp-import-dsc; apt:<filename>package</filename>\n"
+" cd <filename>package</filename>\n"
+" &gitcmd; branch debian\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:142
+msgid ""
+"Whenever you need to work on an arbitrary &debian; package, you can check it "
+"right into &git; with one command: <placeholder type=\"programlisting\" id="
+"\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:151
+msgid ""
+"This uses <command>apt-get</command> to download the source package, puts "
+"the orig tarball on the <option>upstream-branch</option> and the &debian; "
+"changes on the <option>debian-branch</option> (by default <emphasis>master</"
+"emphasis>). The second command creates a branch called <emphasis>debian</"
+"emphasis>. Now you can easily modify the package, revert changes you made, "
+"create other branches for testing, see what changes you made, etc. When "
+"finished, just do"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:159
+#, no-wrap
+msgid ""
+" &gitcmd; commit -a\n"
+" &gitcmd; diff debian --\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/special.xml:167
+#, no-wrap
+msgid " &gbp-import-dsc; <filename>http://mentors.debian.net/debian/pool/main/i/ipsec-tools/ipsec-tools_0.7.3-9.dsc</filename>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:163
+msgid ""
+"to get a nice patch that can be submitted to the &debian; BTS. You can also "
+"fetch the source package from a URL: <placeholder type=\"programlisting\" id="
+"\"0\"/> The import works incrementally; you can import new versions on top "
+"of already imported ones for e.g. easy review of changes."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:176
+msgid "Sloppy tarball creation"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:178
+msgid ""
+"By default &gbp-buildpackage; uses <filename>debian/changelog</filename> to "
+"detect the upstream version and build the corrsponding tarball either via "
+"&pristine-tar; or by using <command>git archive</command> directly. This "
+"ensures that the tarball matches what's in the Debian archive already."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:184
+msgid ""
+"But there might be cases where you don't want to follow these packaging "
+"practice and create a fresh <emphasis>dirty</emphasis> tarball that contains "
+"additional changes. Such tarballs are not suitable for upload into the "
+"archive but might be helpful in local testing."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/special.xml:194
+#, no-wrap
+msgid ""
+"dpkg-source: info: local changes detected, the modified files are:\n"
+" hello-debhelper/configure\n"
+"dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/hello-debhelper_2.8-1.diff.har2Xx\n"
+"dpkg-source: info: you can integrate the local changes with dpkg-source --commit\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:190
+msgid ""
+"Especially when getting started and when you first want to get a package "
+"built and dive into &gbp-dch;, &git-pbuilder; and the 3.0 (quilt) format "
+"later to find out what exactly <placeholder type=\"programlisting\" id=\"0\"/"
+"> means."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:202
+msgid ""
+"For that you can force &gbp-buildpackage; to create a tarball from the "
+"<emphasis>debian-branch</emphasis> dropping the <filename>debian/</filename> "
+"directory. This will give you a tarball that is very close to your current "
+"working copy except for the packaging."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:209
+#, no-wrap
+msgid " &gbp-buildpackage; --git-ignore-new --git-force-create --git-upstream-tree=SLOPPY --git-no-pristine-tar\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:212
+msgid ""
+"The important part is the <emphasis>SLOPPY</emphasis> above. The other "
+"options are there to prevent &gbp-buildpackage; from using &pristine-tar;, "
+"to force the creation of a new tarball and to not abort if you have changes "
+"in your current working copy. If you're still getting an error about "
+"<emphasis>unexpected upstream changes</emphasis> make sure you have no "
+"uncommitted changes in you workig copy (changes in the <filename>debian/</"
+"filename> directory are o.k.) and no files that are ignored by git via "
+"<filename>.gitignore</filename>. A <command>git clean -dfx</command> can "
+"help here."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:226
+msgid ""
+"Please don't use this tarball to upload to the Debian archive since changes "
+"outside <filename>debian/</filename> need to be represented by patches in "
+"<filename>debian/patches</filename>. See the <command>dpkg-source</command> "
+"manpage for details."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:235
+msgid "Integrating with pk4"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:237
+msgid ""
+"&pk4; provides an easy way to fetch the sources of packages currently "
+"installed on the system. In order to let pk4 provide these packages as &git; "
+"repositories you can enable &gbp;'s unpack hook:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:243
+#, no-wrap
+msgid ""
+"mkdir -p ~/.config/pk4/hooks-enabled/unpack/\n"
+"ln -s /usr/share/pk4/hooks-available/unpack/gbp ~/.config/pk4/hooks-enabled/unpack/\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:247
+msgid ""
+"This will make sure packages are imported into a git respository after "
+"download."
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo><address>
+#: manpages/gbp-buildpackage-rpm.xml:4 manpages/gbp-import-srpm.xml:4
+#: manpages/gbp-pq-rpm.xml:4 manpages/gbp-rpm-ch.xml:4
+#, no-wrap
+msgid ""
+" &rpm-email;\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo>
+#: manpages/gbp-buildpackage-rpm.xml:3 manpages/gbp-import-srpm.xml:3
+#: manpages/gbp-pq-rpm.xml:3 manpages/gbp-rpm-ch.xml:3
+msgid ""
+"<placeholder type=\"address\" id=\"0\"/> <author> &rpm-firstname; &rpm-"
+"surname; </author>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-buildpackage-rpm.xml:11 manpages/gbp-buildpackage-rpm.xml:15
+msgid "gbp-buildpackage-rpm"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-buildpackage-rpm.xml:16
+msgid "Build RPM packages from a Git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-buildpackage-rpm.xml:20
+msgid ""
+"&gbp-buildpackage-rpm; <arg><option>--git-[no-]ignore-new</option></arg> "
+"<arg><option>--git-tag</option></arg> <arg><option>--git-verbose</option></"
+"arg> <arg><option>--git-color=</option>[auto|on|off]</arg> <arg><option>--"
+"git-color-scheme=</option><replaceable>COLOR_SCHEME</replaceable></arg> "
+"<arg><option>--git-notify=</option>[auto|on|off]</arg> <arg><option>--git-"
+"tmp-dir</option>=<replaceable>DIRECTORY</replaceable></arg> <arg><option>--"
+"git-vendor</option>=<replaceable>VENDOR</replaceable></arg> <arg><option>--"
+"git-native</option>[auto|on|off]</arg> <arg><option>--git-upstream-branch=</"
+"option><replaceable>TREEISH</replaceable></arg> <arg><option>--git-packaging-"
+"branch=</option><replaceable>BRANCH_NAME</replaceable></arg> <arg><option>--"
+"git-ignore-branch</option></arg> <arg><option>--git-[no-]submodules</"
+"option></arg> <arg><option>--git-builder=</option><replaceable>BUILD_CMD</"
+"replaceable></arg> <arg><option>--git-cleaner=</"
+"option><replaceable>CLEAN_CMD</replaceable></arg> <arg><option>--git-"
+"[no-]sign-tags</option></arg> <arg><option>--git-keyid=</"
+"option><replaceable>GPG-KEYID</replaceable></arg> <arg><option>--git-"
+"posttag=</option><replaceable>COMMAND</replaceable></arg> <arg><option>--git-"
+"postbuild=</option><replaceable>COMMAND</replaceable></arg> <arg><option>--"
+"git-postexport=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-prebuild=</option><replaceable>COMMAND</replaceable></"
+"arg> <arg><option>--git-preexport=</option><replaceable>COMMAND</"
+"replaceable></arg> <arg><option>--git-[no-]build</option></arg> "
+"<arg><option>--git-[no-]hooks</option></arg> <arg><option>--git-packaging-"
+"tag=</option><replaceable>TAG-FORMAT</replaceable></arg> <arg><option>--git-"
+"upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg> "
+"<arg><option>--git-force-create</option></arg> <arg><option>--git-no-create-"
+"orig</option></arg> <arg><option>--git-upstream-tree=</"
+"option><replaceable>[TAG|BRANCH|TREEISH]</replaceable></arg> <arg><option>--"
+"git-tarball-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-compression-level=</option><replaceable>LEVEL</"
+"replaceable></arg> <arg><option>--git-export-dir=</"
+"option><replaceable>DIRECTORY</replaceable></arg> <arg><option>--git-"
+"export=</option><replaceable>TREEISH</replaceable></arg> <arg><option>--git-"
+"packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-spec-file=</option><replaceable>FILEPATH</replaceable></"
+"arg> <arg><option>--git-export-sourcedir</option>=<replaceable>DIRECTORY</"
+"replaceable></arg> <arg><option>--git-export-specdir</"
+"option>=<replaceable>DIRECTORY</replaceable></arg> <arg><option>--git-"
+"[no-]pristine-tar</option></arg> <arg><option>--git-[no-]pristine-tar-"
+"commit</option></arg> <arg><option>--git-tag-only</option></arg> "
+"<arg><option>--git-retag</option></arg> <arg><option>--git-mock</option></"
+"arg> <arg><option>--git-dist</option>=<replaceable>DISTRIBUTION</"
+"replaceable></arg> <arg><option>--git-arch</"
+"option>=<replaceable>ARCHITECTURE</replaceable></arg> <arg><option>--git-"
+"mock-options</option>=<replaceable>OPTIONS</replaceable></arg> "
+"<arg><option>--git-mock-root</option>=<replaceable>ROOT</replaceable></arg> "
+"<arg><option>--git-spec-vcs-tag</option>=<replaceable>TAG_FORMAT</"
+"replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:71 manpages/gbp-buildpackage.xml:70
+#: manpages/gbp-clone.xml:41 manpages/gbp-config.xml:32
+#: manpages/gbp.conf.xml:75 manpages/gbp-create-remote-repo.xml:40
+#: manpages/gbp-dch.xml:84 manpages/gbp-export-orig.xml:38
+#: manpages/gbp-import-dscs.xml:40 manpages/gbp-import-dsc.xml:53
+#: manpages/gbp-import-orig.xml:51 manpages/gbp-import-ref.xml:37
+#: manpages/gbp-import-srpm.xml:57 manpages/gbp-pq-rpm.xml:41
+#: manpages/gbp-pq.xml:46 manpages/gbp-pristine-tar.xml:35
+#: manpages/gbp-pull.xml:38 manpages/gbp-push.xml:36 manpages/gbp-rpm-ch.xml:46
+#: manpages/gbp-setup-gitattributes.xml:28 manpages/gbp-tag.xml:35
+#: manpages/gbp.xml:31
+msgid "DESCRIPTION"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:73
+msgid ""
+"&gbp-buildpackage-rpm; is used to build RPM packages from a &git; "
+"repository. It is an RPM counterpart for the &gbp-buildpackage; tool that is "
+"designed for building Debian packages."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:78
+msgid "&gbp-buildpackage-rpm; will, in order:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:83 manpages/gbp-buildpackage.xml:81
+msgid "Verify that it is being executed from the proper location."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:88 manpages/gbp-buildpackage.xml:86
+#: manpages/gbp-tag.xml:47
+msgid ""
+"Verify that the repository doesn't contain any uncommitted source changes."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:94 manpages/gbp-buildpackage.xml:92
+msgid "Verify that it is being executed from the correct branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:99
+msgid "Export packaging files to a separate build area."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:104
+msgid "Create an orig source tarball if it doesn't exist."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:109
+msgid ""
+"Call <application>rpmbuild</application>(1) (or the application specified "
+"via <option>--git-builder</option>), passing along all command line "
+"arguments that don't start with --git-."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:116
+msgid "(Optionally) tag the tree after a successful build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:121
+msgid ""
+"(Optionally) call a post build hook - e.g. to run <productname>rpmlint</"
+"productname>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:127 manpages/gbp-buildpackage.xml:137
+msgid ""
+"(Optionally) call a post tag hook - e.g. to push the results to a remote "
+"repository after creating the tag."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:134 manpages/gbp-buildpackage.xml:144
+#: manpages/gbp-clone.xml:50 manpages/gbp-config.xml:40
+#: manpages/gbp-create-remote-repo.xml:61 manpages/gbp-dch.xml:148
+#: manpages/gbp-export-orig.xml:47 manpages/gbp-import-dscs.xml:55
+#: manpages/gbp-import-dsc.xml:79 manpages/gbp-import-orig.xml:108
+#: manpages/gbp-import-ref.xml:46 manpages/gbp-import-srpm.xml:70
+#: manpages/gbp-pq-rpm.xml:128 manpages/gbp-pq.xml:133
+#: manpages/gbp-pristine-tar.xml:46 manpages/gbp-pull.xml:54
+#: manpages/gbp-push.xml:90 manpages/gbp-rpm-ch.xml:66
+#: manpages/gbp-setup-gitattributes.xml:50 manpages/gbp-tag.xml:64
+#: manpages/gbp.xml:37
+msgid "OPTIONS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:137 manpages/gbp-buildpackage.xml:751
+msgid "<option>--git-[no-]ignore-new</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:141
+msgid ""
+"Don't abort if there are uncommitted changes in the source tree or the "
+"current branch doesn't match the <replaceable>PACKAGING-BRANCH</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:148 manpages/gbp-buildpackage.xml:574
+msgid "<option>--git-tag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:152
+msgid "Add a git tag after a successful build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:157 manpages/gbp-buildpackage.xml:333
+msgid "<option>--git-builder=<replaceable>BUILD_CMD</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:161
+msgid ""
+"Use <replaceable>BUILD_CMD</replaceable> instead of <command>rpmbuild -ba</"
+"command>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:167 manpages/gbp-buildpackage.xml:345
+msgid "<option>--git-cleaner=<replaceable>CLEAN_CMD</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:171
+msgid "Use <replaceable>CLEAN_CMD</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:176 manpages/gbp-buildpackage.xml:767
+msgid "<option>--git-verbose</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:180
+msgid "Verbose execution"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:185 manpages/gbp-buildpackage.xml:776
+msgid "<option>--git-color=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:189 manpages/gbp-buildpackage.xml:780
+#: manpages/gbp-export-orig.xml:63
+msgid "Whether to use colored output."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:194
+msgid ""
+"<option>--git-color-scheme=</option><replaceable>COLOR_SCHEME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:198 manpages/gbp-buildpackage.xml:789
+msgid ""
+"Colors to use in output (when color is enabled). The format for COLOR_SCHEME "
+"is '<debug>:<info>:<warning>:<error>'. Numerical "
+"values and color names are accepted, empty fields imply the default color. "
+"For example --git-color-scheme='cyan:34::' would show debug messages in "
+"cyan, info messages in blue and other messages in default (i.e. warning and "
+"error messages in red)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:209 manpages/gbp-buildpackage.xml:457
+msgid "<option>--git-notify=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:213
+msgid "Whether to send a desktop notification after the build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:218 manpages/gbp-rpm-ch.xml:71
+msgid "<option>--git-tmp-dir</option>=<replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:222 manpages/gbp-rpm-ch.xml:75
+msgid "Base directory under which temporary directories are created."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:227
+msgid "<option>--git-vendor</option>=<replaceable>VENDOR</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:231 manpages/gbp-import-srpm.xml:79
+#: manpages/gbp-rpm-ch.xml:84
+msgid "Distribution vendor name."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:236
+msgid "<option>--git-native=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:240
+msgid ""
+"Define the 'nativity' of a package. The default value <replaceable>auto</"
+"replaceable> makes &gbp-buildpackage-rpm; to guess. Guessing is based on the "
+"existence of upstream branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:247 manpages/gbp-buildpackage.xml:207
+msgid ""
+"<option>--git-upstream-branch</option>=<replaceable>BRANCH_NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:251 manpages/gbp-buildpackage.xml:211
+msgid ""
+"Branch to build the orig tarball from if <option>--git-upstream-tree</"
+"option> is set to <replaceable>BRANCH</replaceable>. Default is "
+"<replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:259
+msgid ""
+"<option>--git-packaging-branch</option>=<replaceable>BRANCH_NAME</"
+"replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:263
+msgid ""
+"If you're not on this branch when invoking &gbp-buildpackage-rpm; it will "
+"fail. Default is <replaceable>master</replaceable>. This is done to make "
+"sure you don't accidentally release from a topic branch. Not being on this "
+"branch will be ignored when using <option>--git-ignore-new</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:272 manpages/gbp-buildpackage.xml:741
+msgid "<option>--git-ignore-branch</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:276 manpages/gbp-rpm-ch.xml:103
+msgid ""
+"Don't check if the current branch matches <replaceable>PACKAGING-BRANCH</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:282 manpages/gbp-buildpackage.xml:290
+msgid "<option>--git-[no-]submodules</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:286 manpages/gbp-export-orig.xml:99
+msgid "Include git submodules in the orig tarball."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:291 manpages/gbp-buildpackage.xml:590
+msgid "<option>--git-[no-]sign-tags</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:295 manpages/gbp-buildpackage.xml:594
+#: manpages/gbp-import-orig.xml:199 manpages/gbp-import-ref.xml:139
+#: manpages/gbp-import-srpm.xml:108 manpages/gbp-tag.xml:87
+msgid "GPG sign all created tags."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:300 manpages/gbp-buildpackage.xml:599
+msgid "<option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:304 manpages/gbp-buildpackage.xml:603
+#: manpages/gbp-import-dsc.xml:117 manpages/gbp-import-srpm.xml:117
+#: manpages/gbp-tag.xml:96
+msgid "Use this keyid for gpg signing tags."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:309 manpages/gbp-buildpackage.xml:541
+msgid "<option>--git-posttag=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:313
+msgid "Execute <replaceable>COMMAND</replaceable> after tagging a new version."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:317 manpages/gbp-buildpackage.xml:550
+#: manpages/gbp-tag.xml:75
+msgid ""
+"Exported environment variables are: <envar>GBP_TAG</envar> (the name of the "
+"generated tag), <envar>GBP_BRANCH</envar> (the branch the package was built "
+"from) and <envar>GBP_SHA1</envar> (the sha1 of the commit the tag was "
+"created at)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:325 manpages/gbp-buildpackage.xml:525
+msgid "<option>--git-postbuild=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:329
+msgid "Execute <replaceable>COMMAND</replaceable> after successful build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:333 manpages/gbp-buildpackage.xml:534
+msgid ""
+"Exported environment variables are: <envar>GBP_CHANGES_FILE</envar> (the "
+"name of the generated changes file), <envar>GBP_BUILD_DIR</envar> (the build "
+"dir)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:340 manpages/gbp-buildpackage.xml:476
+msgid "<option>--git-preexport=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:344
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> before exporting the source tree."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:348 manpages/gbp-buildpackage-rpm.xml:364
+#: manpages/gbp-buildpackage.xml:501
+msgid ""
+"Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the "
+"repository the package is being built from), <envar>GBP_TMP_DIR</envar> (the "
+"temporary directory where the sources have been initially exported)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:356 manpages/gbp-buildpackage.xml:491
+msgid "<option>--git-postexport=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:360
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> after exporting the source tree."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:372 manpages/gbp-buildpackage.xml:509
+msgid "<option>--git-prebuild=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:376
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> from the build directory before "
+"calling <application>rpmbuild</application> or the application specified via "
+"<option>--git-builder</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:381 manpages/gbp-buildpackage.xml:484
+#: manpages/gbp-buildpackage.xml:518
+msgid ""
+"Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the "
+"repository the package is being built from), <envar>GBP_BUILD_DIR</envar> "
+"(the build dir)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:388
+msgid "<option>--git-[no-]build</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:392
+msgid ""
+"Enable builder. Note: <option>--git-no-build</option> causes the postbuild "
+"hook to be disabled, too."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:398 manpages/gbp-buildpackage.xml:558
+msgid "<option>--git-[no-]hooks</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:402 manpages/gbp-buildpackage.xml:562
+msgid ""
+"Enable running all (cleaner, preexport, postexport, prebuild, postbuild, and "
+"posttag) hooks. Note: the <option>--git-builder</option> command is not "
+"affected by this option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:409
+msgid ""
+"<option>--git-packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:413
+msgid "Use this tag format when tagging released versions of the package."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:418 manpages/gbp-buildpackage.xml:170
+#: manpages/gbp-dch.xml:173
+msgid ""
+"<option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:422 manpages/gbp-dch.xml:177
+#: manpages/gbp-export-orig.xml:108 manpages/gbp-pq-rpm.xml:157
+#: manpages/gbp-pq.xml:277
+msgid ""
+"Use this tag format when looking for tags of upstream versions, default is "
+"<replaceable>upstream/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:428 manpages/gbp-buildpackage.xml:261
+msgid "<option>--git-force-create</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:432 manpages/gbp-export-orig.xml:118
+msgid ""
+"Force creation of an orig tarball (overwriting a pre-existing one if "
+"present)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:438 manpages/gbp-buildpackage.xml:271
+msgid "<option>--git-no-create-orig</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:442
+msgid "Don't try to create any orig tarball."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:447 manpages/gbp-buildpackage.xml:658
+msgid "<option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:451
+msgid ""
+"Export the packaging files from the current branch head (or the treeish "
+"object given via <option>--git-export</option> to <replaceable>DIRECTORY</"
+"replaceable> before building."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:458
+msgid ""
+"<option>--git-export-sourcedir</option>=<replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:460
+msgid ""
+"<option>--git-export-specdir</option>=<replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:464
+msgid ""
+"Subdirectories under export directory where packaging files are exported. "
+"The default build options of rpmbuild builder are also adjusted accordingly."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:471 manpages/gbp-buildpackage.xml:670
+msgid "<option>--git-export=</option><replaceable>TREEISH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:475
+msgid ""
+"Instead of exporting the current branch head, export the treeish object "
+"<replaceable>TREEISH</replaceable>. The special name <replaceable>INDEX</"
+"replaceable> exports the current index, <replaceable>WC</replaceable>) "
+"exports all files in the current working directory."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:484 manpages/gbp-import-srpm.xml:164
+msgid ""
+"<option>--git-packaging-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:488 manpages/gbp-pq-rpm.xml:136
+#: manpages/gbp-rpm-ch.xml:123
+msgid "Subdirectory that contains the RPM packaging files."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:493
+msgid "<option>--git-spec-file=</option><replaceable>FILEPATH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:497
+msgid ""
+"Relative path to the spec file to use. Special value <replaceable>auto</"
+"replaceable> causes &gbp-buildpackage-rpm; to search and guess. Other "
+"values cause the <option>--git-packaging-dir</option> option to be ignored: "
+"the directory of the spec file is used, instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:506
+msgid ""
+"<option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</"
+"replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:510
+msgid ""
+"How to find the upstream sources used to generate the tarball. "
+"<replaceable>TAG</replaceable> looks at a tag corresponding to the version "
+"in the changelog. <replaceable>BRANCH</replaceable> looks at the upstream "
+"branch given via the <option>--git-upstream-branch</option> option. Other "
+"values are interpreted as treeishs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:518 manpages/gbp-buildpackage.xml:201
+msgid ""
+"This doesn't have any effect if <option>--git-pristine-tar</option> is being "
+"used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:524 manpages/gbp-buildpackage.xml:219
+msgid "<option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:528
+msgid ""
+"Search for original tarballs in <replaceable>DIRECTORY</replaceable> instead "
+"of generating them."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:534 manpages/gbp-buildpackage.xml:314
+msgid ""
+"<option>--git-compression-level=</option><replaceable>LEVEL</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:538 manpages/gbp-buildpackage.xml:318
+#: manpages/gbp-export-orig.xml:175
+msgid ""
+"Specifies the upstream tarball compression level if an upstream tarball "
+"needs to be built."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:544 manpages/gbp-buildpackage.xml:637
+msgid "<option>--git-tag-only</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:548
+msgid "Don't build, only tag and run post-tag hooks."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:553 manpages/gbp-buildpackage.xml:626
+msgid "<option>--git-retag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:557
+msgid ""
+"Don't fail tag operations if a tag with the same version already exists, "
+"but, overwrite the existing tag, instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:563 manpages/gbp-buildpackage.xml:158
+msgid "<option>--git-pristine-tar</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:567 manpages/gbp-export-orig.xml:204
+msgid ""
+"Use pristine-tar when generating the upstream tarball if it doesn't exist."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:573 manpages/gbp-buildpackage.xml:251
+msgid "<option>--git-pristine-tar-commit</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:577 manpages/gbp-buildpackage.xml:255
+msgid ""
+"Commit the pristine-tar delta to the pristine-tar branch if a new tarball "
+"was generated and the pristine-tar data isn't already there."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:583
+msgid "<option>--git-mock</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:587
+msgid "Use &mock; to build the rpms by invoking &gbp-builder-mock;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:592
+msgid "<option>--git-dist</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:596
+msgid "Build for this distribution when using &mock; (e.g.: epel-6)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:601
+msgid "<option>--git-arch</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:605
+msgid ""
+"Build for this architecture when using mock, default is to build for the "
+"current host architecture."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:611
+msgid "<option>--git-mock-root</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:615
+msgid ""
+"The mock root to use. Defaults to <replaceable>DIST</replaceable>-"
+"<replaceable>ARCH</replaceable> from above."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:622
+msgid "<option>--git-mock-options</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:626
+msgid ""
+"Additional options to pass to mock. Default is to pass no additional options."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:632
+msgid ""
+"<option>--git-spec-vcs-tag</option>=<replaceable>TAG_FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:636
+msgid ""
+"&gbp-buildpackage-rpm; always automatically sets/updates the 'VCS:' tag in "
+"the spec file after exporting. This option defines the format string for "
+"the 'VCS:' tag. An empty value causes no 'VCS:' tag to be inserted and "
+"possible old 'VCS:' tag to be removed. Otherwise, the old 'VCS:' tag is "
+"updated or a new 'VCS:' tag is added if one does not exist. In the format "
+"string '%(tagname)s' expands to the long tag name (from git-describe) and "
+"'%(commit)s' expans to the sha1 of the exported commit."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:650 manpages/gbp-buildpackage.xml:803
+#: manpages/gbp-clone.xml:189 manpages/gbp-config.xml:72
+#: manpages/gbp.conf.xml:215 manpages/gbp-export-orig.xml:221
+#: manpages/gbp-import-dsc.xml:278 manpages/gbp-import-orig.xml:409
+#: manpages/gbp-import-ref.xml:211 manpages/gbp-pristine-tar.xml:84
+#: manpages/gbp-tag.xml:166
+msgid "EXAMPLES"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:652
+msgid "Only build a source RPM with &rpmbuild;"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage-rpm.xml:655
+#, no-wrap
+msgid ""
+" &gbp-buildpackage-rpm; -bs\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:658
+msgid ""
+"Build an RPM package with &rpmbuild; on a custom branch with the uncommitted "
+"changes included."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage-rpm.xml:662
+#, no-wrap
+msgid ""
+" &gbp-buildpackage-rpm; --git-ignore-branch --git-export=WC\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:668
+msgid ""
+"All options in the config files are specified without the 'git-' prefix."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:672 manpages/gbp-buildpackage.xml:840
+#: manpages/gbp-clone.xml:216 manpages/gbp-config.xml:89
+#: manpages/gbp.conf.xml:304 manpages/gbp-create-remote-repo.xml:146
+#: manpages/gbp-dch.xml:645 manpages/gbp-export-orig.xml:241
+#: manpages/gbp-import-dscs.xml:79 manpages/gbp-import-dsc.xml:300
+#: manpages/gbp-import-orig.xml:430 manpages/gbp-import-ref.xml:234
+#: manpages/gbp-import-srpm.xml:270 manpages/gbp-pq-rpm.xml:262
+#: manpages/gbp-pq.xml:337 manpages/gbp-pristine-tar.xml:97
+#: manpages/gbp-pull.xml:164 manpages/gbp-push.xml:162
+#: manpages/gbp-rpm-ch.xml:339 manpages/gbp-setup-gitattributes.xml:82
+#: manpages/gbp-tag.xml:184 manpages/gbp.xml:182
+msgid "SEE ALSO"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:674
+msgid ""
+"<xref linkend=\"man.gbp.import.srpm\"/>, <xref linkend=\"man.gbp.pq.rpm\"/>, "
+"<xref linkend=\"man.gbp.rpm.ch\"/>, <citerefentry> <refentrytitle>rpmbuild</"
+"refentrytitle> <manvolnum>8</manvolnum> </citerefentry>, <citerefentry> "
+"<refentrytitle>mock</refentrytitle> <manvolnum>1</manvolnum> </"
+"citerefentry>, <xref linkend=\"man.gbp.conf\"/>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:690 manpages/gbp-buildpackage.xml:867
+#: manpages/gbp-clone.xml:229 manpages/gbp-config.xml:95
+#: manpages/gbp-create-remote-repo.xml:154 manpages/gbp-dch.xml:658
+#: manpages/gbp-export-orig.xml:251 manpages/gbp-import-dscs.xml:91
+#: manpages/gbp-import-dsc.xml:324 manpages/gbp-import-orig.xml:445
+#: manpages/gbp-import-ref.xml:249 manpages/gbp-import-srpm.xml:281
+#: manpages/gbp-pq-rpm.xml:270 manpages/gbp-pq.xml:352
+#: manpages/gbp-pristine-tar.xml:105 manpages/gbp-pull.xml:173
+#: manpages/gbp-push.xml:171 manpages/gbp-rpm-ch.xml:350
+#: manpages/gbp-setup-gitattributes.xml:98 manpages/gbp-tag.xml:192
+#: manpages/gbp.xml:206
+msgid "AUTHOR"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:692 manpages/gbp-import-srpm.xml:283
+#: manpages/gbp-pq-rpm.xml:272 manpages/gbp-rpm-ch.xml:352
+msgid "&rpm-username; &rpm-email;"
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo><address>
+#: manpages/gbp-buildpackage.xml:4 manpages/gbp-clone.xml:4
+#: manpages/gbp-config.xml:4 manpages/gbp.conf.xml:4
+#: manpages/gbp-create-remote-repo.xml:4 manpages/gbp-dch.xml:4
+#: manpages/gbp-export-orig.xml:4 manpages/gbp-import-dscs.xml:4
+#: manpages/gbp-import-dsc.xml:4 manpages/gbp-import-orig.xml:4
+#: manpages/gbp-import-ref.xml:4 manpages/gbp-pq.xml:4
+#: manpages/gbp-pristine-tar.xml:4 manpages/gbp-pull.xml:4
+#: manpages/gbp-push.xml:4 manpages/gbp-tag.xml:4 manpages/gbp.xml:4
+#, no-wrap
+msgid ""
+" &dhemail;\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo>
+#: manpages/gbp-buildpackage.xml:3 manpages/gbp-clone.xml:3
+#: manpages/gbp-config.xml:3 manpages/gbp.conf.xml:3
+#: manpages/gbp-create-remote-repo.xml:3 manpages/gbp-dch.xml:3
+#: manpages/gbp-export-orig.xml:3 manpages/gbp-import-dscs.xml:3
+#: manpages/gbp-import-dsc.xml:3 manpages/gbp-import-orig.xml:3
+#: manpages/gbp-import-ref.xml:3 manpages/gbp-pq.xml:3
+#: manpages/gbp-pristine-tar.xml:3 manpages/gbp-pull.xml:3
+#: manpages/gbp-push.xml:3 manpages/gbp-tag.xml:3 manpages/gbp.xml:3
+msgid ""
+"<placeholder type=\"address\" id=\"0\"/> <author> &dhfirstname; &dhsurname; "
+"</author>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-buildpackage.xml:11 manpages/gbp-buildpackage.xml:15
+msgid "gbp-buildpackage"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-buildpackage.xml:16
+msgid "Build &debian; packages from a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-buildpackage.xml:20
+msgid ""
+"&gbp-buildpackage; <arg><option>--git-[no-]ignore-new</option></arg> "
+"<arg><option>--git-tag</option></arg> <arg><option>--git-verbose</option></"
+"arg> <arg><option>--git-color=</option>[auto|on|off]</arg> <arg><option>--"
+"git-color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable></arg> "
+"<arg><option>--git-notify=</option>[auto|on|off]</arg> <arg><option>--git-"
+"upstream-branch=</option><replaceable>TREEISH</replaceable></arg> "
+"<arg><option>--git-debian-branch=</option><replaceable>BRANCH_NAME</"
+"replaceable></arg> <arg><option>--git-ignore-branch</option></arg> "
+"<arg><option>--git-[no-]submodules</option></arg> <arg><option>--git-"
+"builder=</option><replaceable>BUILD_CMD</replaceable></arg> <arg><option>--"
+"git-cleaner=</option><replaceable>CLEAN_CMD</replaceable></arg> "
+"<arg><option>--git-[no-]overlay</option></arg> <arg><option>--git-"
+"[no-]pbuilder</option></arg> <arg><option>--git-[no-]qemubuilder</option></"
+"arg> <arg><option>--git-dist=</option><replaceable>DIST</replaceable></arg> "
+"<arg><option>--git-arch=</option><replaceable>ARCH</replaceable></arg> "
+"<arg><option>--git-[no-]pbuilder-autoconf</option></arg> <arg><option>--git-"
+"pbuilder-options</option>=<replaceable>PBUILDER_OPTIONS</replaceable></arg> "
+"<arg><option>--git-[no-]sign-tags</option></arg> <arg><option>--git-keyid=</"
+"option><replaceable>GPG-KEYID</replaceable></arg> <arg><option>--git-"
+"preexport=</option><replaceable>COMMAND</replaceable></arg> <arg><option>--"
+"git-postexport=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-prebuild=</option><replaceable>COMMAND</replaceable></"
+"arg> <arg><option>--git-postbuild=</option><replaceable>COMMAND</"
+"replaceable></arg> <arg><option>--git-posttag=</option><replaceable>COMMAND</"
+"replaceable></arg> <arg><option>--git-[no-]hooks</option></arg> "
+"<arg><option>--git-debian-tag=</option><replaceable>tag-format</"
+"replaceable></arg> <arg><option>--git-debian-tag-msg=</"
+"option><replaceable>tag-msg-format</replaceable></arg> <arg><option>--git-"
+"upstream-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--git-force-create</option></arg> <arg><option>--git-no-create-"
+"orig</option></arg> <arg><option>--git-upstream-signatures=</option>[auto|on|"
+"off]</arg> <arg><option>--git-upstream-tree=</option><replaceable>[BRANCH|"
+"SLOPPY|TAG|TREEISH]</replaceable></arg> <arg><option>--git-tarball-dir=</"
+"option><replaceable>DIRECTORY</replaceable></arg> <arg><option>--git-"
+"compression=</option><replaceable>TYPE</replaceable></arg> <arg><option>--"
+"git-compression-level=</option><replaceable>LEVEL</replaceable></arg> <arg "
+"rep='repeat'><option>--git-component=</option><replaceable>component</"
+"replaceable></arg> <arg><option>--git-export-dir=</"
+"option><replaceable>DIRECTORY</replaceable></arg> <arg><option>--git-"
+"export=</option><replaceable>TREEISH</replaceable></arg> <arg><option>--git-"
+"[no-]pristine-tar</option></arg> <arg><option>--git-[no-]pristine-tar-"
+"commit</option></arg> <arg><option>--git-[no-]-purge</option></arg> "
+"<arg><option>--git-tag-only</option></arg> <arg><option>--git-retag</"
+"option></arg> <arg rep=\"repeat\"><option>OPTION_PASSED_TO_BUILD_CMD</"
+"option></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:72
+msgid ""
+"&gbp-buildpackage; is used to build &debian; source and .deb packages from a "
+"&git; repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:76
+msgid "&gbp-buildpackage; will, in order:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:97
+msgid ""
+"(Optionally) run a clean command specified with <option>--git-cleaner</"
+"option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:103
+msgid "(Optionally) export the source tree to a separate build area."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:108
+msgid ""
+"Build an orig tarball if it doesn't exist. Optionally using &pristine-tar;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:113
+msgid "(Optionally) call a pre build hook."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:118
+msgid ""
+"Call <application>debuild</application>(1) or &cowbuilder; (via <option>--"
+"git-pbuilder</option>) or the application specified via <option>--git-"
+"builder</option> passing along all arguments given to &gbp-buildpackage; on "
+"the command line that don't start with --git-."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:127
+msgid "(Optionally) tag the current commit after a successful build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:132
+msgid "(Optionally) call a post build hook - e.g. to run &lintian;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:146
+msgid ""
+"All options are prefixed with <option>git-</option> to distinguish options "
+"for &gbp-buildpackage; from options passed to the <replaceable>BUILD_CMD</"
+"replaceable>:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:151
+msgid "Upstream tarball creation options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:152
+msgid ""
+"When &gbp-buildpackage; doesn't find a suitable upstream tarball it will "
+"create one either using &pristine-tar; or <command>git archive</command>. "
+"These options determine how the tarball is created:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:162
+msgid ""
+"Use pristine-tar when generating the upstream tarball if it doesn't exist. "
+"If this mode is enabled the <option>--git-upstream-tag</option>, <option>--"
+"git-upstream-tree</option> options have no effect when creating tarballs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:174
+msgid ""
+"Use this tag format when looking for tags of upstream versions to build the "
+"upstream tarballs. Default is <replaceable>upstream/%(version)s</"
+"replaceable>. This must be set correctly if you don't want to pass any other "
+"options. The default matches what &gbp-import-orig; uses to create tags."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:184
+msgid ""
+"<option>--git-upstream-tree=</option><replaceable>[BRANCH|SLOPPY|TAG|"
+"TREEISH]</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:188
+msgid ""
+"How to find the upstream sources used to generate the tarball. "
+"<replaceable>TAG</replaceable> (the default) looks at a tag corresponding to "
+"the version in the changelog. <replaceable>BRANCH</replaceable> looks at the "
+"upstream branch given via the <option>--git-upstream-branch</option> option. "
+"The <replaceable>SLOPPY</replaceable> option looks at the debian branch "
+"given via the <option>--git-debian-branch</option> and drops the "
+"<filename>debian/</filename> dir."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:198 manpages/gbp-export-orig.xml:135
+msgid "Other values are interpreted as treeishs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:223
+msgid ""
+"Search for upstream tarballs in <replaceable>DIRECTORY</replaceable> instead "
+"of generating them. If a tarball is not found here it will be generated "
+"nevertheless. <replaceable>DIRECTORY</replaceable> can contain a version "
+"format substitution pattern, eg: <replaceable>foo-%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:232
+msgid "<option>--git-component=</option><replaceable>COMPONENT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:236
+msgid ""
+"When generating tarballs create an additional upstream tarball of directory "
+"<replaceable>COMPONENT</replaceable> in the source tree. Using additional "
+"upstream tarballs is a feature of the 3.0 (quilt) source format. See the "
+"<command>dpkg-source</command> manpage for details. Note that the "
+"<replaceable>--git-pristine-tar-commit</replaceable> option is currently "
+"incompatible with this option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:245 manpages/gbp-export-orig.xml:194
+msgid ""
+"This is considered an experimental feature and might change incompatibly."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:265
+msgid ""
+"Force creation of an upstream tarball (overwriting a pre-existing one if "
+"present)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:275
+msgid ""
+"Don't try to create any upstream tarballs or to create symlinks to existing "
+"tarballs in <option>tarball-dir</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:281
+msgid "<option>--git-upstream-signatures=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:285
+msgid "Whether to export the upstream tarball with signatures."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:294
+msgid "Include &git; submodules in the orig tarball if present."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:299
+msgid "<option>--git-compression=</option><replaceable>TYPE</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:303 manpages/gbp-export-orig.xml:160
+msgid ""
+"Specifies the upstream tarball compression type. This will be used to locate "
+"and build the upstream tarball if necessary. The default is "
+"<replaceable>auto</replaceable> which derives the compression type from the "
+"pristine-tar branch if available and falls back to gzip otherwise. Other "
+"options are <replaceable>gzip</replaceable>, <replaceable>bzip2</"
+"replaceable>, <replaceable>lzma</replaceable> and <replaceable>xz</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:326
+msgid "Package build options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:327
+msgid ""
+"&gbp-buildpackage; can invoke different types of builders to produce the "
+"source and binary packages. These options determine which builder is invoked "
+"and how."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:337
+msgid ""
+"Use <replaceable>BUILD_CMD</replaceable> instead of <command>debuild -i -I</"
+"command>. If you want to use &cowbuilder; or &pbuilder; see the <option>--"
+"git-pbuilder</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:349
+msgid ""
+"Use <replaceable>CLEAN_CMD</replaceable> to clean the source tree before the "
+"build. The default is <command>/bin/true</command> (no cleaning)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:356
+msgid "<option>--git-pbuilder</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:360
+msgid ""
+"Build the package using <command>git-pbuilder</command> (which uses "
+"<command>cowbuilder</command> by default). Note that this overwrites any "
+"<option>--git-builder</option> and <option>--git-cleaner</option> options."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:368
+msgid "<option>--git-qemubuilder</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:372
+msgid ""
+"Build package using <command>git-pbuilder</command> with "
+"<command>qemubuilder</command>. Note that this overwrites any <option>--git-"
+"builder</option> and <option>--git-cleaner</option> options."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:380
+msgid "<option>--git-dist=<replaceable>DIST</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:384
+msgid ""
+"Build for distribution <replaceable>DIST</replaceable> when using &git-"
+"pbuilder; (either via <option>--git-pbuilder</option>, <option>--git-"
+"qemubuilder</option> or the corresponding configuration file options). If "
+"unset build for the unstable distribution. The special value <symbol>DEP14</"
+"symbol> will set the distribution to build for from the branch name. I.e. if "
+"you're starting the build from a branch named <replaceable>debian/wheezy-"
+"backports</replaceable> the distribution is set to <replaceable>wheezy-"
+"backports</replaceable>. If the branch is named <replaceable>downstream/sid</"
+"replaceable> the distribution is set to <replaceable>downstream_sid</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:402
+msgid "<option>--git-arch=<replaceable>ARCH</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:406
+msgid ""
+"Build for architecture <replaceable>ARCH</replaceable> when using &git-"
+"pbuilder; (either via <option>--git-pbuilder</option>, <option>--git-"
+"qemubuilder</option> or the corresponding configuration file options). If "
+"unset no architecture is passed to <command>git-pbuilder</command>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:416
+msgid "<option>--git-pbuilder-autoconf</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:420
+msgid ""
+"Whether to try to autoconfigure &git-pbuilder; or to rely on the settings "
+"in .pbuilderrc. See the &git-pbuilder; manpage for details. Only takes "
+"effect when using &git-pbuilder; (either via <option>--git-pbuilder</"
+"option>, <option>--git-qemubuilder</option> or the corresponding "
+"configuration file options)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:429
+msgid "<option>--git-pbuilder-options</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:433
+msgid ""
+"Options to pass to pbuilder when building via &git-pbuilder; (either via "
+"<option>--git-pbuilder</option>, <option>--git-qemubuilder</option> or the "
+"corresponding configuration file options). It does so by using the "
+"<envar>GIT_PBUILDER_OPTIONS</envar> environment variable to pass options to "
+"&git-pbuilder;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:440
+msgid ""
+"As an example, to tell pbuilder to use an alternate .pbuilderrc file, you "
+"may run &gbp-buildpackage; with <option>--git-pbuilder-options=<replaceable>"
+"\"--configfile /tmp/my/pbuilderrc\"</replaceable></option>. See "
+"<citerefentry> <refentrytitle>pbuilder</refentrytitle> <manvolnum>8</"
+"manvolnum> </citerefentry> for more options to pass through here."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:451
+msgid ""
+"If unset the <envar>GIT_PBUILDER_OPTIONS</envar> environment variable will "
+"be left untouched."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:461
+msgid ""
+"Whether to send a desktop notification after the build. This needs python3-"
+"notify2 installed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:469
+msgid "Hook options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:471
+msgid ""
+"Hooks allow you to run arbitrary commands at different stages of the build. "
+"These options configure what will be run:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:480
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> before exporting the source tree. "
+"Valid only if --git-export-dir has been specified."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:495
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> after exporting the source tree. "
+"Valid only if --git-export-dir has been specified. The working directory of "
+"this hook is the toplevel directory of the exported source tree."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:513
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> from the build directory before "
+"calling <application>debuild</application> or the application specified via "
+"<option>--git-builder</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:529
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> after successful build. The "
+"working directory of this hook is the directory the package was built in."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:545
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> after tagging a new version. The "
+"working directory of this hook is the toplevel directory of the &git; "
+"repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:571
+msgid "Tagging options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:578
+msgid ""
+"Add a git tag after a successful build. It tags the currently checked out "
+"commit except when you're on a patch-queue branch. In that case the "
+"corresponding debian branch is tagged."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:584
+msgid ""
+"This is a command line only option that cannot be specified via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:608
+msgid "<option>--git-debian-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:612 manpages/gbp-import-dsc.xml:126
+#: manpages/gbp-tag.xml:105
+msgid ""
+"Use this tag format when tagging &debian; versions, default is "
+"<replaceable>debian/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:618
+msgid ""
+"<option>--git-debian-tag-msg=</option><replaceable>tag-msg-format</"
+"replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:621 manpages/gbp-tag.xml:114
+msgid ""
+"Use this tag message format when signing &debian; versions, default is "
+"<replaceable>%(pkg)s Debian release %(version)s</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:630 manpages/gbp-tag.xml:123
+msgid ""
+"Don't fail tag operations if a tag with the same version already exists. "
+"This is a command line only option that cannot be specified via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:641
+msgid ""
+"Don't build, only tag and run post-tag hooks. This is a command line only "
+"option that cannot be specified via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:650
+msgid "Build area options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:652
+msgid ""
+"&gbp-buildpackage; can export the source tree to a different build-area "
+"before performing the build. This options specify if and how this is done:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:662
+msgid ""
+"Export the current branch head (or the treeish object given via <option>--"
+"git-export</option> to <replaceable>DIRECTORY</replaceable> before building. "
+"If unset the source will not be exported before starting the build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:674
+msgid ""
+"Instead of exporting the current branch head, export the treeish object "
+"<replaceable>TREEISH</replaceable>. The special name <replaceable>INDEX</"
+"replaceable> exports the current index whereas the special name "
+"<replaceable>WC</replaceable> exports the current working copy as is."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:681
+msgid ""
+"Note that using <replaceable>WC</replaceable> enables the <option>--git-"
+"ignore-branch</option> and <option>--git-ignore-new</option> options as well "
+"since when exporting the working copy there's no point in enforcing any "
+"branch or modification checks."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:690
+msgid "<option>--git[-no]-purge</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:694
+msgid ""
+"Purge (remove) temporary build area after build. This is the default but it "
+"can be turned off for e.g. debugging purposes."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:701
+msgid "<option>--git-[no-]overlay</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:705
+msgid ""
+"Extract upstream tarball from <option>tarball-dir</option> when using the "
+"<option>export-dir</option> option (in analogy to mergeWithUpstream in svn-"
+"bp). Also remove debian/ if contained in the upstream tarball in case of 2.0 "
+"and 3.0 source formats."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:712
+msgid ""
+"This option allows one to keep only the debian/ dir in the version control "
+"system."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:720
+msgid "Safety options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:722
+msgid ""
+"In order to make sure what you build is what you upload &gbp-buildpackage; "
+"performs several safety checks. These options allow one to configure and "
+"disable them:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:728
+msgid ""
+"<option>--git-debian-branch</option>=<replaceable>BRANCH_NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:732
+msgid ""
+"If you're not on this branch when invoking &gbp-buildpackage; it will fail. "
+"Default is <replaceable>master</replaceable>. This is done to make sure you "
+"don't accidentally release from a topic branch. Not being on this branch "
+"will be ignored when using <option>--git-ignore-new</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:745 manpages/gbp-tag.xml:147
+msgid ""
+"Don't check if the current branch matches <replaceable>DEBIAN-BRANCH</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:755 manpages/gbp-tag.xml:157
+msgid ""
+"Don't abort if there are uncommitted changes in the source tree or the "
+"current branch doesn't match the <replaceable>DEBIAN-BRANCH</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:764
+msgid "Color and verbosity options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:771
+msgid "Verbose execution. Useful for debugging and bug reports."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:785
+msgid ""
+"<option>--git-color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:805
+msgid ""
+"Build a &debian; package using &git-pbuilder; which in turn invokes "
+"&cowbuildercmd;. Instruct cowbuilder to build within a Wheezy chroot for "
+"i386."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage.xml:810
+#, no-wrap
+msgid ""
+" &gbp-buildpackage; --git-pbuilder --git-arch=i386 --git-dist=wheezy\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:813
+msgid ""
+"Note that the above needs a &cowbuildercmd; chroot already. This can be "
+"created using:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage.xml:817
+#, no-wrap
+msgid ""
+" DIST=wheezy ARCH=i386 &git-pbuilder; create\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:820
+msgid "To export the source tree without performing any build you can use:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage.xml:823
+#, no-wrap
+msgid ""
+" gbp buildpackage --git-export-dir=/where/to/export --git-builder=/bin/true --git-no-pbuilder --git-no-hooks --git-no-purge\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:829
+msgid ""
+"All options in the config files must be specified without the 'git-' prefix. "
+"So e.g. <option>--git-debian-branch</option>=<replaceable>debian/sid</"
+"replaceable> becomes in &gbp.conf;:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp-buildpackage.xml:835
+#, no-wrap
+msgid ""
+" [buildpackage]\n"
+" debian-branch = debian/sid\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:842
+msgid ""
+"<xref linkend=\"man.gbp.import.dsc\"/>, <xref linkend=\"man.gbp.import.dscs"
+"\"/>, <xref linkend=\"man.gbp.import.orig\"/>, <xref linkend=\"man.gbp.dch\"/"
+">, <citerefentry> <refentrytitle>git-pbuilder</refentrytitle> <manvolnum>1</"
+"manvolnum> </citerefentry>, <citerefentry> <refentrytitle>cowbuilder</"
+"refentrytitle> <manvolnum>8</manvolnum> </citerefentry>, <citerefentry> "
+"<refentrytitle>dpkg-source</refentrytitle> <manvolnum>1</manvolnum> </"
+"citerefentry>, <citerefentry> <refentrytitle>git-submodule</refentrytitle> "
+"<manvolnum>1</manvolnum> </citerefentry>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:869 manpages/gbp-clone.xml:231
+#: manpages/gbp-config.xml:97 manpages/gbp.conf.xml:321
+#: manpages/gbp-create-remote-repo.xml:156 manpages/gbp-dch.xml:660
+#: manpages/gbp-export-orig.xml:253 manpages/gbp-import-dscs.xml:93
+#: manpages/gbp-import-dsc.xml:326 manpages/gbp-import-orig.xml:447
+#: manpages/gbp-import-ref.xml:251 manpages/gbp-pq.xml:354
+#: manpages/gbp-pristine-tar.xml:107 manpages/gbp-pull.xml:175
+#: manpages/gbp-push.xml:173 manpages/gbp-tag.xml:194 manpages/gbp.xml:208
+msgid "&dhusername; &dhemail;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-clone.xml:12 manpages/gbp-clone.xml:16
+msgid "gbp-clone"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-clone.xml:18
+msgid "Clone a repository from remote"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-clone.xml:22
+msgid ""
+"&gbp-clone; &man.common.options.synopsis; <arg><option>--all</option></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> <arg><option>--debian-"
+"branch=</option><replaceable>branch_name</replaceable></arg> <arg><option>--"
+"upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--depth=</option><replaceable>depth</replaceable></arg> "
+"<arg><option>--reference=</option><replaceable>repository</replaceable></"
+"arg> <arg><option>--postclone=</option><replaceable>COMMAND</replaceable></"
+"arg> <arg><option>--[no-]hooks</option></arg> <arg><option>--defuse-"
+"gitattributes=</option><replaceable>[auto|on|off]</replaceable></arg> "
+"<arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg> "
+"<arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg> <arg "
+"choice=\"plain\"><replaceable>repository</replaceable></arg> "
+"<arg><replaceable>directory</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:43
+msgid ""
+"&gbp-clone; clones a remote repository and sets up tracking branches for the "
+"<emphasis>debian</emphasis>, <emphasis>upstream</emphasis> and "
+"<emphasis>pristine-tar</emphasis> branches. This way you can easily update "
+"later using &gbp-pull;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist>
+#: manpages/gbp-clone.xml:53 manpages/gbp-config.xml:42
+#: manpages/gbp-create-remote-repo.xml:63 manpages/gbp-dch.xml:150
+#: manpages/gbp-import-dsc.xml:81 manpages/gbp-import-orig.xml:110
+#: manpages/gbp-import-ref.xml:48 manpages/gbp-import-srpm.xml:72
+#: manpages/gbp-pq-rpm.xml:130 manpages/gbp-pq.xml:135
+#: manpages/gbp-pristine-tar.xml:48 manpages/gbp-pull.xml:57
+#: manpages/gbp-push.xml:92 manpages/gbp-rpm-ch.xml:68
+#: manpages/gbp-setup-gitattributes.xml:52 manpages/gbp-tag.xml:66
+msgid "&man.common.options.description;"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:56 manpages/gbp-pull.xml:68
+#: manpages/gbp-setup-gitattributes.xml:71
+msgid "<option>--all</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:59
+msgid ""
+"Track all branches, not only <replaceable>debian</replaceable> and "
+"<replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:64 manpages/gbp-create-remote-repo.xml:102
+#: manpages/gbp-dch.xml:153 manpages/gbp-import-dsc.xml:94
+#: manpages/gbp-import-orig.xml:170 manpages/gbp-import-ref.xml:125
+#: manpages/gbp-pull.xml:89 manpages/gbp-push.xml:103
+msgid "<option>--debian-branch</option>=<replaceable>branch_name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:67 manpages/gbp-dch.xml:157 manpages/gbp-pull.xml:92
+msgid ""
+"The branch in the Git repository the Debian package is being developed on, "
+"default is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:72 manpages/gbp-create-remote-repo.xml:110
+#: manpages/gbp-dch.xml:163 manpages/gbp-import-dsc.xml:84
+#: manpages/gbp-import-orig.xml:160 manpages/gbp-import-ref.xml:90
+#: manpages/gbp-pull.xml:97 manpages/gbp-push.xml:122
+msgid ""
+"<option>--upstream-branch</option>=<replaceable>branch_name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:75 manpages/gbp-create-remote-repo.xml:113
+#: manpages/gbp-import-dsc.xml:88 manpages/gbp-import-orig.xml:164
+#: manpages/gbp-import-srpm.xml:88 manpages/gbp-pull.xml:100
+msgid ""
+"The branch in the &git; repository the upstream sources are put onto. "
+"Default is <replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:80 manpages/gbp-pull.xml:119
+msgid "<option>--depth</option>=<replaceable>depth</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:83
+msgid "Git history depth, for creating shallow git clones."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:87
+msgid "<option>--reference</option>=<replaceable>repository</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:90
+msgid ""
+"Local repository to use as alternate instead of re-copying data from remote "
+"repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:94 manpages/gbp-create-remote-repo.xml:118
+#: manpages/gbp-export-orig.xml:200 manpages/gbp-import-dsc.xml:187
+#: manpages/gbp-import-srpm.xml:182 manpages/gbp-pull.xml:126
+#: manpages/gbp-push.xml:142
+msgid "<option>--pristine-tar</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:97
+msgid "Track pristine tar branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:101
+msgid "<option>--[no-]hooks</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:104
+msgid "Enable running hooks."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:109
+msgid "<option>--postclone=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:112
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> after cloning the source from the "
+"remote."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:116
+msgid ""
+"Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the "
+"repository the package is being built from)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:119
+msgid ""
+"Note that if you clone a repository that contains a hook configuration in "
+"<filename>debian/gbp.conf</filename> this hook will not be run automatically "
+"to prevent execution of untrusted code."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:127
+msgid "<option>--defuse-gitattributes=</option><option>[auto|on|off]</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:130
+msgid ""
+"Disable Git attributes that may interfere with building packages. Works by "
+"updating <filename>.git/info/attributes</filename> to override attributes in "
+"the upstream sources which may cause files to be transformed on checkout. "
+"More specifically, a new macro attribute is defined, <symbol>[attr]dgit-"
+"defuse-attrs</symbol>, which is then applied to <filename>*</filename> "
+"together with <symbol>export-subst</symbol> and <symbol>export-ignore</"
+"symbol>. This is done to be compatible with <command>dgit</command> and "
+"<command>git-deborig</command> which disable Git attributes this way."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:139
+msgid ""
+"If set to <replaceable>auto</replaceable>, first check whether there are any "
+"<filename>.gitattributes</filename> files in the upstream source, and act "
+"only if there are some. If set to <replaceable>on</replaceable>, "
+"unconditionally there are some. If set to <replaceable>off</replaceable>, "
+"does nothing."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:148 manpages/gbp-import-dsc.xml:262
+#: manpages/gbp-import-srpm.xml:254
+msgid "<option>--repo-email=</option><option>[GIT|DEBIAN]</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:151
+msgid ""
+"When set to <option>DEBIAN</option> use the <envar>DEBEMAIL</envar> "
+"environment variable to set the user.email &git; configuration otherwise use "
+"&git;'s defaults."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:159 manpages/gbp-import-dsc.xml:251
+#: manpages/gbp-import-srpm.xml:243
+msgid "<option>--repo-user=</option><option>[GIT|DEBIAN]</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:162
+msgid ""
+"When set to <option>DEBIAN</option> use the <envar>DEBUSER</envar> "
+"environment variable to set the user.name &git; configuration otherwise use "
+"&git;'s defaults."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:170
+msgid "<replaceable>repository</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:173
+msgid ""
+"The (possibly remote) repository to clone from. This is usually a &git; URL "
+"but some shortcuts are supported (see below)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:179
+msgid "<replaceable>directory</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:182
+msgid "The directory to clone to."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:191
+msgid ""
+"Clone a repository and setup a tracking branch for pristine-tar as well:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-clone.xml:195
+#, no-wrap
+msgid " &gbp-clone; --pristine-tar git://honk.sigxcpu.org/git/git-buildpackage.git"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:197
+msgid "Clone from the <emphasis>Git-Vcs</emphasis> URL of a package:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-clone.xml:200
+#, no-wrap
+msgid " &gbp-clone; vcsgit:libvirt"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:202
+msgid "Clone a repository from salsa (Debian's code hosting):"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-clone.xml:205
+#, no-wrap
+msgid " &gbp-clone; salsa:agx/git-buildpackage"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:207
+msgid "Clone from a github repository:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-clone.xml:210
+#, no-wrap
+msgid " &gbp-clone; github:agx/git-buildpackage"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:218
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.pull\"/>, "
+"<xref linkend=\"man.gbp.setup.gitattributes\"/>, <xref linkend=\"man.gbp.conf"
+"\"/>, <citerefentry> <refentrytitle>gitattributes</refentrytitle> "
+"<manvolnum>5</manvolnum> </citerefentry>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-config.xml:12 manpages/gbp-config.xml:16
+msgid "gbp-config"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-config.xml:18
+msgid "Query configuration values"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-config.xml:22
+msgid ""
+"&gbp-config; &man.common.options.synopsis; <group choice='req'> <arg choice="
+"\"plain\"><replaceable>command.option</replaceable></arg> <arg choice=\"plain"
+"\"><replaceable>command</replaceable></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:34
+msgid ""
+"&gbp-config; prints values from the configuration files. It interpolates the "
+"value for <replaceable>option</replaceable> of <replaceable>command</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-config.xml:46 manpages/gbp-pull.xml:135
+msgid "EXIT CODES"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:48
+msgid ""
+"When &gbp-config; finishes, it indicates success or failure with its exit "
+"code:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-config.xml:52 manpages/gbp-pull.xml:141
+msgid "<option>0</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-config.xml:54 manpages/gbp-pull.xml:143
+msgid "Success."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-config.xml:58 manpages/gbp-pull.xml:147
+msgid "<option>1</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-config.xml:60
+msgid "Failed to parse command line"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-config.xml:64 manpages/gbp-pull.xml:153
+msgid "<option>2</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-config.xml:66
+msgid "The value did not exist"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:73
+msgid ""
+"Print the value <option>upstream-branch</option> that &gbp-buildpackage; "
+"would use:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-config.xml:76
+#, no-wrap
+msgid ""
+" $ gbp config buildpackage.upstream-branch\n"
+" buildpackage.upstream-branch=upstream"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:78
+msgid "Print the values of all of &gbp-buildpackage; options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-config.xml:80
+#, no-wrap
+msgid ""
+" $ gbp config buildpackage\n"
+" buildpackage.upstream-branch=upstream\n"
+" buildpackage.debian-branch=master\n"
+" ..."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:91
+msgid "<xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refmeta><refentrytitle>
+#: manpages/gbp.conf.xml:12
+msgid "gbp.conf"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp.conf.xml:16
+msgid "&gbp.conf;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp.conf.xml:17
+msgid "Gbp configuration file"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:27
+msgid "system wide"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:37
+msgid "per user"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:47
+msgid "per branch, can be published with the repository (deprecated)"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:58
+msgid "per branch, can be published with the repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:68
+msgid "per repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:77
+msgid ""
+"The <filename>gbp.conf</filename> configuration files provide default global "
+"options and specific options for individual &gbp; commands. All files have "
+"the same format as described below and are parsed in the above order from "
+"top to bottom with increasing precedence. Non existing files will be skipped."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:84
+msgid ""
+"Each file consists of either zero or one default section, and zero or one "
+"sections for each &gbp; command. Additionally, there can be an arbitrary "
+"number of <option>remote-config</option> sections. Comments start with a "
+"hash sign (<option>#</option>). The overall layout is:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:91
+#, no-wrap
+msgid ""
+" [DEFAULT]\n"
+" # This section is for global settings. Affects all commands.\n"
+" # Options set here have the lowest priority.\n"
+" key = value\n"
+"\n"
+" [<command>]\n"
+" # Specific sections for each command, like <command>buildpackage</command>\n"
+" # Options set here have lower priority than command line options\n"
+" key = value\n"
+"\n"
+" [remote-config <name>]\n"
+" # Specific sections for a remote configuration. This can be used several\n"
+" # times to set up remote configuration for <command>gbp create-remote-repo</command>\n"
+" key = value\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:107
+msgid ""
+"The sections for each command are named like the command (without &gbp;) "
+"surrounded by square brackets (e.g. <option>[buildpackage]</option>). For "
+"backwards compatibility, command sections starting with <filename>git-</"
+"filename> or <filename>gbp-</filename> are also supported but will provoke a "
+"warning when parsed by &gbp;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:115
+msgid ""
+"The keys in the <option>key</option>=<parameter>value</parameter> pairs are "
+"named like the command-line options of the corresponding command (with the "
+"'--' stripped off) and can hold the same values, but see below for details. "
+"In case of &gbp-buildpackage; and &gbp-buildpackage-rpm; the key needs '--"
+"git-' instead of '--' stripped off."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:123
+msgid ""
+"For example, the <xref linkend=\"man.gbp.buildpackage\"/> manual page "
+"documents the <option>--git-export-dir</option>=<parameter>directory</"
+"parameter> option which can be turned into configuration file setting by "
+"dropping the <option>--git-</option> prefix:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:132
+#, no-wrap
+msgid ""
+" [buildpackage]\n"
+" export-dir = directory\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:137
+msgid ""
+"Options that can be repeated on the command line take Python-like lists in "
+"the config file. For example, the <xref linkend=\"man.gbp.import.orig\"/> "
+"command has the <option>--filter</option>=<parameter>pattern</parameter> "
+"option which can be turned into a configuration file option like this:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:145
+#, no-wrap
+msgid ""
+" [import-orig]\n"
+" filter = [ '.svn', '.hg' ]\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:150
+msgid ""
+"Boolean options can be either <option>True</option> or <option>False</"
+"option>. For example, <xref linkend=\"man.gbp.import.orig\"/> has the "
+"<option>--pristine-tar</option> and <option>--no-pristine-tar</option> "
+"options which translate to:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:155
+#, no-wrap
+msgid ""
+" [import-orig]\n"
+" pristine-tar = True\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:159
+msgid "and"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:162
+#, no-wrap
+msgid ""
+" [import-orig]\n"
+" pristine-tar = False\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:165
+msgid "respectively."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp.conf.xml:168
+msgid "Remote site configuration"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp.conf.xml:170
+msgid ""
+"<xref linkend=\"man.gbp.create.remote.repo\"/> can additionally parse remote "
+"site configurations from <filename>gbp.conf</filename>. For example, a "
+"configuration like:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><programlisting>
+#: manpages/gbp.conf.xml:175
+#, no-wrap
+msgid ""
+" [remote-config pkg-libvirt]\n"
+" # Location of the repository\n"
+" remote-url-pattern = ssh://git.debian.org/git/pkg-libvirt/%(pkg)s\n"
+" # Template dir to passed to git-init\n"
+" template-dir = /srv/alioth.debian.org/chroot/home/groups/pkg-libvirt/git-template\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp.conf.xml:183
+msgid ""
+"can be used to create remote repositories for the pkg-libvirt project using:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><programlisting>
+#: manpages/gbp.conf.xml:187
+#, no-wrap
+msgid ""
+" gbp-create-remote-repo --remote-config=pkg-libvirt\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp.conf.xml:191
+msgid ""
+"This can be useful if you're often creating new remote repositories for "
+"different projects."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp.conf.xml:197
+msgid "Notes"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><note><para>
+#: manpages/gbp.conf.xml:200
+msgid ""
+"To see the current set of values that would be applied after parsing the "
+"configuration files, use <xref linkend=\"man.gbp.config\"/>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><note><para>
+#: manpages/gbp.conf.xml:207
+msgid ""
+"<command>gbp import-dscs</command> and <command>git-pbuilder</command> can't "
+"be configured via <filename>gbp.conf</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:217
+msgid "An example set up for packaging work:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:221
+#, no-wrap
+msgid ""
+" # $HOME/.gbp.conf\n"
+"\n"
+" [DEFAULT]\n"
+" pristine-tar = True\n"
+" cleaner = fakeroot debian/rules clean\n"
+"\n"
+" [buildpackage]\n"
+" export-dir = ../build-area/\n"
+"\n"
+" [import-orig]\n"
+" dch = False\n"
+" filter = [\n"
+" '.svn',\n"
+" '.hg',\n"
+" '.bzr',\n"
+" 'CVS',\n"
+" 'debian/*',\n"
+" '*/debian/*'\n"
+" ]\n"
+" filter-pristine-tar = True\n"
+"\n"
+" [import-dsc]\n"
+" filter = [\n"
+" 'CVS',\n"
+" '.cvsignore',\n"
+" '.hg',\n"
+" '.hgignore'\n"
+" '.bzr',\n"
+" '.bzrignore',\n"
+" '.gitignore'\n"
+" ]\n"
+"\n"
+" # End of file\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp.conf.xml:258
+msgid "ENVIRONMENT"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:260
+msgid ""
+"The following environment variables can be used to modify &gbp;'s "
+"configuration file handling:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.conf.xml:265
+msgid "<envar>GBP_CONF_FILES</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:268
+msgid ""
+"A colon separated list of configuration files to parse. If unset or empty "
+"the default list of files is parsed (see above)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.conf.xml:274
+msgid "<envar>GBP_DISABLE_SECTION_DEPRECATION</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:277
+msgid ""
+"When set to a non-empty value don't print a deprecation warning in case "
+"&gbp; encounters a section starting with <emphasis>git-</emphasis> or "
+"<emphasis>gbp-</emphasis>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.conf.xml:284
+msgid "<envar>GBP_DISABLE_GBP_CONF_DEPRECATION</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:287
+msgid ""
+"When set to a non-empty value don't print a deprecation warning in case "
+"&gbp; encounters a configuration file in a deprecated location."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp.conf.xml:297
+msgid "FILES"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:299
+msgid "See <filename>/etc/git-buildpackage/gbp.conf</filename> for an example."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:306
+msgid ""
+"<xref linkend=\"man.gbp.config\"/>, <xref linkend=\"man.gbp.clone\"/>, <xref "
+"linkend=\"man.gbp.create.remote.repo\"/>, <xref linkend=\"man.gbp.pq\"/>, "
+"<xref linkend=\"man.gbp.pull\"/>, <xref linkend=\"man.gbp.dch\"/>, <xref "
+"linkend=\"man.gbp.import.dsc\"/>, <xref linkend=\"man.gbp.import.orig\"/>, "
+"<xref linkend=\"man.gbp.buildpackage\"/>, <ulink url=\"file:///usr/share/doc/"
+"git-buildpackage/manual-html/index.html\"> <citetitle>The Git-Buildpackage "
+"Manual</citetitle></ulink>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp.conf.xml:320
+msgid "AUTHORS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:322
+msgid ""
+"This manual page is based on a POD version by Jari Aalto <email>jari."
+"aalto@cante.net</email>. Released under license GNU GPL version 2 or (at "
+"your option) any later. version."
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-create-remote-repo.xml:12
+#: manpages/gbp-create-remote-repo.xml:16
+msgid "gbp-create-remote-repo"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-create-remote-repo.xml:18
+msgid "Create remote repositories"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-create-remote-repo.xml:22
+msgid ""
+"&gbp-create-remote-repo; &man.common.options.synopsis; <arg><option>--remote-"
+"url-pattern=</option><replaceable>url-pattern</replaceable></arg> "
+"<arg><option>--remote-name=</option><replaceable>name</replaceable></arg> "
+"<arg><option>--template-dir=</option><replaceable>directory</replaceable></"
+"arg> <arg><option>--remote-config=</option><replaceable>config</"
+"replaceable></arg> <arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</"
+"replaceable></arg> <arg><option>--upstream-branch=</"
+"option><replaceable>branch_name</replaceable></arg> <arg><option>--"
+"[no-]track</option></arg> <arg><option>--[no-]bare</option></arg> <group "
+"choice=\"opt\"> <arg><replaceable>create</replaceable></arg> "
+"<arg><replaceable>list</replaceable></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:42
+msgid ""
+"&gbp-create-remote-repo; creates a repository at a remote location via ssh "
+"and pushes the local repository into it. It then sets up remote branch "
+"tracking so you can use &gbp-pull; to update your repository from there."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:47
+msgid ""
+"Before performing any action on the remote location, it will print the "
+"remote URL and ask for confirmation."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:51
+msgid ""
+"Note: By default, the remote repositories are created in the <systemitem "
+"class=\"groupname\">collab-maint</systemitem> repository on <systemitem "
+"class=\"systemname\">git.debian.org</systemitem>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:56
+msgid ""
+"When invoked with <option>list</option> it lists the available remote config "
+"templates."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:66
+msgid ""
+"<option>--remote-url-pattern</option>=<replaceable>pattern</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:69
+msgid ""
+"Where to create the remote repository. The part <replaceable>%(pkg)s</"
+"replaceable> will be replaced by the package name."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:75
+msgid "<option>--remote-name</option>=<replaceable>name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:78
+msgid ""
+"What name git will use when referring to that repository, e.g. 'origin'."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:83
+msgid "<option>--template-dir</option>=<replaceable>directory</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:86
+msgid ""
+"Template directory to pass to <command>git init</command> on the remote "
+"side. This can be used to customize the remote repository, e.g. to set up "
+"hooks."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:92
+msgid "<option>--remote-config</option>=<replaceable>config</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:95
+msgid ""
+"Name of a config file section in <filename>gbp.conf</filename> that "
+"specifies the above parameters. See <xref linkend=\"man.gbp.conf\"/> manpage "
+"for details."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:105 manpages/gbp-import-ref.xml:129
+msgid ""
+"The branch in the &git; repository the &debian; package is being developed "
+"on, default is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:121
+msgid "Whether to push the pristine tar branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:125
+msgid "<option>--[no-]track</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:128
+msgid ""
+"Whether to set up branch tracking for the debian, upstream and pristine-tar "
+"branches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:133
+msgid "<option>--[no-]bare</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:136
+msgid ""
+"Whether to the remote repository should be a bare repository (this is the "
+"default)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:148
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.pull\"/>, "
+"<xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-dch.xml:12 manpages/gbp-dch.xml:16
+msgid "gbp-dch"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-dch.xml:17
+msgid "Generate the &debian; changelog from git commit messages"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-dch.xml:21
+msgid ""
+"&gbp-dch; &man.common.options.synopsis; <arg><option>--debian-branch=</"
+"option><replaceable>branch_name</replaceable></arg> <arg><option>--debian-"
+"tag=</option><replaceable>tag-format</replaceable></arg> <arg><option>--"
+"upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></"
+"arg> <arg><option>--ignore-branch</option></arg> <group> <arg><option>-s</"
+"option> <replaceable>commitish</replaceable></arg> <arg><option>--since=</"
+"option><replaceable>commitish</replaceable></arg> </group> <group> <group> "
+"<arg><option>-S</option></arg> <arg><option>--snapshot</option></arg> </"
+"group> <group> <arg><option>-R</option></arg> <arg><option>--release</"
+"option></arg> </group> </group> <group> <arg><option>-N</option> "
+"<replaceable>version</replaceable></arg> <arg><option>--new-version=</"
+"option><replaceable>version</replaceable></arg> </group> <group> "
+"<arg><option>--bpo</option></arg> <arg><option>--nmu</option></arg> "
+"<arg><option>--qa</option></arg> <arg><option>--security</option></arg> "
+"<arg><option>--team</option></arg> <arg><option>--local=</"
+"option><replaceable>suffix</replaceable></arg> </group> <arg><option>--"
+"distribution=</option><replaceable>name</replaceable></arg> <arg><option>--"
+"force-distribution</option></arg> <group> <arg><option>-U</option> "
+"<replaceable>level</replaceable></arg> <arg><option>--urgency=</"
+"option><replaceable>level</replaceable></arg> </group> <arg><option>--"
+"[no-]full</option></arg> <arg><option>--[no-]meta</option></arg> "
+"<arg><option>--meta-closes=bug-close-tags</option></arg> <arg><option>--meta-"
+"closes-bugnum=bug-number-format</option></arg> <arg><option>--snapshot-"
+"number=</option><replaceable>expression</replaceable></arg> <arg><option>--"
+"id-length=</option><replaceable>number</replaceable></arg> <arg><option>--"
+"git-log=</option><replaceable>git-log-options</replaceable></arg> "
+"<arg><option>--[no-]git-author</option></arg> <arg><option>--"
+"[no-]multimaint</option></arg> <arg><option>--[no-]multimaint-merge</"
+"option></arg> <arg><option>--spawn-editor=[always|never|snapshot|release]</"
+"option></arg> <arg><option>--commit-msg=</option><replaceable>msg-format</"
+"replaceable></arg> <group> <arg><option>-c</option></arg> <arg><option>--"
+"commit</option></arg> </group> <arg><option>--customizations=</"
+"option><replaceable>customization-file</replaceable></arg> <arg><option>--"
+"postedit=</option><replaceable>COMMAND</replaceable></arg> <arg "
+"rep='repeat'><option>--dch-opt=</option><replaceable>dch-options</"
+"replaceable></arg> <arg><option>--verbose</option></arg> <arg choice=\"plain"
+"\"><replaceable><optional>path1 path2</optional></replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:86
+msgid ""
+"&gbp-dch; reads git commit messages and generates the &debian; changelog "
+"from it. It starts at a given commit specified by the <option>--since</"
+"option> option up to the current <emphasis>HEAD</emphasis>. For each commit "
+"found it adds the commit message to the changelog. If <option>--since</"
+"option> is not given the commit to start from is determined by the following "
+"rules (first one matches):"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-dch.xml:96
+msgid ""
+"The start commit is read from the snapshot banner (see below for details)"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-dch.xml:98
+msgid ""
+"If the topmost version of the <filename>debian/changelog</filename> is "
+"alread tagged. Use the commit the tag points to as start commit."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-dch.xml:101
+msgid ""
+"The last commit that modified <filename>debian/changelog</filename> is used "
+"as start commit."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:105
+msgid "This is called automatic mode."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:108
+msgid ""
+"If the distribution of the topmost section in <filename>debian/changelog</"
+"filename> is <emphasis>UNRELEASED</emphasis>, the changelog entries will be "
+"inserted into this section. Otherwise a new section will be created."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:115
+msgid ""
+"If one ore more paths are given as arguments &gbp-dch; will only include "
+"changes in <filename>debian/changelog</filename> that affect these paths. E."
+"g. using <emphasis>debian/</emphasis> is a good choice if upstream uses "
+"&git; and you don't want the upstream history to end up in <filename>debian/"
+"changelog</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:123
+msgid ""
+"To restrict the selected changes even further you can use use the <option>--"
+"git-log</option> option which is passed on verbatim to <command>git log</"
+"command>. E.g. by using <option>--git-log=</option><replaceable>\"--"
+"author=Foo Bar\"</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:130
+msgid ""
+"The above relies on the <option>--debian-branch</option> option pointing to "
+"the current branch and <option>--upstream-branch</option> pointing to the "
+"corresponding upstream branch in order to find the right merge points of "
+"these branches. Furthermore &gbp-dch; must be able to identify git tags from "
+"upstream and Debian version numbers. If you're not using the defaults check "
+"the <option>--upstream-tag</option> and <option>--debian-tag</option> "
+"options and make sure they match the tags created by e.g. &gbp-import-orig; "
+"(when using tarballs) or upstream's tagging pattern (when using upstream's "
+"git directly)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:143
+msgid ""
+"If not changelog exists yet it is created and the version number is derived "
+"from the last upstream tag if found."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:167
+msgid ""
+"Branch to determine the upstream version from. Default is "
+"<replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:183 manpages/gbp-pull.xml:82 manpages/gbp-push.xml:94
+#: manpages/gbp-rpm-ch.xml:99 manpages/gbp-tag.xml:143
+msgid "<option>--ignore-branch</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:187
+msgid ""
+"Don't check if the current branch matches <replaceable>debian-branch</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:193 manpages/gbp-import-dsc.xml:122
+msgid "<option>--debian-tag=</option><replaceable>tag-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:197
+msgid ""
+"Tag format used, when tagging debian versions, default is "
+"<replaceable>debian/%(version)s</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:203
+msgid "<option>--since=</option><replaceable>committish</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:207
+msgid ""
+"Start reading commit messages at <replaceable>committish</replaceable>. "
+"This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:214
+msgid "<option>--auto</option>, <option>-a</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:218
+msgid ""
+"This option is ignored for compatibility with older versions. It used to "
+"trigger automatic mode."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:224
+msgid "<option>--[no-]meta</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:227
+msgid ""
+"Parse meta tags like <option>Closes:</option>, <option>Thanks:</option> and "
+"<option>Gbp-Dch:</option>. See META TAGS below."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:234 manpages/gbp-pq.xml:236
+msgid ""
+"<option>--meta-closes=</option><replaceable>bug-close-tags</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:238
+msgid ""
+"What meta tags to look for to generate bug-closing changelog entries. The "
+"default is <literal>'Closes|LP'</literal> to support Debian and Launchpad."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:244 manpages/gbp-pq.xml:247
+msgid ""
+"<option>--meta-closes-bugnum=</option><replaceable>bug-number-format</"
+"replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:248
+msgid ""
+"What regular expression should be used to parse out the bug number. The "
+"default is <literal>'(?:bug|issue)?\\#?\\s?\\d+'</literal>. Note: the regex "
+"should suppress all portions of the bug number that are not wanted using "
+"<literal>\"(?:)\"</literal>, see Python regex manual for details."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><screen>
+#: manpages/gbp-dch.xml:259
+#, no-wrap
+msgid ""
+" Possible Txt Match? Result\n"
+" ------------ ------ ------\n"
+" bug EX-12345 Y EX-12345\n"
+" ex-01273 Y ex-01273\n"
+" bug ex-1ab Y ex-1\n"
+" EX--12345 N"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:254
+msgid ""
+"Example: <option>--meta-closes-bugnum=</option><literal>\"(?:bug)?\\s*ex-\\d+"
+"\"</literal> would match all of the following: <placeholder type=\"screen\" "
+"id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:269 manpages/gbp-rpm-ch.xml:175
+msgid "<option>--[no-]full</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:273 manpages/gbp-rpm-ch.xml:179
+msgid "Include the full commit message in the changelog output."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:278
+msgid "<option>--snapshot</option>, <option>-S</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:282
+msgid ""
+"Create a snapshot release entry. It uses a snapshot release number which is "
+"smaller than the final release number and adds a warning banner to the "
+"changelog entry. The version number is being auto incremented with every new "
+"snapshot release."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:289
+msgid ""
+"The snapshot banner is also used by &gbp-dch; to determine which entries are "
+"already in the changelog. This prevents duplicated entries in "
+"<filename>debian/changelog</filename> when you did not commit the changelog "
+"yet."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:297
+msgid ""
+"<option>--snapshot-number=</option><replaceable>expression</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:301
+msgid "Python expression that gets eval()ed to the new snapshot number."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:306
+msgid "<option>--release</option>, <option>-R</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:310
+msgid ""
+"Remove any snapshot release banners and version suffixes (if any), set the "
+"current distribution to <replaceable>unstable</replaceable>, and open the "
+"changelog for final tweaking. This option can't be set via &gbp.conf;. It's "
+"usually used to finalize the changelog before making a release."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:320
+msgid ""
+"<option>--new-version=</option><replaceable>version</replaceable>, <option>-"
+"N</option> <replaceable>version</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:325
+msgid ""
+"Add a new changelog section with version <replaceable>newversion</"
+"replaceable>. Together with <option>--snapshot</option>, the snapshot number "
+"will be appended to <replaceable>newversion</replaceable>. This option "
+"can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:334
+msgid "<option>--team</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:338
+msgid ""
+"Create a Team upload changelog entry. This option can't be set via &gbp."
+"conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:344
+msgid "<option>--bpo</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:348
+msgid ""
+"Increment the Debian release number for an upload to backports, and add a "
+"backport upload changelog comment. This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:355
+msgid "<option>--nmu</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:359
+msgid ""
+"Increment the Debian release number for a non-maintainer upload. This "
+"option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:365
+msgid "<option>--qa</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:369
+msgid ""
+"Increment the Debian release number for a Debian QA Team upload, and add a "
+"QA upload changelog comment. This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:376
+msgid "<option>--security</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:380
+msgid ""
+"Increment the Debian release number for a Debian Security Team non-"
+"maintainer upload, and add a \"Security Team upload\" changelog comment. "
+"This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:388
+msgid ""
+"<option>--local=</option><replaceable>suffix</replaceable>, <option>-l</"
+"option> <replaceable>suffix</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:393
+msgid ""
+"Increment the Debian release number for a local build using the specified "
+"suffix. This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:400
+msgid "<option>--distribution=</option><replaceable>name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:404
+msgid ""
+"Set the distribution field to <replaceable>name</replaceable>. This option "
+"can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:410
+msgid "<option>--force-distribution</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:414
+msgid ""
+"Force the distribution specified with <option>--distribution</option> to be "
+"used, even if it doesn't match the list of known distributions. This option "
+"can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:421
+msgid "<option>--urgency=</option><replaceable>level</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:425
+msgid "Set the urgency field to <replaceable>level</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:430
+msgid "<option>--git-log=</option><replaceable>git-log-options</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:434 manpages/gbp-rpm-ch.xml:188
+msgid "Options passed on verbatim to git-log(1)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:439 manpages/gbp-rpm-ch.xml:193
+msgid "<option>--id-length=</option><replaceable>N</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:443 manpages/gbp-rpm-ch.xml:197
+msgid ""
+"Include <replaceable>N</replaceable> digits of the commit id in the "
+"changelog entry. Default is to not include any commit ids at all."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:449
+msgid "<option>--ignore-regex=</option><replaceable>regex</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:453
+msgid ""
+"Ignore commit lines matching <replaceable>regex</replaceable> when "
+"generating the changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:459
+msgid "<option>--git-author</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:463
+msgid ""
+"Use user.name and user.email from <application>git-config</application>(1) "
+"for changelog trailer."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:469
+msgid "<option>--[no-]multimaint-merge</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:473
+msgid "Merge commits by maintainer."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:478
+msgid ""
+"<option>--spawn-editor=<replaceable>[always|never|snapshot|release]</"
+"replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:482
+msgid ""
+"Whether to spawn an editor: always, never, when doing snapshots or when "
+"doing a release."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:488
+msgid "<option>--commit-msg=</option><replaceable>msg-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:492
+msgid ""
+"Use this format string for the commit message when committing the generated "
+"changelog file (when <option>--commit</option> is given). Default is "
+"<replaceable>Update changelog for %(version)s release</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:500
+msgid "<option>--commit</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:504
+msgid "Commit the generated changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:509
+msgid ""
+"<option>--customizations=</option><replaceable>customization-file</"
+"replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:513
+msgid ""
+"Load Python code from <replaceable>customization-file</replaceable>. At the "
+"moment, the only useful thing the code can do is define a custom "
+"format_changelog_entry() function."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:520
+msgid "<option>--postedit=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:524
+msgid ""
+"Run<replaceable>COMMAND</replaceable> after changes to the changelog file "
+"have been finalized, That is, after dch has been run and possible text "
+"editor has been exited, but, before changes are (possibly) committed to git."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:532
+msgid "<option>--dch-opt=</option><replaceable>dch-option</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:536
+msgid ""
+"Pass option to &dch; verbatim. Note that &gbp-dch; invokes &dch; multiple "
+"times and the option is passed to all invocations so not all &dch; options "
+"make sense here. Options may also conflict with options picked by &gbp-dch;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-dch.xml:547
+msgid "Snapshot mode"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:549
+msgid ""
+"Snapshot mode can be used for quick test and install cycles without having "
+"to worry about version numbers or changelog entries."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:553
+msgid ""
+"When using <option>--snapshot</option> or <option>-S</option>, &gbp-dch; "
+"uses a pseudo header in the Debian changelog to remember the last git commit "
+"it added a changelog entry for. It also sets a version number ending in "
+"<replaceable>~<snaspshotnumber>.gbp<commitid></replaceable>. It "
+"automatically increments the snapshot number on subsequent invocations of "
+"&gbp-dch; <option>-S</option> so that later snapshots automatically have a "
+"higher version number. To leave snapshot mode, invoke &gbp-dch; with the "
+"<option>--release</option> option. This removes the pseudo header and "
+"unmangles the version number so the released version has a higher version "
+"number than the snapshots."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-dch.xml:567 manpages/gbp-pq-rpm.xml:204
+#: manpages/gbp-rpm-ch.xml:280
+msgid "META TAGS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:569
+msgid ""
+"Additional to the above options, the formatting of the commit message in "
+"<filename>debian/changelog</filename> can be modified by special tags "
+"(called Meta Tags) given in the git commit message. Meta Tag processing can "
+"be activated via the <option>--meta</option> option. The tags must start at "
+"the first column of a commit message but can appear on any line. They are "
+"of the form <option>Tagname</option>: <replaceable>value</replaceable>. "
+"Valid Meta Tags are:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:581
+msgid "<option>Gbp-Dch</option>: <replaceable>action</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:585
+msgid ""
+"Supported actions are: <replaceable>Ignore</replaceable> which will ignore "
+"this commit when generating <filename>debian/changelog</filename>, "
+"<replaceable>Short</replaceable> which will only use the description (the "
+"first line) of the commit message when generating the changelog entry "
+"(useful when <option>--full</option> is given), and <replaceable>Full</"
+"replaceable> which will use the full commit message when generating the "
+"changelog entry (useful when <option>--full</option> is not given)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:597
+msgid ""
+"In addition to <option>Gbp-Dch</option>, the deprecated <option>Git-Dch</"
+"option> is still supported."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:603
+msgid "<option>Thanks</option>: <replaceable>msg</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:607
+msgid "Add a thanks message after the commit message."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:612
+msgid "<option>Closes</option>: <replaceable>bugnumber</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:616
+msgid ""
+"Indicate in the <filename>debian/changelog</filename> that the bug was "
+"closed by this commit. See the <option>--meta-closes</option> on how to "
+"extend this for other bugtrackers."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:624 manpages/gbp-rpm-ch.xml:318
+msgid "The following git commit message:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-dch.xml:627
+#, no-wrap
+msgid ""
+" Document meta tags\n"
+"\n"
+" so one doesn't have to consult the manual\n"
+"\n"
+" Gbp-Dch: Short\n"
+" Closes: #636088\n"
+" Thanks: Raphal Hertzog for the suggestion"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:635
+msgid "Results in this <filename>debian/changelog</filename> entry:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-dch.xml:638
+#, no-wrap
+msgid ""
+" * Document meta tags.\n"
+" Thanks to Raphal Hertzog for the suggestion (Closes: #636088)"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:647
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.import.dsc"
+"\"/>, <xref linkend=\"man.gbp.import.dscs\"/>, <xref linkend=\"man.gbp."
+"import.orig\"/>, <xref linkend=\"man.gbp.conf\"/>, &man.seealso.common; "
+"<ulink url=\"https://honk.sigxcpu.org/cl2vcs\"> <citetitle>Cl2vcs</"
+"citetitle></ulink>,"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-export-orig.xml:11 manpages/gbp-export-orig.xml:15
+msgid "gbp-export-orig"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-export-orig.xml:16
+msgid "Export upstream tarballs from a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-export-orig.xml:20
+msgid ""
+"&gbp-export-orig; <arg><option>--verbose</option></arg> <arg><option>--"
+"color=</option>[auto|on|off]</arg> <arg><option>--color-scheme</"
+"option>=<replaceable>COLOR_SCHEME</replaceable></arg> <arg><option>--"
+"upstream-branch=</option><replaceable>BRANCH_NAME</replaceable></arg> "
+"<arg><option>--[no-]submodules</option></arg> <arg><option>--upstream-tag=</"
+"option><replaceable>tag-format</replaceable></arg> <arg><option>--upstream-"
+"tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable></arg> "
+"<arg><option>--tarball-dir=</option><replaceable>DIRECTORY</replaceable></"
+"arg> <arg><option>--force-create</option></arg> <arg><option>--compression=</"
+"option><replaceable>TYPE</replaceable></arg> <arg><option>--compression-"
+"level=</option><replaceable>LEVEL</replaceable></arg> <arg "
+"rep='repeat'><option>--component=</option><replaceable>component</"
+"replaceable></arg> <arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--upstream-signatures=</option>[auto|on|off]</arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-export-orig.xml:40
+msgid ""
+"&gbp-export-orig; is used to export upstream tarballs from a &git; "
+"repository. Usually upstream tarballs are created by &gbp-buildpackage; when "
+"needed but if you don't want to perform a build you can use this command."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:50
+msgid "<option>--verbose</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:54
+msgid "verbose execution"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:59
+msgid "<option>--color=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:68
+msgid "<option>--color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:72
+msgid ""
+"Colors to use in output (when color is enabled). The format for COLOR_SCHEME "
+"is '<debug>:<info>:<warning>:<error>'. Numerical "
+"values and color names are accepted, empty fields imply the default color. "
+"For example --color-scheme='cyan:34::' would show debug messages in cyan, "
+"info messages in blue and other messages in default (i.e. warning and error "
+"messages in red)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:83
+msgid ""
+"<option>--upstream-branch</option>=<replaceable>BRANCH_NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:87
+msgid ""
+"Branch to build the orig tarball from if <option>--upstream-tree</option> is "
+"set to <replaceable>BRANCH</replaceable>. Default is <replaceable>upstream</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:95
+msgid "<option>--[no-]submodules</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:104 manpages/gbp-import-srpm.xml:141
+#: manpages/gbp-pq-rpm.xml:153 manpages/gbp-pq.xml:273
+#: manpages/gbp-push.xml:131
+msgid "<option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:114
+msgid "<option>--force-create</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:124
+msgid ""
+"<option>--upstream-tree=</option><replaceable>[BRANCH|TAG|TREEISH]</"
+"replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:128
+msgid ""
+"How to find the upstream sources used to generate the tarball. "
+"<replaceable>TAG</replaceable> (the default) looks at a tag corresponding to "
+"the version in the changelog. <replaceable>BRANCH</replaceable> looks at the "
+"upstream branch given via the <option>--upstream-branch</option> option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:138
+msgid ""
+"This doesn't have any effect if <option>--pristine-tar</option> is being "
+"used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:144
+msgid "<option>--tarball-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:148
+msgid ""
+"Search for original tarballs in <replaceable>DIRECTORY</replaceable> instead "
+"of generating them. <replaceable>DIRECTORY</replaceable> can contain a "
+"version format substitution pattern, eg: <replaceable>foo-%(version)s</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:156
+msgid "<option>--compression=</option><replaceable>TYPE</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:171
+msgid "<option>--compression-level=</option><replaceable>LEVEL</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:181 manpages/gbp-import-orig.xml:246
+#: manpages/gbp-pristine-tar.xml:60
+msgid "<option>--component=</option><replaceable>COMPONENT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:185
+msgid ""
+"When generating tarballs create an additional original tarball of directory "
+"<replaceable>COMPONENT</replaceable> in the source tree. Using additional "
+"original tarballs is a feature of the 3.0 (quilt) source format. See the "
+"<command>dpkg-source</command> manpage for details. Note that the "
+"<replaceable>--pristine-tar-commit</replaceable> option is currently "
+"incompatible with this option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:211 manpages/gbp-import-orig.xml:393
+msgid "<option>--upstream-signatures=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:215
+msgid "Whether to export with upstream signatures."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-export-orig.xml:223
+msgid ""
+"Generate an upstream tarball of the version currently referenced in the "
+"changelog using &pristine-tar;:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-export-orig.xml:227
+#, no-wrap
+msgid ""
+" &gbp-export-orig; --pristine-tar\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-export-orig.xml:230
+msgid ""
+"Same as above but generate and additional tarball for directory "
+"<filename>foo</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-export-orig.xml:234
+#, no-wrap
+msgid ""
+" &gbp-export-orig; --pristine-tar --component=foo\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-export-orig.xml:243
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.import.orig"
+"\"/>, <xref linkend=\"man.gbp.pristine.tar\"/>, <xref linkend=\"man.gbp.conf"
+"\"/>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-dscs.xml:12 manpages/gbp-import-dscs.xml:16
+msgid "gbp-import-dscs"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-dscs.xml:17
+msgid ""
+"Import multiple versions of a Debian source packages into a Git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-dscs.xml:21
+msgid ""
+"&gbp-import-dscs; <arg><option>options</option></arg> <arg><option>gbp "
+"import-dsc options</option></arg> <arg choice=\"plain\"><replaceable>pkg_1."
+"dsc</replaceable></arg> <arg choice=\"plain\"><replaceable>pkg_2.dsc</"
+"replaceable></arg> <arg choice=\"plain\"><replaceable>...</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><para>
+#: manpages/gbp-import-dscs.xml:29
+msgid "or"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-dscs.xml:32
+msgid ""
+"&gbp-import-dscs; <arg choice=\"req\">--debsnap</arg> <arg><option>options</"
+"option></arg> <arg><option>gbp import-dsc options</option></arg> <arg choice="
+"\"req\"><replaceable>package</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dscs.xml:42
+msgid ""
+"&gbp-import-dscs; imports several versions of a Debian source package into a "
+"&git; repository. To do so, it sorts the packages by their versions first, "
+"and then imports them via calling &gbp-import-dsc; on each package."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dscs.xml:48
+msgid ""
+"If the current directory isn't a &git; repository already, the repository is "
+"created in a subdir of the current working directory, named after the first "
+"imported package, otherwise the &git; repository in the current working "
+"directory is being used. This allows for incremental imports."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dscs.xml:58
+msgid "<option>--debsnap</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dscs.xml:61
+msgid "Fetch snapshots from snapshots.debian.org using debsnap."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dscs.xml:65
+msgid "<option>--ignore-repo-config</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dscs.xml:68
+msgid ""
+"Ignore <filename>gbp.conf</filename> files stored in the git repository "
+"itself. This can be useful to ignore branch information and other options "
+"shipped in the package source."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dscs.xml:75
+msgid "All other options are passed on verbatim to &gbp-import-dsc;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dscs.xml:82
+msgid ""
+"<xref linkend=\"man.gbp.import.dsc\"/>, <xref linkend=\"man.gbp.buildpackage"
+"\"/>, <xref linkend=\"man.gbp.import.orig\"/>, <xref linkend=\"man.gbp.dch\"/"
+">, <xref linkend=\"man.gbp.conf\"/>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-dsc.xml:12 manpages/gbp-import-dsc.xml:16
+msgid "gbp-import-dsc"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-dsc.xml:17
+msgid "Import &debian; packages into a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-dsc.xml:21
+msgid ""
+"&gbp-import-dsc; &man.common.options.synopsis; <arg><option>--allow-same-"
+"versions</option></arg> <arg><option>--author-date-is-committer-date</"
+"option></arg> <arg><option>--author-is-committer</option></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</"
+"replaceable></arg> <arg><option>--debian-tag=</option><replaceable>tag-"
+"format</replaceable></arg> <arg rep='repeat'><option>--filter=</"
+"option><replaceable>pattern</replaceable></arg> <arg><option>--keyid=</"
+"option><replaceable>gpg-keyid</replaceable></arg> <arg><option>--[no-]create-"
+"missing-branches</option></arg> <arg><option>--[no-]pristine-tar</option></"
+"arg> <arg><option>--[no-]sign-tags</option></arg> <arg><option>--skip-debian-"
+"tag</option></arg> <arg><option>--upstream-branch=</"
+"option><replaceable>branch_name</replaceable></arg> <arg><option>--upstream-"
+"tag=</option><replaceable>tag-format</replaceable></arg> <arg><option>--"
+"upstream-vcs-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg> "
+"<arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg> <arg "
+"choice=\"plain\"><replaceable>debian-source.dsc</replaceable></arg> <arg "
+"choice=\"opt\"><replaceable>target</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-dsc.xml:43
+msgid ""
+"&gbp-import-dsc; <arg><option>options</option></arg> <arg><option>--"
+"[no-]allow-unauthenticated</option></arg> <group choice=\"plain\"> "
+"<arg><replaceable>URL</replaceable></arg> </group> <arg choice=\"opt"
+"\"><replaceable>target</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:55
+msgid ""
+"&gbp-import-dsc; imports a &debian; source package into a &git; repository, "
+"notes the package version in the commit logs, and commits the change. All "
+"information, including package name, version, &debian; modifications and "
+"upstream source, is automatically detected from the source package. After "
+"import the repository can be used with the other &gbp; tools."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:62
+msgid ""
+"If the command is run from within an existing &git; repository, it will "
+"import into it; if not, a new repository named as the Debian source package "
+"is created. You can override the location of the new repository by "
+"specifying the optional <replaceable>target</replaceable> argument."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:68
+msgid ""
+"When given a <replaceable>URL</replaceable> &gbp-import-dsc; will download "
+"the source package prior to importing it. &dget; is used for all schemes "
+"except for the special scheme <replaceable>apt:///</replaceable> which uses "
+"&apt-get; (and therefore needs <replaceable>deb-src</replaceable> entries in "
+"your <filename>/etc/apt/sources.list</filename>). The later can be "
+"abbreviated by using the pseudo URL <replaceable>apt:</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:98
+msgid ""
+"The branch in the &git; repository the debian sources are put onto. Default "
+"is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:104 manpages/gbp-import-orig.xml:195
+#: manpages/gbp-import-ref.xml:135 manpages/gbp-import-srpm.xml:104
+#: manpages/gbp-tag.xml:83
+msgid "<option>--[no-]sign-tags</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:108
+msgid "GPG sign all created tags"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:113 manpages/gbp-import-orig.xml:204
+#: manpages/gbp-import-ref.xml:144
+msgid "<option>--keyid=</option><replaceable>gpg-keyid</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:132 manpages/gbp-import-orig.xml:214
+#: manpages/gbp-import-ref.xml:100 manpages/gbp-pristine-tar.xml:50
+msgid "<option>--upstream-tag=</option><replaceable>tag-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:136 manpages/gbp-import-orig.xml:218
+#: manpages/gbp-import-srpm.xml:145
+msgid ""
+"Use this tag format when tagging upstream versions, default is "
+"<replaceable>upstream/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:142 manpages/gbp-import-orig.xml:182
+msgid ""
+"<option>--upstream-vcs-tag</option>=<replaceable>tag-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:146 manpages/gbp-import-orig.xml:186
+msgid ""
+"Add <replaceable>tag-format</replaceable> as additional parent to the commit "
+"of the upstream tarball. Useful when upstream uses git and you want to link "
+"to its revision history. The <replaceable>tag-format</replaceable> can be a "
+"pattern similar to what <option>--upstream-tag</option> supports."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:153
+msgid ""
+"The default is to not add upstream tags as additional parents since this "
+"requires additional setup to have the upstream sources in the same "
+"repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:160
+msgid "<option>--skip-debian-tag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:164
+msgid ""
+"Don't create &debian; tag after importing the &debian; patch. This can be "
+"useful if you already created a package but want to further work on it after "
+"importing it into git."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:171 manpages/gbp-import-orig.xml:235
+msgid "<option>--filter=</option><replaceable>pattern</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:175
+msgid ""
+"Filter out files glob-matching <option><replaceable>pattern</replaceable></"
+"option> from upstream tarballs and the debian tarball of 3.0(quilt) "
+"packages. Note that the <emphasis>.diff.gz</emphasis> of 1.0 source format "
+"packages is currently not filtered."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:182
+msgid "This option can be given multiple times."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:191 manpages/gbp-import-srpm.xml:186
+msgid "Generate pristine-tar delta file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:196
+msgid "<option>--allow-unauthenticated</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:200
+msgid ""
+"Whether to skip signature verification on downloads. Passed on verbatim to "
+"&dget; and &apt-get; respectively. Use with care."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:207 manpages/gbp-import-srpm.xml:191
+msgid "<option>--allow-same-version</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:211
+msgid "Allow one to import a package with the same debian version."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:216 manpages/gbp-import-srpm.xml:202
+msgid "<option>--author-is-committer</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:220
+msgid ""
+"When importing the &debian; patch, use the author identity as committer "
+"identity."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:226
+msgid "<option>--author-date-is-committer-date</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:230
+msgid ""
+"When importing the &debian; patch, use the author date as committer date."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><warning><para>
+#: manpages/gbp-import-dsc.xml:234
+msgid ""
+"&git; will subtly misbehave if the committer date of a commit is not later "
+"than or equal to all its parents."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:242 manpages/gbp-import-srpm.xml:212
+msgid "<option>--[no-]create-missing-branches</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:246
+msgid "Create upstream and debian branch if missing."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:254 manpages/gbp-import-srpm.xml:246
+msgid ""
+"When set to <option>DEBIAN</option> use the <envar>DEBUSER</envar> "
+"environment variable to set the user.name &git; configuration otherwise use "
+"&git;'s defaults. Only affects newly created repos."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:265 manpages/gbp-import-srpm.xml:257
+msgid ""
+"When set to <option>DEBIAN</option> use the <envar>DEBEMAIL</envar> "
+"environment variable to set the user.email &git; configuration otherwise use "
+"&git;'s defaults. Only affects newly created repos."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:280
+msgid "Download and import a source package from a URL:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-dsc.xml:283
+#, no-wrap
+msgid ""
+" &gbp-import-dsc; http://http.debian.net/debian/pool/main/h/hello/hello_2.10-1.dsc\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:286
+msgid ""
+"Download and import a source package via <command>apt-get source</command> "
+"from unstable:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-dsc.xml:290
+#, no-wrap
+msgid ""
+" &gbp-import-dsc; apt:hello/sid\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:293
+msgid "Import a source package in the local file system:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-dsc.xml:296
+#, no-wrap
+msgid ""
+" &gbp-import-dsc; ../hello_2.10-1.dsc\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:303
+msgid ""
+"<xref linkend=\"man.gbp.import.dscs\"/>, <xref linkend=\"man.gbp.buildpackage"
+"\"/>, <xref linkend=\"man.gbp.import.orig\"/>, <xref linkend=\"man.gbp.dch\"/"
+">, <citerefentry> <refentrytitle>apt-get</refentrytitle> <manvolnum>1</"
+"manvolnum> </citerefentry>, <citerefentry> <refentrytitle>sources.list</"
+"refentrytitle> <manvolnum>5</manvolnum> </citerefentry>, <citerefentry> "
+"<refentrytitle>dget</refentrytitle> <manvolnum>1</manvolnum> </"
+"citerefentry>, <xref linkend=\"man.gbp.conf\"/>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-orig.xml:12 manpages/gbp-import-orig.xml:16
+msgid "gbp-import-orig"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-orig.xml:17
+msgid "Import an upstream source into a git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-orig.xml:21
+msgid ""
+"&gbp-import-orig; &man.common.options.synopsis; <arg><option>--upstream-"
+"version=</option><replaceable>version</replaceable></arg> <arg><option>--"
+"[no-]merge</option></arg> <arg><option>--merge-mode=</"
+"option><replaceable>[auto|merge|replace]</replaceable></arg> <arg><option>--"
+"upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</"
+"replaceable></arg> <arg><option>--upstream-vcs-tag=</option><replaceable>tag-"
+"format</replaceable></arg> <arg><option>--[no-]sign-tags</option></arg> "
+"<arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></"
+"arg> <arg rep='repeat'><option>--filter=</option><replaceable>pattern</"
+"replaceable></arg> <arg rep='repeat'><option>--component=</"
+"option><replaceable>component</replaceable></arg> <arg><option>--"
+"[no-]pristine-tar</option></arg> <arg><option>--[no-]filter-pristine-tar</"
+"option></arg> <arg><option>--[no-]symlink-orig</option></arg> <arg><option>--"
+"postimport=cmd</option></arg> <arg><option>--postunpack=cmd</option></arg> "
+"<arg><option>--[no-]interactive</option></arg> <arg><option>--[no-]rollback</"
+"option></arg> <arg><option>--upstream-signatures=</option>[auto|on|off]</"
+"arg> <group choice=\"plain\"> <arg choice=\"plain\"><replaceable>filename</"
+"replaceable></arg> <arg choice=\"plain\"><replaceable>url</replaceable></"
+"arg> <arg><option>--uscan</option></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:53
+msgid ""
+"&gbp-import-orig; imports upstream sources into a &git; repository. It can "
+"import from three sources:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-import-orig.xml:59
+msgid ""
+"<replaceable>filename</replaceable>: A file in the local file system. Gzip, "
+"bzip2, lzma and xz compressed tar archives, zip archives and already "
+"unpacked source trees are supported."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-import-orig.xml:67
+msgid ""
+"<replaceable>url</replaceable>: The tarball is downloaded from a "
+"<replaceable>http</replaceable> or <replaceable>https</replaceable> "
+"<replaceable>url</replaceable>. This needs the python3-request package "
+"installed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-import-orig.xml:75
+msgid ""
+"<option>--uscan</option>: The latest upstream or specified version is "
+"fetched via &uscan; relying on <filename>debian/watch</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:81
+msgid ""
+"If the tarballs name is already of the form <replaceable>package-"
+"name_version.orig.tar.gz</replaceable>, the version information is "
+"determined from the tarball's filename, otherwise it can be given on the "
+"command line via <option>--upstream-version</option>. If the source package "
+"name or version can't be determined, &gbp-import-orig; will prompt for it "
+"unless <option>--no-interactive</option> is given."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:90
+msgid ""
+"The sources are placed on the upstream branch (default: "
+"<replaceable>upstream</replaceable>), tagged and merged onto the debian "
+"branch (default: <replaceable>master</replaceable>). This is either done "
+"using plain <command>git merge</command> or by creating a new tree that "
+"consists of the new upstream version plus the <filename>debian/</filename> "
+"directory. The later is used for source format 3.0 (quilt) packages since "
+"direct modifications of the upstream sources are not allowed in that format "
+"and so a 1:1 replacement of the upstream sources is almost always desired. "
+"It can be tweaked via the <option>--merge-mode</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:102
+msgid ""
+"In case of an error &gbp-import-orig; will rollback (undo) all changes it "
+"has done to the repository (see the <option>--rollback</option> option)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:113 manpages/gbp-import-ref.xml:51
+msgid "<option>--upstream-version</option>=<replaceable>version</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:114 manpages/gbp-import-ref.xml:52
+msgid "<option>-u</option><replaceable>version</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:117
+msgid ""
+"The upstream version number. With <option>--uscan</option>, passed to uscan "
+"as <option>--download-debversion</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:123
+msgid "<option>--[no-]merge</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:126
+msgid "Merge the upstream branch to the &debian; branch after import"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:131 manpages/gbp-import-ref.xml:61
+msgid ""
+"<option>--merge-mode=</option><replaceable>[auto|merge|replace]</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:134
+msgid ""
+"How to fold the newly imported upstream source to the &debian; packaging "
+"branch after import."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:138 manpages/gbp-import-ref.xml:68
+msgid ""
+"<replaceable>merge</replaceable> does a &git; <command>merge</command> "
+"leaving you on your own in case of merge conflict resolution."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:143 manpages/gbp-import-ref.xml:73
+msgid ""
+"<replaceable>replace</replaceable> mode on the other hand makes the head of "
+"the &debian; packaging branch identical to the newly imported tree but "
+"preserves the content of the <filename>debian/</filename> directory while "
+"keeping the current head as well as the newly imported tree as parents of "
+"the generated commit. This is similar to a <option>theirs</option> merge "
+"strategy while preserving <filename>debian/</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:153 manpages/gbp-import-ref.xml:83
+msgid ""
+"The default is <replaceable>auto</replaceable> which uses "
+"<replaceable>replace</replaceable> for 3.0 (quilt) packages and "
+"<replaceable>merge</replaceable> otherwise."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:174
+msgid ""
+"The branch in the &git; repository the &debian; package is being developed "
+"on, default is <replaceable>master</replaceable>. After importing the new "
+"sources on the upstream branch, &gbp-import-orig; will try to merge the new "
+"version onto this branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:208 manpages/gbp-import-ref.xml:148
+msgid ""
+"Use this <option><replaceable>keyid</replaceable></option> for gpg signing "
+"tags."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:224 manpages/gbp-import-ref.xml:154
+msgid "<option>--import-msg=</option><replaceable>msg-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:228 manpages/gbp-import-ref.xml:158
+msgid ""
+"Use this format string for the commit message when importing upstream "
+"versions, default is <replaceable>New upstream version %(version)s</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:239
+msgid ""
+"Filter out files glob-matching <option><replaceable>pattern</replaceable></"
+"option>. This option can be given multiple times."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:250
+msgid ""
+"When importing the upstream tarball also look for an additional tarball with "
+"component name <replaceable>COMPONENT</replaceable>. E.g. in <filename>hello-"
+"debhelper_1.0.orig-foo.tar.gz</filename> the component would be "
+"<replaceable>foo</replaceable>. The additional tarball is expected to be in "
+"the same directory than the upstream tarball and to use the same compression "
+"type."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:258 manpages/gbp-pristine-tar.xml:73
+msgid ""
+"Using additional original tarballs is a feature of the 3.0 (quilt) source "
+"format. See the <command>dpkg-source</command> manpage for details. This is "
+"currently considered an experimental feature and might change incompatibly."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:267
+msgid "<option>--[no-]pristine-tar</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:271
+msgid "Generate <command>pristine-tar</command> delta file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:276
+msgid "<option>--[no-]filter-pristine-tar</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:280
+msgid ""
+"If using a filter, also filter the files out of the tarball passed to "
+"<command>pristine-tar</command>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:286
+msgid "<option>--[no-]symlink-orig</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:289
+msgid ""
+"Whether to create and keep a symlink from the upstream tarball to a &debian; "
+"policy conformant upstream tarball name located in <filename class="
+"\"directory\">../</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:294
+msgid ""
+"This is a good idea if not using <command>pristine-tar</command> since it "
+"avoids creating a new tarball with a different md5sum."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:300 manpages/gbp-import-ref.xml:165
+msgid "<option>--postimport=<replaceable>cmd</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:307 manpages/gbp-import-ref.xml:172
+msgid "<envar>GBP_BRANCH</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:309 manpages/gbp-import-ref.xml:174
+msgid "The name of the Debian packaging branch"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:313 manpages/gbp-import-ref.xml:178
+msgid "<envar>GBP_TAG</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:315 manpages/gbp-import-ref.xml:180
+msgid "The name of the just created upstream tag"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:319 manpages/gbp-import-ref.xml:184
+msgid "<envar>GBP_UPSTREAM_VERSION</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:321 manpages/gbp-import-ref.xml:186
+msgid "The just imported upstream version"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:325 manpages/gbp-import-ref.xml:190
+msgid "<envar>GBP_DEBIAN_VERSION</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:327 manpages/gbp-import-ref.xml:192
+msgid "The Debian version of the package with a Debian revision of '-1'"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:303 manpages/gbp-import-ref.xml:168
+msgid ""
+"Run <replaceable>cmd</replaceable> after the import. The hook gets the "
+"following environment variables passed: <placeholder type=\"variablelist\" "
+"id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:336
+msgid "<option>--postunpack=<replaceable>cmd</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:344
+msgid "<envar>GBP_TMP_DIR</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:346
+msgid "The temporary directory the tarballs are unapcked into."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:350
+msgid "<envar>GBP_SOURCES_DIR</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:352
+msgid "The temporary directory where the unpacked sources are."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:356
+msgid "<envar>GBP_GIT_DIR</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:358
+msgid ""
+"The directory of the git repository where the tarball will be imported into."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:339
+msgid ""
+"Run <replaceable>cmd</replaceable> after the import. This can be useful to e."
+"g. convert or remove certain files prior to the import. The hook gets "
+"passed the following environment variables: <placeholder type=\"variablelist"
+"\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:367
+msgid "<option>--uscan</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:370
+msgid ""
+"Use &uscan; to fetch new upstream version. The version can be specified with "
+"<option>--upstream-version</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:376
+msgid "<option>--[no-]interactive</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:379
+msgid "Run command interactively, i.e. ask package name and version if needed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:385 manpages/gbp-import-ref.xml:201
+msgid "<option>--[no-]rollback</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:388 manpages/gbp-import-ref.xml:204
+msgid "Rollback changes in case of an error."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:396
+msgid ""
+"Whether upstream signatures should be imported as well (when using pristine-"
+"tar). <emphasis>no</emphasis> turns this off completely while <emphasis>yes</"
+"emphasis> always tries to import a signature (which can be useful if you "
+"want to fail if e.g. &uscan; did not fetch a signature). The default "
+"<emphasis>auto</emphasis> means to import a signature file if present but do "
+"nothing otherwise."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:411
+msgid ""
+"Download and import a new upstream version using the information from "
+"<filename>debian/watch</filename>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-orig.xml:414
+#, no-wrap
+msgid " &gbp-import-orig; --uscan"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:416
+msgid "Fetch tarball from an URL"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-orig.xml:419
+#, no-wrap
+msgid " &gbp-import-orig; https://debian.example.com/sid/upstream-tarball-0.1.tar.gz"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:421
+msgid "Import a local tarball"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-orig.xml:424
+#, no-wrap
+msgid " &gbp-import-orig; ../upstream-tarball-0.1.tar.gz"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:432 manpages/gbp-import-ref.xml:236
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.import.dsc"
+"\"/>, <xref linkend=\"man.gbp.import.dscs\"/>, <xref linkend=\"man.gbp.dch\"/"
+">, <xref linkend=\"man.gbp.conf\"/>, <citerefentry> <refentrytitle>uscan</"
+"refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-ref.xml:12 manpages/gbp-import-ref.xml:16
+msgid "gbp-import-ref"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-ref.xml:17
+msgid "Update upstream sources when using &git; only"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-ref.xml:21
+msgid ""
+"&gbp-import-ref; &man.common.options.synopsis; <arg><option>--upstream-"
+"version=</option><replaceable>version</replaceable></arg> <arg><option>--"
+"merge-mode=</option><replaceable>[auto|merge|replace]</replaceable></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>branch_name</"
+"replaceable></arg> <arg><option>--upstream-tag=</"
+"option><replaceable>tag_format</replaceable></arg> <arg><option>--upstream-"
+"tree=</option><replaceable>[BRANCH|VERSION|commit-id]</replaceable></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</"
+"replaceable></arg> <arg><option>--[no-]sign-tags</option></arg> "
+"<arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg> "
+"<arg><option>--postimport=cmd</option></arg> <arg><option>--[no-]rollback</"
+"option></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-ref.xml:39
+msgid ""
+"&gbp-import-ref; merges upstream git commits onto your &debian-branch; You "
+"can either specify a branch to merge, give an upstream version or specify "
+"the commit id directly. If no tag exists for the imported commit it will be "
+"automatically created."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:55
+msgid ""
+"The upstream version to merge. The upstream tag to use will be determined "
+"via the <option>--upstream-tag</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:64
+msgid "How to fold the upstream commits onto the &debian; packaging branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:94
+msgid ""
+"The branch in the &git; repository the upstream sources are on. Default is "
+"<replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:104
+msgid ""
+"Use this tag format when looking up upstream tags, default is "
+"<replaceable>upstream/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-ref.xml:110
+msgid ""
+"<option>--upstream-tree=</option><replaceable>[BRANCH|VERSION|commit-id]</"
+"replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:114
+msgid ""
+"What to merge into the &debian-branch;. <replaceable>BRANCH</replaceable> "
+"merges from the upstream branch. <replaceable>VERSION</replaceable> (the "
+"default) looks for a tag determined from the given upstream version number "
+"via the <option>--upstream-version</option> option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:120
+msgid "Other values are interpreted as git commit id to merge from."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-ref.xml:213
+msgid ""
+"Merge commits from the &upstream-branch; into the &debian-branch; creating a "
+"tag for the version <replaceable>0.0~git20180524</replaceable>:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-ref.xml:217
+#, no-wrap
+msgid " &gbp-import-ref; --upstream-tree=BRANCH -u0.0~git20180524"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-ref.xml:219
+msgid ""
+"Merge commits from the the tag corresponding to version <replaceable>1.0</"
+"replaceable>:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-ref.xml:222
+#, no-wrap
+msgid " &gbp-import-ref; --upstream-tree=VERSION -u1.0"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-ref.xml:224
+msgid ""
+"Merge commits given by a SHA1 creating a tag for the version "
+"<replaceable>0.0~git20180524</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-ref.xml:228
+#, no-wrap
+msgid " &gbp-import-ref; --upstream-tree=c4398912c -u0.0~git20180524"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-srpm.xml:12 manpages/gbp-import-srpm.xml:16
+msgid "gbp-import-srpm"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-srpm.xml:17
+msgid "Import source RPM packages into a Git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-srpm.xml:21
+msgid ""
+"&gbp-import-srpm; &man.common.options.synopsis; <arg><option>--vendor</"
+"option>=<replaceable>VENDOR</replaceable></arg> <arg><option>--allow-same-"
+"versions</option></arg> <arg><option>--author-is-committer</option></arg> "
+"<arg><option>--packaging-branch=</option><replaceable>BRANCH-NAME</"
+"replaceable></arg> <arg><option>--packaging-tag=</option><replaceable>TAG-"
+"FORMAT</replaceable></arg> <arg><option>--skip-packaging-tag</option></arg> "
+"<arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></"
+"arg> <arg><option>--filter=</option><replaceable>PATTERN</replaceable></arg> "
+"<arg><option>--keyid=</option><replaceable>GPG-KEYID</replaceable></arg> "
+"<arg><option>--[no-]create-missing-branches</option></arg> <arg><option>--"
+"[no-]pristine-tar</option></arg> <arg><option>--[no-]sign-tags</option></"
+"arg> <arg><option>--upstream-branch=</option><replaceable>BRANCH-NAME</"
+"replaceable></arg> <arg><option>--upstream-tag=</option><replaceable>TAG-"
+"FORMAT</replaceable></arg> <arg><option>--upstream-vcs-tag=</"
+"option><replaceable>TAG-FORMAT</replaceable></arg> <arg><option>--native</"
+"option></arg> <arg><option>--repo-user=</option><option>[GIT|DEBIAN]</"
+"option></arg> <arg><option>--repo-email=</option><option>[GIT|DEBIAN]</"
+"option></arg> <group choice=\"plain\"> <arg><replaceable>SRPM</replaceable></"
+"arg> <arg><replaceable>DIRECTORY</replaceable></arg> </group> <arg choice="
+"\"opt\"><replaceable>target</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-srpm.xml:48
+msgid ""
+"&gbp-import-srpm; <arg><option>options</option></arg> <group choice=\"plain"
+"\"> <arg><replaceable>URL</replaceable></arg> </group> <arg choice=\"opt"
+"\"><replaceable>target</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-srpm.xml:59
+msgid ""
+"&gbp-import-srpm; imports an RPM source package into a &git; repository, "
+"notes the package version in the commit logs, and commits the change. All "
+"information, including package name, version and upstream source is "
+"automatically detected from the source package but you can override the "
+"location of the new repository by optionally specifying the "
+"<replaceable>target</replaceable> argument. The tool supports importing both "
+"archived (src.rpm files) or unpacked (directory) source RPMs. It also "
+"imports from http(s)-URLs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:75 manpages/gbp-rpm-ch.xml:80
+msgid "<option>--vendor</option>=<replaceable>VENDOR</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:84
+msgid ""
+"<option>--upstream-branch</option>=<replaceable>BRANCH-NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:94 manpages/gbp-rpm-ch.xml:89
+msgid ""
+"<option>--packaging-branch</option>=<replaceable>BRANCH-NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:98
+msgid ""
+"The branch in the &git; repository the packaging files are put onto. Default "
+"is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:113 manpages/gbp-tag.xml:92
+msgid "<option>--keyid=</option><replaceable>GPG-KEYID</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:122 manpages/gbp-rpm-ch.xml:109
+msgid "<option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:126
+msgid ""
+"Use this tag format when tagging released versions, default is <replaceable>"
+"%(vendor)s/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:132
+msgid "<option>--skip-packaging-tag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:136
+msgid "Do not create packaging tag after importing the packaging files."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:151
+msgid "<option>--upstream-vcs-tag</option>=<replaceable>TAG-NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:155
+msgid ""
+"Add <replaceable>TAG-FORMAT</replaceable> as an additional parent of the "
+"commit of the upstream tarball. Useful when upstream uses git and you want "
+"to link to its revision history. <replaceable>TAG-FORMAT</replaceable> can "
+"be a pattern similar to what <option>--upstream-tag</option> supports."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:168
+msgid "Subdirectory where to put the RPM packaging files."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:173
+msgid "<option>--filter=</option><replaceable>PATTERN</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:177
+msgid "Filter out files glob-matching pattern. Can be given multiple times."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:195
+msgid ""
+"Allow one to re-import a package with an already existing version. This "
+"will not re-import the upstream sources - only packaging files will be re-"
+"imported."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:206
+msgid ""
+"Use the author identity as the committer when importing upstream sources and "
+"packaging files."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:216
+msgid "Create missing upstream and/or packaging branch if missing."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:221
+msgid "<option>--orphan-packaging</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:225
+msgid ""
+"Import packaging files into an orphan branch that will not be based on the "
+"upstream branch. Useful if you want to maintain (non-native) package using "
+"the 'orphan-packaging' model. This option have no effect if <option>--"
+"native</option> is used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:233
+msgid "<option>--native</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:237
+msgid ""
+"Treat the package as native package. No separate upstream branch or upstream "
+"tags will be created."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-srpm.xml:273
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage.rpm\"/>, <xref linkend=\"man.gbp.pq.rpm"
+"\"/>, <xref linkend=\"man.gbp.rpm.ch\"/>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-pq-rpm.xml:12 manpages/gbp-pq-rpm.xml:16
+msgid "gbp-pq-rpm"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-pq-rpm.xml:17
+msgid "Manage patches and development branches in Git"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-pq-rpm.xml:21
+msgid ""
+"&gbp-pq-rpm; &man.common.options.synopsis; <arg><option>--packaging-dir=</"
+"option><replaceable>DIRECTORY</replaceable></arg> <arg><option>--spec-file=</"
+"option><replaceable>FILEPATH</replaceable></arg> <arg><option>--upstream-"
+"tag=</option><replaceable>TAG-FORMAT</replaceable></arg> <arg><option>--"
+"abbrev=</option><replaceable>num</replaceable></arg> <arg><option>--force</"
+"option></arg> <arg><option>--[no-]drop</option></arg> <arg><option>--"
+"[no-]patch-numbers</option></arg> <group choice=\"plain\"> "
+"<arg><option>drop</option></arg> <arg><option>export</option></arg> "
+"<arg><option>import</option></arg> <arg><option>rebase</option></arg> "
+"<arg><option>switch</option></arg> <arg><option>apply</option></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:43
+msgid ""
+"&gbp-pq-rpm; helps in managing patches and development branch(es) for "
+"packages that are maintained with &gbp;. It designed to be used for packages "
+"that are maintained using the \"orphan-packaging\" model. &gbp-pq-rpm; has "
+"multiple subcommands, or actions, for working with the branches and patches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:50
+msgid ""
+"&gbp-pq-rpm; makes it easy to do source code development on a separate "
+"development branch (patch-queue branch in Debian git-buildpackage terms). "
+"For example, if the packaging files would be stored in <replaceable>master</"
+"replaceable> the associated development branch would be "
+"<replaceable>development/master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-pq-rpm.xml:58 manpages/gbp-pq.xml:62
+msgid "ACTIONS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:61 manpages/gbp-pq.xml:65
+msgid "<option>import</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:65
+msgid ""
+"Create a development (patch-queue) branch by applying all patches from the "
+"packaging branch on top of the upstream version. The patches must apply "
+"without fuzz."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:72 manpages/gbp-pq.xml:76
+msgid "<option>export</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:76
+msgid ""
+"Export patches from the development branch into the packaging branch. It "
+"generates patches (one-per-commit) from the development branch and updates "
+"the spec file accordingly. It doesn't automatically commit the changes "
+"though - they need to verified and committed manually."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:84 manpages/gbp-pq.xml:87
+msgid "<option>rebase</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:88
+msgid ""
+"Switch to the development branch and rebase it against the current upstream "
+"version (indicated in the spec file of the associated packaging branch)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:95 manpages/gbp-pq.xml:97
+msgid "<option>drop</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:99
+msgid ""
+"Drop (delete) the development branch associated to the current branch. For "
+"example, you're on branch <replaceable>foo</replaceable> this would drop "
+"branch <replaceable>development/foo</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:106 manpages/gbp-pq.xml:108
+msgid "<option>apply</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:110
+msgid ""
+"Add a single patch to the development branch - similar to using <command>git-"
+"am</command>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:116 manpages/gbp-pq.xml:121
+msgid "<option>switch</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:120
+msgid ""
+"Switch between the development branch and the associated packaging branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:132 manpages/gbp-rpm-ch.xml:119
+msgid "<option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:141 manpages/gbp-rpm-ch.xml:143
+msgid "<option>--spec-file=</option><replaceable>FILEPATH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:145 manpages/gbp-rpm-ch.xml:147
+msgid ""
+"Relative path to the spec file to use. Special value <replaceable>auto</"
+"replaceable> causes &gbp; to search and guess. Other values cause the "
+"<option>--packaging-dir</option> option to be ignored: the directory of the "
+"spec file is used, instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:163 manpages/gbp-pq.xml:206
+msgid "<option>--abbrev=</option><replaceable>NUM</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:167 manpages/gbp-pq.xml:210
+msgid ""
+"When exporting a patch queue abbreviate commit, instead of showing the full "
+"40-byte hexadecimal object name in header lines, show only a partial prefix "
+"of length <replaceable>NUM</replaceable>. This is useful when existing "
+"patches were not generated by &gbp-pq;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:175 manpages/gbp-pq.xml:218 manpages/gbp-pull.xml:60
+msgid "<option>--force</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:178
+msgid ""
+"Import even if the development (patch-queue) branch already exists. Only "
+"valid for the import action."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:184 manpages/gbp-pq.xml:199
+msgid "<option>--[no-]drop</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:187
+msgid ""
+"Whether to drop (delete) the patch queue branch after a successful export."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:193 manpages/gbp-pq.xml:138
+msgid "<option>--[no-]patch-numbers</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:197
+msgid "Whether the patch files should start with a number or not."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:206
+msgid ""
+"When exporting patches from a patch-queue branch &gbp-pq-rpm; will look at "
+"the commit message for special tags it recognizes. All tags need to start at "
+"the first column and require at least one whitespace after the colon."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:212
+msgid "<option>Gbp-Rpm: Ignore</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:216 manpages/gbp-pq.xml:297
+msgid "Ignores the commit, no patch is generated out of it."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:221
+msgid "<option>Gbp-Rpm: If <expression></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:225
+msgid ""
+"Conditional patch. Put patch inside \"%if <expression>\" in the spec "
+"file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:231
+msgid "<option>Gbp-Rpm: IfArch<expression></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:235
+msgid ""
+"Conditional patch. Put patch inside \"%ifarch <expression>\" in the "
+"spec file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:242
+msgid "For example, the following commit message:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-pq-rpm.xml:245
+#, no-wrap
+msgid ""
+" Fix around a problem in Fedora\n"
+"\n"
+" which is not applicable elsewhere.\n"
+"\n"
+" Gbp-Rpm: If 0%{?fedora}\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:252
+msgid "Will result something like this in the spec file:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-pq-rpm.xml:255
+#, no-wrap
+msgid ""
+" # 0001-Fix-around-a-problem-in-Fedora.patch\n"
+" %if 0%{?fedora}\n"
+" %patch0 -p1\n"
+" %endif\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:264
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage.rpm\"/>, <xref linkend=\"man.gbp.import."
+"srpm\"/>, <xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-pq.xml:12 manpages/gbp-pq.xml:16
+msgid "gbp-pq"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-pq.xml:17
+msgid "Manage quilt patches on patch queue branches in git"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-pq.xml:21
+msgid ""
+"&gbp-pq; &man.common.options.synopsis; <arg><option>--[no-]patch-numbers</"
+"option></arg> <arg><option>--patch-num-format=</option><replaceable>format</"
+"replaceable></arg> <arg><option>--[no-]renumber</option></arg> "
+"<arg><option>--topic=</option><replaceable>topic</replaceable></arg> "
+"<arg><option>--time-machine=</option><replaceable>num</replaceable></arg> "
+"<arg><option>--[no-]drop</option></arg> <arg><option>--abbrev=</"
+"option><replaceable>num</replaceable></arg> <arg><option>--force</option></"
+"arg> <arg><option>--commit</option></arg> <arg><option>--meta-closes=bug-"
+"close-tags</option></arg> <arg><option>--meta-closes-bugnum=bug-number-"
+"format</option></arg> <arg><option>--pq-from=</option><replaceable>[DEBIAN|"
+"TAG]</replaceable></arg> <arg><option>--upstream-tag=</"
+"option><replaceable>tag-format</replaceable></arg> <group choice=\"plain\"> "
+"<arg><option>drop</option></arg> <arg><option>export</option></arg> "
+"<arg><option>import</option></arg> <arg><option>rebase</option></arg> "
+"<arg><option>switch</option></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq.xml:48
+msgid ""
+"&gbp-pq; helps one to manage quilt patches in &debian; packages that are "
+"maintained with &gbp;. This is especially useful with packages using the 3.0 "
+"(quilt) source format. With &gbp-pq;, you can maintain the quilt patches "
+"that should be applied to a package on a separate branch called patch-queue "
+"branch. So if your &debian; package lives on <replaceable>master</"
+"replaceable>, the associated patch-queue branch will be called "
+"<replaceable>patch-queue/master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq.xml:57
+msgid ""
+"See <ulink url=\"https://honk.sigxcpu.org/piki/development/"
+"debian_packages_in_git/\"></ulink> for example workflows."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:69
+msgid ""
+"Create a patch queue branch from quilt patches in debian/patches/ that are "
+"listed in debian/patches/series. The patches must apply without fuzz."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:80
+msgid ""
+"Export the patches on the patch-queue branch associated to the current "
+"branch into a quilt patch series in debian/patches/ and update the series "
+"file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:91
+msgid ""
+"Switch to the patch-queue branch associated to the current branch and rebase "
+"it against the current branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:101
+msgid ""
+"Drop (delete) the patch queue associated to the current branch. So if you're "
+"on branch <replaceable>foo</replaceable>, this would drop branch "
+"<replaceable>patch-queue/foo</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:112
+msgid ""
+"Add a single patch to the patch-queue similar to using <command>git-am</"
+"command>. Use <option>--topic</option> if you want the patch to appear in a "
+"separate subdir when exporting the patch queue using <option>export</"
+"option>. This can be used to separate upstream patches from &debian; "
+"specific patches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:125
+msgid ""
+"Switch to the patch-queue branch if on the base branch and switch to base "
+"branch if on patch-queue branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:142
+msgid ""
+"Whether or not the patch files should be prefixed with a number. The "
+"default is to export patches with patch numbers. Note, however, that this "
+"normally affects patches whose names are automatically generated, and has no "
+"effect on exporting patches which have a <option>Gbp[-Pq]: Name</option> "
+"tag, since the name specified is preserved unless the <option>--renumber</"
+"option> option is used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:153
+msgid "<option>--patch-num-format=</option><replaceable>format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:157
+msgid ""
+"The format specifier for patch number prefixes. The default format is "
+"'%04d-'."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:162
+msgid "<option>--[no-]renumber</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:166
+msgid ""
+"Whether or not to renumber patches exported from the patch queue, instead of "
+"preserving numbers specified in <option>Gbp-Pq: Name</option> tags. The "
+"default is not to renumber patches. Useful when patches need to be renamed "
+"for the sake of uniformity. For example, using <option>--renumber</option> "
+"with <option>--no-patch-num</option> will strip all numeric prefixes from "
+"exported patches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:177
+msgid "<option>--topic=</option><replaceable>topic</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:181
+msgid "Topic to use when importing a single patch"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:186
+msgid "<option>--time-machine=</option><replaceable>NUM</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:190
+msgid ""
+"When importing a patch queue fails, go back commit-by-commit on the current "
+"branch to check if the patch-queue applies there. Do this at most "
+"<replaceable>NUM</replaceable> times. This can be useful if the patch-queue "
+"doesn't apply to the current branch HEAD anymore, e.g. after importing a "
+"new upstream version."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:201
+msgid ""
+"Whether to automatically drop (delete) the patch queue branch after a "
+"successful export"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:220
+msgid ""
+"In case of <option>import</option>, import even if the patch-queue branch "
+"already exists and overwrite its content with <filename>debian/patches</"
+"filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:226
+msgid "<option>--export</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:229
+msgid ""
+"In case of <option>export</option>, commit <filename>debian/patches</"
+"filename>the changes to &git; after exporting the patches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:240
+msgid ""
+"What meta tags to look for to generate a commit message when using "
+"<option>export</option> <option>--commit</option>. The default is "
+"<literal>'Closes|LP'</literal> to support Debian and Launchpad."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:251
+msgid ""
+"What regular expression should be used to parse out the bug number when "
+"using <option>export</option> <option>--commit</option>. The default is "
+"<literal>'(?:bug|issue)?\\#?\\s?\\d+'</literal>. See <xref linkend=\"man."
+"gbp.dch\"/> for details."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:260
+msgid "<option>--pq-from=</option><replaceable>[DEBIAN|TAG]</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:264
+msgid ""
+"How to find the starting point for the patch queue base. The options are "
+"DEBIAN, that will use the Debian branch as the base for the patch queue "
+"branch, and TAG, that will use the corresponding upstream tag as a base for "
+"the patch queue branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:267
+msgid ""
+"This is only needed if your upstream branch is not merged in the Debian "
+"branch. The default is <replaceable>DEBIAN</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-pq.xml:285
+msgid "TAGS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq.xml:287
+msgid ""
+"When exporting patches from a patch-queue branch, &gbp-pq; will look at the "
+"patch header for special tags it recognizes. All tags need to start at the "
+"first column and require at least one whitespace after the colon."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:293
+msgid "<option>Gbp[-Pq]: Ignore</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:302
+msgid "<option>Gbp[-Pq]: Name</option> <replaceable>name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><screen>
+#: manpages/gbp-pq.xml:307 manpages/gbp-pq.xml:319
+#, no-wrap
+msgid "&gbp-pq; export"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:306
+msgid ""
+"The name to use for the patch when running <placeholder type=\"screen\" id="
+"\"0\"/> If unset, it will be formatted like <command>git am</command> would "
+"format it."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:314
+msgid "<option>Gbp[-Pq]: Topic</option> <replaceable>topic</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:318
+msgid ""
+"Moves the patch into a subdir called <replaceable>topic</replaceable> when "
+"running <placeholder type=\"screen\" id=\"0\"/> This allows for some "
+"structure below <filename>debian/patches</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:325
+msgid "<option>Gbp-Pq-Topic:</option> <replaceable>topic</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:329
+msgid ""
+"Deprecated: use <option>Gbp[-Pq]: Topic</option> <replaceable>topic</"
+"replaceable> instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq.xml:339
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <citerefentry> <refentrytitle>dpkg-"
+"source</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, "
+"<citerefentry> <refentrytitle>quilt</refentrytitle> <manvolnum>1</manvolnum> "
+"</citerefentry>, <xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-pristine-tar.xml:12 manpages/gbp-pristine-tar.xml:16
+msgid "gbp-pristine-tar"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-pristine-tar.xml:17
+msgid "Manage pristine-tar commits in a git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-pristine-tar.xml:21
+msgid ""
+"&gbp-pristine-tar; &man.common.options.synopsis; <arg><option>--upstream-"
+"tag=</option><replaceable>tag-format</replaceable></arg> <arg "
+"rep='repeat'><option>--component=</option><replaceable>component</"
+"replaceable></arg> <group choice=\"plain\"> <arg><option>commit</option></"
+"arg> </group> <group choice=\"plain\"> <arg choice=\"plain"
+"\"><replaceable>filename</replaceable></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pristine-tar.xml:37
+msgid ""
+"&gbp-pristine-tar; adds the pristine-tar commit for a given upstream tarball "
+"to a &git; repository. This can be useful if a original tarball has been "
+"already imported and the pristine-tar commits should be added at a later "
+"time or if you're tracking upstream git and want to create pristine-tar "
+"commits nevertheless."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pristine-tar.xml:54
+msgid ""
+"use this tag format when tagging upstream versions, default is "
+"<replaceable>upstream/%(version)s</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pristine-tar.xml:64
+msgid ""
+"When creating the pristine-tar commits also look for an additional tarball "
+"with component name <replaceable>COMPONENT</replaceable>. E.g. in "
+"<filename>hello-debhelper_1.0.orig-foo.tar.gz</filename> the component name "
+"would be <replaceable>foo</replaceable>. The additional tarball is expected "
+"to be in the same directory than the upstream tarball and to use the same "
+"compression type. This option can be given multiple times to add multiple "
+"additional tarballs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pristine-tar.xml:85
+msgid "Add pristine-tar commits for an upstream tarball:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-pristine-tar.xml:87
+#, no-wrap
+msgid " &gbp-pristine-tar; commit ../upstream-tarball-0.1.tar.gz"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pristine-tar.xml:88
+msgid ""
+"Same as above with an additional tarball <filename>../upstream-tarball-"
+"foo-0.1.tar.gz:</filename>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-pristine-tar.xml:91
+#, no-wrap
+msgid " &gbp-pristine-tar; --component-tarball=foo commit ../upstream-tarball-0.1.tar.gz"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pristine-tar.xml:99
+msgid ""
+"<xref linkend=\"man.gbp.import.orig\"/>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-pull.xml:12 manpages/gbp-pull.xml:16
+msgid "gbp-pull"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-pull.xml:18
+msgid "Safely update a repository from remote"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-pull.xml:22
+msgid ""
+"&gbp-pull; &man.common.options.synopsis; <arg><option>--force</option></arg> "
+"<arg><option>--all</option></arg> <arg><option>--redo-pq</option></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> <arg><option>--ignore-"
+"branch</option></arg> <arg><option>--debian-branch=</"
+"option><replaceable>branch_name</replaceable></arg> <arg><option>--upstream-"
+"branch=</option><replaceable>branch_name</replaceable></arg> <arg><option>--"
+"track-missing</option></arg> <arg><option>--depth=</"
+"option><replaceable>depth</replaceable></arg> <arg><replaceable>repository</"
+"replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pull.xml:40
+msgid ""
+"&gbp-pull; updates the <emphasis>debian</emphasis>, <emphasis>upstream</"
+"emphasis> and <emphasis>pristine-tar</emphasis> branches from remote "
+"repositories in one go. It checks if the update is safe (would result in a "
+"<emphasis>fast-forward</emphasis> merge) and aborts otherwise."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pull.xml:46
+msgid ""
+"If given on the command line the changes are fetched from the given "
+"repository otherwise the default for <replaceable>repository</replaceable> "
+"is read from the <replaceable>remote</replaceable> configuration for each "
+"branch (in git's configuration)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:62
+msgid ""
+"Force a branch update even if this results in a non fast forward update."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><warning><para>
+#: manpages/gbp-pull.xml:63
+msgid "Forcing a branch update makes you lose your modifications."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:70
+msgid ""
+"Update all remote-tracking branches that have identical name in the remote "
+"repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pull.xml:75
+msgid "<option>--redo-pq</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:77
+msgid "Also rebuild the corresponding patch-queue using &gbp-pq;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><warning><para>
+#: manpages/gbp-pull.xml:78
+msgid "This drops the patch-queue branch if it exists."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:85
+msgid "Don't care if we're on a branch or in detached head state."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pull.xml:105
+msgid "<option>--track-missing</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:108
+msgid ""
+"If a branch is missing in the local repository try to fetch it from the "
+"remote side and (if it exists) fetch it and set up branch tracking for it. "
+"This ensures that branches that are added at a later point to the remote "
+"side (e.g. <replaceable>pristine-tar</replaceable>) are picked up "
+"automatically. Note that it's not an error for the branch to not exist on "
+"the remote side."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:122
+msgid "Git history depth, for deepening shallow git clones."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:129 manpages/gbp-push.xml:144
+msgid "Whether to update the pristine-tar branch too."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pull.xml:137
+msgid ""
+"When &gbp-pull; finishes, it indicates success or failure with its exit code:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:149
+msgid ""
+"An error occurred during the pull, see the printed error message for details."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:155
+msgid "At least one branch couldn't be fast forwarded."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pull.xml:166
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.clone\"/>, "
+"<xref linkend=\"man.gbp.pq\"/>, <xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-push.xml:12 manpages/gbp-push.xml:16
+msgid "gbp-push"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-push.xml:18
+msgid "Push &debian; packaging changes to a &git; remote"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-push.xml:22
+msgid ""
+"&gbp-push; &man.common.options.synopsis; <arg><option>--ignore-branch</"
+"option></arg> <arg><option>--debian-branch=</"
+"option><replaceable>branch_name</replaceable></arg> <arg><option>--upstream-"
+"branch=</option><replaceable>branch_name</replaceable></arg> <arg><option>--"
+"debian-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></"
+"arg> <arg><option>--[no-]pristine-tar</option></arg> <arg><option>--dry-run</"
+"option></arg> <arg><replaceable>repository</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-push.xml:38
+msgid ""
+"&gbp-push; pushes your local changes to a remote repository. It is best run "
+"after uploading a &debian; package to the archive to update you &debian-"
+"branch;, &upstream-branch;, &pristine-tar; branch and corresponding tags. It "
+"will in order"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:46
+msgid "Verify that it is being executed from the &debian-branch;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:51
+msgid ""
+"Determine the debian tag from <filename>debian/changelog</filename> and add "
+"it the list of things to push if the changelog does not indicate an "
+"unreleased package."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:58
+msgid ""
+"Determine the upstream tag from <filename>debian/changelog</filename> and "
+"add it to the list of things to push if it's not a native package."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:64
+msgid ""
+"Determine if the tags correspond to the branch tips of the corresponding "
+"upstream and debian branches. If so, these branches will be added to the "
+"list of things to push. If not the changes will only be pushed up to the "
+"commit that is referenced by the corresponding tag."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:72
+msgid ""
+"Determine if the pristine-tar branch needs to be pushed and if so adds it to "
+"the list of things to push."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:78
+msgid ""
+"Finally, if not in dry-run mode, pushes the above changes to the remote side."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-push.xml:83
+msgid ""
+"If a <replaceable>remote</replaceable> is given on the command line the "
+"changes are pushed to the given remote repository. By default it will push "
+"to the current branchs remote and fall back to <emphasis>origin</emphasis>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:97
+msgid ""
+"Don't fail if the &debian-branch; does not match the currently checked out "
+"branach and push the current branch instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:106
+msgid ""
+"The branch in the Git repository the Debian package is being developed on. "
+"If set to the empty value the branch will not be pushed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-push.xml:112 manpages/gbp-tag.xml:101
+msgid "<option>--debian-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:115
+msgid ""
+"Use this tag format when looking for tags corresponding to a &debian; "
+"version. Default is <replaceable>debian/%(version)s</replaceable>. If set "
+"to the empty value the tag will not be pushed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:125
+msgid ""
+"The branch in the &git; repository the upstream sources are put onto. If set "
+"to the empty value the branch will not be pushed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:134
+msgid ""
+"Use this tag format when looking for tags of upstream versions. Default is "
+"<replaceable>upstream/%(version)s</replaceable>. If set to the empty value "
+"the tag will not be pushed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-push.xml:148
+msgid "<option>--dry-run</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:151
+msgid ""
+"Pass the <option>--dry-run</option> to &gitcmd; <option>push</option>. So "
+"don't push anything, only check if things are pushable."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-push.xml:164
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.clone\"/>, "
+"<xref linkend=\"man.gbp.pull\"/>, <xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refmeta><refentrytitle>
+#: manpages/gbp-rpm-ch.xml:12
+msgid "gbp-rpm-ch"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-rpm-ch.xml:16
+msgid "gbp-rpm-ch;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-rpm-ch.xml:17
+msgid "Generate the RPM changelog from git commit messages"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-rpm-ch.xml:21
+msgid ""
+"&gbp-rpm-ch; &man.common.options.synopsis; <arg><option>--tmp-dir</"
+"option>=<replaceable>DIRECTORY</replaceable></arg> <arg><option>--vendor</"
+"option>=<replaceable>VENDOR</replaceable></arg> <arg><option>--packaging-"
+"branch=</option><replaceable>BRANCH-NAME</replaceable></arg> <arg><option>--"
+"packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg> "
+"<arg><option>--ignore-branch</option></arg> <arg><option>--packaging-dir=</"
+"option><replaceable>DIRECTORY</replaceable></arg> <arg><option>--changelog-"
+"file=</option><replaceable>FILEPATH</replaceable></arg> <arg><option>--spec-"
+"file=</option><replaceable>FILEPATH</replaceable></arg> <arg><option>--"
+"since=</option><replaceable>COMMITISH</replaceable></arg> <arg><option>--no-"
+"release</option></arg> <arg><option>--[no-]git-author</option></arg> "
+"<arg><option>--[no-]full</option></arg> <arg><option>--id-length=</"
+"option><replaceable>NUMBER</replaceable></arg> <arg><option>--ignore-regex=</"
+"option><replaceable>REGEX</replaceable></arg> <arg><option>--changelog-"
+"revision=</option><replaceable>REV-FORMAT</replaceable></arg> <arg><option>--"
+"git-log=</option><replaceable>GIT-LOG-OPTIONS</replaceable></arg> "
+"<arg><option>--spawn-editor=<replaceable>[always|release|no]</replaceable></"
+"option></arg> <arg><option>--editor-cmd=</option><replaceable>EDITOR</"
+"replaceable></arg> <arg><option>--customizations=</"
+"option><replaceable>CUSTOMIZATION-FILE</replaceable></arg> <arg choice="
+"\"plain\"><replaceable>[PATH1 PATH2]</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:48
+msgid ""
+"&gbp-rpm-ch; reads git commit messages up to the current tip of the current "
+"branch and updates the RPM changelog from them."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:52
+msgid ""
+"By default, &gbp-rpm-ch; tries to guess the last &git; commit documented in "
+"the changelog. Alternatively, <option>--since</option> can be used to tell "
+"&gbp-rpm-ch; at which point it should start in the &git; history, or, "
+"<option>--all</option> to use all commits from the &git; history."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:58
+msgid ""
+"The additional path arguments can be used to restrict the repository paths "
+"&gbp-rpm-ch; looks at. For even more detailed control, you can use <option>--"
+"git-log</option> to restrict the generated changelog entries further. E.g. "
+"by using <option>--git-log=</option><replaceable>\"--author=Foo Bar\"</"
+"replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:93
+msgid ""
+"The branch in the Git repository the package is being developed on, default "
+"is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:113
+msgid ""
+"Tag format used, when tagging releases, default is <replaceable>%(vendor)s/"
+"%(version)s</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:128
+msgid "<option>--changelog-file=</option><replaceable>FILEPATH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:132
+msgid ""
+"Relative path to the changelog file to use. Special value <replaceable>auto</"
+"replaceable> causes &gbp; to guess, <replaceable>SPEC</replaceable> uses the "
+"spec file, <replaceable>CHANGES</replaceable> uses a separate changelog file "
+"(name derived spec file name with .spec suffix replaced by .changes). "
+"Guessing logic is simple: use separate changelog file if it is found, "
+"otherwise use the spec file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:155
+msgid "<option>--since=</option><replaceable>COMMITTISH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:159
+msgid "Start reading commit messages at <replaceable>COMMITTISH</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:165
+msgid "<option>--no-release</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:169
+msgid ""
+"Do not create a new changelog section, just update the last changelog "
+"section."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:184
+msgid "<option>--git-log=</option><replaceable>GIT-LOG-OPTIONS</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:203 manpages/gbp-rpm-ch.xml:229
+msgid "<option>--ignore-regex=</option><replaceable>REGEX</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:207
+msgid ""
+"Ignore lines in commit message matching <replaceable>REGEX</replaceable> "
+"when generating the changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:213
+msgid ""
+"<option>--changelog-revision=</option><replaceable>REV-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:217
+msgid ""
+"Format string to use for revision field in the changelog header. The "
+"following string fields are accepted: <replaceable>%(upstreamversion)s</"
+"replaceable> the upstream version; <replaceable>%(release)s</replaceable> "
+"the rpm patchlevel, i.e. Release; <replaceable>%(version)s</replaceable> "
+"full rpm package version; <replaceable>%(tagname)s</replaceable> tag/commit, "
+"i.e. basically what <command>git-describe</command> would give. If empty "
+"or not defined the default from packaging policy is used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:233
+msgid ""
+"Ignore commit lines matching <replaceable>REGEX</replaceable> when "
+"generating the changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:239
+msgid "<option>--[no-]git-author</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:243
+msgid ""
+"Use user.name and user.email from <application>git-config</application>(1) "
+"for the changelog header."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:249
+msgid ""
+"<option>--spawn-editor=<replaceable>[always|release|no]</replaceable></"
+"option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:253
+msgid "Whether to spawn an editor: always, when doing a release or never."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:258
+msgid "<option>--editor-cmd=<replaceable>EDITOR</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:262
+msgid "The editor to use for editing the changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:267
+msgid ""
+"<option>--customizations=</option><replaceable>CUSTOMIZATION-FILE</"
+"replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:271
+msgid ""
+"Load Python code from <replaceable>CUSTOMIZATION-FILE</replaceable>. At the "
+"moment, the only useful thing the code can do is define a custom "
+"ChangelogEntryFormatter class."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:282
+msgid ""
+"Additional to the above options the formatting of the new changelog entries "
+"(one-per-commit) in the changelog can be modified by special tags (called "
+"Meta Tags) given in the git commit message. The tags must start at the first "
+"column of a commit message but can appear on any line. They are of the form "
+"<option>Tagname</option>: <replaceable>VALUE</replaceable>. Valid Meta Tags "
+"are:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:291
+msgid "<option>Git-Rpm-Ch</option>: <replaceable>ACTION</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:295
+msgid ""
+"Supported actions are: <replaceable>Ignore</replaceable> which will ignore "
+"this commit when generating new changelog entries. <replaceable>Short</"
+"replaceable> which will only use the description (the first line) of the "
+"commit message when generating the changelog entry (useful when <option>--"
+"full</option> is given) and <replaceable>Full</replaceable> which will use "
+"the full commit message when generating the changelog entry (useful when "
+"<option>--full</option> is not given)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:307
+msgid ""
+"<option>[Close|Closes|...]</option>: <replaceable>BUGNUMBER</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:311
+msgid ""
+"Indicate in the changelog entry that bug <replaceable>BUGNUMBER</"
+"replaceable> was addressed in this commit."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-rpm-ch.xml:321
+#, no-wrap
+msgid ""
+" Document meta tags\n"
+"\n"
+" so one doesn't have to consult the manual\n"
+"\n"
+" Git-Rpm-Ch: Short\n"
+" Closes: #636088\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:329
+msgid "Results in this changelog entry:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-rpm-ch.xml:332
+#, no-wrap
+msgid ""
+" - Document meta tags (Closes: #636088)\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:341
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage.rpm\"/>, <xref linkend=\"man.gbp.import."
+"srpm\"/>, <xref linkend=\"man.gbp.conf\"/>, &man.seealso.common; <ulink url="
+"\"https://honk.sigxcpu.org/cl2vcs\"> <citetitle>Cl2vcs</citetitle></ulink>,"
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo><address>
+#: manpages/gbp-setup-gitattributes.xml:4
+#, no-wrap
+msgid ""
+" <email>andrew@shadura.me</email>\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo>
+#: manpages/gbp-setup-gitattributes.xml:3
+msgid ""
+"<placeholder type=\"address\" id=\"0\"/> <author> <firstname>Andrej</"
+"firstname> <surname>Shadura</surname> </author>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-setup-gitattributes.xml:11
+#: manpages/gbp-setup-gitattributes.xml:15
+msgid "gbp-setup-gitattributes"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-setup-gitattributes.xml:16
+msgid "Set up &git; attributes for packaging"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-setup-gitattributes.xml:20
+msgid ""
+"&gbp-setup-gitattributes; &man.common.options.synopsis; <arg><option>--"
+"[no-]dgit-defuse-attrs</option></arg> <arg><option>--all</option></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:30
+msgid ""
+"&gbp-setup-gitattributes; sets up <filename>.git/info/attributes</filename> "
+"in the current &git; repository to sane defaults most suitable for packaging "
+"work. At the moment, this amounts to making sure no transformations happen "
+"during checkout, commit or export. More attributes may be added in future, "
+"by default all known settings are applied."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:36
+msgid ""
+"Upstream sources may ship <filename>.gitattributes</filename> files enabling "
+"certain transformations to the committed source, usually to make working "
+"with files in different encodings more convenient for the upstream authors. "
+"For Debian packaging, it is necessary to override these attributes, since "
+"they cause often unwanted conversion of files (e.g. line endings, encodings "
+"and some others). Working with such source tree is confusing, since the "
+"working tree differs from the Git history (and sometimes from the source "
+"tarball), and can lead to errors."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:45
+msgid ""
+"By default, &gbp-clone; tries to detect the usage of <filename>."
+"gitattributes</filename> in the upstream source and disables the Git "
+"attributes only when necessary."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-setup-gitattributes.xml:54
+msgid "<option>--[no-]dgit-defuse-attrs</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-setup-gitattributes.xml:58
+msgid ""
+"<option>Disables all transforming attributes for all files. This is done by "
+"defining a macro attribute <symbol>[attr]dgit-defuse-attrs</symbol> and "
+"applying it to <filename>*</filename> together with <symbol>export-subst</"
+"symbol> and <symbol>export-ignore</symbol>.</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-setup-gitattributes.xml:64
+msgid ""
+"This method is compatible with <command>dgit</command> and <command>git-"
+"deborig</command> which use this macro attribute. Older versions of "
+"<command>dgit</command> use an incomplete preset missing some attributes; if "
+"such is found, it is replaced by an updated definition."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-setup-gitattributes.xml:75
+msgid "Apply all known &git; attribute settings. This is the default."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:84
+msgid ""
+"<xref linkend=\"man.gbp.clone\"/>, <xref linkend=\"man.gbp.push\"/>, <xref "
+"linkend=\"man.gbp.conf\"/>, <citerefentry> <refentrytitle>gitattributes</"
+"refentrytitle> <manvolnum>5</manvolnum> </citerefentry>, <citerefentry> "
+"<refentrytitle>dgit</refentrytitle> <manvolnum>7</manvolnum> </citerefentry>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:100
+msgid "Andrej Shadura <email>andrew@shadura.me</email>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-tag.xml:11 manpages/gbp-tag.xml:15
+msgid "gbp-tag"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-tag.xml:16
+msgid "Tag a &debian; packages in a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-tag.xml:20
+msgid ""
+"&gbp-tag; &man.common.options.synopsis; <arg><option>--ignore-branch</"
+"option></arg> <arg><option>--[no-]ignore-new</option></arg> <arg><option>--"
+"[no-]sign-tags</option></arg> <arg><option>--keyid=</option><replaceable>GPG-"
+"KEYID</replaceable></arg> <arg><option>--debian-branch=</"
+"option><replaceable>BRANCH_NAME</replaceable></arg> <arg><option>--debian-"
+"tag=</option><replaceable>tag-format</replaceable></arg> <arg><option>--"
+"debian-tag-msg=</option><replaceable>tag-msg-format</replaceable></arg> "
+"<arg><option>--posttag=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--retag</option></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-tag.xml:37
+msgid "&gbp-tag; tags the current head commit appropriately. It will in order:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-tag.xml:42
+msgid "Verify that it is being executed from the Debian branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-tag.xml:53
+msgid ""
+"Create a git tag using the information from <filename>debian/changelog</"
+"filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-tag.xml:58
+msgid "(Optionally) call a post tag hook."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:68
+msgid "<option>--posttag=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-tag.xml:72
+msgid "Execute <replaceable>COMMAND</replaceable> after creating the tag."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:111
+msgid ""
+"<option>--debian-tag-msg=</option><replaceable>tag-msg-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:119
+msgid "<option>--retag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:130
+msgid "<option>--debian-branch</option>=<replaceable>BRANCH_NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-tag.xml:134
+msgid ""
+"If you're not on this branch when invoking &gbp-tag; it will fail. Default "
+"is <replaceable>master</replaceable>. This is done to make sure you don't "
+"accidentally tag on the wrong branch. Not being on this branch will be "
+"ignored when using <option>--ignore-branch</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:153
+msgid "<option>--[no-]ignore-new</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-tag.xml:168
+msgid "Create a tag with the current defaults"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-tag.xml:171
+#, no-wrap
+msgid ""
+" &gbp-tag;\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-tag.xml:174
+msgid "Create using a more upstreamish tag format:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-tag.xml:177
+#, no-wrap
+msgid ""
+" &gbp-tag; --debian-tag='v%(version)s'\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-tag.xml:186
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.push\"/>, "
+"<xref linkend=\"man.gbp.conf\"/>,"
+msgstr ""
+
+#. type: Content of: <refentry><refmeta><refentrytitle>
+#: manpages/gbp.xml:12
+msgid "gbp"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp.xml:16
+msgid "&gbp;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp.xml:17
+msgid "Maintain &debian; packages in &git;"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp.xml:21
+msgid ""
+"&gbp; <group choice='req'> <arg><option>--help</option></arg> <arg><option>--"
+"version</option></arg> <arg><option>--list-cmds</option></arg> "
+"<arg><option>command</option><arg choice='opt' rep='repeat'><option>args</"
+"option></arg></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.xml:33
+msgid ""
+"&gbp; is used to maintain &debian; source packages in the &git; version "
+"control system."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:40
+msgid "<option>--help</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:43
+msgid "Print help"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:47
+msgid "<option>--version</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:50
+msgid "Print the programs version"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:54
+msgid "<option>--list-cmds</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:57
+msgid "List all available commands"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp.xml:63
+msgid "GBP COMMANDS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.xml:65
+msgid ""
+"These are the possible commands. For possible arguments to these commands, "
+"please see the corresponding man pages."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:70
+msgid "buildpackage"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:73
+msgid "Build source and binary packages from a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:79
+msgid "import-orig"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:82
+msgid "Import a new upstream version into a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:88
+msgid "export-orig"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:91
+msgid "Recreate upstream tarballs from a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:97
+msgid "import-dsc"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:100
+msgid "Import a &debian; source package into a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:106
+msgid "import-dscs"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:109
+msgid ""
+"Import several &debian; source packages into a &git; repository, sorted by "
+"version number"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:116
+msgid "dch"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:119
+msgid ""
+"Generate the <filename>debian/changelog</filename> from &git; commit history"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:125
+msgid "pq"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:128
+msgid ""
+"Manage <filename>debian/patches</filename> using &git; <option>rebase</"
+"option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:134
+msgid "pull"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:137
+msgid "Update a &git; repository from a remote"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:143
+msgid "clone"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:146
+msgid ""
+"Clone a &git; repository from a remote and set up the necessary branch "
+"tracking."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:152
+msgid "create-remote-repo"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:155
+msgid "Create a remote &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:161
+msgid "tag"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:164
+msgid "Tag a &debian; release in a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:170
+msgid "push"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:173
+msgid "Push packaging branches to a remote &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.xml:184
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.clone\"/>, "
+"<xref linkend=\"man.gbp.create.remote.repo\"/>, <xref linkend=\"man.gbp.dch"
+"\"/>, <xref linkend=\"man.gbp.export.orig\"/>, <xref linkend=\"man.gbp."
+"import.dsc\"/>, <xref linkend=\"man.gbp.import.dscs\"/>, <xref linkend=\"man."
+"gbp.import.orig\"/>, <xref linkend=\"man.gbp.pq\"/>, <xref linkend=\"man.gbp."
+"pristine.tar\"/>, <xref linkend=\"man.gbp.pull\"/>, <xref linkend=\"man.gbp."
+"push\"/>, <xref linkend=\"man.gbp.tag\"/>, <citerefentry> <refentrytitle>git-"
+"pbuilder</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <xref "
+"linkend=\"man.gbp.conf\"/>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <title>
+#: manpages/man.conffiles.xml:1
+msgid "CONFIGURATION FILES"
+msgstr ""
+
+#. type: Content of: <para>
+#: manpages/man.conffiles.xml:2
+msgid ""
+"Several <filename>gbp.conf</filename> files are parsed to set defaults for "
+"the above command-line arguments. See the <xref linkend=\"man.gbp.conf\"/> "
+"manpage for details."
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: manpages/man.seealso.xml:1
+msgid ""
+"<citerefentry> <refentrytitle>debuild</refentrytitle> <manvolnum>1</"
+"manvolnum> </citerefentry>, <citerefentry> <refentrytitle>git</"
+"refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <citerefentry> "
+"<refentrytitle>pristine-tar</refentrytitle> <manvolnum>1</manvolnum> </"
+"citerefentry>, <ulink url=\"file:///usr/share/doc/git-buildpackage/manual-"
+"html/index.html\"> <citetitle>The Git-Buildpackage Manual</citetitle></ulink>"
+msgstr ""
--- /dev/null
+# SOME DESCRIPTIVE TITLE
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2021-10-01 17:31+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. type: Content of: <book><bookinfo><title>
+#: manual.xml:16
+msgid "Building Debian Packages with git-buildpackage"
+msgstr ""
+
+#. type: Content of: <book><bookinfo><address>
+#: manual.xml:18
+#, no-wrap
+msgid "&dhemail;"
+msgstr ""
+
+#. type: Content of: <book><bookinfo>
+#: manual.xml:17
+msgid ""
+"<author>&dhfirstname; &dhsurname;</author> <placeholder type=\"address\" "
+"id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <book><bookinfo><subtitle>
+#: manual.xml:19
+msgid "Version: &gbp-version;"
+msgstr ""
+
+#. type: Content of: <book><appendix><title>
+#: manual.xml:31
+msgid "Command Reference"
+msgstr ""
+
+#. type: Content of: <book><appendix><title>
+#: manual.xml:55
+msgid "Copyright"
+msgstr ""
+
+#. type: Content of: <para>
+#: copyright.xml:2
+msgid ""
+"git-buildpackage, all associated scripts and programs, this manual, and all "
+"build scripts are Copyright © 2006-2017 Guido Günther."
+msgstr ""
+
+#. type: Content of: <para>
+#: copyright.xml:6
+msgid ""
+"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; Version 2 of the License."
+msgstr ""
+
+#. type: Content of: <para>
+#: copyright.xml:12
+msgid ""
+"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."
+msgstr ""
+
+#. type: Content of: <para>
+#: copyright.xml:19
+msgid ""
+"You should have received a copy of the GNU General Public License along with "
+"this program; if not, please see <http://www.gnu.org/licenses/>"
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/building.xml:2
+msgid "Building Packages from the &git; Repository"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:4
+msgid ""
+"In order to build a &debian; package from the &git; repository, you use: "
+"&gbp-buildpackage;. This builds the upstream tarball (as will be described "
+"below) and invokes &debuild; to build the package. To use another build "
+"command, you can use the <option>--git-builder</option> option as described "
+"later in the manual, but &debuild; is nice since it can invoke "
+"<productname>lintian</productname>. During the development phase (when "
+"you're either not on the <emphasis>debian-branch</emphasis> or when you have "
+"uncommitted changes in your repository), you'll usually use:"
+msgstr ""
+
+#. type: Content of: <chapter><programlisting>
+#: chapters/building.xml:14
+#, no-wrap
+msgid "&gbp-buildpackage; <option>--git-ignore-new</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:16
+msgid ""
+"If &gbp-buildpackage; doesn't find a valid upstream tarball, it will create "
+"one by looking at the tag matching the upstream version. To change this "
+"behaviour, see the <option>--git-upstream-tree</option> option."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:20
+msgid ""
+"If you want to recreate the original tarball using the additional "
+"information from the <option>pristine-tar branch</option>, you have to "
+"specify the <option>--git-pristine-tar</option> option. This will make sure "
+"the upstream tarball matches exactly the one imported. Using this option is "
+"the recommended way of recreating the upstream tarball."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:26
+msgid ""
+"Once you're satisfied with the build and want to do a release, you commit "
+"all your changes and issue:"
+msgstr ""
+
+#. type: Content of: <chapter><programlisting>
+#: chapters/building.xml:29
+#, no-wrap
+msgid "&gbp-buildpackage; <option>--git-tag</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/building.xml:31
+msgid ""
+"This will again build the &debian; package and tag the final result after "
+"extracting the current version from the changelog. If you want &gpg;-signed "
+"tags, you can use the <option>--git-sign</option> and "
+"<option>--git-keyid</option> options. To save typing, these option can be "
+"specified via the configuration files. You can furthermore change the tag "
+"format used when creating tags with the <option>debian-tag</option> option; "
+"the default is <replaceable>debian/<version></replaceable>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/building.xml:39
+msgid "Using a separate build dir"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:40
+msgid ""
+"Tools like &svn-buildpackage; use a separate build-area. To achieve a "
+"similar behaviour with &gbp-buildpackage;, use the "
+"<option>--git-export-dir</option> option:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/building.xml:43
+#, no-wrap
+msgid ""
+"&gbp-buildpackage; "
+"<option>--git-export-dir</option>=<replaceable>../build-area/</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:45
+msgid ""
+"This will export the head of the current branch to "
+"<replaceable>../build-area/package-version</replaceable> and build the "
+"package. If you don't want to export the current branch head, you can use "
+"<option>--git-export</option> to export any treeish object. Here are some "
+"examples:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/building.xml:51
+#, no-wrap
+msgid ""
+"&gbp-buildpackage; "
+"<option>--git-export-dir</option>=<replaceable>../build-area</replaceable> "
+"<option>--git-export</option>=<replaceable>debian/0.4.3</replaceable>\n"
+"&gbp-buildpackage; "
+"<option>--git-export-dir</option>=<replaceable>../build-area</replaceable> "
+"<option>--git-export</option>=<replaceable>etch</replaceable>\n"
+"&gbp-buildpackage; "
+"<option>--git-export-dir</option>=<replaceable>../build-area</replaceable> "
+"<option>--git-export</option>=<replaceable>8caed309653d69b7ab440e3d35abc090eb4c6697</replaceable>\n"
+"&gbp-buildpackage; "
+"<option>--git-export-dir</option>=<replaceable>../build-area</replaceable> "
+"<option>--git-export</option>=<replaceable>INDEX</replaceable>\n"
+"&gbp-buildpackage; "
+"<option>--git-export-dir</option>=<replaceable>../build-area</replaceable> "
+"<option>--git-export</option>=<replaceable>WC</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:57
+msgid ""
+"The special argument <replaceable>INDEX</replaceable> exports the state of "
+"the current index, which can be used to include staged but uncommitted "
+"changes in the build. Whereas the special argument "
+"<replaceable>WC</replaceable> exports the current working copy as is."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/building.xml:64
+#, no-wrap
+msgid ""
+"[buildpackage]\n"
+"# use a build area relative to the git repository\n"
+"export-dir=../build-area\n"
+"# to use the same build area for all packages use an absolute path:\n"
+"#export-dir=/home/debian-packages/build-area\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:61
+msgid ""
+"If you want to default to build in a separate build area, you can specify "
+"the directory to use in the <filename>gbp.conf</filename> file. "
+"<placeholder type=\"programlisting\" id=\"0\"/> &gbp-buildpackage; will "
+"cleanup the build-area after a successful build. If you want to keep the "
+"build tree, use <replaceable>--git-no-purge</replaceable>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/building.xml:75
+msgid "Invoking external programs"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/building.xml:77
+msgid ""
+"Besides the commands for cleaning the package build dir "
+"(<option>cleaner</option>) and building the package "
+"(<option>builder</option>), you can also invoke hooks during the package "
+"build: immediately before a build (<option>prebuild</option>), after a "
+"successful build (<option>postbuild</option>), and after creating a tag "
+"(<option>posttag</option>). Typical applications are running "
+"<productname>lintian</productname> or pushing changes into a remote "
+"repository."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/building.xml:87
+msgid "Running lintian"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:93
+#, no-wrap
+msgid ""
+"&gbp-buildpackage; <option>--git-postbuild</option>=<replaceable>'lintian "
+"$GBP_CHANGES_FILE'</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:97
+#, no-wrap
+msgid ""
+"<option>postbuild</option>=<replaceable>lintian "
+"$GBP_CHANGES_FILE</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:88
+msgid ""
+"&gbp-buildpackage; exports several variables into the "
+"<option>posttag</option>'s environment (for details see the <xref "
+"linkend=\"man.gbp.buildpackage\"/> manual page). To invoke &lintian;, we "
+"need to tell it where to find the changes file: <placeholder "
+"type=\"programlisting\" id=\"0\"/> To call &lintian; automatically after "
+"each successful build, add: <placeholder type=\"programlisting\" id=\"1\"/> "
+"to your <filename>.gbp.conf</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/building.xml:103
+msgid "Pushing into a remote repository"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:107
+#, no-wrap
+msgid ""
+"&gbp-buildpackage; <option>--git-tag</option> "
+"<option>--git-posttag</option>=<replaceable>\"git push && git push "
+"--tags\"</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:104
+msgid ""
+"If you want to push your changes automatically after a successful build and "
+"tag, you can use &gbp-buildpackage;'s posttag hook. A very simple invocation "
+"would look like this: <placeholder type=\"programlisting\" id=\"0\"/> This "
+"assumes you have set up a remote repository to push to in "
+"<filename>.git/config</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:117
+#, no-wrap
+msgid ""
+"#!/bin/sh -e\n"
+"#\n"
+"# gbp-posttag-push: post tag hook to push out the newly created tag and to\n"
+"# forward the remote branch to that position\n"
+"\n"
+"if ! REMOTE=$(git config --get branch.\"${GBP_BRANCH}\".remote); then\n"
+" REMOTE=origin\n"
+"fi\n"
+"\n"
+"if [ \"$GBP_TAG\" ]; then\n"
+" echo \"Pushing $GBP_TAG to $REMOTE\"\n"
+" git push \"$REMOTE\" \"$GBP_TAG\"\n"
+"else\n"
+" echo \"GBP_TAG not set.\"\n"
+" exit 1\n"
+"fi\n"
+"\n"
+"if [ \"$GBP_SHA1\" ] && [ \"$GBP_BRANCH\" ]; then\n"
+" git push \"$REMOTE\" \"$GBP_SHA1\":\"$GBP_BRANCH\"\n"
+"else\n"
+" echo \"GBP_SHA1 or GBP_BRANCH not set.\"\n"
+" exit 1\n"
+"fi\n"
+"echo \"done.\"\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/building.xml:146
+#, no-wrap
+msgid "<option>posttag</option>=<replaceable>\"gbp-posttag-push\"</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:112
+msgid ""
+"Usually, you want to make sure you don't push out any unrelated changes into "
+"the remote repository. This is handled by the following hook which only "
+"pushes out the created tag to where you pulled from and also forwards the "
+"corresponding remote branch to that position: <placeholder "
+"type=\"programlisting\" id=\"0\"/> <envar>GBP_TAG</envar>, "
+"<envar>GBP_SHA1</envar> and <envar>GBP_BRANCH</envar> are passed to the hook "
+"via the environment. To call this hook automatically upon tag creation, add: "
+"<placeholder type=\"programlisting\" id=\"1\"/> to your "
+"<filename>.gbp.conf</filename> and make sure <filename>gbp-push</filename> "
+"is somewhere in your <envar>$PATH</envar>. On &debian; systems, a more "
+"complete example can be found in "
+"<filename>/usr/share/doc/examples/git-buildpackage/examples/gbp-posttag-push</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/building.xml:155
+msgid "Running postexport hook"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:156
+msgid ""
+"&gbp-buildpackage; exports several variables into the "
+"<option>postexport</option>'s environment (for details see the <xref "
+"linkend=\"man.gbp.buildpackage\"/> manual page). The motivation for the "
+"postexport action is to allow further adjustment of the sources prior to "
+"building the package. A typical use case scenario is to allow creating "
+"multiple source and binary packages from one &debian; branch, e.g. the "
+"bootstrap gcc and in the next stage the full gcc."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:165
+msgid ""
+"The postexport action postpones the creation of the upstream tarball, so "
+"that the metadata for creating it is already present in the exported source "
+"tree. The example postexport script below "
+"(<filename>crosstoolchain-expand.sh</filename>) expands changelog, lintian "
+"override files, rules and control files according to an environment variable "
+"<envar>PKG_FLAVOR</envar>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:173
+msgid ""
+"Sample <filename>gbp.conf</filename> - enables source tree export by "
+"specifying the export directory:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/building.xml:177
+#, no-wrap
+msgid ""
+"[buildpackage]\n"
+"# use a build area relative to the git repository\n"
+"export-dir = ../build-area\n"
+"# disable the since the sources are being exported first\n"
+"cleaner =\n"
+"# post export script that handles expansion of &debian; specific files\n"
+"postexport = crosstoolchain-expand.sh\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:187
+msgid "Sample postexport script: <filename>crosstoolchain-expand.sh</filename>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/building.xml:189
+#, no-wrap
+msgid ""
+"#!/bin/sh\n"
+"#\n"
+"# Purpose: this script is intended for creating multiple source and\n"
+"# binary Debian packages from one source tree. It can be used in\n"
+"# conjunction with git-buildpackage that support a postexport hook\n"
+"#\n"
+"# A typical use is preparing a bootstrap gcc package that is needed\n"
+"# for building newlib and then preparing a full gcc package from the\n"
+"# same source tree. The user may specify the package flavor via\n"
+"# PKG_FLAVOR environmental variable. \n"
+"#\n"
+"#\n"
+"# The script expands/processes the following files:\n"
+"#\n"
+"# - changelog.tmpl is converted to standard Debian changelog\n"
+"#\n"
+"#\n"
+"# - all binary package lintian override template files are expanded\n"
+"# and renamed to the requested package flavor\n"
+"#\n"
+"# - source package lintian override template file is expanded and\n"
+"# renamed\n"
+"#\n"
+"# - rules.$PKG_FLAVOR and control.$PKG_FLAVOR are renamed to rules and\n"
+"# control resp.\n"
+"\n"
+"\n"
+"# the template string has been carefully chosen, so that\n"
+"# e.g. changelogs that refer to the source package can still be\n"
+"# processed by dch/git-dch resp.\n"
+"TMPL_STR=-XXXXXX\n"
+"\n"
+"# by default replace string for the template is empty\n"
+"REPLACE_STR=\n"
+"\n"
+"if [ -n \"$PKG_FLAVOR\" ]; then\n"
+" REPLACE_STR=-$PKG_FLAVOR\n"
+"fi\n"
+"\n"
+"REPLACE_EXPR=\"s/$TMPL_STR/$REPLACE_STR/g\"\n"
+"\n"
+"\n"
+"# actual processing of relevant files\n"
+"cd debian\n"
+"\n"
+"# expand the template changelog\n"
+"# remove the symlinked version\n"
+"rm changelog\n"
+"chglog_tmpl=changelog.tmpl\n"
+"[ -f \"$chglog_tmpl\" ] || {\n"
+" echo \"Missing changelog template (debian/$chglog_tmpl)\"\n"
+" exit 1\n"
+"}\n"
+"cat changelog.tmpl | sed -e \"$REPLACE_EXPR\" > changelog\n"
+"rm changelog.tmpl\n"
+"\n"
+"# process binary package lintian overrides - each override must match\n"
+"# its package name\n"
+"for f in *.lintian-overrides.tmpl; do\n"
+" outfile=${f%.tmpl}\n"
+" [ -f \"$f\" ] || {\n"
+"\techo \"Missing lintian override files for binary packages\"\n"
+"\texit 1\n"
+" }\n"
+" cat $f | sed -e \"$REPLACE_EXPR\" > ${outfile/$TMPL_STR/$REPLACE_STR}\n"
+" rm $f\n"
+"done\n"
+"\n"
+"# process the only source package lintian override\n"
+"source_lintian=source/lintian-overrides.tmpl\n"
+"cat $source_lintian | sed -e \"$REPLACE_EXPR\" > ${source_lintian%.tmpl}\n"
+"rm $source_lintian\n"
+"\n"
+"# rules and control file are package flavor specific\n"
+"[ -f rules.$PKG_FLAVOR ] && mv rules.$PKG_FLAVOR rules\n"
+"[ -f control.$PKG_FLAVOR ] && mv control.$PKG_FLAVOR control\n"
+"rm -f rules.* control.*\n"
+"\n"
+"exit 0\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/building.xml:271
+msgid "Running preexport hook"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/building.xml:272
+msgid ""
+"&gbp-buildpackage; exports several variables into the "
+"<option>preexport</option>'s environment (for details see the <xref "
+"linkend=\"man.gbp.buildpackage\"/> manual page). The motivation for the "
+"preexport action is to allow further actions before preparing and exporting "
+"the orig tarballs to the build directory. A usecase could be having the "
+"orig tarballs in a separate repository due to very large binary assets, that "
+"need to be checked out to the correct branch before creating the tarballs."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/cfgfile.xml:2
+msgid "Configuration Files"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:6 manpages/gbp.conf.xml:23
+msgid "/etc/git-buildpackage/gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:7
+msgid "system wide configuration"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:10 manpages/gbp.conf.xml:33
+msgid "~/.gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:11
+msgid "per user configuration"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:14 manpages/gbp.conf.xml:43
+msgid ".gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:15
+msgid "per repository/branch configuration (deprecated)"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:18 manpages/gbp.conf.xml:54
+msgid "debian/gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:19
+msgid "per repository/branch configuration"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:22 manpages/gbp.conf.xml:64
+msgid ".git/gbp.conf"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:23
+msgid "per (local) repository configuration"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:29
+msgid "[DEFAULT]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:31
+msgid "Options in this section apply to all &gbp; commands."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:35
+msgid "[buildpackage]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:36
+msgid ""
+"Options in this section apply to &gbp-buildpackage; only and override "
+"options from the [DEFAULT] section."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:40
+msgid "[import-orig]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:41
+msgid ""
+"Options in this section apply to &gbp-import-orig; only and override options "
+"from the [DEFAULT] section."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:45
+msgid "[import-dsc]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:46
+msgid ""
+"Options in this section apply to &gbp-import-dsc; only and override options "
+"from the [DEFAULT] section."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:50
+msgid "[dch]"
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:51
+msgid ""
+"Options in this section apply to &gbp-dch; only and override options from "
+"the [DEFAULT] section."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><term>
+#: chapters/cfgfile.xml:55
+msgid "..."
+msgstr ""
+
+#. type: Content of: <chapter><para><variablelist><varlistentry><listitem><para>
+#: chapters/cfgfile.xml:56
+msgid "Same for the other &gbp; commands"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/cfgfile.xml:3
+msgid ""
+"The configuration files are parsed in this order: <placeholder "
+"type=\"variablelist\" id=\"0\"/> All have the same format. They consist of "
+"several sections, all of them are optional: <placeholder "
+"type=\"variablelist\" id=\"1\"/> The actual options in these sections are "
+"the command line options without the '--' prefix. So "
+"<option>--upstream-branch=</option><replaceable>dfsgfree</replaceable> would "
+"read:"
+msgstr ""
+
+#. type: Content of: <chapter><screen>
+#: chapters/cfgfile.xml:63
+#, no-wrap
+msgid ""
+" <option>upstream-branch</option>=<replaceable>dfsgfree</replaceable>\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/cfgfile.xml:66
+msgid ""
+"in the config file. In the special case of &gbp-buildpackage;, the stripped "
+"prefix is not '--' but '--git-'. Here's a more complete example:"
+msgstr ""
+
+#. type: Content of: <chapter><programlisting>
+#: chapters/cfgfile.xml:70
+#, no-wrap
+msgid ""
+" [DEFAULT]\n"
+" # the default build command\n"
+" builder=debuild -i\\.git -I.git\n"
+" # the default branch for upstream sources\n"
+" upstream-branch=upstream\n"
+" # the default branch for the debian patch\n"
+" debian-branch=master\n"
+"\n"
+" [buildpackage]\n"
+" upstream-branch=dfsgclean\n"
+" # Sign tags with GPG:\n"
+" sign-tags = True\n"
+" # Keyid to sign tags with\n"
+" #keyid = 0xdeadbeef\n"
+"\n"
+" [import-orig]\n"
+" upstream-branch=notdfsgclean\n"
+"\n"
+" [import-dsc]\n"
+" upstream-branch=notdfsgclean\n"
+"\n"
+" [dch]\n"
+" git-log=--no-merges\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/cfgfile.xml:95
+msgid "For more details, see the <xref linkend=\"man.gbp.conf\"/> manual page."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/cfgfile.xml:99
+msgid "Overriding Parsing Order"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/cfgfile.xml:114
+#, no-wrap
+msgid ""
+"\t$ cat <<EOF >~/.gbp.late.conf\n"
+"\t[DEFAULT]\n"
+"\texport-dir = ../build-area\n"
+"\ttarball-dir = ../tarballs\n"
+"\tEOF\n"
+"\n"
+"\t$ export GBP_CONF_FILES=~/.gbp.conf:debian/gbp.conf:~/.gbp.late.conf\n"
+"\t$ cd <mypkg>\n"
+"\t$ gbp config buildpackage.export-dir\n"
+"\t../build-area\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/cfgfile.xml:101
+msgid ""
+"The environment variable <envar>GBP_CONF_FILES</envar> can be used to "
+"override the order in which configuration files are parsed. The following "
+"example parses two configuration files in the users home directory "
+"(<filename>~/.gbp.conf</filename> and <filename>~/.gbp.late.conf</filename>) "
+"and in the debian directory (<filename>debian/gbp.conf</filename>). The "
+"file are parsed from left to right. Since <filename> "
+"~/.gbp.late.conf</filename> is at the very end of the list it can be used to "
+"override configuration entries shipped by the package. This can be useful if "
+"packages set e.g. <option>export-dir</option> or "
+"<option>tarball-dir</option> and you perfer different locations: "
+"<placeholder type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/cfgfile.xml:131
+#, no-wrap
+msgid ""
+"\t$ export GBP_CONFI_FILES=/does/not/exist\n"
+"\t$ gbp config buildpackage.debian-branch\n"
+"\tmaster\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/cfgfile.xml:127
+msgid ""
+"If you want all configuration files to be skipped, set "
+"<envar>GBP_CONF_FILES</envar> to a non existing location. This way only "
+"default values and options from the command line will be used: <placeholder "
+"type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/import.xml:2
+msgid "Importing Sources"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:5
+msgid "Importing already existing &debian; packages"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:8
+#, no-wrap
+msgid " &gbp-import-dsc; package_0.1-1.dsc\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:6
+msgid ""
+"Importing an already existing &debian; package into a &git; repository is as "
+"easy as: <placeholder type=\"programlisting\" id=\"0\"/> This will create a "
+"new &git; repository named after the imported package, put the upstream "
+"sources onto the <option>upstream-branch</option> and the &debian; patch on "
+"the <option>debian-branch</option>. In case of a &debian; native package, "
+"only the <option>debian-branch</option> is being used. You can specify "
+"alternative branch names via the <option>--upstream-branch</option> and "
+"<option>--debian-branch</option> options, or via the "
+"<option>upstream-branch</option> and <option>debian-branch</option> options "
+"in the configuration file."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:20 chapters/import.xml:100
+msgid ""
+"If you want to be able to exactly recreate the original tarball "
+"(orig.tar.gz) from &git;, you should also specify the "
+"<option>--pristine-tar</option> option. This is recommended."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:28
+#, no-wrap
+msgid ""
+" cd package/\n"
+" &gbp-import-dsc; package_0.1-2.dsc\n"
+" &gbp-import-dsc; package_0.1-3.dsc\n"
+" &gbp-import-dsc; package_0.2-1.dsc\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:25
+msgid ""
+"If you want to import further versions, you can change into your shiny new "
+"&git; repository and just continue with the same command: <placeholder "
+"type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:37
+#, no-wrap
+msgid " &gbp-import-dscs; /path/to/history/package_*.dsc\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:35
+msgid ""
+"Or you can import all versions at once using &gbp-import-dscs;: <placeholder "
+"type=\"programlisting\" id=\"0\"/> This will create a &git; repository if "
+"necessary and import all versions sorted by version number."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:46
+#, no-wrap
+msgid " &gbp-import-dscs; --debsnap package\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:42
+msgid ""
+"You can also import all versions of a package known from the <ulink "
+"url=\"http://snapshot.debian.org/\">snapshot.debian.org</ulink> service "
+"using the <option>--debsnap</option> option of &gbp-import-dscs;: "
+"<placeholder type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:52 chapters/patches.xml:181
+msgid "Importing a new upstream version"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:56
+#, no-wrap
+msgid ""
+" &gbp-import-orig; <filename>/path/to/package_0.2.orig.tar.gz</filename>\n"
+" &gbp-import-orig; <filename>/path/to/package_0.2.tar.bz2</filename>\n"
+" &gbp-import-orig; <filename>/path/to/package-0.2/</filename>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:53
+msgid ""
+"Change into your &git; repository (which can be empty), make sure it has all "
+"local modifications committed, and run either of: <placeholder "
+"type=\"programlisting\" id=\"0\"/> This puts the upstream sources onto the "
+"<option>upstream-branch</option> and tags them accordingly (the default tag "
+"format is <replaceable>upstream/%(version)s</replaceable>)."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:65
+msgid ""
+"The result is then placed onto the <option>debian-branch</option>. The way "
+"this happens is determined by the <option>--merge-mode</option> option. The "
+"default mode <option>auto</option> replaces the upstream sources while "
+"preserving the <filename>debian/</filename> directory for 3.0 (quilt) "
+"packages. A &git; merge is used for all other source format versions."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:74
+msgid ""
+"You can again specify different branch names via the "
+"<option>--upstream-branch</option> and <option>--debian-branch</option> "
+"options."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:83
+#, no-wrap
+msgid " &gbp-import-orig; --uscan\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:78
+msgid ""
+"If you are using <filename>debian/watch</filename> to keep track of how to "
+"retrieve upstream sources, you can simply use the <option>--uscan</option> "
+"option to download and import the latest upstream version: <placeholder "
+"type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:89
+#, no-wrap
+msgid ""
+" &gbp-import-orig; "
+"<option>--filter</option>=<replaceable>'CVS/*'</replaceable> "
+"<filename>/path/to/package_0.2.orig.tar.gz</filename>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:86
+msgid ""
+"You can also filter out content you don't want imported: <placeholder "
+"type=\"programlisting\" id=\"0\"/> The <option>--filter</option> option can "
+"be used multiple times for more complex filtering."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:95
+msgid ""
+"If you expect a merge conflict, you can delay the merge to the "
+"<option>debian-branch</option> via the <option>--no-merge</option> option "
+"and pull in the changes from the <option>upstream-branch</option> later."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:104
+msgid ""
+"To customize the commit message used by &gbp-import-orig;, use the "
+"<option>--import-msg</option> option. This string is a &pyformat;, into "
+"which the <replaceable>version</replaceable> variable is "
+"interpolated. (i.e., use <replaceable>%(version)s</replaceable> in your "
+"message to get the imported upstream version)."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:113
+msgid "Recovering from errors"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:114
+msgid ""
+"In case of an error &gbp-import-orig; will by default rollback (undo) all "
+"changes it has done to the repository so far:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/import.xml:118
+#, no-wrap
+msgid ""
+"\t$ &gbp; import-orig --verbose --filter='CVS/*' --filter='.bzr/*' "
+"--filter='.hg/*' --filter='.svn/*' --upstream-version=1.9 "
+"../gif2apng-1.9.tar.gz\n"
+"\tgbp:info: Importing '../gif2apng-1.9.tar.gz' to branch 'upstream' "
+"(filtering out [\"'CVS/*'\", \"'.bzr/*'\", \"'.hg/*'\", \"'.svn/*'\"])...\n"
+"\tgbp:info: Source package is gif2apng\n"
+"\tgbp:info: Upstream version is 1.9\n"
+"\tgbp:info: Merging to 'master'\n"
+"\tgbp:error: Automatic merge failed.\n"
+"\tgbp:error: Error detected, Will roll back changes.\n"
+"\tgbp:info: Rolling back branch upstream by resetting it to "
+"a6733c1f1e190ac0ed4774abc3466e9986a6df5e\n"
+"\tgbp:info: Rolling back branch pristine-tar by resetting it to "
+"0ee24ac614c920e30af82d602882c2ee841c88e5\n"
+"\tgbp:info: Rolling back tag upstream/1.9 by deleting it\n"
+"\tgbp:info: Rolling back branch master by resetting it to "
+"ce99782336e83a56e8e579b3cdadf93b0c19e1a8\n"
+"\tgbp:info: Rolling back failed merge of upstream/1.9\n"
+"\tgbp:error: Rolled back changes after import error.\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:133
+msgid ""
+"In this case the import failed due to a merge conflict. Other reasons are "
+"running out of disk space, problems when generating the pristine-tar "
+"delta. If you don't want &gbp-import-orig; to undo changes made to the "
+"repository use the <option>--no-rollback</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:143
+msgid "Converting an existing &git; repository"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:145
+msgid ""
+"If the &git; repository wasn't created with &gbp-import-dsc;, you have to "
+"tell &gbp-buildpackage; and friends where to find the upstream sources."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:149
+msgid "Upstream sources on a branch"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:155
+#, no-wrap
+msgid " &gitcmd; branch -m theupstream-branch upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:160
+#, no-wrap
+msgid ""
+"<command>cat</command> <<EOF > <filename>.git/gbp.conf</filename>\n"
+"[DEFAULT]\n"
+"# this is the upstream-branch:\n"
+"upstream-branch=theupstream-branch\n"
+"EOF\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:151
+msgid ""
+"If the upstream sources are already on a separate branch, things are pretty "
+"simple. You can either rename that branch to the default "
+"<option>upstream-branch</option> name <emphasis>upstream</emphasis> with: "
+"<placeholder type=\"programlisting\" id=\"0\"/> or you can tell "
+"&gbp-buildpackage; the name of the branch to use as "
+"<option>upstream-branch</option>: <placeholder type=\"programlisting\" "
+"id=\"1\"/> If you then use &gbp-import-orig; to import new upstream sources, "
+"they will from now on end up on <emphasis>theupstream-branch</emphasis> and "
+"merged to the <option>debian-branch</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:172
+msgid "Upstream sources not on a branch"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:179
+#, no-wrap
+msgid " &gitcmd; branch upstream $(&gitcmd; log --format='%H' | tail -1)\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:174
+msgid ""
+"If you don't have an upstream branch but started your repository with only "
+"the upstream sources (not the &debian; patch), you can simply branch from "
+"that point. So use &gitkcmd; or &gitcmd;-log to locate the commit-id of that "
+"commit and create the upstream branch from there, e.g.: <placeholder "
+"type=\"programlisting\" id=\"0\"/> The important thing here is that the "
+"<envar>COMMIT_ID</envar> specifies a point on the master branch that carried "
+"<emphasis>only</emphasis> the upstream sources and not the &debian; "
+"modifications. The above example assumes that this was the first commit to "
+"that repository."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><warning><para>
+#: chapters/import.xml:186
+msgid ""
+"There's currently no <emphasis>easy</emphasis> way to create the "
+"<option>upstream-branch</option> if you never had the upstream sources as a "
+"single commit. Using &gbp-import-orig; on such repositories might lead to "
+"unexpected merge results."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:190
+msgid ""
+"In order to fix this you can prepend the upstream sources as a single commit "
+"to your tree using &git;'s <ulink "
+"url=\"http://git.or.cz/gitwiki/GraftPoint\">grafts</ulink>. Afterwards you "
+"can simply create a branch as explained above and &gbp-import-orig; will "
+"work as expected."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:200
+#, no-wrap
+msgid ""
+" <command>git checkout</command> <option>--orphan</option> "
+"<replaceable>upstream</replaceable>\n"
+" <command>git rm</command> <option>-rf</option> "
+"<replaceable>.</replaceable>\n"
+" <command>git commit</command> <option>--allow-empty</option> "
+"<option>-m</option> <replaceable>'Initial upstream branch.'</replaceable>\n"
+" <command>git checkout</command> <option>-f</option> "
+"<replaceable>master</replaceable>\n"
+" # When not using 3.0 (quilt) with the default --merge-mode=auto\n"
+" <command>git merge</command> <option>--allow-unrelated-histories</option> "
+"<replaceable>upstream</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:195
+msgid ""
+"Alternatively, if you are only importing source from original tarballs (for "
+"instance when converting from a Subversion repository where the "
+"mergeWithUpstream was set for svn-buildpackage), you can create an empty "
+"upstream branch with the following commands: <placeholder "
+"type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:212
+msgid "Starting a &debian; package from scratch"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:214
+msgid ""
+"So far, we assumed you already have a &debian; package to start with, but "
+"what if you want to start a new package? First, create an empty repository:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/import.xml:218
+#, no-wrap
+msgid ""
+" <command>mkdir</command> package-0.1\n"
+" <command>cd</command> package-0.1\n"
+" <command>git init</command>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/import.xml:225
+#, no-wrap
+msgid ""
+" &gbp-import-orig; <option>-u</option> <replaceable>0.1</replaceable> "
+"<filename>../package-0.1.tar.gz</filename>\n"
+" <command>dh_make</command>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:222
+msgid ""
+"Then, you import the upstream sources, branch off the "
+"<option>upstream-branch</option> branch and add the &debian; files (e.g. via "
+"dh_make): <placeholder type=\"programlisting\" id=\"0\"/> That's it, you're "
+"done. If you want to publish your new repository, you can use "
+"&gbp-create-remote-repo;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:233
+msgid "When upstream uses Git"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:235
+msgid ""
+"If upstream uses &git; for development (and you don't want to ignore that "
+"fact entirely), there are at least three ways to handle packaging. The first "
+"one uses &git; exclusively and creates the upstream tarballs from the "
+"upstream tag while the second one still uses upstream tarballs but links "
+"your packaging &git; history with upstreams &git; history. The third one "
+"also uses a tarballs but does not link to the upstream history."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:245
+msgid "No upstream tarballs"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:246
+msgid ""
+"If upstream doesn't build upstream tarballs, or you don't care about them, "
+"the simplest way is to clone upstream's repository and create a separate "
+"packaging branch in there. You will not need &gbp-import-orig; at all with "
+"this workflow. &gbp-buildpackage; will handle creating the upstream tarballs "
+"needed for the Debian source package."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:254
+msgid ""
+"For that to work you need to tell &gbp; what the upstream tag format looks "
+"like. Therefore you either use the <option>--git-upstream-tag</option> "
+"command line option or the <option>upstream-tag</option> configuration file "
+"variable to specify upstream's tag format."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:262
+msgid ""
+"For example a common upstream format is to put a "
+"<replaceable>v</replaceable> in front of the version number. In this case, "
+"the configuration option would look like:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/import.xml:268
+#, no-wrap
+msgid ""
+"[DEFAULT]\n"
+"upstream-tag = v%(version)s\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:272
+msgid ""
+"<replaceable>version</replaceable> will be replaced by &gbp; with the "
+"upstream version number as determined from "
+"<filename>debian/changelog</filename>. The <replaceable>%()s</replaceable> "
+"might be familiar from &pyformat;s. The option was placed in the "
+"<emphasis>[DEFAULT]</emphasis> section instead of the "
+"<emphasis>[buildpackage]</emphasis> section of the configuration so other "
+"tools like &gbp-dch; make use of it too."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:283
+msgid ""
+"Some upstreams use other formats though and don't separate numbers by dots "
+"but rather by underscore(<replaceable>_</replaceable>), "
+"hyphen(<replaceable>-</replaceable>) or anything else. In order to cope with "
+"that you can use version mangling of these characters via substitution. The "
+"substitution works as follows:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/import.xml:292
+#, no-wrap
+msgid ""
+"[DEFAULT]\n"
+"upstream-tag = v%(version%.%_)s\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:296
+msgid ""
+"This means that each occurrence of <replaceable>.</replaceable> will be "
+"replaced by <replaceable>_</replaceable> in the upstream version number. For "
+"example the upstream version <replaceable>1.2.3</replaceable> as determined "
+"from the <filename>debian/changelog</filename> will be looked up as &git; "
+"tag <replaceable>v1_2_3</replaceable> by &gbp-buildpackage;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:306
+msgid ""
+"If you want the substitution to be the <replaceable>%</replaceable> "
+"character you have to escape "
+"it. E.g. <replaceable>%(version%-%\\%)s</replaceable> will replace "
+"<replaceable>-</replaceable> with <replaceable>%</replaceable>, transforming "
+"<replaceable>1-A.B.C</replaceable> to <replaceable>1%A.B.C</replaceable>. "
+"Only a single replacement is supported and it can only replace a single "
+"character."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><warning><para>
+#: chapters/import.xml:312
+msgid ""
+"Since some of the possible mangling characters like "
+"<replaceable>_</replaceable> and <replaceable>%</replaceable> are also used "
+"to denote epochs and tilde revisions these versions can't be reconstructed "
+"when mapping from &git; tags back to &debian; versions and will therefore "
+"break other tools like &gbp-dch;. So use version mangling with care. It's "
+"better to come up with a Debian compatible tag format upstream. See &dep14; "
+"for the currently used expansion rules for Debian version numbers."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:321
+msgid ""
+"If you're using &pristine-tar; you can make &gbp-buildpackage; commit the "
+"generated tarball back to the pristine-tar branch using the "
+"<option>--git-pristine-tar-commit</option> option or you can use "
+"&gbp-pristine-tar; after you've created the tarballs. This will make sure "
+"others building your package can exactly regenerate the tarball you created "
+"when building the &debian; package."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><title>
+#: chapters/import.xml:334
+msgid "Step by step"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para>
+#: chapters/import.xml:335
+msgid ""
+"To not make any assumptions about &gbp;'s configuration, the following steps "
+"have all options given in its long versions on the command line. You can add "
+"these to &gbp.conf; to save lots of typing."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para><programlisting>
+#: chapters/import.xml:344
+#, no-wrap
+msgid ""
+" <command>git clone</command> --no-checkout -o upstream "
+"git://git.example.com/libgbp.git\n"
+" <command>cd</command> libgbp\n"
+" <command>git checkout</command> -b debian/sid v1.0\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para>
+#: chapters/import.xml:340
+msgid ""
+"First, we clone the upstream repository. To avoid any ambiguities between "
+"the &debian; packaging repository and the upstream repository, we name the "
+"upstream repository <replaceable>upstream</replaceable> instead of the "
+"default <replaceable>origin</replaceable>. <placeholder "
+"type=\"programlisting\" id=\"0\"/> The above makes sure we have "
+"<replaceable>debian/sid</replaceable> for the &debian; packaging. We didn't "
+"create any <replaceable>upstream/*</replaceable> branches; they're not "
+"needed for the packaging and only need to be kept up to date. We started the "
+"branch at the commit corresponding to the tag "
+"<replaceable>v1.0</replaceable>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para><programlisting>
+#: chapters/import.xml:356
+#, no-wrap
+msgid ""
+" <command>gbp buildpackage</command> --git-pristine-tar "
+"--git-pristine-tar-commit --git-upstream-tag='v%(version)s' "
+"--git-debian-branch=debian/sid\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para><programlisting>
+#: chapters/import.xml:361
+#, no-wrap
+msgid ""
+" <command>git fetch</command> upstream\n"
+" <command>git merge</command> v1.1\n"
+" <command>gbp dch</command> --debian-branch=debian/sid --snapshot --auto "
+"debian/\n"
+" &gbp-buildpackage; --git-ignore-new --git-pristine-tar "
+"--git-pristine-tar-commit --git-upstream-tag='v%(version)s'\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para><programlisting>
+#: chapters/import.xml:371
+#, no-wrap
+msgid ""
+" <command>gbp dch</command> --release --auto --debian-branch=debian/sid\n"
+" <command>git commit</command> -m\"Release 1.1-1\" debian/changelog\n"
+" &gbp-buildpackage; --git-upstream-tag='v%(version)s' "
+"--git-debian-branch=debian/sid\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><sect3><para>
+#: chapters/import.xml:353
+msgid ""
+"After adding the &debian; packaging, we build the package. This assumes "
+"you're using &pristine-tar; and upstream uses a version number format as "
+"described above: <placeholder type=\"programlisting\" id=\"0\"/> When "
+"updating to a new upstream version, we simply fetch from upstream and merge "
+"in the new tag. Afterwards, we update the changelog and build the package: "
+"<placeholder type=\"programlisting\" id=\"1\"/> Note that the above "
+"&gbp-dch; call makes sure we only pickup changes in the "
+"<filename>debian/</filename> directory. Since we told it to build a snapshot "
+"changelog entry and we hadn't commit the changelog yet, we need to tell "
+"&gbp-buildpackage; that the working directory is unclean via the "
+"<option>--git-ignore-new</option> option. Once everything looks good, "
+"commit the changelog and build a release version: <placeholder "
+"type=\"programlisting\" id=\"2\"/> If you want to share your repository with "
+"others, you can use &gbp-create-remote-repo; and &gbp-pull; as usual."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:381
+msgid "Upstream tarballs and linked upstream history"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:388
+#, no-wrap
+msgid " &gbp-import-orig; --upstream-vcs-tag=v0.0.1 foo_0.0.1.orig.tar.gz\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:382
+msgid ""
+"If you want to track upstream's &git; but continue to import the upstream "
+"tarballs, e.g. to make sure the tarball uploaded to &debian; has the same "
+"checksum as upstream's, you can use the <option>--upstream-vcs-tag</option> "
+"option when importing new tarballs with &gbp-import-orig;. Assuming you have "
+"the upstream source in your repository with a tag "
+"<replaceable>v0.0.1</replaceable>, you can use: <placeholder "
+"type=\"programlisting\" id=\"0\"/> to add upstream's tag as additional "
+"parent to the merge commit. See <ulink "
+"url=\"http://bugs.debian.org/664771\">#664771</ulink> for more details."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/import.xml:396
+msgid "Upstream tarballs and separate upstream history"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/import.xml:404
+#, no-wrap
+msgid ""
+" &gitcmd; remote add upstream https://upstream.example.com/upstream.git\n"
+" &gitcmd; fetch upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/import.xml:398
+msgid ""
+"If you want to have upstream's &git; history available but don't want to "
+"link it to your packaging history you can simply keep it as a separate "
+"history. E.g. if you already have a &git; repository with your packaging, "
+"change into that repository and do: <placeholder type=\"programlisting\" "
+"id=\"0\"/> This will pull in upstream's &git; history into your repo but "
+"since your packaging commits and upstreams commits have no common parents "
+"the two histories will stay nicely separated. Of course you can browse it "
+"and cherry-pick from it but any remote repos you push to will not get "
+"upstream's history by default unless you push any of upstream's refs."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><warning><para>
+#: chapters/import.xml:415
+msgid ""
+"Since &git; has a single tag namespace pushing changes with <command>git "
+"push --tags</command> will push upstream's tags (and therefore it's history) "
+"too so be sure to only push dedicated tag names."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/import.xml:426
+msgid "Branch layout"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:428
+msgid ""
+"By default, &gbp; uses one branch to keep the &debian; packaging called "
+"<emphasis>master</emphasis> and a branch to keep the upstream packaging "
+"called <emphasis>upstream</emphasis>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:432
+msgid ""
+"This layout is simple to get started but falls short if one needs to "
+"maintain several versions of the package at the same time. Therefore the "
+"following the &dep14; layout is recommended:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><term>
+#: chapters/import.xml:439
+msgid "debian/<release>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><listitem><para>
+#: chapters/import.xml:443
+msgid ""
+"the &debian; packaging for a release <emphasis>jessie</emphasis>, "
+"<emphasis>stretch</emphasis>, <emphasis>sid</emphasis>, "
+"<emphasis>jessie</emphasis>, <emphasis>jessie-backports</emphasis>, "
+"<emphasis>jessie-security</emphasis> or <emphasis>experimental</emphasis>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><term>
+#: chapters/import.xml:451
+msgid "upstream/latest"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><listitem><para>
+#: chapters/import.xml:455
+msgid "the latest upstream sources."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><term>
+#: chapters/import.xml:461
+msgid "dfsg/latest"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><variablelist><varlistentry><listitem><para>
+#: chapters/import.xml:465
+msgid ""
+"the DFSG-clean upstream sources in case the cleanup is done via a &git; "
+"merge from upstream to this branch."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/import.xml:472
+msgid ""
+"In case &pristine-tar; is being used, there will be a single "
+"<emphasis>pristine-tar</emphasis> branch that keeps all binary deltas."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/intro.xml:2
+msgid "Introduction"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/intro.xml:4
+msgid ""
+"Welcome to git-buildpackage (short &gbp;), a system that integrates the "
+"<ulink url=\"http://www.debian.org/\">Debian</ulink> package build system "
+"with <ulink url=\"http://git.or.cz/\">Git</ulink>. The most recent version "
+"of this manual can be found &manual;."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/intro.xml:10
+msgid "This is what &gbp; can do for you:"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:12
+msgid "Initially import an existing &debian; package into &git;"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:13
+msgid ""
+"Incrementally import new versions of a Debian package into &git; e.g. for "
+"importing NMUs or to maintain downstream modifications"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:16
+msgid "Import new upstream versions from tarballs with optionally filters applied"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:17
+msgid "Recreate the upstream tarball from information stored in &git;"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:18
+msgid ""
+"Maintain a consistent branch and tag naming within a &git; repository, "
+"across repositories or across a team of developers"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:20
+msgid "Automatically sign generated tags"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:21
+msgid ""
+"Make sure you have committed all changes to the right branch before building "
+"and releasing"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:24
+msgid ""
+"Execute hooks at various points of the package build process e.g. to "
+"automatically push changes to remote repositories"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:28
+msgid "Integrate the build process with cowbuilder or other builders"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:29
+msgid "Export to a clean build area before building the package"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:30
+msgid "Generate debian/changelog automatically"
+msgstr ""
+
+#. type: Content of: <chapter><para><itemizedlist><listitem><para>
+#: chapters/intro.xml:31
+msgid "Manage your quilt patches when using 3.0 (quilt) source format"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/intro.xml:34
+msgid ""
+"All of this is (hopefully) being done without restricting the user to "
+"certain usage patterns."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/intro.xml:38
+msgid "Repository Layout and Terminology"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><footnote><para>
+#: chapters/intro.xml:40
+msgid "this, of course, has no meaning for &debian; native packages"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><footnote><para>
+#: chapters/intro.xml:45
+msgid "corresponding to the command line and config file options"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:39
+msgid ""
+"It is recommended to have the &debian; packaging on a separate branch than "
+"the upstream source <placeholder type=\"footnote\" id=\"0\"/>. This is "
+"necessary to be able to import and merge in new upstream versions via "
+"&gbp-import-orig;. To distinguish these two branches, the following "
+"terminology <placeholder type=\"footnote\" id=\"1\"/> is used:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><itemizedlist><listitem><para>
+#: chapters/intro.xml:49
+msgid ""
+"The <option>debian-branch</option> (the default branch name used in the "
+"&git; repository is <emphasis>master</emphasis>) holds your current "
+"development work. That's the branch you usually cut your releases from and "
+"the default branch new upstream releases are merged onto."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><itemizedlist><listitem><para>
+#: chapters/intro.xml:55
+msgid ""
+"The <option>upstream-branch</option> (the default branch name used in the "
+"&git; repository is <emphasis>upstream</emphasis>) holds the upstream "
+"releases. This can either be a branch you import to or a branch of an "
+"upstream &git; repository you pull from."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><itemizedlist><listitem><para>
+#: chapters/intro.xml:61
+msgid ""
+"The <option>pristine-tar branch</option> (the default branch name used in "
+"the &git; repository is <emphasis>pristine-tar</emphasis>) holds the "
+"necessary additional information to recreate the original tarball from the "
+"<option>upstream-branch</option>. In order to use this feature, you need to "
+"install the &pristine-tar; package."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><itemizedlist><listitem><para>
+#: chapters/intro.xml:68
+msgid ""
+"There can be one or more <option>patch-queue</option> branches. Every "
+"patch-queue branch is related to a <option>debian-branch</option>. If the "
+"<option>debian-branch</option> is called <emphasis>master</emphasis>, the "
+"corresponding patch-queue branch is called "
+"<emphasis>patch-queue/master</emphasis>. The patch-queue branch is the "
+"&debian; branch plus the contents of <emphasis>debian/patches</emphasis> "
+"applied. These branches are managed with &gbp-pq;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:79
+msgid ""
+"You're completely free to pick any repository layout; the branch names above "
+"are only &gbp;'s defaults. They can be changed at any point in time, and you "
+"can work with an arbitrary number of branches. For example, branches like "
+"<emphasis>nmu</emphasis>, <emphasis>backports</emphasis> or "
+"<emphasis>stable</emphasis> might (temporarily or permanently) become your "
+"<option>debian-branch</option>, and branches like <emphasis>dfsg</emphasis> "
+"or <emphasis>snapshots</emphasis> might become your "
+"<option>upstream-branch</option>—it doesn't matter if these branches "
+"are maintained with &gbp-import-orig; or not."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:91
+msgid ""
+"A recommended branch layout is described in <xref "
+"linkend=\"gbp.branch.naming\"/>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:94
+msgid ""
+"Since &gbp-buildpackage; only works with local &git;-repositories, you have "
+"to use <command>git push</command> in order to publish your changes to "
+"remote repositories like <ulink "
+"url=\"http://git.debian.org/\">git.debian.org</ulink>; this can be automated "
+"with &gbp-buildpackage;'s <option>post-tag</option> hook."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/intro.xml:103
+msgid "Workflow"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:105
+msgid "A typical, simple workflow consists of the following steps:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:108
+msgid ""
+"Initially import a &debian; package via &gbp-import-dsc;. This imports the "
+"&debian; Package on the <option>debian-branch</option> and the upstream "
+"sources on the <option>upstream-branch</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:111
+msgid ""
+"Develop, test, commit changes. During this time, you can always build the "
+"package with &gbp-buildpackage;. In case you have uncommitted changes in "
+"your source tree, you can use the <option>--git-ignore-new</option> option."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:115
+msgid ""
+"Optionally you can create the &debian; changelog entries using &gbp-dch; and "
+"create snapshot releases for testing using its <option>--snapshot</option> "
+"option."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:118
+msgid ""
+"Once satisfied, you can build the final package with &gbp-buildpackage; "
+"<option>--git-tag</option>. This additionally creates a tag within &git; so "
+"you can switch back to that version later at any time. The format of the "
+"tags can be specified; tags can be &gpg; signed."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/intro.xml:123
+msgid ""
+"When a new upstream version is released and upstream isn't using &git;, you "
+"can import the new version via &gbp-import-orig; onto the "
+"<option>upstream-branch</option>. &gbp-import-orig; will by default try to "
+"merge the new upstream version onto the <option>debian-branch</option> (you "
+"can skip the merge with <option>--no-merge</option>). After resolving any "
+"potential conflicts, go back to the second step."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/intro.xml:131
+msgid "These steps will be explained in more details in the following sections."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/patches.xml:2
+msgid "Working with Patches"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:5
+msgid ""
+"&gbp-pq; can be used to manage patches that modify the upstream source "
+"inside <filename>debian/patches/</filename>. This is mostly intended for 3.0 "
+"(quilt) format source packages."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:12
+msgid ""
+"The basic idea is that patches are imported from your &debian-branch; to a "
+"patch-queue branch with one patch file in "
+"<filename>debian/patches/</filename> becoming one commit on the the "
+"patch-queue branch. The created branch will be named after the branch you "
+"imported from with <filename>patch-queue/</filename> prepended. So if you do "
+"your &debian; packaging on <filename>debian/sid</filename> and do a"
+msgstr ""
+
+#. type: Content of: <chapter><programlisting>
+#: chapters/patches.xml:22
+#, no-wrap
+msgid " &gbp-pq-import;\n"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:25
+msgid ""
+"then the newly created branch will be called "
+"<filename>patch-queue/debian/sid</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:29
+msgid ""
+"On the patch-queue branch you can work on the commits using familiar &git; "
+"commands (rebase, commit --amend, etc). When done, &gbp-pq; will be used to "
+"turn the commits on the patch-queue branch into patch in "
+"<filename>debian/patches/</filename> files again."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:37
+msgid ""
+"This workflow facilitates e.g. the cherry-picking of patches for stable "
+"releases, the forward-porting of patches to new upstream versions by using "
+"git rebase on the patch-queue branch (patches already applied upstream are "
+"detected automatically) as well as the reordering, dropping and renaming of "
+"patches without having to resort to &quilt;. The generated patches in "
+"<filename>debian/patches/</filename> have all the necessary information to "
+"forward them upstream since they use a format similar to "
+"<command>git-format-patch</command>."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:49
+msgid ""
+"The main drawback of this workflow is the lack of history on the patch-queue "
+"branch since it is frequently droppend and recreated. But there is full "
+"history on the your &debian-branch;, of course."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/patches.xml:56
+msgid ""
+"Also, beware that &gbp-pq; currently has incomplete support for <ulink "
+"url=\"https://dep-team.pages.debian.net/deps/dep3/\">DEP3</ulink> headers. "
+"Initially, parsing with <command>git-mailinfo(1)</command> is attempted, "
+"which supports only the <computeroutput>From</computeroutput> and "
+"<computeroutput>Subject</computeroutput> fields. If neither of these are "
+"present, &gbp-pq; will attempt to convert the patch from DEP3 format into a "
+"<command>git-mailinfo(1)</command> compatible format. This involves first "
+"loading <computeroutput>From</computeroutput> using the "
+"<computeroutput>Author</computeroutput> field and "
+"<computeroutput>Subject</computeroutput> using the first line of the "
+"<computeroutput>Description</computeroutput> field. Then, any additional "
+"fields (such as <computeroutput>Origin</computeroutput> and "
+"<computeroutput>Forwarded</computeroutput>), and the remainder of the "
+"<computeroutput>Description</computeroutput> (if any), will be appended to "
+"the body."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/patches.xml:74
+msgid "Basic Workflow"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:77
+msgid ""
+"This example assumes you're working on a source 3.0 (quilt) format package "
+"with patches in <filename>debian/patches</filename> parseable by "
+"<command>git-quiltimport(1)</command>. The git branch currently checked out "
+"is named <filename>debian/sid</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:85
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-unapplied.png\" "
+"format=\"PNG\"/> </imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:90
+msgid "The &debian-branch; we start from."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:95
+msgid ""
+"Let's first create the patch-queue branch and import the contents of "
+"<filename>debian/patches</filename> onto it using &gbp-pq;"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:101
+#, no-wrap
+msgid ""
+" <command>cd <replaceable>REPO</replaceable></command>\n"
+" &gbp-pq; import\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/patches.xml:108
+#, no-wrap
+msgid ""
+" gbp:info: Trying to apply patches at "
+"'aaa1011bfd5aa74fea43620aae94709de05f80be'\n"
+" gbp:info: 18 patches listed in 'debian/patches/series' imported on "
+"'patch-queue/debian/sid'\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:106
+msgid ""
+"This will generate output like: <placeholder type=\"screen\" id=\"0\"/> What "
+"happened is that &gbp-pq; imported each patch file and switched you to the "
+"newly created patch-queue branch "
+"(<filename>patch-queue/debian/sid</filename>) automatically."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:117
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-applied.png\" format=\"PNG\"/> "
+"</imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:122
+msgid ""
+"The patch-queue branch with patches from <filename>debian/patches</filename> "
+"applied."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:129
+msgid ""
+"Now you can work on the patch-queue branch (add, remove, rebase, test) to "
+"get your patches into shape:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><itemizedlist><listitem><para>
+#: chapters/patches.xml:134
+msgid ""
+"To add what will later become a patch in "
+"<filename>debian/patches/</filename> simply make a commit. The first line of "
+"the commit message will become the patch name later. The following lines "
+"include the details of what the patch does."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><itemizedlist><listitem><para>
+#: chapters/patches.xml:143
+msgid ""
+"To remove or edit commits use git rebase -i . The git documentation explains "
+"how to work with git-rebase."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:151
+msgid ""
+"Once satisfied with the commits let's regenerate the patches in "
+"<filename>debian/patches/</filename> using &gbp-pq;. This will switch you "
+"back to the branch <filename>debian/sid</filename> and regenerate the "
+"patches using a method similar to <command>git-format-patch</command>:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:159
+#, no-wrap
+msgid " &gbp-pq; export\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:162
+msgid "You can now commit the result by using:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:164
+#, no-wrap
+msgid ""
+" &gitcmd; add debian/patches\n"
+" &gitcmd; commit\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:168
+msgid ""
+"If you don't want to commit the result by hand each time you can also pass "
+"<option>--commit</option> to the &gbp; <option>export</option> command "
+"above."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:174
+msgid ""
+"Next you can update <filename>debian/changelog</filename> (e.g. by running "
+"\"&gbp-dch; <option>-S</option> <option>-a</option>\") and build the package "
+"as usual."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:184
+msgid "To update your patches for a new upstream version one"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:189
+msgid ""
+"Imports the current patches onto the patch-queue branch (if not done "
+"already) using &gbp-pq-import;. This will allow you to rebase the patches on "
+"the new upstream version later."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:196
+msgid ""
+"Imports the new upstream version with &gbp-import-orig; "
+"<option>--uscan</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:202
+msgid ""
+"Rebases the patches onto the new upstream version using "
+"&gbp-pq-rebase;. This will bring the patches up to date regarding the new "
+"upstream version. Patches already applied upstream can be dropped and "
+"remaining patches can be modified to apply to the new version."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:211
+msgid ""
+"Exports the patches to <filename>debian/patches</filename> using "
+"&gbp-pq-export;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:218
+msgid ""
+"But don't worry if you forgot to do so before importing the new version (or "
+"if another team member imported the version already)."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:223
+msgid ""
+"In this case you can make &gbp-pq; figure out where to apply the patches by "
+"using the <option>--time-machine=</option> option. The following command"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:229
+#, no-wrap
+msgid " &gbp-pq-import; --force --time-machine=10\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><footnote><para>
+#: chapters/patches.xml:236
+msgid ""
+"This is not necessarily your debian-branch; HEAD since the new upstream "
+"version might have changed so that the patches no longer apply cleanly "
+"there."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:233
+msgid ""
+"would drop your current patch-queue branch (if existent) and create a new "
+"one by going back in your commit history as far as 10 commits to find a "
+"place where your patches still apply <placeholder type=\"footnote\" "
+"id=\"0\"/>. If it finds such a commit on your &debian-branch; it will create "
+"the patch-queue branch from there and switch you to that branch. You can now "
+"rework your patches to apply to the new upstream version by using "
+"&gbp-pq-rebase;:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:247
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-time-machine.png\" "
+"format=\"PNG\"/> </imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:252
+msgid "The patch-queue branch and &debian-branch; after importing the patches."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:259
+#, no-wrap
+msgid " &gbp-pq-rebase;\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:263
+msgid "or you can invoke &gitcmd; <option>rebase</option> directly:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:267
+#, no-wrap
+msgid " &gitcmd; rebase -i debian/sid\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:271
+msgid ""
+"Should the rebase fail (e.g. because the upstream source changed at the same "
+"place your patches modify the code) you can resolve this by using the "
+"options of &gitcmd; <option>rebase</option> (if you simply want to abort use "
+"&gitcmd; <option>rebase</option> <option>--abort</option>)."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:279
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-rebase.png\" format=\"PNG\"/> "
+"</imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:284
+msgid ""
+"The patch-queue branch after rebasing the patches. Patches that were merged "
+"upstream were dropped."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:291
+msgid "Once done you can export your commits to patch files again:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><programlisting>
+#: chapters/patches.xml:294 chapters/patches.xml:345
+#, no-wrap
+msgid " &gbp-pq-export; --commit\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:298
+msgid "The export will also switch you back to the &debian-branch;."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject>
+#: chapters/patches.xml:301
+msgid ""
+"<imageobject> <imagedata fileref=\"images/pq-export.png\" format=\"PNG\"/> "
+"</imageobject>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><mediaobject><caption><para>
+#: chapters/patches.xml:306
+msgid "The &debian-branch; after exporting the patches and committing the changes."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:312
+msgid ""
+"See this in action in a <ulink "
+"url=\"https://honk.sigxcpu.org/piki/projects/git-buildpackage/videos/gbp-pq-new-upstream-version.ogv\">short "
+"video</ulink>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/patches.xml:319
+msgid "Adding your first patch"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:322
+msgid ""
+"If a package doesn't have any patches yet, these are the steps to add your "
+"first patch:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para><programlisting>
+#: chapters/patches.xml:330
+#, no-wrap
+msgid " &gbp-pq-import;\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:327
+msgid ""
+"Launch an import. If there's nothing to import &gbp-pq; will just create an "
+"empty branch and switch your working copy to it: <placeholder "
+"type=\"programlisting\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:336
+msgid ""
+"Create your first patch: edit files, test, commit your changes using "
+"<command>git commit</command>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:342
+msgid "To generate the new Quilt patch set use"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:348
+msgid ""
+"This will switch you back to your &debian-branch; branch, generate the "
+"patches and commit them right away to this branch."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><orderedlist><listitem><para>
+#: chapters/patches.xml:353
+msgid ""
+"Skip the <option>--commit</option> if you don't want to commit right "
+"away. If you want to pick the changelog message from the patch see "
+"<filename>/usr/share/doc/git-buildpackage/examples/gbp-add-patch</filename>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/patches.xml:363
+msgid "Team maintenance"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:365
+msgid ""
+"The easiest way is to not push out any patch-queue/* branches at all. They "
+"can be recreated by any team member easily by using"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:369
+#, no-wrap
+msgid " &gbp-pq-import; --force\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:373
+msgid ""
+"The patch-queue branch can also be re-created when pulling (this will "
+"additionally drop your current patch-queue branch and recreate it from "
+"<filename>debian/patches</filename>):"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/patches.xml:377
+#, no-wrap
+msgid " &gbp-pull; --redo-pq\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/patches.xml:381
+msgid ""
+"Note that you can push out patch-queue branches. Other team members must "
+"just be aware that branches in the patch-queue/ namespace are being rebased "
+"frequently and therefore cause non fast-forward updates."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/releases.xml:2
+msgid "Releases and Snapshots"
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/releases.xml:5
+msgid ""
+"The &changelog; gives the &debian; package a version number and keeps track "
+"of changes made to the package in a particular version. While the changelog "
+"can still be maintained by hand we can make use of &gbp-dch; to have our "
+"&git; commit messages end up in &changelog;. This avoids the double "
+"maintenance of the &git; commit history and the &debian; changelog. If you "
+"don't want a one to one mapping of changelog entries to &git; commits you're "
+"free to edit the changelog by hand at any point."
+msgstr ""
+
+#. type: Content of: <chapter><para>
+#: chapters/releases.xml:16
+msgid ""
+"Not committing changelog entries with the actual modifications also has the "
+"advantage that the changelog won't cause any trouble when cherry-picking "
+"patches from different branches. It can be created when releasing the "
+"package or after performing several commits. Invocations of &dch; and "
+"&gbp-dch; can be mixed."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/releases.xml:24
+msgid "Maintaining <filename>debian/changelog</filename>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/releases.xml:26
+msgid "Creating &changelog; just before the release"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:28
+msgid ""
+"The simplest way is doing all the changes to the "
+"<option>debian-branch</option> without touching "
+"<filename>debian/changelog</filename> at all. Then, when done, do:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/releases.xml:33 chapters/releases.xml:115
+#, no-wrap
+msgid "&gbp-dch; <option>--release</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:36
+msgid ""
+"This will look up the latest released version in the changelog, increment "
+"the version in the &debian; changelog, generate changelog messages from the "
+"corresponding &git; commit id up to the branch head, and finally spawns an "
+"editor for final changelog editing."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/releases.xml:43
+msgid "Incrementally filling &changelog;"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para><programlisting>
+#: chapters/releases.xml:49
+#, no-wrap
+msgid "&gbp-dch;\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:45
+msgid ""
+"You can run &gbp-dch; without any options to make it add all commit messages "
+"since the last &debian; tag to a new UNRELEASED changelog section: "
+"<placeholder type=\"programlisting\" id=\"0\"/> You can then commit the "
+"<filename>debian/changelog</filename> to have your current changes "
+"recorded. Later invocations of &gbp-dch; will check when "
+"<filename>debian/changelog</filename> was last modified and not add these "
+"commits again. Upon your last call of &gbp-dch; before releasing the package "
+"add <option>--release</option> again to have the "
+"<emphasis>UNRELEASED</emphasis> distribution in the changelog turned into "
+"<emphasis>unstable</emphasis>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/releases.xml:64
+msgid "Creating snapshots with increasing version numbers"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:66
+msgid ""
+"The downside of the above methods is that you either have the version number "
+"of the last release in &changelog; or that you have a changelog entry with "
+"<emphasis>UNRELEASED</emphasis> that has the same version number for all "
+"commits you do during the development cycle of your package. Although this "
+"is common practice in &debian; it means that also all your test builds have "
+"the same version number which makes them hard to distinguish in "
+"e.g. continuous integration pipelines."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:77
+msgid ""
+"To address these shortcomings &gbp-dch; has a <option>--snapshot</option> "
+"option that can be used to create (unreleased) snapshots for intermediate "
+"testing with a version number that is lower than the one of the final "
+"package:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/releases.xml:83 chapters/releases.xml:103
+#, no-wrap
+msgid "&gbp-dch; <option>--snapshot</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:86
+msgid ""
+"will generate a snapshot release with a specially crafted version number and "
+"a warning in the changelog that this is a snapshot release:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/releases.xml:90
+#, no-wrap
+msgid ""
+"git-buildpackage (0.3.7~1.gbp470ce2) UNRELEASED; urgency=low\n"
+"\n"
+" ** SNAPSHOT build @470ce29ec7877705c844474a2fd89869aea0406d **\n"
+"\n"
+" * add support for automatic snapshot \n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:97
+msgid ""
+"During subsequent calls with <option>--snapshot</option>, this version "
+"number will continue to increase. Since the snapshot banner contains the "
+"commit id of the current branch HEAD, &gbp-dch; can figure out what to "
+"append to the changelog by itself (even without committing the changelog "
+"first): <placeholder type=\"programlisting\" id=\"0\"/> will fetch the "
+"commit id from &changelog; and add changelog entries from that point to the "
+"current HEAD—again auto incrementing the version number. If you don't "
+"want to start at that commit id, you can specify any id or tag with:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/releases.xml:109
+#, no-wrap
+msgid ""
+"&gbp-dch; "
+"<option>--since</option>=<replaceable>e76a6a180a57701ae4ae381f74523cacb3152780</replaceable> "
+"<option>--snapshot</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:112
+msgid "After testing, you can remove the snapshot header by a final &gbp-dch; call:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:118
+msgid ""
+"This will pick new commit if present and remove the specially crafted "
+"version number and the snapshot header. If you want finer control of what is "
+"being added you can again use the <option>--since</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><title>
+#: chapters/releases.xml:123
+msgid "Customizing snapshot numbers"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:124
+msgid ""
+"If the auto incrementing of the snapshot number doesn't suite your needs, "
+"you can give any Python expression that evaluates to a positive integer to "
+"calculate the new snapshot number:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/releases.xml:128
+#, no-wrap
+msgid ""
+"&gbp-dch; <option>-S</option> <option>-a</option> "
+"<option>--snapshot-number</option>=<replaceable>1</replaceable>\n"
+"&gbp-dch; <option>-S</option> <option>-a</option> "
+"<option>--snapshot-number</option>=<replaceable>'snapshot + "
+"2'</replaceable>\n"
+"&gbp-dch; <option>-S</option> <option>-a</option> "
+"<option>--snapshot-number</option>=<replaceable>'os.popen(\"git-log "
+"--pretty=oneline | wc -l\").readlines()[0]'</replaceable>\n"
+"&gbp-dch; <option>-S</option> <option>-a</option> "
+"<option>--snapshot-number</option>=<replaceable>`git-log --pretty=oneline "
+"debian/0.3.3 | wc -l`</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><para>
+#: chapters/releases.xml:134
+msgid ""
+"You can also add the snapshot-number calculation to "
+"<filename>gbp.conf</filename>:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><sect2><programlisting>
+#: chapters/releases.xml:137
+#, no-wrap
+msgid ""
+"[DEFAULT]\n"
+"snapshot-number = os.popen(\"git-log --pretty=oneline | wc "
+"-l\").readlines()[0]\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/releases.xml:144
+msgid "Tuning commit messages"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:146
+msgid ""
+"You can use <option>--full</option> to include the full commit message in "
+"the changelog. If you want to tweak the formatting there's a "
+"<option>--customizations</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:155
+#, no-wrap
+msgid ""
+"New upstream version\n"
+"\n"
+"Closes: #1000\n"
+"Thanks: cool upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:162
+#, no-wrap
+msgid " * New upstream version (Closes: #1000) - thanks to cool upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:151
+msgid ""
+"Additionally, there are tags <option>Closes:</option> and "
+"<option>Thanks:</option> available to customize the commit message. Each tag "
+"has to start at the beginning of a single line. For example, the git commit "
+"message <placeholder type=\"screen\" id=\"0\"/> would result in a changelog "
+"entry: <placeholder type=\"screen\" id=\"1\"/> You can use the "
+"<option>Closes:</option> tag multiple times."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:167
+msgid ""
+"There are several tags to further customize what (and how) commit messages "
+"get included into the changelog:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:171
+msgid "To exclude a commit from the generated changelog, use:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:175
+#, no-wrap
+msgid "Gbp-Dch: Ignore\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:181
+#, no-wrap
+msgid ""
+"Set correct branchnames in debian/gbp.conf\n"
+"\n"
+"Gbp-Dch: Ignore\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:174
+msgid ""
+"<placeholder type=\"screen\" id=\"0\"/> This is e.g. useful if you're just "
+"fixing up a previous commit and couldn't amend it, or for other janitorial "
+"commits that really don't need to end up in the changelog. For example, the "
+"following git commit message <placeholder type=\"screen\" id=\"1\"/> will "
+"not show up in the generated changelog in any way."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:190
+#, no-wrap
+msgid "Gbp-Dch: Full\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:188
+msgid ""
+"To include the full commit message in the changelog, use: <placeholder "
+"type=\"screen\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:196
+#, no-wrap
+msgid "Gbp-Dch: Short\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:194
+msgid ""
+"To only include the short description in the changelog and skip the body, "
+"use: <placeholder type=\"screen\" id=\"0\"/> The latter only takes effect "
+"when running &gbp-dch; with the <option>--full</option> option since "
+"including only the short description is the default."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:203
+msgid ""
+"Usually, changelog entries should correspond to a single &git; commit. In "
+"this case, it's convenient to include the commit id in the changelog entry. "
+"This has the advantage that it's easy for people to identify changes without "
+"having to write very extensive changelog messages—the link back to "
+"&git; can be automated via the <option>Vcs-Browser</option> and "
+"<option>Vcs-Git</option> fields in <filename>debian/control</filename>. See "
+"<ulink url=\"https://honk.sigxcpu.org/cl2vcs\"> Cl2vcs</ulink> for how this "
+"looks."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><screen>
+#: chapters/releases.xml:219
+#, no-wrap
+msgid ""
+" * [571bfd4] New upstream version (Closes: #1000) - thanks to cool "
+"upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/releases.xml:215
+msgid ""
+"The inclusion of the commit id can be done automatically via &gbp-dch;'s "
+"<option>--id-length</option> option. Using "
+"<option>--id-length</option>=<replaceable>7</replaceable> would change the "
+"above example to: <placeholder type=\"screen\" id=\"0\"/> This makes it much "
+"easier to see which commit actually fixed bug #1000."
+msgstr ""
+
+#. type: Content of: <chapter><title>
+#: chapters/special.xml:2
+msgid "Special Use Cases"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:4
+msgid "Handling non-DFSG clean upstream sources"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:5
+msgid ""
+"If you have to handle non-DFSG clean upstream sources, you can use a "
+"different branch which you have to create once:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:9
+#, no-wrap
+msgid " &gitcmd; branch dfsg_clean upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:12
+msgid ""
+"This creates the <emphasis>dfsg_clean</emphasis> branch from the tip of a "
+"branch called <emphasis>upstream</emphasis>. Then, when importing a new "
+"upstream version, you import the new version on the "
+"<option>upstream-branch</option> (by default named "
+"<emphasis>upstream</emphasis>) as usual and just don't merge to the "
+"<emphasis>debian-branch</emphasis> (by default named "
+"<emphasis>master</emphasis>):"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:21
+#, no-wrap
+msgid ""
+" &gbp-import-orig; --no-merge "
+"<filename>/path/to/nondfsg-clean-package_10.4.orig.tar.gz</filename>\n"
+" &gitcmd; <option>tag</option> 10.4\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:25
+msgid ""
+"After the import, you can switch to the <emphasis>dfsg_clean</emphasis> "
+"branch and get the newly imported changes from the upstream branch:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:29
+#, no-wrap
+msgid ""
+" &gitcmd; <option>checkout</option> dfsg_clean\n"
+" &gitcmd; <option>pull</option> <filename>.</filename> upstream\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:32
+msgid ""
+"Now make this checkout dfsg clean (preferably by a cleanup script), commit "
+"your changes and merge to your <option>debian-branch</option>:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:35
+#, no-wrap
+msgid ""
+" cleanup-script.sh\n"
+" &gitcmd; commit -a -m \"Make source dfsg clean\"\n"
+" &gitcmd; tag <replaceable>10.4.dfsg</replaceable>\n"
+" &gitcmd; checkout <replaceable>master</replaceable>\n"
+" &gitcmd; pull <replaceable>.</replaceable> "
+"<replaceable>dfsg_clean</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:44
+msgid "Importing NMUs"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:46
+msgid ""
+"First, create a branch that holds the NMUs from the tip of your "
+"<option>debian-branch</option> (default is <emphasis>master</emphasis>) "
+"once:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:50
+#, no-wrap
+msgid ""
+" &gitcmd; <option>branch</option> <replaceable>nmu</replaceable> "
+"<replaceable>master</replaceable>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:53
+msgid "To import an NMU, change into the git repository and use &gbp-import-dsc;:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:56
+#, no-wrap
+msgid ""
+" &gitcmd; checkout <replaceable>master</replaceable>\n"
+" &gbp-import-dsc; "
+"<option>--debian-branch</option>=<replaceable>nmu</replaceable> "
+"<filename>/path/to/package_1.0-1nmu0.dsc</filename>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:60
+msgid ""
+"This will import the NMU onto the branched named <emphasis>nmu</emphasis> "
+"instead of the default <option>master</option>. This method can also be used "
+"to import \"old\" releases into the &git; repository when migrating to &git; "
+"from another VCS."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:68
+msgid "Building with &cowbuilder;"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:70
+msgid ""
+"&cowbuilder; is nice tool to build Debian packages in a defined "
+"environment. It makes sure all build-dependencies are specified correctly "
+"by building the package in a clean chroot. As its cousin &pbuilder; it can "
+"be extended via hooks to (e.g. run autopkg tests) but doesn't need a tarball "
+"unpacked but uses copy on write tree to speed up the build."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:79
+msgid ""
+"Since &cowbuilder; uses different command line arguments than &debuild; and "
+"&dpkg-buildpackage;, we can't simply pass the options to run it on the "
+"command line. To simplifiy the integration we use a separate helper named "
+"&git-pbuilder;. &gbp; has it's own command line option for this:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:86
+#, no-wrap
+msgid " &gbp-buildpackage; <option>--git-pbuilder</option>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:89
+msgid ""
+"This will set the build command to run &git-pbuilder; (which invokes "
+"&cowbuilder; by default) and the clean command to "
+"<command>/bin/true</command>. It also activates the parsing of several "
+"&git-pbuilder; related options like <option>--git-dist</option>, "
+"<option>--git-arch</option> and <option>--git-pbuilder-options</option>."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:98
+msgid ""
+"We can make &git-pbuilder; usage the default by adding it to "
+"<filename>~/.gbp.conf</filename>:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:102
+#, no-wrap
+msgid ""
+"cat <<EOF > <filename>~/.gbp.conf</filename>\n"
+"[DEFAULT]\n"
+"# We invoke cowbuilder via git-pbuilder. Arguments passed to "
+"&gbp-buildpackage;\n"
+"# will be passed to dpkg-buildpackage in the chroot\n"
+"pbuilder = True\n"
+"EOF\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/special.xml:115
+#, no-wrap
+msgid " &gbp-buildpackage; --git-pbuilder --git-dist=jessie\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:110
+msgid ""
+"<command>git-pbuilder</command> defaults to building a package for the "
+"<envar>sid</envar> distribution. If you want to build for another "
+"distribution, pass this in the <option>--git-dist</option> option: "
+"<placeholder type=\"programlisting\" id=\"0\"/> If you want to use "
+"<command>debuild</command> again (without modifying "
+"<filename>~/.gbp.conf</filename>), you can use:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:122
+#, no-wrap
+msgid " &gbp-buildpackage; --git-no-pbuilder\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:125
+msgid ""
+"In order for all of the above to work you have to create a base chroot first "
+"using &git-pbuilder;:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:129
+#, no-wrap
+msgid " <command>git-pbuilder</command> create\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:132
+msgid "This can later be updated using:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:135
+#, no-wrap
+msgid " <command>git-pbuilder</command> update\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:140
+msgid "Working on random packages"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/special.xml:145
+#, no-wrap
+msgid ""
+" &gbp-import-dsc; apt:<filename>package</filename>\n"
+" cd <filename>package</filename>\n"
+" &gitcmd; branch debian\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:142
+msgid ""
+"Whenever you need to work on an arbitrary &debian; package, you can check it "
+"right into &git; with one command: <placeholder type=\"programlisting\" "
+"id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:151
+msgid ""
+"This uses <command>apt-get</command> to download the source package, puts "
+"the orig tarball on the <option>upstream-branch</option> and the &debian; "
+"changes on the <option>debian-branch</option> (by default "
+"<emphasis>master</emphasis>). The second command creates a branch called "
+"<emphasis>debian</emphasis>. Now you can easily modify the package, revert "
+"changes you made, create other branches for testing, see what changes you "
+"made, etc. When finished, just do"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:159
+#, no-wrap
+msgid ""
+" &gitcmd; commit -a\n"
+" &gitcmd; diff debian --\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/special.xml:167
+#, no-wrap
+msgid ""
+" &gbp-import-dsc; "
+"<filename>http://mentors.debian.net/debian/pool/main/i/ipsec-tools/ipsec-tools_0.7.3-9.dsc</filename>\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:163
+msgid ""
+"to get a nice patch that can be submitted to the &debian; BTS. You can also "
+"fetch the source package from a URL: <placeholder type=\"programlisting\" "
+"id=\"0\"/> The import works incrementally; you can import new versions on "
+"top of already imported ones for e.g. easy review of changes."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:176
+msgid "Sloppy tarball creation"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:178
+msgid ""
+"By default &gbp-buildpackage; uses <filename>debian/changelog</filename> to "
+"detect the upstream version and build the corrsponding tarball either via "
+"&pristine-tar; or by using <command>git archive</command> directly. This "
+"ensures that the tarball matches what's in the Debian archive already."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:184
+msgid ""
+"But there might be cases where you don't want to follow these packaging "
+"practice and create a fresh <emphasis>dirty</emphasis> tarball that contains "
+"additional changes. Such tarballs are not suitable for upload into the "
+"archive but might be helpful in local testing."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para><programlisting>
+#: chapters/special.xml:194
+#, no-wrap
+msgid ""
+"dpkg-source: info: local changes detected, the modified files are:\n"
+" hello-debhelper/configure\n"
+"dpkg-source: error: aborting due to unexpected upstream changes, see "
+"/tmp/hello-debhelper_2.8-1.diff.har2Xx\n"
+"dpkg-source: info: you can integrate the local changes with dpkg-source "
+"--commit\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:190
+msgid ""
+"Especially when getting started and when you first want to get a package "
+"built and dive into &gbp-dch;, &git-pbuilder; and the 3.0 (quilt) format "
+"later to find out what exactly <placeholder type=\"programlisting\" "
+"id=\"0\"/> means."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:202
+msgid ""
+"For that you can force &gbp-buildpackage; to create a tarball from the "
+"<emphasis>debian-branch</emphasis> dropping the <filename>debian/</filename> "
+"directory. This will give you a tarball that is very close to your current "
+"working copy except for the packaging."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:209
+#, no-wrap
+msgid ""
+" &gbp-buildpackage; --git-ignore-new --git-force-create "
+"--git-upstream-tree=SLOPPY --git-no-pristine-tar\n"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:212
+msgid ""
+"The important part is the <emphasis>SLOPPY</emphasis> above. The other "
+"options are there to prevent &gbp-buildpackage; from using &pristine-tar;, "
+"to force the creation of a new tarball and to not abort if you have changes "
+"in your current working copy. If you're still getting an error about "
+"<emphasis>unexpected upstream changes</emphasis> make sure you have no "
+"uncommitted changes in you workig copy (changes in the "
+"<filename>debian/</filename> directory are o.k.) and no files that are "
+"ignored by git via <filename>.gitignore</filename>. A <command>git clean "
+"-dfx</command> can help here."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:226
+msgid ""
+"Please don't use this tarball to upload to the Debian archive since changes "
+"outside <filename>debian/</filename> need to be represented by patches in "
+"<filename>debian/patches</filename>. See the <command>dpkg-source</command> "
+"manpage for details."
+msgstr ""
+
+#. type: Content of: <chapter><sect1><title>
+#: chapters/special.xml:235
+msgid "Integrating with pk4"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:237
+msgid ""
+"&pk4; provides an easy way to fetch the sources of packages currently "
+"installed on the system. In order to let pk4 provide these packages as &git; "
+"repositories you can enable &gbp;'s unpack hook:"
+msgstr ""
+
+#. type: Content of: <chapter><sect1><programlisting>
+#: chapters/special.xml:243
+#, no-wrap
+msgid ""
+"mkdir -p ~/.config/pk4/hooks-enabled/unpack/\n"
+"ln -s /usr/share/pk4/hooks-available/unpack/gbp "
+"~/.config/pk4/hooks-enabled/unpack/\n"
+" "
+msgstr ""
+
+#. type: Content of: <chapter><sect1><para>
+#: chapters/special.xml:247
+msgid ""
+"This will make sure packages are imported into a git respository after "
+"download."
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo><address>
+#: manpages/gbp-buildpackage-rpm.xml:4 manpages/gbp-import-srpm.xml:4
+#: manpages/gbp-pq-rpm.xml:4 manpages/gbp-rpm-ch.xml:4
+#, no-wrap
+msgid ""
+" &rpm-email;\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo>
+#: manpages/gbp-buildpackage-rpm.xml:3 manpages/gbp-import-srpm.xml:3
+#: manpages/gbp-pq-rpm.xml:3 manpages/gbp-rpm-ch.xml:3
+msgid ""
+"<placeholder type=\"address\" id=\"0\"/> <author> &rpm-firstname; "
+"&rpm-surname; </author>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-buildpackage-rpm.xml:11 manpages/gbp-buildpackage-rpm.xml:15
+msgid "gbp-buildpackage-rpm"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-buildpackage-rpm.xml:16
+msgid "Build RPM packages from a Git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-buildpackage-rpm.xml:20
+msgid ""
+"&gbp-buildpackage-rpm; <arg><option>--git-[no-]ignore-new</option></arg> "
+"<arg><option>--git-tag</option></arg> "
+"<arg><option>--git-verbose</option></arg> "
+"<arg><option>--git-color=</option>[auto|on|off]</arg> "
+"<arg><option>--git-color-scheme=</option><replaceable>COLOR_SCHEME</replaceable></arg> "
+"<arg><option>--git-notify=</option>[auto|on|off]</arg> "
+"<arg><option>--git-tmp-dir</option>=<replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-vendor</option>=<replaceable>VENDOR</replaceable></arg> "
+"<arg><option>--git-native</option>[auto|on|off]</arg> "
+"<arg><option>--git-upstream-branch=</option><replaceable>TREEISH</replaceable></arg> "
+"<arg><option>--git-packaging-branch=</option><replaceable>BRANCH_NAME</replaceable></arg> "
+"<arg><option>--git-ignore-branch</option></arg> "
+"<arg><option>--git-[no-]submodules</option></arg> "
+"<arg><option>--git-builder=</option><replaceable>BUILD_CMD</replaceable></arg> "
+"<arg><option>--git-cleaner=</option><replaceable>CLEAN_CMD</replaceable></arg> "
+"<arg><option>--git-[no-]sign-tags</option></arg> "
+"<arg><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable></arg> "
+"<arg><option>--git-posttag=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-postbuild=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-postexport=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-prebuild=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-preexport=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-[no-]build</option></arg> "
+"<arg><option>--git-[no-]hooks</option></arg> "
+"<arg><option>--git-packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg> "
+"<arg><option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg> "
+"<arg><option>--git-force-create</option></arg> "
+"<arg><option>--git-no-create-orig</option></arg> "
+"<arg><option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable></arg> "
+"<arg><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-compression-level=</option><replaceable>LEVEL</replaceable></arg> "
+"<arg><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-export=</option><replaceable>TREEISH</replaceable></arg> "
+"<arg><option>--git-packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-spec-file=</option><replaceable>FILEPATH</replaceable></arg> "
+"<arg><option>--git-export-sourcedir</option>=<replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-export-specdir</option>=<replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-[no-]pristine-tar</option></arg> "
+"<arg><option>--git-[no-]pristine-tar-commit</option></arg> "
+"<arg><option>--git-tag-only</option></arg> "
+"<arg><option>--git-retag</option></arg> "
+"<arg><option>--git-mock</option></arg> "
+"<arg><option>--git-dist</option>=<replaceable>DISTRIBUTION</replaceable></arg> "
+"<arg><option>--git-arch</option>=<replaceable>ARCHITECTURE</replaceable></arg> "
+"<arg><option>--git-mock-options</option>=<replaceable>OPTIONS</replaceable></arg> "
+"<arg><option>--git-mock-root</option>=<replaceable>ROOT</replaceable></arg> "
+"<arg><option>--git-spec-vcs-tag</option>=<replaceable>TAG_FORMAT</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:71 manpages/gbp-buildpackage.xml:70
+#: manpages/gbp-clone.xml:41 manpages/gbp-config.xml:32
+#: manpages/gbp.conf.xml:75 manpages/gbp-create-remote-repo.xml:40
+#: manpages/gbp-dch.xml:84 manpages/gbp-export-orig.xml:38
+#: manpages/gbp-import-dscs.xml:40 manpages/gbp-import-dsc.xml:53
+#: manpages/gbp-import-orig.xml:51 manpages/gbp-import-ref.xml:37
+#: manpages/gbp-import-srpm.xml:57 manpages/gbp-pq-rpm.xml:41
+#: manpages/gbp-pq.xml:46 manpages/gbp-pristine-tar.xml:35
+#: manpages/gbp-pull.xml:38 manpages/gbp-push.xml:36 manpages/gbp-rpm-ch.xml:46
+#: manpages/gbp-setup-gitattributes.xml:28 manpages/gbp-tag.xml:35
+#: manpages/gbp.xml:31
+msgid "DESCRIPTION"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:73
+msgid ""
+"&gbp-buildpackage-rpm; is used to build RPM packages from a &git; "
+"repository. It is an RPM counterpart for the &gbp-buildpackage; tool that is "
+"designed for building Debian packages."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:78
+msgid "&gbp-buildpackage-rpm; will, in order:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:83 manpages/gbp-buildpackage.xml:81
+msgid "Verify that it is being executed from the proper location."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:88 manpages/gbp-buildpackage.xml:86
+#: manpages/gbp-tag.xml:47
+msgid "Verify that the repository doesn't contain any uncommitted source changes."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:94 manpages/gbp-buildpackage.xml:92
+msgid "Verify that it is being executed from the correct branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:99
+msgid "Export packaging files to a separate build area."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:104
+msgid "Create an orig source tarball if it doesn't exist."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:109
+msgid ""
+"Call <application>rpmbuild</application>(1) (or the application specified "
+"via <option>--git-builder</option>), passing along all command line "
+"arguments that don't start with --git-."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:116
+msgid "(Optionally) tag the tree after a successful build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:121
+msgid ""
+"(Optionally) call a post build hook - e.g. to run "
+"<productname>rpmlint</productname>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:127 manpages/gbp-buildpackage.xml:137
+msgid ""
+"(Optionally) call a post tag hook - e.g. to push the results to a remote "
+"repository after creating the tag."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:134 manpages/gbp-buildpackage.xml:144
+#: manpages/gbp-clone.xml:50 manpages/gbp-config.xml:40
+#: manpages/gbp-create-remote-repo.xml:61 manpages/gbp-dch.xml:148
+#: manpages/gbp-export-orig.xml:47 manpages/gbp-import-dscs.xml:55
+#: manpages/gbp-import-dsc.xml:79 manpages/gbp-import-orig.xml:108
+#: manpages/gbp-import-ref.xml:46 manpages/gbp-import-srpm.xml:70
+#: manpages/gbp-pq-rpm.xml:128 manpages/gbp-pq.xml:133
+#: manpages/gbp-pristine-tar.xml:46 manpages/gbp-pull.xml:54
+#: manpages/gbp-push.xml:90 manpages/gbp-rpm-ch.xml:66
+#: manpages/gbp-setup-gitattributes.xml:50 manpages/gbp-tag.xml:64
+#: manpages/gbp.xml:37
+msgid "OPTIONS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:137 manpages/gbp-buildpackage.xml:751
+msgid "<option>--git-[no-]ignore-new</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:141
+msgid ""
+"Don't abort if there are uncommitted changes in the source tree or the "
+"current branch doesn't match the "
+"<replaceable>PACKAGING-BRANCH</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:148 manpages/gbp-buildpackage.xml:574
+msgid "<option>--git-tag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:152
+msgid "Add a git tag after a successful build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:157 manpages/gbp-buildpackage.xml:333
+msgid "<option>--git-builder=<replaceable>BUILD_CMD</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:161
+msgid ""
+"Use <replaceable>BUILD_CMD</replaceable> instead of <command>rpmbuild "
+"-ba</command>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:167 manpages/gbp-buildpackage.xml:345
+msgid "<option>--git-cleaner=<replaceable>CLEAN_CMD</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:171
+msgid "Use <replaceable>CLEAN_CMD</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:176 manpages/gbp-buildpackage.xml:767
+msgid "<option>--git-verbose</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:180
+msgid "Verbose execution"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:185 manpages/gbp-buildpackage.xml:776
+msgid "<option>--git-color=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:189 manpages/gbp-buildpackage.xml:780
+#: manpages/gbp-export-orig.xml:63
+msgid "Whether to use colored output."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:194
+msgid "<option>--git-color-scheme=</option><replaceable>COLOR_SCHEME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:198 manpages/gbp-buildpackage.xml:789
+msgid ""
+"Colors to use in output (when color is enabled). The format for COLOR_SCHEME "
+"is '<debug>:<info>:<warning>:<error>'. Numerical "
+"values and color names are accepted, empty fields imply the default "
+"color. For example --git-color-scheme='cyan:34::' would show debug messages "
+"in cyan, info messages in blue and other messages in default (i.e. warning "
+"and error messages in red)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:209 manpages/gbp-buildpackage.xml:457
+msgid "<option>--git-notify=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:213
+msgid "Whether to send a desktop notification after the build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:218 manpages/gbp-rpm-ch.xml:71
+msgid "<option>--git-tmp-dir</option>=<replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:222 manpages/gbp-rpm-ch.xml:75
+msgid "Base directory under which temporary directories are created."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:227
+msgid "<option>--git-vendor</option>=<replaceable>VENDOR</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:231 manpages/gbp-import-srpm.xml:79
+#: manpages/gbp-rpm-ch.xml:84
+msgid "Distribution vendor name."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:236
+msgid "<option>--git-native=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:240
+msgid ""
+"Define the 'nativity' of a package. The default value "
+"<replaceable>auto</replaceable> makes &gbp-buildpackage-rpm; to "
+"guess. Guessing is based on the existence of upstream branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:247 manpages/gbp-buildpackage.xml:207
+msgid "<option>--git-upstream-branch</option>=<replaceable>BRANCH_NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:251 manpages/gbp-buildpackage.xml:211
+msgid ""
+"Branch to build the orig tarball from if "
+"<option>--git-upstream-tree</option> is set to "
+"<replaceable>BRANCH</replaceable>. Default is "
+"<replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:259
+msgid "<option>--git-packaging-branch</option>=<replaceable>BRANCH_NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:263
+msgid ""
+"If you're not on this branch when invoking &gbp-buildpackage-rpm; it will "
+"fail. Default is <replaceable>master</replaceable>. This is done to make "
+"sure you don't accidentally release from a topic branch. Not being on this "
+"branch will be ignored when using <option>--git-ignore-new</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:272 manpages/gbp-buildpackage.xml:741
+msgid "<option>--git-ignore-branch</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:276 manpages/gbp-rpm-ch.xml:103
+msgid ""
+"Don't check if the current branch matches "
+"<replaceable>PACKAGING-BRANCH</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:282 manpages/gbp-buildpackage.xml:290
+msgid "<option>--git-[no-]submodules</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:286 manpages/gbp-export-orig.xml:99
+msgid "Include git submodules in the orig tarball."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:291 manpages/gbp-buildpackage.xml:590
+msgid "<option>--git-[no-]sign-tags</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:295 manpages/gbp-buildpackage.xml:594
+#: manpages/gbp-import-orig.xml:199 manpages/gbp-import-ref.xml:139
+#: manpages/gbp-import-srpm.xml:108 manpages/gbp-tag.xml:87
+msgid "GPG sign all created tags."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:300 manpages/gbp-buildpackage.xml:599
+msgid "<option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:304 manpages/gbp-buildpackage.xml:603
+#: manpages/gbp-import-dsc.xml:117 manpages/gbp-import-srpm.xml:117
+#: manpages/gbp-tag.xml:96
+msgid "Use this keyid for gpg signing tags."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:309 manpages/gbp-buildpackage.xml:541
+msgid "<option>--git-posttag=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:313
+msgid "Execute <replaceable>COMMAND</replaceable> after tagging a new version."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:317 manpages/gbp-buildpackage.xml:550
+#: manpages/gbp-tag.xml:75
+msgid ""
+"Exported environment variables are: <envar>GBP_TAG</envar> (the name of the "
+"generated tag), <envar>GBP_BRANCH</envar> (the branch the package was built "
+"from) and <envar>GBP_SHA1</envar> (the sha1 of the commit the tag was "
+"created at)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:325 manpages/gbp-buildpackage.xml:525
+msgid "<option>--git-postbuild=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:329
+msgid "Execute <replaceable>COMMAND</replaceable> after successful build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:333 manpages/gbp-buildpackage.xml:534
+msgid ""
+"Exported environment variables are: <envar>GBP_CHANGES_FILE</envar> (the "
+"name of the generated changes file), <envar>GBP_BUILD_DIR</envar> (the build "
+"dir)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:340 manpages/gbp-buildpackage.xml:476
+msgid "<option>--git-preexport=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:344
+msgid "Execute <replaceable>COMMAND</replaceable> before exporting the source tree."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:348 manpages/gbp-buildpackage-rpm.xml:364
+#: manpages/gbp-buildpackage.xml:501
+msgid ""
+"Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the "
+"repository the package is being built from), <envar>GBP_TMP_DIR</envar> (the "
+"temporary directory where the sources have been initially exported)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:356 manpages/gbp-buildpackage.xml:491
+msgid "<option>--git-postexport=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:360
+msgid "Execute <replaceable>COMMAND</replaceable> after exporting the source tree."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:372 manpages/gbp-buildpackage.xml:509
+msgid "<option>--git-prebuild=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:376
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> from the build directory before "
+"calling <application>rpmbuild</application> or the application specified via "
+"<option>--git-builder</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:381 manpages/gbp-buildpackage.xml:484
+#: manpages/gbp-buildpackage.xml:518
+msgid ""
+"Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the "
+"repository the package is being built from), <envar>GBP_BUILD_DIR</envar> "
+"(the build dir)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:388
+msgid "<option>--git-[no-]build</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:392
+msgid ""
+"Enable builder. Note: <option>--git-no-build</option> causes the postbuild "
+"hook to be disabled, too."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:398 manpages/gbp-buildpackage.xml:558
+msgid "<option>--git-[no-]hooks</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:402 manpages/gbp-buildpackage.xml:562
+msgid ""
+"Enable running all (cleaner, preexport, postexport, prebuild, postbuild, and "
+"posttag) hooks. Note: the <option>--git-builder</option> command is not "
+"affected by this option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:409
+msgid "<option>--git-packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:413
+msgid "Use this tag format when tagging released versions of the package."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:418 manpages/gbp-buildpackage.xml:170
+#: manpages/gbp-dch.xml:173
+msgid "<option>--git-upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:422 manpages/gbp-dch.xml:177
+#: manpages/gbp-export-orig.xml:108 manpages/gbp-pq-rpm.xml:157
+#: manpages/gbp-pq.xml:277
+msgid ""
+"Use this tag format when looking for tags of upstream versions, default is "
+"<replaceable>upstream/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:428 manpages/gbp-buildpackage.xml:261
+msgid "<option>--git-force-create</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:432 manpages/gbp-export-orig.xml:118
+msgid ""
+"Force creation of an orig tarball (overwriting a pre-existing one if "
+"present)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:438 manpages/gbp-buildpackage.xml:271
+msgid "<option>--git-no-create-orig</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:442
+msgid "Don't try to create any orig tarball."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:447 manpages/gbp-buildpackage.xml:658
+msgid "<option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:451
+msgid ""
+"Export the packaging files from the current branch head (or the treeish "
+"object given via <option>--git-export</option> to "
+"<replaceable>DIRECTORY</replaceable> before building."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:458
+msgid "<option>--git-export-sourcedir</option>=<replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:460
+msgid "<option>--git-export-specdir</option>=<replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:464
+msgid ""
+"Subdirectories under export directory where packaging files are "
+"exported. The default build options of rpmbuild builder are also adjusted "
+"accordingly."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:471 manpages/gbp-buildpackage.xml:670
+msgid "<option>--git-export=</option><replaceable>TREEISH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:475
+msgid ""
+"Instead of exporting the current branch head, export the treeish object "
+"<replaceable>TREEISH</replaceable>. The special name "
+"<replaceable>INDEX</replaceable> exports the current index, "
+"<replaceable>WC</replaceable>) exports all files in the current working "
+"directory."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:484 manpages/gbp-import-srpm.xml:164
+msgid "<option>--git-packaging-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:488 manpages/gbp-pq-rpm.xml:136
+#: manpages/gbp-rpm-ch.xml:123
+msgid "Subdirectory that contains the RPM packaging files."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:493
+msgid "<option>--git-spec-file=</option><replaceable>FILEPATH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:497
+msgid ""
+"Relative path to the spec file to use. Special value "
+"<replaceable>auto</replaceable> causes &gbp-buildpackage-rpm; to search and "
+"guess. Other values cause the <option>--git-packaging-dir</option> option "
+"to be ignored: the directory of the spec file is used, instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:506
+msgid "<option>--git-upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:510
+msgid ""
+"How to find the upstream sources used to generate the tarball. "
+"<replaceable>TAG</replaceable> looks at a tag corresponding to the version "
+"in the changelog. <replaceable>BRANCH</replaceable> looks at the upstream "
+"branch given via the <option>--git-upstream-branch</option> option. Other "
+"values are interpreted as treeishs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:518 manpages/gbp-buildpackage.xml:201
+msgid ""
+"This doesn't have any effect if <option>--git-pristine-tar</option> is being "
+"used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:524 manpages/gbp-buildpackage.xml:219
+msgid "<option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:528
+msgid ""
+"Search for original tarballs in <replaceable>DIRECTORY</replaceable> instead "
+"of generating them."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:534 manpages/gbp-buildpackage.xml:314
+msgid "<option>--git-compression-level=</option><replaceable>LEVEL</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:538 manpages/gbp-buildpackage.xml:318
+#: manpages/gbp-export-orig.xml:175
+msgid ""
+"Specifies the upstream tarball compression level if an upstream tarball "
+"needs to be built."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:544 manpages/gbp-buildpackage.xml:637
+msgid "<option>--git-tag-only</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:548
+msgid "Don't build, only tag and run post-tag hooks."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:553 manpages/gbp-buildpackage.xml:626
+msgid "<option>--git-retag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:557
+msgid ""
+"Don't fail tag operations if a tag with the same version already exists, "
+"but, overwrite the existing tag, instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:563 manpages/gbp-buildpackage.xml:158
+msgid "<option>--git-pristine-tar</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:567 manpages/gbp-export-orig.xml:204
+msgid "Use pristine-tar when generating the upstream tarball if it doesn't exist."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:573 manpages/gbp-buildpackage.xml:251
+msgid "<option>--git-pristine-tar-commit</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:577 manpages/gbp-buildpackage.xml:255
+msgid ""
+"Commit the pristine-tar delta to the pristine-tar branch if a new tarball "
+"was generated and the pristine-tar data isn't already there."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:583
+msgid "<option>--git-mock</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:587
+msgid "Use &mock; to build the rpms by invoking &gbp-builder-mock;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:592
+msgid "<option>--git-dist</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:596
+msgid "Build for this distribution when using &mock; (e.g.: epel-6)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:601
+msgid "<option>--git-arch</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:605
+msgid ""
+"Build for this architecture when using mock, default is to build for the "
+"current host architecture."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:611
+msgid "<option>--git-mock-root</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:615
+msgid ""
+"The mock root to use. Defaults to "
+"<replaceable>DIST</replaceable>-<replaceable>ARCH</replaceable> from above."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:622
+msgid "<option>--git-mock-options</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:626
+msgid ""
+"Additional options to pass to mock. Default is to pass no additional "
+"options."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage-rpm.xml:632
+msgid "<option>--git-spec-vcs-tag</option>=<replaceable>TAG_FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage-rpm.xml:636
+msgid ""
+"&gbp-buildpackage-rpm; always automatically sets/updates the 'VCS:' tag in "
+"the spec file after exporting. This option defines the format string for "
+"the 'VCS:' tag. An empty value causes no 'VCS:' tag to be inserted and "
+"possible old 'VCS:' tag to be removed. Otherwise, the old 'VCS:' tag is "
+"updated or a new 'VCS:' tag is added if one does not exist. In the format "
+"string '%(tagname)s' expands to the long tag name (from git-describe) and "
+"'%(commit)s' expans to the sha1 of the exported commit."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:650 manpages/gbp-buildpackage.xml:803
+#: manpages/gbp-clone.xml:189 manpages/gbp-config.xml:72
+#: manpages/gbp.conf.xml:215 manpages/gbp-export-orig.xml:221
+#: manpages/gbp-import-dsc.xml:278 manpages/gbp-import-orig.xml:409
+#: manpages/gbp-import-ref.xml:211 manpages/gbp-pristine-tar.xml:84
+#: manpages/gbp-tag.xml:166
+msgid "EXAMPLES"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:652
+msgid "Only build a source RPM with &rpmbuild;"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage-rpm.xml:655
+#, no-wrap
+msgid ""
+" &gbp-buildpackage-rpm; -bs\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:658
+msgid ""
+"Build an RPM package with &rpmbuild; on a custom branch with the uncommitted "
+"changes included."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage-rpm.xml:662
+#, no-wrap
+msgid ""
+" &gbp-buildpackage-rpm; --git-ignore-branch --git-export=WC\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:668
+msgid "All options in the config files are specified without the 'git-' prefix."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:672 manpages/gbp-buildpackage.xml:840
+#: manpages/gbp-clone.xml:216 manpages/gbp-config.xml:89
+#: manpages/gbp.conf.xml:304 manpages/gbp-create-remote-repo.xml:146
+#: manpages/gbp-dch.xml:645 manpages/gbp-export-orig.xml:241
+#: manpages/gbp-import-dscs.xml:79 manpages/gbp-import-dsc.xml:300
+#: manpages/gbp-import-orig.xml:430 manpages/gbp-import-ref.xml:234
+#: manpages/gbp-import-srpm.xml:270 manpages/gbp-pq-rpm.xml:262
+#: manpages/gbp-pq.xml:337 manpages/gbp-pristine-tar.xml:97
+#: manpages/gbp-pull.xml:164 manpages/gbp-push.xml:162
+#: manpages/gbp-rpm-ch.xml:339 manpages/gbp-setup-gitattributes.xml:82
+#: manpages/gbp-tag.xml:184 manpages/gbp.xml:182
+msgid "SEE ALSO"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:674
+msgid ""
+"<xref linkend=\"man.gbp.import.srpm\"/>, <xref linkend=\"man.gbp.pq.rpm\"/>, "
+"<xref linkend=\"man.gbp.rpm.ch\"/>, <citerefentry> "
+"<refentrytitle>rpmbuild</refentrytitle> <manvolnum>8</manvolnum> "
+"</citerefentry>, <citerefentry> <refentrytitle>mock</refentrytitle> "
+"<manvolnum>1</manvolnum> </citerefentry>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-buildpackage-rpm.xml:690 manpages/gbp-buildpackage.xml:867
+#: manpages/gbp-clone.xml:229 manpages/gbp-config.xml:95
+#: manpages/gbp-create-remote-repo.xml:154 manpages/gbp-dch.xml:658
+#: manpages/gbp-export-orig.xml:251 manpages/gbp-import-dscs.xml:91
+#: manpages/gbp-import-dsc.xml:324 manpages/gbp-import-orig.xml:445
+#: manpages/gbp-import-ref.xml:249 manpages/gbp-import-srpm.xml:281
+#: manpages/gbp-pq-rpm.xml:270 manpages/gbp-pq.xml:352
+#: manpages/gbp-pristine-tar.xml:105 manpages/gbp-pull.xml:173
+#: manpages/gbp-push.xml:171 manpages/gbp-rpm-ch.xml:350
+#: manpages/gbp-setup-gitattributes.xml:98 manpages/gbp-tag.xml:192
+#: manpages/gbp.xml:206
+msgid "AUTHOR"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage-rpm.xml:692 manpages/gbp-import-srpm.xml:283
+#: manpages/gbp-pq-rpm.xml:272 manpages/gbp-rpm-ch.xml:352
+msgid "&rpm-username; &rpm-email;"
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo><address>
+#: manpages/gbp-buildpackage.xml:4 manpages/gbp-clone.xml:4
+#: manpages/gbp-config.xml:4 manpages/gbp.conf.xml:4
+#: manpages/gbp-create-remote-repo.xml:4 manpages/gbp-dch.xml:4
+#: manpages/gbp-export-orig.xml:4 manpages/gbp-import-dscs.xml:4
+#: manpages/gbp-import-dsc.xml:4 manpages/gbp-import-orig.xml:4
+#: manpages/gbp-import-ref.xml:4 manpages/gbp-pq.xml:4
+#: manpages/gbp-pristine-tar.xml:4 manpages/gbp-pull.xml:4
+#: manpages/gbp-push.xml:4 manpages/gbp-tag.xml:4 manpages/gbp.xml:4
+#, no-wrap
+msgid ""
+" &dhemail;\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo>
+#: manpages/gbp-buildpackage.xml:3 manpages/gbp-clone.xml:3
+#: manpages/gbp-config.xml:3 manpages/gbp.conf.xml:3
+#: manpages/gbp-create-remote-repo.xml:3 manpages/gbp-dch.xml:3
+#: manpages/gbp-export-orig.xml:3 manpages/gbp-import-dscs.xml:3
+#: manpages/gbp-import-dsc.xml:3 manpages/gbp-import-orig.xml:3
+#: manpages/gbp-import-ref.xml:3 manpages/gbp-pq.xml:3
+#: manpages/gbp-pristine-tar.xml:3 manpages/gbp-pull.xml:3
+#: manpages/gbp-push.xml:3 manpages/gbp-tag.xml:3 manpages/gbp.xml:3
+msgid ""
+"<placeholder type=\"address\" id=\"0\"/> <author> &dhfirstname; &dhsurname; "
+"</author>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-buildpackage.xml:11 manpages/gbp-buildpackage.xml:15
+msgid "gbp-buildpackage"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-buildpackage.xml:16
+msgid "Build &debian; packages from a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-buildpackage.xml:20
+msgid ""
+"&gbp-buildpackage; <arg><option>--git-[no-]ignore-new</option></arg> "
+"<arg><option>--git-tag</option></arg> "
+"<arg><option>--git-verbose</option></arg> "
+"<arg><option>--git-color=</option>[auto|on|off]</arg> "
+"<arg><option>--git-color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable></arg> "
+"<arg><option>--git-notify=</option>[auto|on|off]</arg> "
+"<arg><option>--git-upstream-branch=</option><replaceable>TREEISH</replaceable></arg> "
+"<arg><option>--git-debian-branch=</option><replaceable>BRANCH_NAME</replaceable></arg> "
+"<arg><option>--git-ignore-branch</option></arg> "
+"<arg><option>--git-[no-]submodules</option></arg> "
+"<arg><option>--git-builder=</option><replaceable>BUILD_CMD</replaceable></arg> "
+"<arg><option>--git-cleaner=</option><replaceable>CLEAN_CMD</replaceable></arg> "
+"<arg><option>--git-[no-]overlay</option></arg> "
+"<arg><option>--git-[no-]pbuilder</option></arg> "
+"<arg><option>--git-[no-]qemubuilder</option></arg> "
+"<arg><option>--git-dist=</option><replaceable>DIST</replaceable></arg> "
+"<arg><option>--git-arch=</option><replaceable>ARCH</replaceable></arg> "
+"<arg><option>--git-[no-]pbuilder-autoconf</option></arg> "
+"<arg><option>--git-pbuilder-options</option>=<replaceable>PBUILDER_OPTIONS</replaceable></arg> "
+"<arg><option>--git-[no-]sign-tags</option></arg> "
+"<arg><option>--git-keyid=</option><replaceable>GPG-KEYID</replaceable></arg> "
+"<arg><option>--git-preexport=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-postexport=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-prebuild=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-postbuild=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-posttag=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--git-[no-]hooks</option></arg> "
+"<arg><option>--git-debian-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--git-debian-tag-msg=</option><replaceable>tag-msg-format</replaceable></arg> "
+"<arg><option>--git-upstream-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--git-force-create</option></arg> "
+"<arg><option>--git-no-create-orig</option></arg> "
+"<arg><option>--git-upstream-signatures=</option>[auto|on|off]</arg> "
+"<arg><option>--git-upstream-tree=</option><replaceable>[BRANCH|SLOPPY|TAG|TREEISH]</replaceable></arg> "
+"<arg><option>--git-tarball-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-compression=</option><replaceable>TYPE</replaceable></arg> "
+"<arg><option>--git-compression-level=</option><replaceable>LEVEL</replaceable></arg> "
+"<arg "
+"rep='repeat'><option>--git-component=</option><replaceable>component</replaceable></arg> "
+"<arg><option>--git-export-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--git-export=</option><replaceable>TREEISH</replaceable></arg> "
+"<arg><option>--git-[no-]pristine-tar</option></arg> "
+"<arg><option>--git-[no-]pristine-tar-commit</option></arg> "
+"<arg><option>--git-[no-]-purge</option></arg> "
+"<arg><option>--git-tag-only</option></arg> "
+"<arg><option>--git-retag</option></arg> <arg "
+"rep=\"repeat\"><option>OPTION_PASSED_TO_BUILD_CMD</option></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:72
+msgid ""
+"&gbp-buildpackage; is used to build &debian; source and .deb packages from a "
+"&git; repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:76
+msgid "&gbp-buildpackage; will, in order:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:97
+msgid ""
+"(Optionally) run a clean command specified with "
+"<option>--git-cleaner</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:103
+msgid "(Optionally) export the source tree to a separate build area."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:108
+msgid "Build an orig tarball if it doesn't exist. Optionally using &pristine-tar;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:113
+msgid "(Optionally) call a pre build hook."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:118
+msgid ""
+"Call <application>debuild</application>(1) or &cowbuilder; (via "
+"<option>--git-pbuilder</option>) or the application specified via "
+"<option>--git-builder</option> passing along all arguments given to "
+"&gbp-buildpackage; on the command line that don't start with --git-."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:127
+msgid "(Optionally) tag the current commit after a successful build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-buildpackage.xml:132
+msgid "(Optionally) call a post build hook - e.g. to run &lintian;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:146
+msgid ""
+"All options are prefixed with <option>git-</option> to distinguish options "
+"for &gbp-buildpackage; from options passed to the "
+"<replaceable>BUILD_CMD</replaceable>:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:151
+msgid "Upstream tarball creation options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:152
+msgid ""
+"When &gbp-buildpackage; doesn't find a suitable upstream tarball it will "
+"create one either using &pristine-tar; or <command>git "
+"archive</command>. These options determine how the tarball is created:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:162
+msgid ""
+"Use pristine-tar when generating the upstream tarball if it doesn't "
+"exist. If this mode is enabled the <option>--git-upstream-tag</option>, "
+"<option>--git-upstream-tree</option> options have no effect when creating "
+"tarballs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:174
+msgid ""
+"Use this tag format when looking for tags of upstream versions to build the "
+"upstream tarballs. Default is "
+"<replaceable>upstream/%(version)s</replaceable>. This must be set correctly "
+"if you don't want to pass any other options. The default matches what "
+"&gbp-import-orig; uses to create tags."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:184
+msgid "<option>--git-upstream-tree=</option><replaceable>[BRANCH|SLOPPY|TAG|TREEISH]</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:188
+msgid ""
+"How to find the upstream sources used to generate the tarball. "
+"<replaceable>TAG</replaceable> (the default) looks at a tag corresponding to "
+"the version in the changelog. <replaceable>BRANCH</replaceable> looks at the "
+"upstream branch given via the <option>--git-upstream-branch</option> "
+"option. The <replaceable>SLOPPY</replaceable> option looks at the debian "
+"branch given via the <option>--git-debian-branch</option> and drops the "
+"<filename>debian/</filename> dir."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:198 manpages/gbp-export-orig.xml:135
+msgid "Other values are interpreted as treeishs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:223
+msgid ""
+"Search for upstream tarballs in <replaceable>DIRECTORY</replaceable> instead "
+"of generating them. If a tarball is not found here it will be generated "
+"nevertheless. <replaceable>DIRECTORY</replaceable> can contain a version "
+"format substitution pattern, eg: <replaceable>foo-%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:232
+msgid "<option>--git-component=</option><replaceable>COMPONENT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:236
+msgid ""
+"When generating tarballs create an additional upstream tarball of directory "
+"<replaceable>COMPONENT</replaceable> in the source tree. Using additional "
+"upstream tarballs is a feature of the 3.0 (quilt) source format. See the "
+"<command>dpkg-source</command> manpage for details. Note that the "
+"<replaceable>--git-pristine-tar-commit</replaceable> option is currently "
+"incompatible with this option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:245 manpages/gbp-export-orig.xml:194
+msgid "This is considered an experimental feature and might change incompatibly."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:265
+msgid ""
+"Force creation of an upstream tarball (overwriting a pre-existing one if "
+"present)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:275
+msgid ""
+"Don't try to create any upstream tarballs or to create symlinks to existing "
+"tarballs in <option>tarball-dir</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:281
+msgid "<option>--git-upstream-signatures=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:285
+msgid "Whether to export the upstream tarball with signatures."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:294
+msgid "Include &git; submodules in the orig tarball if present."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:299
+msgid "<option>--git-compression=</option><replaceable>TYPE</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:303 manpages/gbp-export-orig.xml:160
+msgid ""
+"Specifies the upstream tarball compression type. This will be used to locate "
+"and build the upstream tarball if necessary. The default is "
+"<replaceable>auto</replaceable> which derives the compression type from the "
+"pristine-tar branch if available and falls back to gzip otherwise. Other "
+"options are <replaceable>gzip</replaceable>, "
+"<replaceable>bzip2</replaceable>, <replaceable>lzma</replaceable> and "
+"<replaceable>xz</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:326
+msgid "Package build options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:327
+msgid ""
+"&gbp-buildpackage; can invoke different types of builders to produce the "
+"source and binary packages. These options determine which builder is invoked "
+"and how."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:337
+msgid ""
+"Use <replaceable>BUILD_CMD</replaceable> instead of <command>debuild -i "
+"-I</command>. If you want to use &cowbuilder; or &pbuilder; see the "
+"<option>--git-pbuilder</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:349
+msgid ""
+"Use <replaceable>CLEAN_CMD</replaceable> to clean the source tree before the "
+"build. The default is <command>/bin/true</command> (no cleaning)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:356
+msgid "<option>--git-pbuilder</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:360
+msgid ""
+"Build the package using <command>git-pbuilder</command> (which uses "
+"<command>cowbuilder</command> by default). Note that this overwrites any "
+"<option>--git-builder</option> and <option>--git-cleaner</option> options."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:368
+msgid "<option>--git-qemubuilder</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:372
+msgid ""
+"Build package using <command>git-pbuilder</command> with "
+"<command>qemubuilder</command>. Note that this overwrites any "
+"<option>--git-builder</option> and <option>--git-cleaner</option> options."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:380
+msgid "<option>--git-dist=<replaceable>DIST</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:384
+msgid ""
+"Build for distribution <replaceable>DIST</replaceable> when using "
+"&git-pbuilder; (either via <option>--git-pbuilder</option>, "
+"<option>--git-qemubuilder</option> or the corresponding configuration file "
+"options). If unset build for the unstable distribution. The special value "
+"<symbol>DEP14</symbol> will set the distribution to build for from the "
+"branch name. I.e. if you're starting the build from a branch named "
+"<replaceable>debian/wheezy-backports</replaceable> the distribution is set "
+"to <replaceable>wheezy-backports</replaceable>. If the branch is named "
+"<replaceable>downstream/sid</replaceable> the distribution is set to "
+"<replaceable>downstream_sid</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:402
+msgid "<option>--git-arch=<replaceable>ARCH</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:406
+msgid ""
+"Build for architecture <replaceable>ARCH</replaceable> when using "
+"&git-pbuilder; (either via <option>--git-pbuilder</option>, "
+"<option>--git-qemubuilder</option> or the corresponding configuration file "
+"options). If unset no architecture is passed to "
+"<command>git-pbuilder</command>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:416
+msgid "<option>--git-pbuilder-autoconf</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:420
+msgid ""
+"Whether to try to autoconfigure &git-pbuilder; or to rely on the settings in "
+".pbuilderrc. See the &git-pbuilder; manpage for details. Only takes effect "
+"when using &git-pbuilder; (either via <option>--git-pbuilder</option>, "
+"<option>--git-qemubuilder</option> or the corresponding configuration file "
+"options)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:429
+msgid "<option>--git-pbuilder-options</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:433
+msgid ""
+"Options to pass to pbuilder when building via &git-pbuilder; (either via "
+"<option>--git-pbuilder</option>, <option>--git-qemubuilder</option> or the "
+"corresponding configuration file options). It does so by using the "
+"<envar>GIT_PBUILDER_OPTIONS</envar> environment variable to pass options to "
+"&git-pbuilder;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:440
+msgid ""
+"As an example, to tell pbuilder to use an alternate .pbuilderrc file, you "
+"may run &gbp-buildpackage; with "
+"<option>--git-pbuilder-options=<replaceable>\"--configfile "
+"/tmp/my/pbuilderrc\"</replaceable></option>. See <citerefentry> "
+"<refentrytitle>pbuilder</refentrytitle> <manvolnum>8</manvolnum> "
+"</citerefentry> for more options to pass through here."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:451
+msgid ""
+"If unset the <envar>GIT_PBUILDER_OPTIONS</envar> environment variable will "
+"be left untouched."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:461
+msgid ""
+"Whether to send a desktop notification after the build. This needs "
+"python3-notify2 installed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:469
+msgid "Hook options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:471
+msgid ""
+"Hooks allow you to run arbitrary commands at different stages of the "
+"build. These options configure what will be run:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:480
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> before exporting the source "
+"tree. Valid only if --git-export-dir has been specified."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:495
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> after exporting the source "
+"tree. Valid only if --git-export-dir has been specified. The working "
+"directory of this hook is the toplevel directory of the exported source "
+"tree."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:513
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> from the build directory before "
+"calling <application>debuild</application> or the application specified via "
+"<option>--git-builder</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:529
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> after successful build. The "
+"working directory of this hook is the directory the package was built in."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:545
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> after tagging a new version. The "
+"working directory of this hook is the toplevel directory of the &git; "
+"repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:571
+msgid "Tagging options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:578
+msgid ""
+"Add a git tag after a successful build. It tags the currently checked out "
+"commit except when you're on a patch-queue branch. In that case the "
+"corresponding debian branch is tagged."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:584
+msgid "This is a command line only option that cannot be specified via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:608
+msgid "<option>--git-debian-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:612 manpages/gbp-import-dsc.xml:126
+#: manpages/gbp-tag.xml:105
+msgid ""
+"Use this tag format when tagging &debian; versions, default is "
+"<replaceable>debian/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:618
+msgid "<option>--git-debian-tag-msg=</option><replaceable>tag-msg-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:621 manpages/gbp-tag.xml:114
+msgid ""
+"Use this tag message format when signing &debian; versions, default is "
+"<replaceable>%(pkg)s Debian release %(version)s</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:630 manpages/gbp-tag.xml:123
+msgid ""
+"Don't fail tag operations if a tag with the same version already "
+"exists. This is a command line only option that cannot be specified via "
+"&gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:641
+msgid ""
+"Don't build, only tag and run post-tag hooks. This is a command line only "
+"option that cannot be specified via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:650
+msgid "Build area options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:652
+msgid ""
+"&gbp-buildpackage; can export the source tree to a different build-area "
+"before performing the build. This options specify if and how this is done:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:662
+msgid ""
+"Export the current branch head (or the treeish object given via "
+"<option>--git-export</option> to <replaceable>DIRECTORY</replaceable> before "
+"building. If unset the source will not be exported before starting the "
+"build."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:674
+msgid ""
+"Instead of exporting the current branch head, export the treeish object "
+"<replaceable>TREEISH</replaceable>. The special name "
+"<replaceable>INDEX</replaceable> exports the current index whereas the "
+"special name <replaceable>WC</replaceable> exports the current working copy "
+"as is."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:681
+msgid ""
+"Note that using <replaceable>WC</replaceable> enables the "
+"<option>--git-ignore-branch</option> and <option>--git-ignore-new</option> "
+"options as well since when exporting the working copy there's no point in "
+"enforcing any branch or modification checks."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:690
+msgid "<option>--git[-no]-purge</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:694
+msgid ""
+"Purge (remove) temporary build area after build. This is the default but it "
+"can be turned off for e.g. debugging purposes."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:701
+msgid "<option>--git-[no-]overlay</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:705
+msgid ""
+"Extract upstream tarball from <option>tarball-dir</option> when using the "
+"<option>export-dir</option> option (in analogy to mergeWithUpstream in "
+"svn-bp). Also remove debian/ if contained in the upstream tarball in case of "
+"2.0 and 3.0 source formats."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:712
+msgid ""
+"This option allows one to keep only the debian/ dir in the version control "
+"system."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:720
+msgid "Safety options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp-buildpackage.xml:722
+msgid ""
+"In order to make sure what you build is what you upload &gbp-buildpackage; "
+"performs several safety checks. These options allow one to configure and "
+"disable them:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:728
+msgid "<option>--git-debian-branch</option>=<replaceable>BRANCH_NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:732
+msgid ""
+"If you're not on this branch when invoking &gbp-buildpackage; it will "
+"fail. Default is <replaceable>master</replaceable>. This is done to make "
+"sure you don't accidentally release from a topic branch. Not being on this "
+"branch will be ignored when using <option>--git-ignore-new</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:745 manpages/gbp-tag.xml:147
+msgid ""
+"Don't check if the current branch matches "
+"<replaceable>DEBIAN-BRANCH</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:755 manpages/gbp-tag.xml:157
+msgid ""
+"Don't abort if there are uncommitted changes in the source tree or the "
+"current branch doesn't match the <replaceable>DEBIAN-BRANCH</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp-buildpackage.xml:764
+msgid "Color and verbosity options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-buildpackage.xml:771
+msgid "Verbose execution. Useful for debugging and bug reports."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
+#: manpages/gbp-buildpackage.xml:785
+msgid "<option>--git-color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:805
+msgid ""
+"Build a &debian; package using &git-pbuilder; which in turn invokes "
+"&cowbuildercmd;. Instruct cowbuilder to build within a Wheezy chroot for "
+"i386."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage.xml:810
+#, no-wrap
+msgid ""
+" &gbp-buildpackage; --git-pbuilder --git-arch=i386 --git-dist=wheezy\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:813
+msgid ""
+"Note that the above needs a &cowbuildercmd; chroot already. This can be "
+"created using:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage.xml:817
+#, no-wrap
+msgid ""
+" DIST=wheezy ARCH=i386 &git-pbuilder; create\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:820
+msgid "To export the source tree without performing any build you can use:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-buildpackage.xml:823
+#, no-wrap
+msgid ""
+" gbp buildpackage --git-export-dir=/where/to/export "
+"--git-builder=/bin/true --git-no-pbuilder --git-no-hooks --git-no-purge\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:829
+msgid ""
+"All options in the config files must be specified without the 'git-' "
+"prefix. So "
+"e.g. "
+"<option>--git-debian-branch</option>=<replaceable>debian/sid</replaceable> "
+"becomes in &gbp.conf;:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp-buildpackage.xml:835
+#, no-wrap
+msgid ""
+" [buildpackage]\n"
+" debian-branch = debian/sid\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:842
+msgid ""
+"<xref linkend=\"man.gbp.import.dsc\"/>, <xref "
+"linkend=\"man.gbp.import.dscs\"/>, <xref linkend=\"man.gbp.import.orig\"/>, "
+"<xref linkend=\"man.gbp.dch\"/>, <citerefentry> "
+"<refentrytitle>git-pbuilder</refentrytitle> <manvolnum>1</manvolnum> "
+"</citerefentry>, <citerefentry> <refentrytitle>cowbuilder</refentrytitle> "
+"<manvolnum>8</manvolnum> </citerefentry>, <citerefentry> "
+"<refentrytitle>dpkg-source</refentrytitle> <manvolnum>1</manvolnum> "
+"</citerefentry>, <citerefentry> <refentrytitle>git-submodule</refentrytitle> "
+"<manvolnum>1</manvolnum> </citerefentry>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-buildpackage.xml:869 manpages/gbp-clone.xml:231
+#: manpages/gbp-config.xml:97 manpages/gbp.conf.xml:321
+#: manpages/gbp-create-remote-repo.xml:156 manpages/gbp-dch.xml:660
+#: manpages/gbp-export-orig.xml:253 manpages/gbp-import-dscs.xml:93
+#: manpages/gbp-import-dsc.xml:326 manpages/gbp-import-orig.xml:447
+#: manpages/gbp-import-ref.xml:251 manpages/gbp-pq.xml:354
+#: manpages/gbp-pristine-tar.xml:107 manpages/gbp-pull.xml:175
+#: manpages/gbp-push.xml:173 manpages/gbp-tag.xml:194 manpages/gbp.xml:208
+msgid "&dhusername; &dhemail;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-clone.xml:12 manpages/gbp-clone.xml:16
+msgid "gbp-clone"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-clone.xml:18
+msgid "Clone a repository from remote"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-clone.xml:22
+msgid ""
+"&gbp-clone; &man.common.options.synopsis; <arg><option>--all</option></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--depth=</option><replaceable>depth</replaceable></arg> "
+"<arg><option>--reference=</option><replaceable>repository</replaceable></arg> "
+"<arg><option>--postclone=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--[no-]hooks</option></arg> "
+"<arg><option>--defuse-gitattributes=</option><replaceable>[auto|on|off]</replaceable></arg> "
+"<arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg> "
+"<arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg> <arg "
+"choice=\"plain\"><replaceable>repository</replaceable></arg> "
+"<arg><replaceable>directory</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:43
+msgid ""
+"&gbp-clone; clones a remote repository and sets up tracking branches for the "
+"<emphasis>debian</emphasis>, <emphasis>upstream</emphasis> and "
+"<emphasis>pristine-tar</emphasis> branches. This way you can easily update "
+"later using &gbp-pull;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist>
+#: manpages/gbp-clone.xml:53 manpages/gbp-config.xml:42
+#: manpages/gbp-create-remote-repo.xml:63 manpages/gbp-dch.xml:150
+#: manpages/gbp-import-dsc.xml:81 manpages/gbp-import-orig.xml:110
+#: manpages/gbp-import-ref.xml:48 manpages/gbp-import-srpm.xml:72
+#: manpages/gbp-pq-rpm.xml:130 manpages/gbp-pq.xml:135
+#: manpages/gbp-pristine-tar.xml:48 manpages/gbp-pull.xml:57
+#: manpages/gbp-push.xml:92 manpages/gbp-rpm-ch.xml:68
+#: manpages/gbp-setup-gitattributes.xml:52 manpages/gbp-tag.xml:66
+msgid "&man.common.options.description;"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:56 manpages/gbp-pull.xml:68
+#: manpages/gbp-setup-gitattributes.xml:71
+msgid "<option>--all</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:59
+msgid ""
+"Track all branches, not only <replaceable>debian</replaceable> and "
+"<replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:64 manpages/gbp-create-remote-repo.xml:102
+#: manpages/gbp-dch.xml:153 manpages/gbp-import-dsc.xml:94
+#: manpages/gbp-import-orig.xml:170 manpages/gbp-import-ref.xml:125
+#: manpages/gbp-pull.xml:89 manpages/gbp-push.xml:103
+msgid "<option>--debian-branch</option>=<replaceable>branch_name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:67 manpages/gbp-dch.xml:157 manpages/gbp-pull.xml:92
+msgid ""
+"The branch in the Git repository the Debian package is being developed on, "
+"default is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:72 manpages/gbp-create-remote-repo.xml:110
+#: manpages/gbp-dch.xml:163 manpages/gbp-import-dsc.xml:84
+#: manpages/gbp-import-orig.xml:160 manpages/gbp-import-ref.xml:90
+#: manpages/gbp-pull.xml:97 manpages/gbp-push.xml:122
+msgid "<option>--upstream-branch</option>=<replaceable>branch_name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:75 manpages/gbp-create-remote-repo.xml:113
+#: manpages/gbp-import-dsc.xml:88 manpages/gbp-import-orig.xml:164
+#: manpages/gbp-import-srpm.xml:88 manpages/gbp-pull.xml:100
+msgid ""
+"The branch in the &git; repository the upstream sources are put "
+"onto. Default is <replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:80 manpages/gbp-pull.xml:119
+msgid "<option>--depth</option>=<replaceable>depth</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:83
+msgid "Git history depth, for creating shallow git clones."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:87
+msgid "<option>--reference</option>=<replaceable>repository</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:90
+msgid ""
+"Local repository to use as alternate instead of re-copying data from remote "
+"repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:94 manpages/gbp-create-remote-repo.xml:118
+#: manpages/gbp-export-orig.xml:200 manpages/gbp-import-dsc.xml:187
+#: manpages/gbp-import-srpm.xml:182 manpages/gbp-pull.xml:126
+#: manpages/gbp-push.xml:142
+msgid "<option>--pristine-tar</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:97
+msgid "Track pristine tar branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:101
+msgid "<option>--[no-]hooks</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:104
+msgid "Enable running hooks."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:109
+msgid "<option>--postclone=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:112
+msgid ""
+"Execute <replaceable>COMMAND</replaceable> after cloning the source from the "
+"remote."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:116
+msgid ""
+"Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the "
+"repository the package is being built from)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:119
+msgid ""
+"Note that if you clone a repository that contains a hook configuration in "
+"<filename>debian/gbp.conf</filename> this hook will not be run automatically "
+"to prevent execution of untrusted code."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:127
+msgid "<option>--defuse-gitattributes=</option><option>[auto|on|off]</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:130
+msgid ""
+"Disable Git attributes that may interfere with building packages. Works by "
+"updating <filename>.git/info/attributes</filename> to override attributes in "
+"the upstream sources which may cause files to be transformed on checkout. "
+"More specifically, a new macro attribute is defined, "
+"<symbol>[attr]dgit-defuse-attrs</symbol>, which is then applied to "
+"<filename>*</filename> together with <symbol>export-subst</symbol> and "
+"<symbol>export-ignore</symbol>. This is done to be compatible with "
+"<command>dgit</command> and <command>git-deborig</command> which disable Git "
+"attributes this way."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:139
+msgid ""
+"If set to <replaceable>auto</replaceable>, first check whether there are any "
+"<filename>.gitattributes</filename> files in the upstream source, and act "
+"only if there are some. If set to <replaceable>on</replaceable>, "
+"unconditionally there are some. If set to <replaceable>off</replaceable>, "
+"does nothing."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:148 manpages/gbp-import-dsc.xml:262
+#: manpages/gbp-import-srpm.xml:254
+msgid "<option>--repo-email=</option><option>[GIT|DEBIAN]</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:151
+msgid ""
+"When set to <option>DEBIAN</option> use the <envar>DEBEMAIL</envar> "
+"environment variable to set the user.email &git; configuration otherwise use "
+"&git;'s defaults."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:159 manpages/gbp-import-dsc.xml:251
+#: manpages/gbp-import-srpm.xml:243
+msgid "<option>--repo-user=</option><option>[GIT|DEBIAN]</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:162
+msgid ""
+"When set to <option>DEBIAN</option> use the <envar>DEBUSER</envar> "
+"environment variable to set the user.name &git; configuration otherwise use "
+"&git;'s defaults."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:170
+msgid "<replaceable>repository</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:173
+msgid ""
+"The (possibly remote) repository to clone from. This is usually a &git; URL "
+"but some shortcuts are supported (see below)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-clone.xml:179
+msgid "<replaceable>directory</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-clone.xml:182
+msgid "The directory to clone to."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:191
+msgid "Clone a repository and setup a tracking branch for pristine-tar as well:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-clone.xml:195
+#, no-wrap
+msgid ""
+" &gbp-clone; --pristine-tar "
+"git://honk.sigxcpu.org/git/git-buildpackage.git"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:197
+msgid "Clone from the <emphasis>Git-Vcs</emphasis> URL of a package:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-clone.xml:200
+#, no-wrap
+msgid " &gbp-clone; vcsgit:libvirt"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:202
+msgid "Clone a repository from salsa (Debian's code hosting):"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-clone.xml:205
+#, no-wrap
+msgid " &gbp-clone; salsa:agx/git-buildpackage"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:207
+msgid "Clone from a github repository:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-clone.xml:210
+#, no-wrap
+msgid " &gbp-clone; github:agx/git-buildpackage"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-clone.xml:218
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.pull\"/>, "
+"<xref linkend=\"man.gbp.setup.gitattributes\"/>, <xref "
+"linkend=\"man.gbp.conf\"/>, <citerefentry> "
+"<refentrytitle>gitattributes</refentrytitle> <manvolnum>5</manvolnum> "
+"</citerefentry>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-config.xml:12 manpages/gbp-config.xml:16
+msgid "gbp-config"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-config.xml:18
+msgid "Query configuration values"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-config.xml:22
+msgid ""
+"&gbp-config; &man.common.options.synopsis; <group choice='req'> <arg "
+"choice=\"plain\"><replaceable>command.option</replaceable></arg> <arg "
+"choice=\"plain\"><replaceable>command</replaceable></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:34
+msgid ""
+"&gbp-config; prints values from the configuration files. It interpolates the "
+"value for <replaceable>option</replaceable> of "
+"<replaceable>command</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-config.xml:46 manpages/gbp-pull.xml:135
+msgid "EXIT CODES"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:48
+msgid ""
+"When &gbp-config; finishes, it indicates success or failure with its exit "
+"code:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-config.xml:52 manpages/gbp-pull.xml:141
+msgid "<option>0</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-config.xml:54 manpages/gbp-pull.xml:143
+msgid "Success."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-config.xml:58 manpages/gbp-pull.xml:147
+msgid "<option>1</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-config.xml:60
+msgid "Failed to parse command line"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-config.xml:64 manpages/gbp-pull.xml:153
+msgid "<option>2</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-config.xml:66
+msgid "The value did not exist"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:73
+msgid ""
+"Print the value <option>upstream-branch</option> that &gbp-buildpackage; "
+"would use:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-config.xml:76
+#, no-wrap
+msgid ""
+" $ gbp config buildpackage.upstream-branch\n"
+" buildpackage.upstream-branch=upstream"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:78
+msgid "Print the values of all of &gbp-buildpackage; options"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-config.xml:80
+#, no-wrap
+msgid ""
+" $ gbp config buildpackage\n"
+" buildpackage.upstream-branch=upstream\n"
+" buildpackage.debian-branch=master\n"
+" ..."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-config.xml:91
+msgid "<xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refmeta><refentrytitle>
+#: manpages/gbp.conf.xml:12
+msgid "gbp.conf"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp.conf.xml:16
+msgid "&gbp.conf;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp.conf.xml:17
+msgid "Gbp configuration file"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:27
+msgid "system wide"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:37
+msgid "per user"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:47
+msgid "per branch, can be published with the repository (deprecated)"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:58
+msgid "per branch, can be published with the repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:68
+msgid "per repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:77
+msgid ""
+"The <filename>gbp.conf</filename> configuration files provide default global "
+"options and specific options for individual &gbp; commands. All files have "
+"the same format as described below and are parsed in the above order from "
+"top to bottom with increasing precedence. Non existing files will be "
+"skipped."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:84
+msgid ""
+"Each file consists of either zero or one default section, and zero or one "
+"sections for each &gbp; command. Additionally, there can be an arbitrary "
+"number of <option>remote-config</option> sections. Comments start with a "
+"hash sign (<option>#</option>). The overall layout is:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:91
+#, no-wrap
+msgid ""
+" [DEFAULT]\n"
+" # This section is for global settings. Affects all commands.\n"
+" # Options set here have the lowest priority.\n"
+" key = value\n"
+"\n"
+" [<command>]\n"
+" # Specific sections for each command, like "
+"<command>buildpackage</command>\n"
+" # Options set here have lower priority than command line options\n"
+" key = value\n"
+"\n"
+" [remote-config <name>]\n"
+" # Specific sections for a remote configuration. This can be used "
+"several\n"
+" # times to set up remote configuration for <command>gbp "
+"create-remote-repo</command>\n"
+" key = value\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:107
+msgid ""
+"The sections for each command are named like the command (without &gbp;) "
+"surrounded by square brackets (e.g. <option>[buildpackage]</option>). For "
+"backwards compatibility, command sections starting with "
+"<filename>git-</filename> or <filename>gbp-</filename> are also supported "
+"but will provoke a warning when parsed by &gbp;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:115
+msgid ""
+"The keys in the <option>key</option>=<parameter>value</parameter> pairs are "
+"named like the command-line options of the corresponding command (with the "
+"'--' stripped off) and can hold the same values, but see below for "
+"details. In case of &gbp-buildpackage; and &gbp-buildpackage-rpm; the key "
+"needs '--git-' instead of '--' stripped off."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:123
+msgid ""
+"For example, the <xref linkend=\"man.gbp.buildpackage\"/> manual page "
+"documents the "
+"<option>--git-export-dir</option>=<parameter>directory</parameter> option "
+"which can be turned into configuration file setting by dropping the "
+"<option>--git-</option> prefix:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:132
+#, no-wrap
+msgid ""
+" [buildpackage]\n"
+" export-dir = directory\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:137
+msgid ""
+"Options that can be repeated on the command line take Python-like lists in "
+"the config file. For example, the <xref linkend=\"man.gbp.import.orig\"/> "
+"command has the <option>--filter</option>=<parameter>pattern</parameter> "
+"option which can be turned into a configuration file option like this:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:145
+#, no-wrap
+msgid ""
+" [import-orig]\n"
+" filter = [ '.svn', '.hg' ]\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:150
+msgid ""
+"Boolean options can be either <option>True</option> or "
+"<option>False</option>. For example, <xref linkend=\"man.gbp.import.orig\"/> "
+"has the <option>--pristine-tar</option> and "
+"<option>--no-pristine-tar</option> options which translate to:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:155
+#, no-wrap
+msgid ""
+" [import-orig]\n"
+" pristine-tar = True\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:159
+msgid "and"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:162
+#, no-wrap
+msgid ""
+" [import-orig]\n"
+" pristine-tar = False\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:165
+msgid "respectively."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp.conf.xml:168
+msgid "Remote site configuration"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp.conf.xml:170
+msgid ""
+"<xref linkend=\"man.gbp.create.remote.repo\"/> can additionally parse remote "
+"site configurations from <filename>gbp.conf</filename>. For example, a "
+"configuration like:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><programlisting>
+#: manpages/gbp.conf.xml:175
+#, no-wrap
+msgid ""
+" [remote-config pkg-libvirt]\n"
+" # Location of the repository\n"
+" remote-url-pattern = ssh://git.debian.org/git/pkg-libvirt/%(pkg)s\n"
+" # Template dir to passed to git-init\n"
+" template-dir = "
+"/srv/alioth.debian.org/chroot/home/groups/pkg-libvirt/git-template\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp.conf.xml:183
+msgid "can be used to create remote repositories for the pkg-libvirt project using:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><programlisting>
+#: manpages/gbp.conf.xml:187
+#, no-wrap
+msgid ""
+" gbp-create-remote-repo --remote-config=pkg-libvirt\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><para>
+#: manpages/gbp.conf.xml:191
+msgid ""
+"This can be useful if you're often creating new remote repositories for "
+"different projects."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><title>
+#: manpages/gbp.conf.xml:197
+msgid "Notes"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><note><para>
+#: manpages/gbp.conf.xml:200
+msgid ""
+"To see the current set of values that would be applied after parsing the "
+"configuration files, use <xref linkend=\"man.gbp.config\"/>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><refsect2><note><para>
+#: manpages/gbp.conf.xml:207
+msgid ""
+"<command>gbp import-dscs</command> and <command>git-pbuilder</command> can't "
+"be configured via <filename>gbp.conf</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:217
+msgid "An example set up for packaging work:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><programlisting>
+#: manpages/gbp.conf.xml:221
+#, no-wrap
+msgid ""
+" # $HOME/.gbp.conf\n"
+"\n"
+" [DEFAULT]\n"
+" pristine-tar = True\n"
+" cleaner = fakeroot debian/rules clean\n"
+"\n"
+" [buildpackage]\n"
+" export-dir = ../build-area/\n"
+"\n"
+" [import-orig]\n"
+" dch = False\n"
+" filter = [\n"
+" '.svn',\n"
+" '.hg',\n"
+" '.bzr',\n"
+" 'CVS',\n"
+" 'debian/*',\n"
+" '*/debian/*'\n"
+" ]\n"
+" filter-pristine-tar = True\n"
+"\n"
+" [import-dsc]\n"
+" filter = [\n"
+" 'CVS',\n"
+" '.cvsignore',\n"
+" '.hg',\n"
+" '.hgignore'\n"
+" '.bzr',\n"
+" '.bzrignore',\n"
+" '.gitignore'\n"
+" ]\n"
+"\n"
+" # End of file\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp.conf.xml:258
+msgid "ENVIRONMENT"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:260
+msgid ""
+"The following environment variables can be used to modify &gbp;'s "
+"configuration file handling:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.conf.xml:265
+msgid "<envar>GBP_CONF_FILES</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:268
+msgid ""
+"A colon separated list of configuration files to parse. If unset or empty "
+"the default list of files is parsed (see above)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.conf.xml:274
+msgid "<envar>GBP_DISABLE_SECTION_DEPRECATION</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:277
+msgid ""
+"When set to a non-empty value don't print a deprecation warning in case "
+"&gbp; encounters a section starting with <emphasis>git-</emphasis> or "
+"<emphasis>gbp-</emphasis>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.conf.xml:284
+msgid "<envar>GBP_DISABLE_GBP_CONF_DEPRECATION</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.conf.xml:287
+msgid ""
+"When set to a non-empty value don't print a deprecation warning in case "
+"&gbp; encounters a configuration file in a deprecated location."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp.conf.xml:297
+msgid "FILES"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:299
+msgid "See <filename>/etc/git-buildpackage/gbp.conf</filename> for an example."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:306
+msgid ""
+"<xref linkend=\"man.gbp.config\"/>, <xref linkend=\"man.gbp.clone\"/>, <xref "
+"linkend=\"man.gbp.create.remote.repo\"/>, <xref linkend=\"man.gbp.pq\"/>, "
+"<xref linkend=\"man.gbp.pull\"/>, <xref linkend=\"man.gbp.dch\"/>, <xref "
+"linkend=\"man.gbp.import.dsc\"/>, <xref linkend=\"man.gbp.import.orig\"/>, "
+"<xref linkend=\"man.gbp.buildpackage\"/>, <ulink "
+"url=\"file:///usr/share/doc/git-buildpackage/manual-html/index.html\"> "
+"<citetitle>The Git-Buildpackage Manual</citetitle></ulink>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp.conf.xml:320
+msgid "AUTHORS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.conf.xml:322
+msgid ""
+"This manual page is based on a POD version by Jari Aalto "
+"<email>jari.aalto@cante.net</email>. Released under license GNU GPL version "
+"2 or (at your option) any later. version."
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-create-remote-repo.xml:12
+#: manpages/gbp-create-remote-repo.xml:16
+msgid "gbp-create-remote-repo"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-create-remote-repo.xml:18
+msgid "Create remote repositories"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-create-remote-repo.xml:22
+msgid ""
+"&gbp-create-remote-repo; &man.common.options.synopsis; "
+"<arg><option>--remote-url-pattern=</option><replaceable>url-pattern</replaceable></arg> "
+"<arg><option>--remote-name=</option><replaceable>name</replaceable></arg> "
+"<arg><option>--template-dir=</option><replaceable>directory</replaceable></arg> "
+"<arg><option>--remote-config=</option><replaceable>config</replaceable></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--[no-]track</option></arg> "
+"<arg><option>--[no-]bare</option></arg> <group choice=\"opt\"> "
+"<arg><replaceable>create</replaceable></arg> "
+"<arg><replaceable>list</replaceable></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:42
+msgid ""
+"&gbp-create-remote-repo; creates a repository at a remote location via ssh "
+"and pushes the local repository into it. It then sets up remote branch "
+"tracking so you can use &gbp-pull; to update your repository from there."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:47
+msgid ""
+"Before performing any action on the remote location, it will print the "
+"remote URL and ask for confirmation."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:51
+msgid ""
+"Note: By default, the remote repositories are created in the <systemitem "
+"class=\"groupname\">collab-maint</systemitem> repository on <systemitem "
+"class=\"systemname\">git.debian.org</systemitem>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:56
+msgid ""
+"When invoked with <option>list</option> it lists the available remote config "
+"templates."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:66
+msgid "<option>--remote-url-pattern</option>=<replaceable>pattern</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:69
+msgid ""
+"Where to create the remote repository. The part "
+"<replaceable>%(pkg)s</replaceable> will be replaced by the package name."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:75
+msgid "<option>--remote-name</option>=<replaceable>name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:78
+msgid "What name git will use when referring to that repository, e.g. 'origin'."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:83
+msgid "<option>--template-dir</option>=<replaceable>directory</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:86
+msgid ""
+"Template directory to pass to <command>git init</command> on the remote "
+"side. This can be used to customize the remote repository, e.g. to set up "
+"hooks."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:92
+msgid "<option>--remote-config</option>=<replaceable>config</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:95
+msgid ""
+"Name of a config file section in <filename>gbp.conf</filename> that "
+"specifies the above parameters. See <xref linkend=\"man.gbp.conf\"/> manpage "
+"for details."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:105 manpages/gbp-import-ref.xml:129
+msgid ""
+"The branch in the &git; repository the &debian; package is being developed "
+"on, default is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:121
+msgid "Whether to push the pristine tar branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:125
+msgid "<option>--[no-]track</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:128
+msgid ""
+"Whether to set up branch tracking for the debian, upstream and pristine-tar "
+"branches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-create-remote-repo.xml:133
+msgid "<option>--[no-]bare</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-create-remote-repo.xml:136
+msgid ""
+"Whether to the remote repository should be a bare repository (this is the "
+"default)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-create-remote-repo.xml:148
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.pull\"/>, "
+"<xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-dch.xml:12 manpages/gbp-dch.xml:16
+msgid "gbp-dch"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-dch.xml:17
+msgid "Generate the &debian; changelog from git commit messages"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-dch.xml:21
+msgid ""
+"&gbp-dch; &man.common.options.synopsis; "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--ignore-branch</option></arg> <group> <arg><option>-s</option> "
+"<replaceable>commitish</replaceable></arg> "
+"<arg><option>--since=</option><replaceable>commitish</replaceable></arg> "
+"</group> <group> <group> <arg><option>-S</option></arg> "
+"<arg><option>--snapshot</option></arg> </group> <group> "
+"<arg><option>-R</option></arg> <arg><option>--release</option></arg> "
+"</group> </group> <group> <arg><option>-N</option> "
+"<replaceable>version</replaceable></arg> "
+"<arg><option>--new-version=</option><replaceable>version</replaceable></arg> "
+"</group> <group> <arg><option>--bpo</option></arg> "
+"<arg><option>--nmu</option></arg> <arg><option>--qa</option></arg> "
+"<arg><option>--security</option></arg> <arg><option>--team</option></arg> "
+"<arg><option>--local=</option><replaceable>suffix</replaceable></arg> "
+"</group> "
+"<arg><option>--distribution=</option><replaceable>name</replaceable></arg> "
+"<arg><option>--force-distribution</option></arg> <group> "
+"<arg><option>-U</option> <replaceable>level</replaceable></arg> "
+"<arg><option>--urgency=</option><replaceable>level</replaceable></arg> "
+"</group> <arg><option>--[no-]full</option></arg> "
+"<arg><option>--[no-]meta</option></arg> "
+"<arg><option>--meta-closes=bug-close-tags</option></arg> "
+"<arg><option>--meta-closes-bugnum=bug-number-format</option></arg> "
+"<arg><option>--snapshot-number=</option><replaceable>expression</replaceable></arg> "
+"<arg><option>--id-length=</option><replaceable>number</replaceable></arg> "
+"<arg><option>--git-log=</option><replaceable>git-log-options</replaceable></arg> "
+"<arg><option>--[no-]git-author</option></arg> "
+"<arg><option>--[no-]multimaint</option></arg> "
+"<arg><option>--[no-]multimaint-merge</option></arg> "
+"<arg><option>--spawn-editor=[always|never|snapshot|release]</option></arg> "
+"<arg><option>--commit-msg=</option><replaceable>msg-format</replaceable></arg> "
+"<group> <arg><option>-c</option></arg> <arg><option>--commit</option></arg> "
+"</group> "
+"<arg><option>--customizations=</option><replaceable>customization-file</replaceable></arg> "
+"<arg><option>--postedit=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg "
+"rep='repeat'><option>--dch-opt=</option><replaceable>dch-options</replaceable></arg> "
+"<arg><option>--verbose</option></arg> <arg "
+"choice=\"plain\"><replaceable><optional>path1 "
+"path2</optional></replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:86
+msgid ""
+"&gbp-dch; reads git commit messages and generates the &debian; changelog "
+"from it. It starts at a given commit specified by the "
+"<option>--since</option> option up to the current "
+"<emphasis>HEAD</emphasis>. For each commit found it adds the commit message "
+"to the changelog. If <option>--since</option> is not given the commit to "
+"start from is determined by the following rules (first one matches):"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-dch.xml:96
+msgid "The start commit is read from the snapshot banner (see below for details)"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-dch.xml:98
+msgid ""
+"If the topmost version of the <filename>debian/changelog</filename> is "
+"alread tagged. Use the commit the tag points to as start commit."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-dch.xml:101
+msgid ""
+"The last commit that modified <filename>debian/changelog</filename> is used "
+"as start commit."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:105
+msgid "This is called automatic mode."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:108
+msgid ""
+"If the distribution of the topmost section in "
+"<filename>debian/changelog</filename> is <emphasis>UNRELEASED</emphasis>, "
+"the changelog entries will be inserted into this section. Otherwise a new "
+"section will be created."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:115
+msgid ""
+"If one ore more paths are given as arguments &gbp-dch; will only include "
+"changes in <filename>debian/changelog</filename> that affect these paths. "
+"E.g. using <emphasis>debian/</emphasis> is a good choice if upstream uses "
+"&git; and you don't want the upstream history to end up in "
+"<filename>debian/changelog</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:123
+msgid ""
+"To restrict the selected changes even further you can use use the "
+"<option>--git-log</option> option which is passed on verbatim to "
+"<command>git log</command>. E.g. by using "
+"<option>--git-log=</option><replaceable>\"--author=Foo Bar\"</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:130
+msgid ""
+"The above relies on the <option>--debian-branch</option> option pointing to "
+"the current branch and <option>--upstream-branch</option> pointing to the "
+"corresponding upstream branch in order to find the right merge points of "
+"these branches. Furthermore &gbp-dch; must be able to identify git tags from "
+"upstream and Debian version numbers. If you're not using the defaults check "
+"the <option>--upstream-tag</option> and <option>--debian-tag</option> "
+"options and make sure they match the tags created by e.g. &gbp-import-orig; "
+"(when using tarballs) or upstream's tagging pattern (when using upstream's "
+"git directly)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:143
+msgid ""
+"If not changelog exists yet it is created and the version number is derived "
+"from the last upstream tag if found."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:167
+msgid ""
+"Branch to determine the upstream version from. Default is "
+"<replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:183 manpages/gbp-pull.xml:82 manpages/gbp-push.xml:94
+#: manpages/gbp-rpm-ch.xml:99 manpages/gbp-tag.xml:143
+msgid "<option>--ignore-branch</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:187
+msgid ""
+"Don't check if the current branch matches "
+"<replaceable>debian-branch</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:193 manpages/gbp-import-dsc.xml:122
+msgid "<option>--debian-tag=</option><replaceable>tag-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:197
+msgid ""
+"Tag format used, when tagging debian versions, default is "
+"<replaceable>debian/%(version)s</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:203
+msgid "<option>--since=</option><replaceable>committish</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:207
+msgid ""
+"Start reading commit messages at <replaceable>committish</replaceable>. "
+"This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:214
+msgid "<option>--auto</option>, <option>-a</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:218
+msgid ""
+"This option is ignored for compatibility with older versions. It used to "
+"trigger automatic mode."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:224
+msgid "<option>--[no-]meta</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:227
+msgid ""
+"Parse meta tags like <option>Closes:</option>, <option>Thanks:</option> and "
+"<option>Gbp-Dch:</option>. See META TAGS below."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:234 manpages/gbp-pq.xml:236
+msgid "<option>--meta-closes=</option><replaceable>bug-close-tags</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:238
+msgid ""
+"What meta tags to look for to generate bug-closing changelog entries. The "
+"default is <literal>'Closes|LP'</literal> to support Debian and Launchpad."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:244 manpages/gbp-pq.xml:247
+msgid "<option>--meta-closes-bugnum=</option><replaceable>bug-number-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:248
+msgid ""
+"What regular expression should be used to parse out the bug number. The "
+"default is <literal>'(?:bug|issue)?\\#?\\s?\\d+'</literal>. Note: the regex "
+"should suppress all portions of the bug number that are not wanted using "
+"<literal>\"(?:)\"</literal>, see Python regex manual for details."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><screen>
+#: manpages/gbp-dch.xml:259
+#, no-wrap
+msgid ""
+" Possible Txt Match? Result\n"
+" ------------ ------ ------\n"
+" bug EX-12345 Y EX-12345\n"
+" ex-01273 Y ex-01273\n"
+" bug ex-1ab Y ex-1\n"
+" EX--12345 N"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:254
+msgid ""
+"Example: "
+"<option>--meta-closes-bugnum=</option><literal>\"(?:bug)?\\s*ex-\\d+\"</literal> "
+"would match all of the following: <placeholder type=\"screen\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:269 manpages/gbp-rpm-ch.xml:175
+msgid "<option>--[no-]full</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:273 manpages/gbp-rpm-ch.xml:179
+msgid "Include the full commit message in the changelog output."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:278
+msgid "<option>--snapshot</option>, <option>-S</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:282
+msgid ""
+"Create a snapshot release entry. It uses a snapshot release number which is "
+"smaller than the final release number and adds a warning banner to the "
+"changelog entry. The version number is being auto incremented with every new "
+"snapshot release."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:289
+msgid ""
+"The snapshot banner is also used by &gbp-dch; to determine which entries are "
+"already in the changelog. This prevents duplicated entries in "
+"<filename>debian/changelog</filename> when you did not commit the changelog "
+"yet."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:297
+msgid "<option>--snapshot-number=</option><replaceable>expression</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:301
+msgid "Python expression that gets eval()ed to the new snapshot number."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:306
+msgid "<option>--release</option>, <option>-R</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:310
+msgid ""
+"Remove any snapshot release banners and version suffixes (if any), set the "
+"current distribution to <replaceable>unstable</replaceable>, and open the "
+"changelog for final tweaking. This option can't be set via &gbp.conf;. It's "
+"usually used to finalize the changelog before making a release."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:320
+msgid ""
+"<option>--new-version=</option><replaceable>version</replaceable>, "
+"<option>-N</option> <replaceable>version</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:325
+msgid ""
+"Add a new changelog section with version "
+"<replaceable>newversion</replaceable>. Together with "
+"<option>--snapshot</option>, the snapshot number will be appended to "
+"<replaceable>newversion</replaceable>. This option can't be set via "
+"&gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:334
+msgid "<option>--team</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:338
+msgid ""
+"Create a Team upload changelog entry. This option can't be set via "
+"&gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:344
+msgid "<option>--bpo</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:348
+msgid ""
+"Increment the Debian release number for an upload to backports, and add a "
+"backport upload changelog comment. This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:355
+msgid "<option>--nmu</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:359
+msgid ""
+"Increment the Debian release number for a non-maintainer upload. This "
+"option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:365
+msgid "<option>--qa</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:369
+msgid ""
+"Increment the Debian release number for a Debian QA Team upload, and add a "
+"QA upload changelog comment. This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:376
+msgid "<option>--security</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:380
+msgid ""
+"Increment the Debian release number for a Debian Security Team "
+"non-maintainer upload, and add a \"Security Team upload\" changelog "
+"comment. This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:388
+msgid ""
+"<option>--local=</option><replaceable>suffix</replaceable>, "
+"<option>-l</option> <replaceable>suffix</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:393
+msgid ""
+"Increment the Debian release number for a local build using the specified "
+"suffix. This option can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:400
+msgid "<option>--distribution=</option><replaceable>name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:404
+msgid ""
+"Set the distribution field to <replaceable>name</replaceable>. This option "
+"can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:410
+msgid "<option>--force-distribution</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:414
+msgid ""
+"Force the distribution specified with <option>--distribution</option> to be "
+"used, even if it doesn't match the list of known distributions. This option "
+"can't be set via &gbp.conf;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:421
+msgid "<option>--urgency=</option><replaceable>level</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:425
+msgid "Set the urgency field to <replaceable>level</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:430
+msgid "<option>--git-log=</option><replaceable>git-log-options</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:434 manpages/gbp-rpm-ch.xml:188
+msgid "Options passed on verbatim to git-log(1)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:439 manpages/gbp-rpm-ch.xml:193
+msgid "<option>--id-length=</option><replaceable>N</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:443 manpages/gbp-rpm-ch.xml:197
+msgid ""
+"Include <replaceable>N</replaceable> digits of the commit id in the "
+"changelog entry. Default is to not include any commit ids at all."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:449
+msgid "<option>--ignore-regex=</option><replaceable>regex</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:453
+msgid ""
+"Ignore commit lines matching <replaceable>regex</replaceable> when "
+"generating the changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:459
+msgid "<option>--git-author</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:463
+msgid ""
+"Use user.name and user.email from <application>git-config</application>(1) "
+"for changelog trailer."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:469
+msgid "<option>--[no-]multimaint-merge</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:473
+msgid "Merge commits by maintainer."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:478
+msgid "<option>--spawn-editor=<replaceable>[always|never|snapshot|release]</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:482
+msgid ""
+"Whether to spawn an editor: always, never, when doing snapshots or when "
+"doing a release."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:488
+msgid "<option>--commit-msg=</option><replaceable>msg-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:492
+msgid ""
+"Use this format string for the commit message when committing the generated "
+"changelog file (when <option>--commit</option> is given). Default is "
+"<replaceable>Update changelog for %(version)s release</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:500
+msgid "<option>--commit</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:504
+msgid "Commit the generated changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:509
+msgid "<option>--customizations=</option><replaceable>customization-file</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:513
+msgid ""
+"Load Python code from <replaceable>customization-file</replaceable>. At the "
+"moment, the only useful thing the code can do is define a custom "
+"format_changelog_entry() function."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:520
+msgid "<option>--postedit=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:524
+msgid ""
+"Run<replaceable>COMMAND</replaceable> after changes to the changelog file "
+"have been finalized, That is, after dch has been run and possible text "
+"editor has been exited, but, before changes are (possibly) committed to git."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:532
+msgid "<option>--dch-opt=</option><replaceable>dch-option</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:536
+msgid ""
+"Pass option to &dch; verbatim. Note that &gbp-dch; invokes &dch; multiple "
+"times and the option is passed to all invocations so not all &dch; options "
+"make sense here. Options may also conflict with options picked by &gbp-dch;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-dch.xml:547
+msgid "Snapshot mode"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:549
+msgid ""
+"Snapshot mode can be used for quick test and install cycles without having "
+"to worry about version numbers or changelog entries."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:553
+msgid ""
+"When using <option>--snapshot</option> or <option>-S</option>, &gbp-dch; "
+"uses a pseudo header in the Debian changelog to remember the last git commit "
+"it added a changelog entry for. It also sets a version number ending in "
+"<replaceable>~<snaspshotnumber>.gbp<commitid></replaceable>. It "
+"automatically increments the snapshot number on subsequent invocations of "
+"&gbp-dch; <option>-S</option> so that later snapshots automatically have a "
+"higher version number. To leave snapshot mode, invoke &gbp-dch; with the "
+"<option>--release</option> option. This removes the pseudo header and "
+"unmangles the version number so the released version has a higher version "
+"number than the snapshots."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-dch.xml:567 manpages/gbp-pq-rpm.xml:204
+#: manpages/gbp-rpm-ch.xml:280
+msgid "META TAGS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:569
+msgid ""
+"Additional to the above options, the formatting of the commit message in "
+"<filename>debian/changelog</filename> can be modified by special tags "
+"(called Meta Tags) given in the git commit message. Meta Tag processing can "
+"be activated via the <option>--meta</option> option. The tags must start at "
+"the first column of a commit message but can appear on any line. They are "
+"of the form <option>Tagname</option>: "
+"<replaceable>value</replaceable>. Valid Meta Tags are:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:581
+msgid "<option>Gbp-Dch</option>: <replaceable>action</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:585
+msgid ""
+"Supported actions are: <replaceable>Ignore</replaceable> which will ignore "
+"this commit when generating <filename>debian/changelog</filename>, "
+"<replaceable>Short</replaceable> which will only use the description (the "
+"first line) of the commit message when generating the changelog entry "
+"(useful when <option>--full</option> is given), and "
+"<replaceable>Full</replaceable> which will use the full commit message when "
+"generating the changelog entry (useful when <option>--full</option> is not "
+"given)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:597
+msgid ""
+"In addition to <option>Gbp-Dch</option>, the deprecated "
+"<option>Git-Dch</option> is still supported."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:603
+msgid "<option>Thanks</option>: <replaceable>msg</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:607
+msgid "Add a thanks message after the commit message."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-dch.xml:612
+msgid "<option>Closes</option>: <replaceable>bugnumber</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-dch.xml:616
+msgid ""
+"Indicate in the <filename>debian/changelog</filename> that the bug was "
+"closed by this commit. See the <option>--meta-closes</option> on how to "
+"extend this for other bugtrackers."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:624 manpages/gbp-rpm-ch.xml:318
+msgid "The following git commit message:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-dch.xml:627
+#, no-wrap
+msgid ""
+" Document meta tags\n"
+"\n"
+" so one doesn't have to consult the manual\n"
+"\n"
+" Gbp-Dch: Short\n"
+" Closes: #636088\n"
+" Thanks: Raphaël Hertzog for the suggestion"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:635
+msgid "Results in this <filename>debian/changelog</filename> entry:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-dch.xml:638
+#, no-wrap
+msgid ""
+" * Document meta tags.\n"
+" Thanks to Raphaël Hertzog for the suggestion (Closes: #636088)"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-dch.xml:647
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref "
+"linkend=\"man.gbp.import.dsc\"/>, <xref linkend=\"man.gbp.import.dscs\"/>, "
+"<xref linkend=\"man.gbp.import.orig\"/>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common; <ulink url=\"https://honk.sigxcpu.org/cl2vcs\"> "
+"<citetitle>Cl2vcs</citetitle></ulink>,"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-export-orig.xml:11 manpages/gbp-export-orig.xml:15
+msgid "gbp-export-orig"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-export-orig.xml:16
+msgid "Export upstream tarballs from a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-export-orig.xml:20
+msgid ""
+"&gbp-export-orig; <arg><option>--verbose</option></arg> "
+"<arg><option>--color=</option>[auto|on|off]</arg> "
+"<arg><option>--color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>BRANCH_NAME</replaceable></arg> "
+"<arg><option>--[no-]submodules</option></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--upstream-tree=</option><replaceable>[TAG|BRANCH|TREEISH]</replaceable></arg> "
+"<arg><option>--tarball-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--force-create</option></arg> "
+"<arg><option>--compression=</option><replaceable>TYPE</replaceable></arg> "
+"<arg><option>--compression-level=</option><replaceable>LEVEL</replaceable></arg> "
+"<arg "
+"rep='repeat'><option>--component=</option><replaceable>component</replaceable></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--upstream-signatures=</option>[auto|on|off]</arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-export-orig.xml:40
+msgid ""
+"&gbp-export-orig; is used to export upstream tarballs from a &git; "
+"repository. Usually upstream tarballs are created by &gbp-buildpackage; when "
+"needed but if you don't want to perform a build you can use this command."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:50
+msgid "<option>--verbose</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:54
+msgid "verbose execution"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:59
+msgid "<option>--color=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:68
+msgid "<option>--color-scheme</option>=<replaceable>COLOR_SCHEME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:72
+msgid ""
+"Colors to use in output (when color is enabled). The format for COLOR_SCHEME "
+"is '<debug>:<info>:<warning>:<error>'. Numerical "
+"values and color names are accepted, empty fields imply the default "
+"color. For example --color-scheme='cyan:34::' would show debug messages in "
+"cyan, info messages in blue and other messages in default (i.e. warning and "
+"error messages in red)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:83
+msgid "<option>--upstream-branch</option>=<replaceable>BRANCH_NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:87
+msgid ""
+"Branch to build the orig tarball from if <option>--upstream-tree</option> is "
+"set to <replaceable>BRANCH</replaceable>. Default is "
+"<replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:95
+msgid "<option>--[no-]submodules</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:104 manpages/gbp-import-srpm.xml:141
+#: manpages/gbp-pq-rpm.xml:153 manpages/gbp-pq.xml:273
+#: manpages/gbp-push.xml:131
+msgid "<option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:114
+msgid "<option>--force-create</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:124
+msgid "<option>--upstream-tree=</option><replaceable>[BRANCH|TAG|TREEISH]</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:128
+msgid ""
+"How to find the upstream sources used to generate the tarball. "
+"<replaceable>TAG</replaceable> (the default) looks at a tag corresponding to "
+"the version in the changelog. <replaceable>BRANCH</replaceable> looks at the "
+"upstream branch given via the <option>--upstream-branch</option> option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:138
+msgid ""
+"This doesn't have any effect if <option>--pristine-tar</option> is being "
+"used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:144
+msgid "<option>--tarball-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:148
+msgid ""
+"Search for original tarballs in <replaceable>DIRECTORY</replaceable> instead "
+"of generating them. <replaceable>DIRECTORY</replaceable> can contain a "
+"version format substitution pattern, eg: "
+"<replaceable>foo-%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:156
+msgid "<option>--compression=</option><replaceable>TYPE</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:171
+msgid "<option>--compression-level=</option><replaceable>LEVEL</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:181 manpages/gbp-import-orig.xml:246
+#: manpages/gbp-pristine-tar.xml:60
+msgid "<option>--component=</option><replaceable>COMPONENT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:185
+msgid ""
+"When generating tarballs create an additional original tarball of directory "
+"<replaceable>COMPONENT</replaceable> in the source tree. Using additional "
+"original tarballs is a feature of the 3.0 (quilt) source format. See the "
+"<command>dpkg-source</command> manpage for details. Note that the "
+"<replaceable>--pristine-tar-commit</replaceable> option is currently "
+"incompatible with this option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-export-orig.xml:211 manpages/gbp-import-orig.xml:393
+msgid "<option>--upstream-signatures=</option>[auto|on|off]"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><varlistentry><listitem><para>
+#: manpages/gbp-export-orig.xml:215
+msgid "Whether to export with upstream signatures."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-export-orig.xml:223
+msgid ""
+"Generate an upstream tarball of the version currently referenced in the "
+"changelog using &pristine-tar;:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-export-orig.xml:227
+#, no-wrap
+msgid ""
+" &gbp-export-orig; --pristine-tar\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-export-orig.xml:230
+msgid ""
+"Same as above but generate and additional tarball for directory "
+"<filename>foo</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-export-orig.xml:234
+#, no-wrap
+msgid ""
+" &gbp-export-orig; --pristine-tar --component=foo\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-export-orig.xml:243
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref "
+"linkend=\"man.gbp.import.orig\"/>, <xref linkend=\"man.gbp.pristine.tar\"/>, "
+"<xref linkend=\"man.gbp.conf\"/>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-dscs.xml:12 manpages/gbp-import-dscs.xml:16
+msgid "gbp-import-dscs"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-dscs.xml:17
+msgid "Import multiple versions of a Debian source packages into a Git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-dscs.xml:21
+msgid ""
+"&gbp-import-dscs; <arg><option>options</option></arg> <arg><option>gbp "
+"import-dsc options</option></arg> <arg "
+"choice=\"plain\"><replaceable>pkg_1.dsc</replaceable></arg> <arg "
+"choice=\"plain\"><replaceable>pkg_2.dsc</replaceable></arg> <arg "
+"choice=\"plain\"><replaceable>...</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><para>
+#: manpages/gbp-import-dscs.xml:29
+msgid "or"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-dscs.xml:32
+msgid ""
+"&gbp-import-dscs; <arg choice=\"req\">--debsnap</arg> "
+"<arg><option>options</option></arg> <arg><option>gbp import-dsc "
+"options</option></arg> <arg "
+"choice=\"req\"><replaceable>package</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dscs.xml:42
+msgid ""
+"&gbp-import-dscs; imports several versions of a Debian source package into a "
+"&git; repository. To do so, it sorts the packages by their versions first, "
+"and then imports them via calling &gbp-import-dsc; on each package."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dscs.xml:48
+msgid ""
+"If the current directory isn't a &git; repository already, the repository is "
+"created in a subdir of the current working directory, named after the first "
+"imported package, otherwise the &git; repository in the current working "
+"directory is being used. This allows for incremental imports."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dscs.xml:58
+msgid "<option>--debsnap</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dscs.xml:61
+msgid "Fetch snapshots from snapshots.debian.org using debsnap."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dscs.xml:65
+msgid "<option>--ignore-repo-config</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dscs.xml:68
+msgid ""
+"Ignore <filename>gbp.conf</filename> files stored in the git repository "
+"itself. This can be useful to ignore branch information and other options "
+"shipped in the package source."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dscs.xml:75
+msgid "All other options are passed on verbatim to &gbp-import-dsc;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dscs.xml:82
+msgid ""
+"<xref linkend=\"man.gbp.import.dsc\"/>, <xref "
+"linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.import.orig\"/>, "
+"<xref linkend=\"man.gbp.dch\"/>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-dsc.xml:12 manpages/gbp-import-dsc.xml:16
+msgid "gbp-import-dsc"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-dsc.xml:17
+msgid "Import &debian; packages into a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-dsc.xml:21
+msgid ""
+"&gbp-import-dsc; &man.common.options.synopsis; "
+"<arg><option>--allow-same-versions</option></arg> "
+"<arg><option>--author-date-is-committer-date</option></arg> "
+"<arg><option>--author-is-committer</option></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg "
+"rep='repeat'><option>--filter=</option><replaceable>pattern</replaceable></arg> "
+"<arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg> "
+"<arg><option>--[no-]create-missing-branches</option></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--[no-]sign-tags</option></arg> "
+"<arg><option>--skip-debian-tag</option></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--upstream-vcs-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg> "
+"<arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg> <arg "
+"choice=\"plain\"><replaceable>debian-source.dsc</replaceable></arg> <arg "
+"choice=\"opt\"><replaceable>target</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-dsc.xml:43
+msgid ""
+"&gbp-import-dsc; <arg><option>options</option></arg> "
+"<arg><option>--[no-]allow-unauthenticated</option></arg> <group "
+"choice=\"plain\"> <arg><replaceable>URL</replaceable></arg> </group> <arg "
+"choice=\"opt\"><replaceable>target</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:55
+msgid ""
+"&gbp-import-dsc; imports a &debian; source package into a &git; repository, "
+"notes the package version in the commit logs, and commits the change. All "
+"information, including package name, version, &debian; modifications and "
+"upstream source, is automatically detected from the source package. After "
+"import the repository can be used with the other &gbp; tools."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:62
+msgid ""
+"If the command is run from within an existing &git; repository, it will "
+"import into it; if not, a new repository named as the Debian source package "
+"is created. You can override the location of the new repository by "
+"specifying the optional <replaceable>target</replaceable> argument."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:68
+msgid ""
+"When given a <replaceable>URL</replaceable> &gbp-import-dsc; will download "
+"the source package prior to importing it. &dget; is used for all schemes "
+"except for the special scheme <replaceable>apt:///</replaceable> which uses "
+"&apt-get; (and therefore needs <replaceable>deb-src</replaceable> entries in "
+"your <filename>/etc/apt/sources.list</filename>). The later can be "
+"abbreviated by using the pseudo URL <replaceable>apt:</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:98
+msgid ""
+"The branch in the &git; repository the debian sources are put onto. Default "
+"is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:104 manpages/gbp-import-orig.xml:195
+#: manpages/gbp-import-ref.xml:135 manpages/gbp-import-srpm.xml:104
+#: manpages/gbp-tag.xml:83
+msgid "<option>--[no-]sign-tags</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:108
+msgid "GPG sign all created tags"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:113 manpages/gbp-import-orig.xml:204
+#: manpages/gbp-import-ref.xml:144
+msgid "<option>--keyid=</option><replaceable>gpg-keyid</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:132 manpages/gbp-import-orig.xml:214
+#: manpages/gbp-import-ref.xml:100 manpages/gbp-pristine-tar.xml:50
+msgid "<option>--upstream-tag=</option><replaceable>tag-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:136 manpages/gbp-import-orig.xml:218
+#: manpages/gbp-import-srpm.xml:145
+msgid ""
+"Use this tag format when tagging upstream versions, default is "
+"<replaceable>upstream/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:142 manpages/gbp-import-orig.xml:182
+msgid "<option>--upstream-vcs-tag</option>=<replaceable>tag-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:146 manpages/gbp-import-orig.xml:186
+msgid ""
+"Add <replaceable>tag-format</replaceable> as additional parent to the commit "
+"of the upstream tarball. Useful when upstream uses git and you want to link "
+"to its revision history. The <replaceable>tag-format</replaceable> can be a "
+"pattern similar to what <option>--upstream-tag</option> supports."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:153
+msgid ""
+"The default is to not add upstream tags as additional parents since this "
+"requires additional setup to have the upstream sources in the same "
+"repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:160
+msgid "<option>--skip-debian-tag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:164
+msgid ""
+"Don't create &debian; tag after importing the &debian; patch. This can be "
+"useful if you already created a package but want to further work on it after "
+"importing it into git."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:171 manpages/gbp-import-orig.xml:235
+msgid "<option>--filter=</option><replaceable>pattern</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:175
+msgid ""
+"Filter out files glob-matching "
+"<option><replaceable>pattern</replaceable></option> from upstream tarballs "
+"and the debian tarball of 3.0(quilt) packages. Note that the "
+"<emphasis>.diff.gz</emphasis> of 1.0 source format packages is currently not "
+"filtered."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:182
+msgid "This option can be given multiple times."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:191 manpages/gbp-import-srpm.xml:186
+msgid "Generate pristine-tar delta file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:196
+msgid "<option>--allow-unauthenticated</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:200
+msgid ""
+"Whether to skip signature verification on downloads. Passed on verbatim to "
+"&dget; and &apt-get; respectively. Use with care."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:207 manpages/gbp-import-srpm.xml:191
+msgid "<option>--allow-same-version</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:211
+msgid "Allow one to import a package with the same debian version."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:216 manpages/gbp-import-srpm.xml:202
+msgid "<option>--author-is-committer</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:220
+msgid ""
+"When importing the &debian; patch, use the author identity as committer "
+"identity."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:226
+msgid "<option>--author-date-is-committer-date</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:230
+msgid "When importing the &debian; patch, use the author date as committer date."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><warning><para>
+#: manpages/gbp-import-dsc.xml:234
+msgid ""
+"&git; will subtly misbehave if the committer date of a commit is not later "
+"than or equal to all its parents."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-dsc.xml:242 manpages/gbp-import-srpm.xml:212
+msgid "<option>--[no-]create-missing-branches</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:246
+msgid "Create upstream and debian branch if missing."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:254 manpages/gbp-import-srpm.xml:246
+msgid ""
+"When set to <option>DEBIAN</option> use the <envar>DEBUSER</envar> "
+"environment variable to set the user.name &git; configuration otherwise use "
+"&git;'s defaults. Only affects newly created repos."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-dsc.xml:265 manpages/gbp-import-srpm.xml:257
+msgid ""
+"When set to <option>DEBIAN</option> use the <envar>DEBEMAIL</envar> "
+"environment variable to set the user.email &git; configuration otherwise use "
+"&git;'s defaults. Only affects newly created repos."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:280
+msgid "Download and import a source package from a URL:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-dsc.xml:283
+#, no-wrap
+msgid ""
+" &gbp-import-dsc; "
+"http://http.debian.net/debian/pool/main/h/hello/hello_2.10-1.dsc\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:286
+msgid ""
+"Download and import a source package via <command>apt-get source</command> "
+"from unstable:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-dsc.xml:290
+#, no-wrap
+msgid ""
+" &gbp-import-dsc; apt:hello/sid\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:293
+msgid "Import a source package in the local file system:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-dsc.xml:296
+#, no-wrap
+msgid ""
+" &gbp-import-dsc; ../hello_2.10-1.dsc\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-dsc.xml:303
+msgid ""
+"<xref linkend=\"man.gbp.import.dscs\"/>, <xref "
+"linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.import.orig\"/>, "
+"<xref linkend=\"man.gbp.dch\"/>, <citerefentry> "
+"<refentrytitle>apt-get</refentrytitle> <manvolnum>1</manvolnum> "
+"</citerefentry>, <citerefentry> <refentrytitle>sources.list</refentrytitle> "
+"<manvolnum>5</manvolnum> </citerefentry>, <citerefentry> "
+"<refentrytitle>dget</refentrytitle> <manvolnum>1</manvolnum> "
+"</citerefentry>, <xref linkend=\"man.gbp.conf\"/>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-orig.xml:12 manpages/gbp-import-orig.xml:16
+msgid "gbp-import-orig"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-orig.xml:17
+msgid "Import an upstream source into a git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-orig.xml:21
+msgid ""
+"&gbp-import-orig; &man.common.options.synopsis; "
+"<arg><option>--upstream-version=</option><replaceable>version</replaceable></arg> "
+"<arg><option>--[no-]merge</option></arg> "
+"<arg><option>--merge-mode=</option><replaceable>[auto|merge|replace]</replaceable></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--upstream-vcs-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--[no-]sign-tags</option></arg> "
+"<arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg "
+"rep='repeat'><option>--filter=</option><replaceable>pattern</replaceable></arg> "
+"<arg "
+"rep='repeat'><option>--component=</option><replaceable>component</replaceable></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--[no-]filter-pristine-tar</option></arg> "
+"<arg><option>--[no-]symlink-orig</option></arg> "
+"<arg><option>--postimport=cmd</option></arg> "
+"<arg><option>--postunpack=cmd</option></arg> "
+"<arg><option>--[no-]interactive</option></arg> "
+"<arg><option>--[no-]rollback</option></arg> "
+"<arg><option>--upstream-signatures=</option>[auto|on|off]</arg> <group "
+"choice=\"plain\"> <arg "
+"choice=\"plain\"><replaceable>filename</replaceable></arg> <arg "
+"choice=\"plain\"><replaceable>url</replaceable></arg> "
+"<arg><option>--uscan</option></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:53
+msgid ""
+"&gbp-import-orig; imports upstream sources into a &git; repository. It can "
+"import from three sources:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-import-orig.xml:59
+msgid ""
+"<replaceable>filename</replaceable>: A file in the local file system. Gzip, "
+"bzip2, lzma and xz compressed tar archives, zip archives and already "
+"unpacked source trees are supported."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-import-orig.xml:67
+msgid ""
+"<replaceable>url</replaceable>: The tarball is downloaded from a "
+"<replaceable>http</replaceable> or <replaceable>https</replaceable> "
+"<replaceable>url</replaceable>. This needs the python3-request package "
+"installed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><orderedlist><listitem><para>
+#: manpages/gbp-import-orig.xml:75
+msgid ""
+"<option>--uscan</option>: The latest upstream or specified version is "
+"fetched via &uscan; relying on <filename>debian/watch</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:81
+msgid ""
+"If the tarballs name is already of the form "
+"<replaceable>package-name_version.orig.tar.gz</replaceable>, the version "
+"information is determined from the tarball's filename, otherwise it can be "
+"given on the command line via <option>--upstream-version</option>. If the "
+"source package name or version can't be determined, &gbp-import-orig; will "
+"prompt for it unless <option>--no-interactive</option> is given."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:90
+msgid ""
+"The sources are placed on the upstream branch (default: "
+"<replaceable>upstream</replaceable>), tagged and merged onto the debian "
+"branch (default: <replaceable>master</replaceable>). This is either done "
+"using plain <command>git merge</command> or by creating a new tree that "
+"consists of the new upstream version plus the <filename>debian/</filename> "
+"directory. The later is used for source format 3.0 (quilt) packages since "
+"direct modifications of the upstream sources are not allowed in that format "
+"and so a 1:1 replacement of the upstream sources is almost always "
+"desired. It can be tweaked via the <option>--merge-mode</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:102
+msgid ""
+"In case of an error &gbp-import-orig; will rollback (undo) all changes it "
+"has done to the repository (see the <option>--rollback</option> option)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:113 manpages/gbp-import-ref.xml:51
+msgid "<option>--upstream-version</option>=<replaceable>version</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:114 manpages/gbp-import-ref.xml:52
+msgid "<option>-u</option><replaceable>version</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:117
+msgid ""
+"The upstream version number. With <option>--uscan</option>, passed to uscan "
+"as <option>--download-debversion</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:123
+msgid "<option>--[no-]merge</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:126
+msgid "Merge the upstream branch to the &debian; branch after import"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:131 manpages/gbp-import-ref.xml:61
+msgid "<option>--merge-mode=</option><replaceable>[auto|merge|replace]</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:134
+msgid ""
+"How to fold the newly imported upstream source to the &debian; packaging "
+"branch after import."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:138 manpages/gbp-import-ref.xml:68
+msgid ""
+"<replaceable>merge</replaceable> does a &git; <command>merge</command> "
+"leaving you on your own in case of merge conflict resolution."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:143 manpages/gbp-import-ref.xml:73
+msgid ""
+"<replaceable>replace</replaceable> mode on the other hand makes the head of "
+"the &debian; packaging branch identical to the newly imported tree but "
+"preserves the content of the <filename>debian/</filename> directory while "
+"keeping the current head as well as the newly imported tree as parents of "
+"the generated commit. This is similar to a <option>theirs</option> merge "
+"strategy while preserving <filename>debian/</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:153 manpages/gbp-import-ref.xml:83
+msgid ""
+"The default is <replaceable>auto</replaceable> which uses "
+"<replaceable>replace</replaceable> for 3.0 (quilt) packages and "
+"<replaceable>merge</replaceable> otherwise."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:174
+msgid ""
+"The branch in the &git; repository the &debian; package is being developed "
+"on, default is <replaceable>master</replaceable>. After importing the new "
+"sources on the upstream branch, &gbp-import-orig; will try to merge the new "
+"version onto this branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:208 manpages/gbp-import-ref.xml:148
+msgid ""
+"Use this <option><replaceable>keyid</replaceable></option> for gpg signing "
+"tags."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:224 manpages/gbp-import-ref.xml:154
+msgid "<option>--import-msg=</option><replaceable>msg-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:228 manpages/gbp-import-ref.xml:158
+msgid ""
+"Use this format string for the commit message when importing upstream "
+"versions, default is <replaceable>New upstream version "
+"%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:239
+msgid ""
+"Filter out files glob-matching "
+"<option><replaceable>pattern</replaceable></option>. This option can be "
+"given multiple times."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:250
+msgid ""
+"When importing the upstream tarball also look for an additional tarball with "
+"component name <replaceable>COMPONENT</replaceable>. E.g. in "
+"<filename>hello-debhelper_1.0.orig-foo.tar.gz</filename> the component would "
+"be <replaceable>foo</replaceable>. The additional tarball is expected to be "
+"in the same directory than the upstream tarball and to use the same "
+"compression type."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:258 manpages/gbp-pristine-tar.xml:73
+msgid ""
+"Using additional original tarballs is a feature of the 3.0 (quilt) source "
+"format. See the <command>dpkg-source</command> manpage for details. This is "
+"currently considered an experimental feature and might change incompatibly."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:267
+msgid "<option>--[no-]pristine-tar</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:271
+msgid "Generate <command>pristine-tar</command> delta file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:276
+msgid "<option>--[no-]filter-pristine-tar</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:280
+msgid ""
+"If using a filter, also filter the files out of the tarball passed to "
+"<command>pristine-tar</command>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:286
+msgid "<option>--[no-]symlink-orig</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:289
+msgid ""
+"Whether to create and keep a symlink from the upstream tarball to a &debian; "
+"policy conformant upstream tarball name located in <filename "
+"class=\"directory\">../</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:294
+msgid ""
+"This is a good idea if not using <command>pristine-tar</command> since it "
+"avoids creating a new tarball with a different md5sum."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:300 manpages/gbp-import-ref.xml:165
+msgid "<option>--postimport=<replaceable>cmd</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:307 manpages/gbp-import-ref.xml:172
+msgid "<envar>GBP_BRANCH</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:309 manpages/gbp-import-ref.xml:174
+msgid "The name of the Debian packaging branch"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:313 manpages/gbp-import-ref.xml:178
+msgid "<envar>GBP_TAG</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:315 manpages/gbp-import-ref.xml:180
+msgid "The name of the just created upstream tag"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:319 manpages/gbp-import-ref.xml:184
+msgid "<envar>GBP_UPSTREAM_VERSION</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:321 manpages/gbp-import-ref.xml:186
+msgid "The just imported upstream version"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:325 manpages/gbp-import-ref.xml:190
+msgid "<envar>GBP_DEBIAN_VERSION</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:327 manpages/gbp-import-ref.xml:192
+msgid "The Debian version of the package with a Debian revision of '-1'"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:303 manpages/gbp-import-ref.xml:168
+msgid ""
+"Run <replaceable>cmd</replaceable> after the import. The hook gets the "
+"following environment variables passed: <placeholder type=\"variablelist\" "
+"id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:336
+msgid "<option>--postunpack=<replaceable>cmd</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:344
+msgid "<envar>GBP_TMP_DIR</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:346
+msgid "The temporary directory the tarballs are unapcked into."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:350
+msgid "<envar>GBP_SOURCES_DIR</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:352
+msgid "The temporary directory where the unpacked sources are."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:356
+msgid "<envar>GBP_GIT_DIR</envar>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:358
+msgid "The directory of the git repository where the tarball will be imported into."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:339
+msgid ""
+"Run <replaceable>cmd</replaceable> after the import. This can be useful to "
+"e.g. convert or remove certain files prior to the import. The hook gets "
+"passed the following environment variables: <placeholder "
+"type=\"variablelist\" id=\"0\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:367
+msgid "<option>--uscan</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:370
+msgid ""
+"Use &uscan; to fetch new upstream version. The version can be specified with "
+"<option>--upstream-version</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:376
+msgid "<option>--[no-]interactive</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:379
+msgid "Run command interactively, i.e. ask package name and version if needed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-orig.xml:385 manpages/gbp-import-ref.xml:201
+msgid "<option>--[no-]rollback</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:388 manpages/gbp-import-ref.xml:204
+msgid "Rollback changes in case of an error."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-orig.xml:396
+msgid ""
+"Whether upstream signatures should be imported as well (when using "
+"pristine-tar). <emphasis>no</emphasis> turns this off completely while "
+"<emphasis>yes</emphasis> always tries to import a signature (which can be "
+"useful if you want to fail if e.g. &uscan; did not fetch a signature). The "
+"default <emphasis>auto</emphasis> means to import a signature file if "
+"present but do nothing otherwise."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:411
+msgid ""
+"Download and import a new upstream version using the information from "
+"<filename>debian/watch</filename>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-orig.xml:414
+#, no-wrap
+msgid " &gbp-import-orig; --uscan"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:416
+msgid "Fetch tarball from an URL"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-orig.xml:419
+#, no-wrap
+msgid ""
+" &gbp-import-orig; "
+"https://debian.example.com/sid/upstream-tarball-0.1.tar.gz"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:421
+msgid "Import a local tarball"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-orig.xml:424
+#, no-wrap
+msgid " &gbp-import-orig; ../upstream-tarball-0.1.tar.gz"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-orig.xml:432 manpages/gbp-import-ref.xml:236
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref "
+"linkend=\"man.gbp.import.dsc\"/>, <xref linkend=\"man.gbp.import.dscs\"/>, "
+"<xref linkend=\"man.gbp.dch\"/>, <xref linkend=\"man.gbp.conf\"/>, "
+"<citerefentry> <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> "
+"</citerefentry>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-ref.xml:12 manpages/gbp-import-ref.xml:16
+msgid "gbp-import-ref"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-ref.xml:17
+msgid "Update upstream sources when using &git; only"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-ref.xml:21
+msgid ""
+"&gbp-import-ref; &man.common.options.synopsis; "
+"<arg><option>--upstream-version=</option><replaceable>version</replaceable></arg> "
+"<arg><option>--merge-mode=</option><replaceable>[auto|merge|replace]</replaceable></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag_format</replaceable></arg> "
+"<arg><option>--upstream-tree=</option><replaceable>[BRANCH|VERSION|commit-id]</replaceable></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--[no-]sign-tags</option></arg> "
+"<arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg> "
+"<arg><option>--postimport=cmd</option></arg> "
+"<arg><option>--[no-]rollback</option></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-ref.xml:39
+msgid ""
+"&gbp-import-ref; merges upstream git commits onto your &debian-branch; You "
+"can either specify a branch to merge, give an upstream version or specify "
+"the commit id directly. If no tag exists for the imported commit it will be "
+"automatically created."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:55
+msgid ""
+"The upstream version to merge. The upstream tag to use will be determined "
+"via the <option>--upstream-tag</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:64
+msgid "How to fold the upstream commits onto the &debian; packaging branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:94
+msgid ""
+"The branch in the &git; repository the upstream sources are on. Default is "
+"<replaceable>upstream</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:104
+msgid ""
+"Use this tag format when looking up upstream tags, default is "
+"<replaceable>upstream/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-ref.xml:110
+msgid "<option>--upstream-tree=</option><replaceable>[BRANCH|VERSION|commit-id]</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:114
+msgid ""
+"What to merge into the &debian-branch;. <replaceable>BRANCH</replaceable> "
+"merges from the upstream branch. <replaceable>VERSION</replaceable> (the "
+"default) looks for a tag determined from the given upstream version number "
+"via the <option>--upstream-version</option> option."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-ref.xml:120
+msgid "Other values are interpreted as git commit id to merge from."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-ref.xml:213
+msgid ""
+"Merge commits from the &upstream-branch; into the &debian-branch; creating a "
+"tag for the version <replaceable>0.0~git20180524</replaceable>:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-ref.xml:217
+#, no-wrap
+msgid " &gbp-import-ref; --upstream-tree=BRANCH -u0.0~git20180524"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-ref.xml:219
+msgid ""
+"Merge commits from the the tag corresponding to version "
+"<replaceable>1.0</replaceable>:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-ref.xml:222
+#, no-wrap
+msgid " &gbp-import-ref; --upstream-tree=VERSION -u1.0"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-ref.xml:224
+msgid ""
+"Merge commits given by a SHA1 creating a tag for the version "
+"<replaceable>0.0~git20180524</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-import-ref.xml:228
+#, no-wrap
+msgid " &gbp-import-ref; --upstream-tree=c4398912c -u0.0~git20180524"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-import-srpm.xml:12 manpages/gbp-import-srpm.xml:16
+msgid "gbp-import-srpm"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-import-srpm.xml:17
+msgid "Import source RPM packages into a Git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-srpm.xml:21
+msgid ""
+"&gbp-import-srpm; &man.common.options.synopsis; "
+"<arg><option>--vendor</option>=<replaceable>VENDOR</replaceable></arg> "
+"<arg><option>--allow-same-versions</option></arg> "
+"<arg><option>--author-is-committer</option></arg> "
+"<arg><option>--packaging-branch=</option><replaceable>BRANCH-NAME</replaceable></arg> "
+"<arg><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg> "
+"<arg><option>--skip-packaging-tag</option></arg> "
+"<arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--filter=</option><replaceable>PATTERN</replaceable></arg> "
+"<arg><option>--keyid=</option><replaceable>GPG-KEYID</replaceable></arg> "
+"<arg><option>--[no-]create-missing-branches</option></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--[no-]sign-tags</option></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>BRANCH-NAME</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg> "
+"<arg><option>--upstream-vcs-tag=</option><replaceable>TAG-FORMAT</replaceable></arg> "
+"<arg><option>--native</option></arg> "
+"<arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg> "
+"<arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg> "
+"<group choice=\"plain\"> <arg><replaceable>SRPM</replaceable></arg> "
+"<arg><replaceable>DIRECTORY</replaceable></arg> </group> <arg "
+"choice=\"opt\"><replaceable>target</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-import-srpm.xml:48
+msgid ""
+"&gbp-import-srpm; <arg><option>options</option></arg> <group "
+"choice=\"plain\"> <arg><replaceable>URL</replaceable></arg> </group> <arg "
+"choice=\"opt\"><replaceable>target</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-srpm.xml:59
+msgid ""
+"&gbp-import-srpm; imports an RPM source package into a &git; repository, "
+"notes the package version in the commit logs, and commits the change. All "
+"information, including package name, version and upstream source is "
+"automatically detected from the source package but you can override the "
+"location of the new repository by optionally specifying the "
+"<replaceable>target</replaceable> argument. The tool supports importing both "
+"archived (src.rpm files) or unpacked (directory) source RPMs. It also "
+"imports from http(s)-URLs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:75 manpages/gbp-rpm-ch.xml:80
+msgid "<option>--vendor</option>=<replaceable>VENDOR</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:84
+msgid "<option>--upstream-branch</option>=<replaceable>BRANCH-NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:94 manpages/gbp-rpm-ch.xml:89
+msgid "<option>--packaging-branch</option>=<replaceable>BRANCH-NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:98
+msgid ""
+"The branch in the &git; repository the packaging files are put onto. Default "
+"is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:113 manpages/gbp-tag.xml:92
+msgid "<option>--keyid=</option><replaceable>GPG-KEYID</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:122 manpages/gbp-rpm-ch.xml:109
+msgid "<option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:126
+msgid ""
+"Use this tag format when tagging released versions, default is "
+"<replaceable>%(vendor)s/%(version)s</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:132
+msgid "<option>--skip-packaging-tag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:136
+msgid "Do not create packaging tag after importing the packaging files."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:151
+msgid "<option>--upstream-vcs-tag</option>=<replaceable>TAG-NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:155
+msgid ""
+"Add <replaceable>TAG-FORMAT</replaceable> as an additional parent of the "
+"commit of the upstream tarball. Useful when upstream uses git and you want "
+"to link to its revision history. <replaceable>TAG-FORMAT</replaceable> can "
+"be a pattern similar to what <option>--upstream-tag</option> supports."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:168
+msgid "Subdirectory where to put the RPM packaging files."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:173
+msgid "<option>--filter=</option><replaceable>PATTERN</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:177
+msgid "Filter out files glob-matching pattern. Can be given multiple times."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:195
+msgid ""
+"Allow one to re-import a package with an already existing version. This "
+"will not re-import the upstream sources - only packaging files will be "
+"re-imported."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:206
+msgid ""
+"Use the author identity as the committer when importing upstream sources and "
+"packaging files."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:216
+msgid "Create missing upstream and/or packaging branch if missing."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:221
+msgid "<option>--orphan-packaging</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:225
+msgid ""
+"Import packaging files into an orphan branch that will not be based on the "
+"upstream branch. Useful if you want to maintain (non-native) package using "
+"the 'orphan-packaging' model. This option have no effect if "
+"<option>--native</option> is used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-import-srpm.xml:233
+msgid "<option>--native</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-import-srpm.xml:237
+msgid ""
+"Treat the package as native package. No separate upstream branch or upstream "
+"tags will be created."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-import-srpm.xml:273
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage.rpm\"/>, <xref "
+"linkend=\"man.gbp.pq.rpm\"/>, <xref linkend=\"man.gbp.rpm.ch\"/>, <xref "
+"linkend=\"man.gbp.conf\"/>, &man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-pq-rpm.xml:12 manpages/gbp-pq-rpm.xml:16
+msgid "gbp-pq-rpm"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-pq-rpm.xml:17
+msgid "Manage patches and development branches in Git"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-pq-rpm.xml:21
+msgid ""
+"&gbp-pq-rpm; &man.common.options.synopsis; "
+"<arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--spec-file=</option><replaceable>FILEPATH</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>TAG-FORMAT</replaceable></arg> "
+"<arg><option>--abbrev=</option><replaceable>num</replaceable></arg> "
+"<arg><option>--force</option></arg> <arg><option>--[no-]drop</option></arg> "
+"<arg><option>--[no-]patch-numbers</option></arg> <group choice=\"plain\"> "
+"<arg><option>drop</option></arg> <arg><option>export</option></arg> "
+"<arg><option>import</option></arg> <arg><option>rebase</option></arg> "
+"<arg><option>switch</option></arg> <arg><option>apply</option></arg> "
+"</group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:43
+msgid ""
+"&gbp-pq-rpm; helps in managing patches and development branch(es) for "
+"packages that are maintained with &gbp;. It designed to be used for packages "
+"that are maintained using the \"orphan-packaging\" model. &gbp-pq-rpm; has "
+"multiple subcommands, or actions, for working with the branches and patches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:50
+msgid ""
+"&gbp-pq-rpm; makes it easy to do source code development on a separate "
+"development branch (patch-queue branch in Debian git-buildpackage terms). "
+"For example, if the packaging files would be stored in "
+"<replaceable>master</replaceable> the associated development branch would be "
+"<replaceable>development/master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-pq-rpm.xml:58 manpages/gbp-pq.xml:62
+msgid "ACTIONS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:61 manpages/gbp-pq.xml:65
+msgid "<option>import</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:65
+msgid ""
+"Create a development (patch-queue) branch by applying all patches from the "
+"packaging branch on top of the upstream version. The patches must apply "
+"without fuzz."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:72 manpages/gbp-pq.xml:76
+msgid "<option>export</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:76
+msgid ""
+"Export patches from the development branch into the packaging branch. It "
+"generates patches (one-per-commit) from the development branch and updates "
+"the spec file accordingly. It doesn't automatically commit the changes "
+"though - they need to verified and committed manually."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:84 manpages/gbp-pq.xml:87
+msgid "<option>rebase</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:88
+msgid ""
+"Switch to the development branch and rebase it against the current upstream "
+"version (indicated in the spec file of the associated packaging branch)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:95 manpages/gbp-pq.xml:97
+msgid "<option>drop</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:99
+msgid ""
+"Drop (delete) the development branch associated to the current branch. For "
+"example, you're on branch <replaceable>foo</replaceable> this would drop "
+"branch <replaceable>development/foo</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:106 manpages/gbp-pq.xml:108
+msgid "<option>apply</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:110
+msgid ""
+"Add a single patch to the development branch - similar to using "
+"<command>git-am</command>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:116 manpages/gbp-pq.xml:121
+msgid "<option>switch</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:120
+msgid "Switch between the development branch and the associated packaging branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:132 manpages/gbp-rpm-ch.xml:119
+msgid "<option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:141 manpages/gbp-rpm-ch.xml:143
+msgid "<option>--spec-file=</option><replaceable>FILEPATH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:145 manpages/gbp-rpm-ch.xml:147
+msgid ""
+"Relative path to the spec file to use. Special value "
+"<replaceable>auto</replaceable> causes &gbp; to search and guess. Other "
+"values cause the <option>--packaging-dir</option> option to be ignored: the "
+"directory of the spec file is used, instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:163 manpages/gbp-pq.xml:206
+msgid "<option>--abbrev=</option><replaceable>NUM</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:167 manpages/gbp-pq.xml:210
+msgid ""
+"When exporting a patch queue abbreviate commit, instead of showing the full "
+"40-byte hexadecimal object name in header lines, show only a partial prefix "
+"of length <replaceable>NUM</replaceable>. This is useful when existing "
+"patches were not generated by &gbp-pq;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:175 manpages/gbp-pq.xml:218 manpages/gbp-pull.xml:60
+msgid "<option>--force</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:178
+msgid ""
+"Import even if the development (patch-queue) branch already exists. Only "
+"valid for the import action."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:184 manpages/gbp-pq.xml:199
+msgid "<option>--[no-]drop</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:187
+msgid "Whether to drop (delete) the patch queue branch after a successful export."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:193 manpages/gbp-pq.xml:138
+msgid "<option>--[no-]patch-numbers</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:197
+msgid "Whether the patch files should start with a number or not."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:206
+msgid ""
+"When exporting patches from a patch-queue branch &gbp-pq-rpm; will look at "
+"the commit message for special tags it recognizes. All tags need to start at "
+"the first column and require at least one whitespace after the colon."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:212
+msgid "<option>Gbp-Rpm: Ignore</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:216 manpages/gbp-pq.xml:297
+msgid "Ignores the commit, no patch is generated out of it."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:221
+msgid "<option>Gbp-Rpm: If <expression></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:225
+msgid ""
+"Conditional patch. Put patch inside \"%if <expression>\" in the spec "
+"file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq-rpm.xml:231
+msgid "<option>Gbp-Rpm: IfArch<expression></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq-rpm.xml:235
+msgid ""
+"Conditional patch. Put patch inside \"%ifarch <expression>\" in the "
+"spec file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:242
+msgid "For example, the following commit message:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-pq-rpm.xml:245
+#, no-wrap
+msgid ""
+" Fix around a problem in Fedora\n"
+"\n"
+" which is not applicable elsewhere.\n"
+"\n"
+" Gbp-Rpm: If 0%{?fedora}\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:252
+msgid "Will result something like this in the spec file:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-pq-rpm.xml:255
+#, no-wrap
+msgid ""
+" # 0001-Fix-around-a-problem-in-Fedora.patch\n"
+" %if 0%{?fedora}\n"
+" %patch0 -p1\n"
+" %endif\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq-rpm.xml:264
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage.rpm\"/>, <xref "
+"linkend=\"man.gbp.import.srpm\"/>, <xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-pq.xml:12 manpages/gbp-pq.xml:16
+msgid "gbp-pq"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-pq.xml:17
+msgid "Manage quilt patches on patch queue branches in git"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-pq.xml:21
+msgid ""
+"&gbp-pq; &man.common.options.synopsis; "
+"<arg><option>--[no-]patch-numbers</option></arg> "
+"<arg><option>--patch-num-format=</option><replaceable>format</replaceable></arg> "
+"<arg><option>--[no-]renumber</option></arg> "
+"<arg><option>--topic=</option><replaceable>topic</replaceable></arg> "
+"<arg><option>--time-machine=</option><replaceable>num</replaceable></arg> "
+"<arg><option>--[no-]drop</option></arg> "
+"<arg><option>--abbrev=</option><replaceable>num</replaceable></arg> "
+"<arg><option>--force</option></arg> <arg><option>--commit</option></arg> "
+"<arg><option>--meta-closes=bug-close-tags</option></arg> "
+"<arg><option>--meta-closes-bugnum=bug-number-format</option></arg> "
+"<arg><option>--pq-from=</option><replaceable>[DEBIAN|TAG]</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<group choice=\"plain\"> <arg><option>drop</option></arg> "
+"<arg><option>export</option></arg> <arg><option>import</option></arg> "
+"<arg><option>rebase</option></arg> <arg><option>switch</option></arg> "
+"</group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq.xml:48
+msgid ""
+"&gbp-pq; helps one to manage quilt patches in &debian; packages that are "
+"maintained with &gbp;. This is especially useful with packages using the 3.0 "
+"(quilt) source format. With &gbp-pq;, you can maintain the quilt patches "
+"that should be applied to a package on a separate branch called patch-queue "
+"branch. So if your &debian; package lives on "
+"<replaceable>master</replaceable>, the associated patch-queue branch will be "
+"called <replaceable>patch-queue/master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq.xml:57
+msgid ""
+"See <ulink "
+"url=\"https://honk.sigxcpu.org/piki/development/debian_packages_in_git/\"></ulink> "
+"for example workflows."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:69
+msgid ""
+"Create a patch queue branch from quilt patches in debian/patches/ that are "
+"listed in debian/patches/series. The patches must apply without fuzz."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:80
+msgid ""
+"Export the patches on the patch-queue branch associated to the current "
+"branch into a quilt patch series in debian/patches/ and update the series "
+"file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:91
+msgid ""
+"Switch to the patch-queue branch associated to the current branch and rebase "
+"it against the current branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:101
+msgid ""
+"Drop (delete) the patch queue associated to the current branch. So if you're "
+"on branch <replaceable>foo</replaceable>, this would drop branch "
+"<replaceable>patch-queue/foo</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:112
+msgid ""
+"Add a single patch to the patch-queue similar to using "
+"<command>git-am</command>. Use <option>--topic</option> if you want the "
+"patch to appear in a separate subdir when exporting the patch queue using "
+"<option>export</option>. This can be used to separate upstream patches from "
+"&debian; specific patches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:125
+msgid ""
+"Switch to the patch-queue branch if on the base branch and switch to base "
+"branch if on patch-queue branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:142
+msgid ""
+"Whether or not the patch files should be prefixed with a number. The "
+"default is to export patches with patch numbers. Note, however, that this "
+"normally affects patches whose names are automatically generated, and has no "
+"effect on exporting patches which have a <option>Gbp[-Pq]: Name</option> "
+"tag, since the name specified is preserved unless the "
+"<option>--renumber</option> option is used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:153
+msgid "<option>--patch-num-format=</option><replaceable>format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:157
+msgid ""
+"The format specifier for patch number prefixes. The default format is "
+"'%04d-'."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:162
+msgid "<option>--[no-]renumber</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:166
+msgid ""
+"Whether or not to renumber patches exported from the patch queue, instead of "
+"preserving numbers specified in <option>Gbp-Pq: Name</option> tags. The "
+"default is not to renumber patches. Useful when patches need to be renamed "
+"for the sake of uniformity. For example, using <option>--renumber</option> "
+"with <option>--no-patch-num</option> will strip all numeric prefixes from "
+"exported patches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:177
+msgid "<option>--topic=</option><replaceable>topic</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:181
+msgid "Topic to use when importing a single patch"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:186
+msgid "<option>--time-machine=</option><replaceable>NUM</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:190
+msgid ""
+"When importing a patch queue fails, go back commit-by-commit on the current "
+"branch to check if the patch-queue applies there. Do this at most "
+"<replaceable>NUM</replaceable> times. This can be useful if the patch-queue "
+"doesn't apply to the current branch HEAD anymore, e.g. after importing a "
+"new upstream version."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:201
+msgid ""
+"Whether to automatically drop (delete) the patch queue branch after a "
+"successful export"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:220
+msgid ""
+"In case of <option>import</option>, import even if the patch-queue branch "
+"already exists and overwrite its content with "
+"<filename>debian/patches</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:226
+msgid "<option>--export</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:229
+msgid ""
+"In case of <option>export</option>, commit "
+"<filename>debian/patches</filename>the changes to &git; after exporting the "
+"patches."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:240
+msgid ""
+"What meta tags to look for to generate a commit message when using "
+"<option>export</option> <option>--commit</option>. The default is "
+"<literal>'Closes|LP'</literal> to support Debian and Launchpad."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:251
+msgid ""
+"What regular expression should be used to parse out the bug number when "
+"using <option>export</option> <option>--commit</option>. The default is "
+"<literal>'(?:bug|issue)?\\#?\\s?\\d+'</literal>. See <xref "
+"linkend=\"man.gbp.dch\"/> for details."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:260
+msgid "<option>--pq-from=</option><replaceable>[DEBIAN|TAG]</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:264
+msgid ""
+"How to find the starting point for the patch queue base. The options are "
+"DEBIAN, that will use the Debian branch as the base for the patch queue "
+"branch, and TAG, that will use the corresponding upstream tag as a base for "
+"the patch queue branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:267
+msgid ""
+"This is only needed if your upstream branch is not merged in the Debian "
+"branch. The default is <replaceable>DEBIAN</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp-pq.xml:285
+msgid "TAGS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq.xml:287
+msgid ""
+"When exporting patches from a patch-queue branch, &gbp-pq; will look at the "
+"patch header for special tags it recognizes. All tags need to start at the "
+"first column and require at least one whitespace after the colon."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:293
+msgid "<option>Gbp[-Pq]: Ignore</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:302
+msgid "<option>Gbp[-Pq]: Name</option> <replaceable>name</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><screen>
+#: manpages/gbp-pq.xml:307 manpages/gbp-pq.xml:319
+#, no-wrap
+msgid "&gbp-pq; export"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:306
+msgid ""
+"The name to use for the patch when running <placeholder type=\"screen\" "
+"id=\"0\"/> If unset, it will be formatted like <command>git am</command> "
+"would format it."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:314
+msgid "<option>Gbp[-Pq]: Topic</option> <replaceable>topic</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:318
+msgid ""
+"Moves the patch into a subdir called <replaceable>topic</replaceable> when "
+"running <placeholder type=\"screen\" id=\"0\"/> This allows for some "
+"structure below <filename>debian/patches</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pq.xml:325
+msgid "<option>Gbp-Pq-Topic:</option> <replaceable>topic</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pq.xml:329
+msgid ""
+"Deprecated: use <option>Gbp[-Pq]: Topic</option> "
+"<replaceable>topic</replaceable> instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pq.xml:339
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <citerefentry> "
+"<refentrytitle>dpkg-source</refentrytitle> <manvolnum>1</manvolnum> "
+"</citerefentry>, <citerefentry> <refentrytitle>quilt</refentrytitle> "
+"<manvolnum>1</manvolnum> </citerefentry>, <xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-pristine-tar.xml:12 manpages/gbp-pristine-tar.xml:16
+msgid "gbp-pristine-tar"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-pristine-tar.xml:17
+msgid "Manage pristine-tar commits in a git repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-pristine-tar.xml:21
+msgid ""
+"&gbp-pristine-tar; &man.common.options.synopsis; "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg "
+"rep='repeat'><option>--component=</option><replaceable>component</replaceable></arg> "
+"<group choice=\"plain\"> <arg><option>commit</option></arg> </group> <group "
+"choice=\"plain\"> <arg "
+"choice=\"plain\"><replaceable>filename</replaceable></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pristine-tar.xml:37
+msgid ""
+"&gbp-pristine-tar; adds the pristine-tar commit for a given upstream tarball "
+"to a &git; repository. This can be useful if a original tarball has been "
+"already imported and the pristine-tar commits should be added at a later "
+"time or if you're tracking upstream git and want to create pristine-tar "
+"commits nevertheless."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pristine-tar.xml:54
+msgid ""
+"use this tag format when tagging upstream versions, default is "
+"<replaceable>upstream/%(version)s</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pristine-tar.xml:64
+msgid ""
+"When creating the pristine-tar commits also look for an additional tarball "
+"with component name <replaceable>COMPONENT</replaceable>. E.g. in "
+"<filename>hello-debhelper_1.0.orig-foo.tar.gz</filename> the component name "
+"would be <replaceable>foo</replaceable>. The additional tarball is expected "
+"to be in the same directory than the upstream tarball and to use the same "
+"compression type. This option can be given multiple times to add multiple "
+"additional tarballs."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pristine-tar.xml:85
+msgid "Add pristine-tar commits for an upstream tarball:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-pristine-tar.xml:87
+#, no-wrap
+msgid " &gbp-pristine-tar; commit ../upstream-tarball-0.1.tar.gz"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pristine-tar.xml:88
+msgid ""
+"Same as above with an additional tarball "
+"<filename>../upstream-tarball-foo-0.1.tar.gz:</filename>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-pristine-tar.xml:91
+#, no-wrap
+msgid ""
+" &gbp-pristine-tar; --component-tarball=foo commit "
+"../upstream-tarball-0.1.tar.gz"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pristine-tar.xml:99
+msgid ""
+"<xref linkend=\"man.gbp.import.orig\"/>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-pull.xml:12 manpages/gbp-pull.xml:16
+msgid "gbp-pull"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-pull.xml:18
+msgid "Safely update a repository from remote"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-pull.xml:22
+msgid ""
+"&gbp-pull; &man.common.options.synopsis; <arg><option>--force</option></arg> "
+"<arg><option>--all</option></arg> <arg><option>--redo-pq</option></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--ignore-branch</option></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--track-missing</option></arg> "
+"<arg><option>--depth=</option><replaceable>depth</replaceable></arg> "
+"<arg><replaceable>repository</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pull.xml:40
+msgid ""
+"&gbp-pull; updates the <emphasis>debian</emphasis>, "
+"<emphasis>upstream</emphasis> and <emphasis>pristine-tar</emphasis> branches "
+"from remote repositories in one go. It checks if the update is safe (would "
+"result in a <emphasis>fast-forward</emphasis> merge) and aborts otherwise."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pull.xml:46
+msgid ""
+"If given on the command line the changes are fetched from the given "
+"repository otherwise the default for <replaceable>repository</replaceable> "
+"is read from the <replaceable>remote</replaceable> configuration for each "
+"branch (in git's configuration)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:62
+msgid "Force a branch update even if this results in a non fast forward update."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><warning><para>
+#: manpages/gbp-pull.xml:63
+msgid "Forcing a branch update makes you lose your modifications."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:70
+msgid ""
+"Update all remote-tracking branches that have identical name in the remote "
+"repository."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pull.xml:75
+msgid "<option>--redo-pq</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:77
+msgid "Also rebuild the corresponding patch-queue using &gbp-pq;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para><warning><para>
+#: manpages/gbp-pull.xml:78
+msgid "This drops the patch-queue branch if it exists."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:85
+msgid "Don't care if we're on a branch or in detached head state."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-pull.xml:105
+msgid "<option>--track-missing</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:108
+msgid ""
+"If a branch is missing in the local repository try to fetch it from the "
+"remote side and (if it exists) fetch it and set up branch tracking for "
+"it. This ensures that branches that are added at a later point to the remote "
+"side (e.g. <replaceable>pristine-tar</replaceable>) are picked up "
+"automatically. Note that it's not an error for the branch to not exist on "
+"the remote side."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:122
+msgid "Git history depth, for deepening shallow git clones."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:129 manpages/gbp-push.xml:144
+msgid "Whether to update the pristine-tar branch too."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pull.xml:137
+msgid ""
+"When &gbp-pull; finishes, it indicates success or failure with its exit "
+"code:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:149
+msgid ""
+"An error occurred during the pull, see the printed error message for "
+"details."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-pull.xml:155
+msgid "At least one branch couldn't be fast forwarded."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-pull.xml:166
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.clone\"/>, "
+"<xref linkend=\"man.gbp.pq\"/>, <xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-push.xml:12 manpages/gbp-push.xml:16
+msgid "gbp-push"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-push.xml:18
+msgid "Push &debian; packaging changes to a &git; remote"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-push.xml:22
+msgid ""
+"&gbp-push; &man.common.options.synopsis; "
+"<arg><option>--ignore-branch</option></arg> "
+"<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg> "
+"<arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--[no-]pristine-tar</option></arg> "
+"<arg><option>--dry-run</option></arg> "
+"<arg><replaceable>repository</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-push.xml:38
+msgid ""
+"&gbp-push; pushes your local changes to a remote repository. It is best run "
+"after uploading a &debian; package to the archive to update you "
+"&debian-branch;, &upstream-branch;, &pristine-tar; branch and corresponding "
+"tags. It will in order"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:46
+msgid "Verify that it is being executed from the &debian-branch;."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:51
+msgid ""
+"Determine the debian tag from <filename>debian/changelog</filename> and add "
+"it the list of things to push if the changelog does not indicate an "
+"unreleased package."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:58
+msgid ""
+"Determine the upstream tag from <filename>debian/changelog</filename> and "
+"add it to the list of things to push if it's not a native package."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:64
+msgid ""
+"Determine if the tags correspond to the branch tips of the corresponding "
+"upstream and debian branches. If so, these branches will be added to the "
+"list of things to push. If not the changes will only be pushed up to the "
+"commit that is referenced by the corresponding tag."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:72
+msgid ""
+"Determine if the pristine-tar branch needs to be pushed and if so adds it to "
+"the list of things to push."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-push.xml:78
+msgid ""
+"Finally, if not in dry-run mode, pushes the above changes to the remote "
+"side."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-push.xml:83
+msgid ""
+"If a <replaceable>remote</replaceable> is given on the command line the "
+"changes are pushed to the given remote repository. By default it will push "
+"to the current branchs remote and fall back to <emphasis>origin</emphasis>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:97
+msgid ""
+"Don't fail if the &debian-branch; does not match the currently checked out "
+"branach and push the current branch instead."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:106
+msgid ""
+"The branch in the Git repository the Debian package is being developed "
+"on. If set to the empty value the branch will not be pushed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-push.xml:112 manpages/gbp-tag.xml:101
+msgid "<option>--debian-tag=</option><replaceable>TAG-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:115
+msgid ""
+"Use this tag format when looking for tags corresponding to a &debian; "
+"version. Default is <replaceable>debian/%(version)s</replaceable>. If set "
+"to the empty value the tag will not be pushed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:125
+msgid ""
+"The branch in the &git; repository the upstream sources are put onto. If set "
+"to the empty value the branch will not be pushed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:134
+msgid ""
+"Use this tag format when looking for tags of upstream versions. Default is "
+"<replaceable>upstream/%(version)s</replaceable>. If set to the empty value "
+"the tag will not be pushed."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-push.xml:148
+msgid "<option>--dry-run</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-push.xml:151
+msgid ""
+"Pass the <option>--dry-run</option> to &gitcmd; <option>push</option>. So "
+"don't push anything, only check if things are pushable."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-push.xml:164
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.clone\"/>, "
+"<xref linkend=\"man.gbp.pull\"/>, <xref linkend=\"man.gbp.conf\"/>"
+msgstr ""
+
+#. type: Content of: <refentry><refmeta><refentrytitle>
+#: manpages/gbp-rpm-ch.xml:12
+msgid "gbp-rpm-ch"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-rpm-ch.xml:16
+msgid "gbp-rpm-ch;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-rpm-ch.xml:17
+msgid "Generate the RPM changelog from git commit messages"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-rpm-ch.xml:21
+msgid ""
+"&gbp-rpm-ch; &man.common.options.synopsis; "
+"<arg><option>--tmp-dir</option>=<replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--vendor</option>=<replaceable>VENDOR</replaceable></arg> "
+"<arg><option>--packaging-branch=</option><replaceable>BRANCH-NAME</replaceable></arg> "
+"<arg><option>--packaging-tag=</option><replaceable>TAG-FORMAT</replaceable></arg> "
+"<arg><option>--ignore-branch</option></arg> "
+"<arg><option>--packaging-dir=</option><replaceable>DIRECTORY</replaceable></arg> "
+"<arg><option>--changelog-file=</option><replaceable>FILEPATH</replaceable></arg> "
+"<arg><option>--spec-file=</option><replaceable>FILEPATH</replaceable></arg> "
+"<arg><option>--since=</option><replaceable>COMMITISH</replaceable></arg> "
+"<arg><option>--no-release</option></arg> "
+"<arg><option>--[no-]git-author</option></arg> "
+"<arg><option>--[no-]full</option></arg> "
+"<arg><option>--id-length=</option><replaceable>NUMBER</replaceable></arg> "
+"<arg><option>--ignore-regex=</option><replaceable>REGEX</replaceable></arg> "
+"<arg><option>--changelog-revision=</option><replaceable>REV-FORMAT</replaceable></arg> "
+"<arg><option>--git-log=</option><replaceable>GIT-LOG-OPTIONS</replaceable></arg> "
+"<arg><option>--spawn-editor=<replaceable>[always|release|no]</replaceable></option></arg> "
+"<arg><option>--editor-cmd=</option><replaceable>EDITOR</replaceable></arg> "
+"<arg><option>--customizations=</option><replaceable>CUSTOMIZATION-FILE</replaceable></arg> "
+"<arg choice=\"plain\"><replaceable>[PATH1 PATH2]</replaceable></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:48
+msgid ""
+"&gbp-rpm-ch; reads git commit messages up to the current tip of the current "
+"branch and updates the RPM changelog from them."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:52
+msgid ""
+"By default, &gbp-rpm-ch; tries to guess the last &git; commit documented in "
+"the changelog. Alternatively, <option>--since</option> can be used to tell "
+"&gbp-rpm-ch; at which point it should start in the &git; history, or, "
+"<option>--all</option> to use all commits from the &git; history."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:58
+msgid ""
+"The additional path arguments can be used to restrict the repository paths "
+"&gbp-rpm-ch; looks at. For even more detailed control, you can use "
+"<option>--git-log</option> to restrict the generated changelog entries "
+"further. E.g. by using "
+"<option>--git-log=</option><replaceable>\"--author=Foo Bar\"</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:93
+msgid ""
+"The branch in the Git repository the package is being developed on, default "
+"is <replaceable>master</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:113
+msgid ""
+"Tag format used, when tagging releases, default is "
+"<replaceable>%(vendor)s/%(version)s</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:128
+msgid "<option>--changelog-file=</option><replaceable>FILEPATH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:132
+msgid ""
+"Relative path to the changelog file to use. Special value "
+"<replaceable>auto</replaceable> causes &gbp; to guess, "
+"<replaceable>SPEC</replaceable> uses the spec file, "
+"<replaceable>CHANGES</replaceable> uses a separate changelog file (name "
+"derived spec file name with .spec suffix replaced by .changes). Guessing "
+"logic is simple: use separate changelog file if it is found, otherwise use "
+"the spec file."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:155
+msgid "<option>--since=</option><replaceable>COMMITTISH</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:159
+msgid "Start reading commit messages at <replaceable>COMMITTISH</replaceable>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:165
+msgid "<option>--no-release</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:169
+msgid ""
+"Do not create a new changelog section, just update the last changelog "
+"section."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:184
+msgid "<option>--git-log=</option><replaceable>GIT-LOG-OPTIONS</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:203 manpages/gbp-rpm-ch.xml:229
+msgid "<option>--ignore-regex=</option><replaceable>REGEX</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:207
+msgid ""
+"Ignore lines in commit message matching <replaceable>REGEX</replaceable> "
+"when generating the changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:213
+msgid "<option>--changelog-revision=</option><replaceable>REV-FORMAT</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:217
+msgid ""
+"Format string to use for revision field in the changelog header. The "
+"following string fields are accepted: "
+"<replaceable>%(upstreamversion)s</replaceable> the upstream version; "
+"<replaceable>%(release)s</replaceable> the rpm patchlevel, i.e. Release; "
+"<replaceable>%(version)s</replaceable> full rpm package version; "
+"<replaceable>%(tagname)s</replaceable> tag/commit, i.e. basically what "
+"<command>git-describe</command> would give. If empty or not defined the "
+"default from packaging policy is used."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:233
+msgid ""
+"Ignore commit lines matching <replaceable>REGEX</replaceable> when "
+"generating the changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:239
+msgid "<option>--[no-]git-author</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:243
+msgid ""
+"Use user.name and user.email from <application>git-config</application>(1) "
+"for the changelog header."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:249
+msgid "<option>--spawn-editor=<replaceable>[always|release|no]</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:253
+msgid "Whether to spawn an editor: always, when doing a release or never."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:258
+msgid "<option>--editor-cmd=<replaceable>EDITOR</replaceable></option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:262
+msgid "The editor to use for editing the changelog."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:267
+msgid "<option>--customizations=</option><replaceable>CUSTOMIZATION-FILE</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:271
+msgid ""
+"Load Python code from <replaceable>CUSTOMIZATION-FILE</replaceable>. At the "
+"moment, the only useful thing the code can do is define a custom "
+"ChangelogEntryFormatter class."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:282
+msgid ""
+"Additional to the above options the formatting of the new changelog entries "
+"(one-per-commit) in the changelog can be modified by special tags (called "
+"Meta Tags) given in the git commit message. The tags must start at the first "
+"column of a commit message but can appear on any line. They are of the form "
+"<option>Tagname</option>: <replaceable>VALUE</replaceable>. Valid Meta Tags "
+"are:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:291
+msgid "<option>Git-Rpm-Ch</option>: <replaceable>ACTION</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:295
+msgid ""
+"Supported actions are: <replaceable>Ignore</replaceable> which will ignore "
+"this commit when generating new changelog entries. "
+"<replaceable>Short</replaceable> which will only use the description (the "
+"first line) of the commit message when generating the changelog entry "
+"(useful when <option>--full</option> is given) and "
+"<replaceable>Full</replaceable> which will use the full commit message when "
+"generating the changelog entry (useful when <option>--full</option> is not "
+"given)."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-rpm-ch.xml:307
+msgid "<option>[Close|Closes|...]</option>: <replaceable>BUGNUMBER</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-rpm-ch.xml:311
+msgid ""
+"Indicate in the changelog entry that bug "
+"<replaceable>BUGNUMBER</replaceable> was addressed in this commit."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-rpm-ch.xml:321
+#, no-wrap
+msgid ""
+" Document meta tags\n"
+"\n"
+" so one doesn't have to consult the manual\n"
+"\n"
+" Git-Rpm-Ch: Short\n"
+" Closes: #636088\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:329
+msgid "Results in this changelog entry:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-rpm-ch.xml:332
+#, no-wrap
+msgid ""
+" - Document meta tags (Closes: #636088)\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-rpm-ch.xml:341
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage.rpm\"/>, <xref "
+"linkend=\"man.gbp.import.srpm\"/>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common; <ulink url=\"https://honk.sigxcpu.org/cl2vcs\"> "
+"<citetitle>Cl2vcs</citetitle></ulink>,"
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo><address>
+#: manpages/gbp-setup-gitattributes.xml:4
+#, no-wrap
+msgid ""
+" <email>andrew@shadura.me</email>\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refentryinfo>
+#: manpages/gbp-setup-gitattributes.xml:3
+msgid ""
+"<placeholder type=\"address\" id=\"0\"/> <author> "
+"<firstname>Andrej</firstname> <surname>Shadura</surname> </author>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-setup-gitattributes.xml:11
+#: manpages/gbp-setup-gitattributes.xml:15
+msgid "gbp-setup-gitattributes"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-setup-gitattributes.xml:16
+msgid "Set up &git; attributes for packaging"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-setup-gitattributes.xml:20
+msgid ""
+"&gbp-setup-gitattributes; &man.common.options.synopsis; "
+"<arg><option>--[no-]dgit-defuse-attrs</option></arg> "
+"<arg><option>--all</option></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:30
+msgid ""
+"&gbp-setup-gitattributes; sets up <filename>.git/info/attributes</filename> "
+"in the current &git; repository to sane defaults most suitable for packaging "
+"work. At the moment, this amounts to making sure no transformations happen "
+"during checkout, commit or export. More attributes may be added in future, "
+"by default all known settings are applied."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:36
+msgid ""
+"Upstream sources may ship <filename>.gitattributes</filename> files enabling "
+"certain transformations to the committed source, usually to make working "
+"with files in different encodings more convenient for the upstream "
+"authors. For Debian packaging, it is necessary to override these attributes, "
+"since they cause often unwanted conversion of files (e.g. line endings, "
+"encodings and some others). Working with such source tree is confusing, "
+"since the working tree differs from the Git history (and sometimes from the "
+"source tarball), and can lead to errors."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:45
+msgid ""
+"By default, &gbp-clone; tries to detect the usage of "
+"<filename>.gitattributes</filename> in the upstream source and disables the "
+"Git attributes only when necessary."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-setup-gitattributes.xml:54
+msgid "<option>--[no-]dgit-defuse-attrs</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-setup-gitattributes.xml:58
+msgid ""
+"<option>Disables all transforming attributes for all files. This is done by "
+"defining a macro attribute <symbol>[attr]dgit-defuse-attrs</symbol> and "
+"applying it to <filename>*</filename> together with "
+"<symbol>export-subst</symbol> and <symbol>export-ignore</symbol>.</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-setup-gitattributes.xml:64
+msgid ""
+"This method is compatible with <command>dgit</command> and "
+"<command>git-deborig</command> which use this macro attribute. Older "
+"versions of <command>dgit</command> use an incomplete preset missing some "
+"attributes; if such is found, it is replaced by an updated definition."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-setup-gitattributes.xml:75
+msgid "Apply all known &git; attribute settings. This is the default."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:84
+msgid ""
+"<xref linkend=\"man.gbp.clone\"/>, <xref linkend=\"man.gbp.push\"/>, <xref "
+"linkend=\"man.gbp.conf\"/>, <citerefentry> "
+"<refentrytitle>gitattributes</refentrytitle> <manvolnum>5</manvolnum> "
+"</citerefentry>, <citerefentry> <refentrytitle>dgit</refentrytitle> "
+"<manvolnum>7</manvolnum> </citerefentry>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-setup-gitattributes.xml:100
+msgid "Andrej Shadura <email>andrew@shadura.me</email>"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp-tag.xml:11 manpages/gbp-tag.xml:15
+msgid "gbp-tag"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp-tag.xml:16
+msgid "Tag a &debian; packages in a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp-tag.xml:20
+msgid ""
+"&gbp-tag; &man.common.options.synopsis; "
+"<arg><option>--ignore-branch</option></arg> "
+"<arg><option>--[no-]ignore-new</option></arg> "
+"<arg><option>--[no-]sign-tags</option></arg> "
+"<arg><option>--keyid=</option><replaceable>GPG-KEYID</replaceable></arg> "
+"<arg><option>--debian-branch=</option><replaceable>BRANCH_NAME</replaceable></arg> "
+"<arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg> "
+"<arg><option>--debian-tag-msg=</option><replaceable>tag-msg-format</replaceable></arg> "
+"<arg><option>--posttag=</option><replaceable>COMMAND</replaceable></arg> "
+"<arg><option>--retag</option></arg>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-tag.xml:37
+msgid "&gbp-tag; tags the current head commit appropriately. It will in order:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-tag.xml:42
+msgid "Verify that it is being executed from the Debian branch."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-tag.xml:53
+msgid ""
+"Create a git tag using the information from "
+"<filename>debian/changelog</filename>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><itemizedlist><listitem><para>
+#: manpages/gbp-tag.xml:58
+msgid "(Optionally) call a post tag hook."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:68
+msgid "<option>--posttag=</option><replaceable>COMMAND</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-tag.xml:72
+msgid "Execute <replaceable>COMMAND</replaceable> after creating the tag."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:111
+msgid "<option>--debian-tag-msg=</option><replaceable>tag-msg-format</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:119
+msgid "<option>--retag</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:130
+msgid "<option>--debian-branch</option>=<replaceable>BRANCH_NAME</replaceable>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp-tag.xml:134
+msgid ""
+"If you're not on this branch when invoking &gbp-tag; it will fail. Default "
+"is <replaceable>master</replaceable>. This is done to make sure you don't "
+"accidentally tag on the wrong branch. Not being on this branch will be "
+"ignored when using <option>--ignore-branch</option>."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp-tag.xml:153
+msgid "<option>--[no-]ignore-new</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-tag.xml:168
+msgid "Create a tag with the current defaults"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-tag.xml:171
+#, no-wrap
+msgid ""
+" &gbp-tag;\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-tag.xml:174
+msgid "Create using a more upstreamish tag format:"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><screen>
+#: manpages/gbp-tag.xml:177
+#, no-wrap
+msgid ""
+" &gbp-tag; --debian-tag='v%(version)s'\n"
+" "
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp-tag.xml:186
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.push\"/>, "
+"<xref linkend=\"man.gbp.conf\"/>,"
+msgstr ""
+
+#. type: Content of: <refentry><refmeta><refentrytitle>
+#: manpages/gbp.xml:12
+msgid "gbp"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refname>
+#: manpages/gbp.xml:16
+msgid "&gbp;"
+msgstr ""
+
+#. type: Content of: <refentry><refnamediv><refpurpose>
+#: manpages/gbp.xml:17
+msgid "Maintain &debian; packages in &git;"
+msgstr ""
+
+#. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
+#: manpages/gbp.xml:21
+msgid ""
+"&gbp; <group choice='req'> <arg><option>--help</option></arg> "
+"<arg><option>--version</option></arg> "
+"<arg><option>--list-cmds</option></arg> <arg><option>command</option><arg "
+"choice='opt' rep='repeat'><option>args</option></arg></arg> </group>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.xml:33
+msgid ""
+"&gbp; is used to maintain &debian; source packages in the &git; version "
+"control system."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:40
+msgid "<option>--help</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:43
+msgid "Print help"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:47
+msgid "<option>--version</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:50
+msgid "Print the programs version"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:54
+msgid "<option>--list-cmds</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:57
+msgid "List all available commands"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><title>
+#: manpages/gbp.xml:63
+msgid "GBP COMMANDS"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.xml:65
+msgid ""
+"These are the possible commands. For possible arguments to these commands, "
+"please see the corresponding man pages."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:70
+msgid "buildpackage"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:73
+msgid "Build source and binary packages from a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:79
+msgid "import-orig"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:82
+msgid "Import a new upstream version into a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:88
+msgid "export-orig"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:91
+msgid "Recreate upstream tarballs from a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:97
+msgid "import-dsc"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:100
+msgid "Import a &debian; source package into a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:106
+msgid "import-dscs"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:109
+msgid ""
+"Import several &debian; source packages into a &git; repository, sorted by "
+"version number"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:116
+msgid "dch"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:119
+msgid "Generate the <filename>debian/changelog</filename> from &git; commit history"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:125
+msgid "pq"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:128
+msgid ""
+"Manage <filename>debian/patches</filename> using &git; "
+"<option>rebase</option>"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:134
+msgid "pull"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:137
+msgid "Update a &git; repository from a remote"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:143
+msgid "clone"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:146
+msgid ""
+"Clone a &git; repository from a remote and set up the necessary branch "
+"tracking."
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:152
+msgid "create-remote-repo"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:155
+msgid "Create a remote &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:161
+msgid "tag"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:164
+msgid "Tag a &debian; release in a &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
+#: manpages/gbp.xml:170
+msgid "push"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
+#: manpages/gbp.xml:173
+msgid "Push packaging branches to a remote &git; repository"
+msgstr ""
+
+#. type: Content of: <refentry><refsect1><para>
+#: manpages/gbp.xml:184
+msgid ""
+"<xref linkend=\"man.gbp.buildpackage\"/>, <xref linkend=\"man.gbp.clone\"/>, "
+"<xref linkend=\"man.gbp.create.remote.repo\"/>, <xref "
+"linkend=\"man.gbp.dch\"/>, <xref linkend=\"man.gbp.export.orig\"/>, <xref "
+"linkend=\"man.gbp.import.dsc\"/>, <xref linkend=\"man.gbp.import.dscs\"/>, "
+"<xref linkend=\"man.gbp.import.orig\"/>, <xref linkend=\"man.gbp.pq\"/>, "
+"<xref linkend=\"man.gbp.pristine.tar\"/>, <xref linkend=\"man.gbp.pull\"/>, "
+"<xref linkend=\"man.gbp.push\"/>, <xref linkend=\"man.gbp.tag\"/>, "
+"<citerefentry> <refentrytitle>git-pbuilder</refentrytitle> "
+"<manvolnum>1</manvolnum> </citerefentry>, <xref linkend=\"man.gbp.conf\"/>, "
+"&man.seealso.common;"
+msgstr ""
+
+#. type: Content of: <title>
+#: manpages/man.conffiles.xml:1
+msgid "CONFIGURATION FILES"
+msgstr ""
+
+#. type: Content of: <para>
+#: manpages/man.conffiles.xml:2
+msgid ""
+"Several <filename>gbp.conf</filename> files are parsed to set defaults for "
+"the above command-line arguments. See the <xref linkend=\"man.gbp.conf\"/> "
+"manpage for details."
+msgstr ""
+
+#. type: Content of: outside any tag (error?)
+#: manpages/man.seealso.xml:1
+msgid ""
+"<citerefentry> <refentrytitle>debuild</refentrytitle> "
+"<manvolnum>1</manvolnum> </citerefentry>, <citerefentry> "
+"<refentrytitle>git</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, "
+"<citerefentry> <refentrytitle>pristine-tar</refentrytitle> "
+"<manvolnum>1</manvolnum> </citerefentry>, <ulink "
+"url=\"file:///usr/share/doc/git-buildpackage/manual-html/index.html\"> "
+"<citetitle>The Git-Buildpackage Manual</citetitle></ulink>"
+msgstr ""
--- /dev/null
+[po_directory] po/
+
+[options] --master-charset UTF-8 --keep 0
+
+[type: docbook] manual.xml $lang:_gen/$lang/manual.xml
+[type: docbook] copyright.xml $lang:_gen/$lang/copyright.xml
+
+[type: docbook] chapters/building.xml $lang:_gen/$lang/chapters/building.xml
+[type: docbook] chapters/cfgfile.xml $lang:_gen/$lang/chapters/cfgfile.xml
+[type: docbook] chapters/import.xml $lang:_gen/$lang/chapters/import.xml
+[type: docbook] chapters/intro.xml $lang:_gen/$lang/chapters/intro.xml
+[type: docbook] chapters/patches.xml $lang:_gen/$lang/chapters/patches.xml
+[type: docbook] chapters/releases.xml $lang:_gen/$lang/chapters/releases.xml
+[type: docbook] chapters/special.xml $lang:_gen/$lang/chapters/special.xml
+
+[type: docbook] manpages/gbp-buildpackage-rpm.xml $lang:_gen/$lang/manpages/gbp-buildpackage-rpm.xml
+[type: docbook] manpages/gbp-buildpackage.xml $lang:_gen/$lang/manpages/gbp-buildpackage.xml
+[type: docbook] manpages/gbp-clone.xml $lang:_gen/$lang/manpages/gbp-clone.xml
+[type: docbook] manpages/gbp-config.xml $lang:_gen/$lang/manpages/gbp-config.xml
+[type: docbook] manpages/gbp.conf.xml $lang:_gen/$lang/manpages/gbp.conf.xml
+[type: docbook] manpages/gbp-create-remote-repo.xml $lang:_gen/$lang/manpages/gbp-create-remote-repo.xml
+[type: docbook] manpages/gbp-dch.xml $lang:_gen/$lang/manpages/gbp-dch.xml
+[type: docbook] manpages/gbp-export-orig.xml $lang:_gen/$lang/manpages/gbp-export-orig.xml
+[type: docbook] manpages/gbp-import-dscs.xml $lang:_gen/$lang/manpages/gbp-import-dscs.xml
+[type: docbook] manpages/gbp-import-dsc.xml $lang:_gen/$lang/manpages/gbp-import-dsc.xml
+[type: docbook] manpages/gbp-import-orig.xml $lang:_gen/$lang/manpages/gbp-import-orig.xml
+[type: docbook] manpages/gbp-import-ref.xml $lang:_gen/$lang/manpages/gbp-import-ref.xml
+[type: docbook] manpages/gbp-import-srpm.xml $lang:_gen/$lang/manpages/gbp-import-srpm.xml
+[type: docbook] manpages/gbp-pq-rpm.xml $lang:_gen/$lang/manpages/gbp-pq-rpm.xml
+[type: docbook] manpages/gbp-pq.xml $lang:_gen/$lang/manpages/gbp-pq.xml
+[type: docbook] manpages/gbp-pristine-tar.xml $lang:_gen/$lang/manpages/gbp-pristine-tar.xml
+[type: docbook] manpages/gbp-pull.xml $lang:_gen/$lang/manpages/gbp-pull.xml
+[type: docbook] manpages/gbp-push.xml $lang:_gen/$lang/manpages/gbp-push.xml
+[type: docbook] manpages/gbp-rpm-ch.xml $lang:_gen/$lang/manpages/gbp-rpm-ch.xml
+[type: docbook] manpages/gbp-setup-gitattributes.xml $lang:_gen/$lang/manpages/gbp-setup-gitattributes.xml
+[type: docbook] manpages/gbp-tag.xml $lang:_gen/$lang/manpages/gbp-tag.xml
+[type: docbook] manpages/gbp.xml $lang:_gen/$lang/manpages/gbp.xml
+[type: docbook] manpages/man.conffiles.xml $lang:_gen/$lang/manpages/man.conffiles.xml
+[type: docbook] manpages/man.seealso.xml $lang:_gen/$lang/manpages/man.seealso.xml
--- /dev/null
+This package is maintained with git-buildpackage(1). It follows DEP-14
+for branch naming (e.g. using debian/sid for the current version
+in Debian unstable).
+
+It uses pristine-tar(1) to store enough information in git to generate
+bit identical tarballs when building the package without having
+downloaded an upstream tarball first.
+
+When working with patches it is recommended to use "gbp pq import" to
+import the patches, modify the source and then use "gbp pq export
+--commit" to commit the modifications.
+
+The changelog is generated using "gbp dch" so if you submit any
+changes don't bother to add changelog entries but rather provide
+a nice git commit message that can then end up in the changelog.
+
+It is recommended to build the package with pbuilder using:
+
+ gbp buildpackage --git-pbuilder
+
+For information on how to set up a pbuilder environment see the
+git-pbuilder(1) manpage. In short:
+
+ DIST=sid git-pbuilder create
+ gbp clone <project-url>
+ cd <project>
+ gbp buildpackage --git-pbuilder
+
+ -- Guido Günther <agx@sigxcpu.org>, Wed, 2 Dec 2015 18:51:15 +0100
#!/usr/bin/python3 -u
# vim: set fileencoding=utf-8 :
#
-# (C) 2010 Guido Guenther <agx@sigxcpu.org>
+# (C) 2010,2015 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
"""Add a patch from debian/patches and autocreate the commit message from the
patch info
import os
import os.path
from gbp.command_wrappers import (Command)
-from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
+from gbp.config import GbpOptionParserDebian
from gbp.errors import GbpError
from gbp.git import (GitRepositoryError, GitRepository)
from gbp.patch_series import Patch
closes += line + '\n'
patch_name = os.path.basename(patch.path)
- msg="""New patch %s
+ msg = """New patch %s
%s
%s
retval = 0
parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] - add a new patch')
+ usage='%prog [options] - add a new patch')
parser.add_config_file_option(option_name="meta-closes", dest="meta_closes",
- help="Meta tags for the bts close commands, default is '%(meta-closes)s'")
+ help="Meta tags for the bts close commands, default is '%(meta-closes)s'")
parser.add_option("-e", "--edit", action="store_true", dest="edit", default=False,
help="edit commit message before committing")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
return retval
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
+++ /dev/null
-#!/bin/bash -e
-#
-# cowbuilder helper for git-buildpackage
-#
-# This is only left here for compatibility. Better use git-pbuilder instead.
-
-echo "***"
-echo " This script is deprecated."
-echo " Please switch to /usr/bin/git-pbuilder"
-echo " See file:///usr/share/doc/git-buildpackage/manual-html/gbp.special.html#GBP.SPECIAL.PBUILDER"
-echo "***"
-
-DIST=${0/*gbp-cowbuilder-}
-ACTION=$1
-
-CONF=/etc/pbuilder/pbuilderrc.$DIST
-WA_OPT='--debian-etch-workaround'
-
-case $DIST in
- sarge*|etch*)
- echo "`basename $0`: Using $WA_OPT"
- OPTS="$OPTS $WA_OPT"
- ;;
-esac
-
-case $ACTION in
- update|create|login)
- sudo cowbuilder --$ACTION --configfile=${CONF} --dist $DIST
- ;;
- *)
- # pass all options to dpkg-buildpackage:
- pdebuild --configfile ${CONF} \
- --pbuilder cowbuilder \
- --buildresult ${GBP_BUILD_DIR}/.. \
- --debbuildopts "-i -I $*" \
- -- $OPTS
- ;;
-esac
-
+++ /dev/null
-#!/usr/bin/python3
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2009,2012 Guido Guenther <agx@sigxcpu.org>
-#
-# gbp-posttag-push: post tag hook to be called by git-buildpackage to push out
-# the newly created tag and to forward the remote branch to that position
-#
-# it checks for explicit push destinations, if none are found it pushes back to
-# where the branch got merged from. Before pushing it checks if the tag is
-# signed.
-#
-# use:
-# [git-buildpackage]
-# posttag = gbp-posttag-push
-#
-# Options:
-# -d: dry-run
-# -u: push upstream branch too, if not on remote already
-# --verbose: verbose command output
-
-
-import ConfigParser
-import os
-import subprocess
-import sys
-
-import gbp.log
-from gbp.config import GbpOptionParser
-from gbp.deb.git import DebianGitRepository
-
-
-
-class Env(object):
- pass
-
-
-def get_push_targets(env):
- """get a list of push targets"""
- dests = {}
- cmd = "git config --get-regexp 'remote\..*\.push' '^%s(:.*)?$'" % env.branch
- for remote in subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True).communicate()[0].split("\n"):
- if not len(remote):
- continue
- repo, refspec = remote.split()
- repo = ".".join(repo.split('.')[1:-1]) # remote.<repo>.push
- try:
- remote = refspec.split(':')[1] # src:dest
- except IndexError:
- remote = refspec
- dests[repo] = remote
- return dests
-
-
-def get_pull(env):
- """where did we pull from?"""
- cmd = 'git config --get branch."%s".remote' % env.branch
- remote = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True).communicate()[0].strip()
- if not remote:
- remote = 'origin'
- return { remote: env.branch }
-
-
-def git_push_sim(*args):
- print "git push %s" % " ".join(args)
-
-
-def get_upstream_tag(repo, tag, tag_format):
- # FIXME: This assumes the debian version is the last part after the slash:
- version = tag.split('/')[-1]
- no_epoch = version.split(':')[-1]
- upstream = version.rsplit('-')[0]
- tag = tag_format % dict(version=upstream)
- if repo.has_tag(tag):
- return tag
- return None
-
-
-def main(argv):
- env = Env()
- upstream_sha1 = None
-
- try:
- parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
- usage='%prog [options] paths')
- except ConfigParser.ParsingError as err:
- gbp.log.error(err)
- return 1
-
- parser.add_option("-d", "--dry-run", dest="dryrun", default=False,
- action="store_true", help="dry run, don't push.")
- parser.add_option("-u", "--push-upstream", dest="push_upstream",
- default=False,
- action="store_true",
- help="also push upstream branch changes")
- parser.add_config_file_option(option_name="upstream-branch",
- dest="upstream_branch")
- parser.add_config_file_option(option_name="upstream-tag",
- dest="upstream_tag")
- parser.add_option("--verbose", action="store_true", dest="verbose",
- default=False, help="verbose command execution")
-
- (options, args) = parser.parse_args()
-
- gbp.log.setup(False, options.verbose)
- repo = DebianGitRepository('.')
-
- if options.dryrun:
- print "Dry run mode. Not pushing."
- repo.push = git_push_sim
- repo.push_tag = git_push_sim
-
- for envvar in [ "GBP_TAG", "GBP_BRANCH", "GBP_SHA1" ]:
- var = os.getenv(envvar)
- if var:
- env.__dict__.setdefault( "%s" % envvar.split("_")[1].lower(), var)
- else:
- print >>sys.stderr, "%s not set." % envvar
- return 1
-
- dests = get_push_targets(env)
- if not dests:
- dests = get_pull(env)
-
- upstream_tag = get_upstream_tag(repo, env.tag, options.upstream_tag)
- if upstream_tag:
- upstream_sha1 = repo.rev_parse("%s^{}" % upstream_tag)
-
- if not repo.verify_tag(env.tag):
- print >>sys.stderr, "Not pushing unsigned tag $GBP_TAG."
- return 0
-
- for dest in dests:
- print "Pushing %s to %s" % (env.sha1, dest)
- repo.push_tag(dest, env.tag)
- repo.push(dest, env.sha1, dests[dest])
- if options.push_upstream and upstream_tag:
- repo.push_tag(dest, upstream_tag)
- if not repo.branch_contains("%s/%s" % (dest, options.upstream_branch),
- upstream_sha1, remote=True):
- repo.push(dest, upstream_sha1, options.upstream_branch)
- print "done."
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
-
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
--- /dev/null
+#!/bin/bash
+#
+# Try to update a package to a new upstream version
+
+set -e
+
+DB=$(gbp config buildpackage.debian-branch | sed 's/\(.*debian-branch=\)\(.*\)/\2/')
+MAINTAINER=$(dpkg-parsechangelog -SMaintainer)
+SOURCE=$(dpkg-parsechangelog -SSource)
+OLD_VERSION=$(dpkg-parsechangelog -SVersion)
+
+git checkout "${DB}"
+gbp pq import --force
+git checkout "${DB}"
+
+set +e
+gbp import-orig --uscan --no-interactive --no-pristine-tar
+ret=$?
+set -e
+# no new version found
+if [ $ret = 4 ]; then
+ exit 0
+# all other errors
+elif [ $ret != 0 ]; then
+ exit $ret
+fi
+
+if ! gbp pq rebase; then
+ echo "Automatic rebase failed"
+ git rebase --abort
+ exit 1
+fi
+
+gbp pq export --commit
+gbp dch -S -a
+
+NEW_VERSION=$(dpkg-parsechangelog -SVersion)
+git commit -m"Snapshot build of ${SOURCE} $NEW_VERSION" debian/changelog
+
+gbp buildpackage --git-pbuilder \
+ --git-no-pristine-tar \
+ --git-postbuild='lintian $GBP_CHANGES_FILE' \
+ -nc \
+ ${GBP_BUILDPACKAGE_ARGS}
+
+MSG="Fast forward of ${SOURCE} from ${OLD_VERSION} to ${NEW_VERSION} successful"
+echo "${MSG}"
+MAILADDR=$(echo $MAINTAINER | sed -e 's/.*<\(.*\)>/\1/')
+echo "$MSG" | mail -s "Update of ${SOURCE} to ${NEW_VERSION}" "${MAILADDR}"
# Reset the changelog
git checkout -f debian/changelog
-# Create a monitonically increasing changelog by including the build number
-git-dch -S -a --ignore-branch --snapshot-number=${BUILD_NUMBER}
+# Create a monotonically increasing changelog by including the build number
+gbp dch -S -a --ignore-branch --snapshot-number=${BUILD_NUMBER}
# Build the package
[ -z ARCH ] || GBP_OPTS="$GBP_OPTS --git-arch=$ARCH"
[ -z DIST ] || GBP_OPTS="$GBP_OPTS --git-dist=$DIST"
-git-buildpackage ${GBP_OPTS} --git-ignore-branch --git-pbuilder --git-cleaner=/bin/true --git-ignore-new --git-pristine-tar -b
+gbp buildpackage ${GBP_OPTS} --git-ignore-branch --git-pbuilder --git-cleaner=/bin/true --git-ignore-new --git-pristine-tar -b
import textwrap
import gbp.dch
+
def format_changelog_entry(commit_info, options, last_commit=False):
entry = gbp.dch.format_changelog_entry(commit_info, options, last_commit)
if entry:
#! /usr/bin/python3
# vim: set fileencoding=utf-8 :
#
-# (C) 2010 Guido G¨¹nther <agx@sigxcpu.org>
+# (C) 2010 Guido Günther <agx@sigxcpu.org>
# 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
+++ /dev/null
-# Configuration file for git-buildpackage rpm tools
-
-[DEFAULT]
-# Default build command
-#builder = rpmbuild -ba
-# Default clean command:
-#cleaner = git clean -fd
-# Default branch for upstream sources
-#upstream-branch = upstream
-# Default branch for the packaging files
-#packaging-branch = master
-# Name of the distribution vendor
-#vendor=myvendor
-# Default tag formats to be used
-#upstream-tag = upstream/%(version)s
-#packaging-tag = packaging/%(version)s
-# Use pristine-tar
-#pristine-tar = True
-# Don't check if packaging-branch == current branch
-#ignore-branch = True
-# Use color when on a terminal, alternatives: on/true, off/false or auto
-#color = auto
-# Directory containing rpm packaging files
-#packaging-dir=rpm
-# Spec file to be used
-#spec-file = gbp.spec
-# Compress auto-generated patches
-#patch-export-compress=100k
-# Squash commits until certain tree-ish into one diff
-#patch-export-squash-until = stable-updates:stable
-# Export patches with numbering in filenames
-#patch-numbers = False
-
-###
-### Options only affecting git-buildpackage-rpm
-###
-[git-buildpackage-rpm]
-# Look for a tag matching the upstream version when creating a tarball
-#upstream-tree = tag
-# Uncomment this to automatically GPG sign tags
-#sign-tags = True
-# Keyid to GPG sign tags with
-#keyid = 0xdeadbeef
-# Push to a remote repository after a successful tag
-#posttag = git-push git.example.com
-# Run rpmlint after a successful build (for all rpm's found under build dir)
-#postbuild = find $GBP_BUILD_DIR -name '*rpm' -exec rpmlint -i {} \;
-# Run a script before build
-#prebuild = GIT_DIR=$GBP_GIT_DIR my_prebuild.sh
-# Build/export in a non-default directory
-#export-dir = ../build-area/
-# Special directory to look for pre-built orig source archives
-#tarball-dir = ../tarballs/
-# Build despite of unclean repository, i.e. untracked files are present
-#ignore-untracked = True
-# Ignore all local changes (i.e. build despite of modified files)
-#ignore-new = True
-# Commit-ish to build
-#export = HEAD
-# Use best compression
-#compression-level = best
-# Don't send notifications, alternatives: on/true, off/false or auto
-#notify = off
-# Transparently handle submodules
-#submodules = True
-# Rpmbuild related options
-#rpmbuild-builddir=BUILD_DIR
-#rpmbuild-rpmdir=RPM_DIR
-#rpmbuild-sourcedir=SOURCE_DIR
-#rpmbuild-specdir=SPEC_DIR
-#rpmbuild-srpmdir=SRPM_DIR
-#rpmbuild-buildrootdir=BUILDROOT_DIR
-# Generate patches against upstream
-#patch-export = True
-
-###
-### Options only affecting git-import-orig-rpm
-###
-[git-import-orig-rpm]
-# Set a different upstream branch to import to:
-#upstream-branch = newupstream
-# Set a different branch to merge to:
-#packaging-branch = pkgclean
-# Don't merge new upstream to packaging branch by default:
-#merge = False
-# Filter out files when importing
-#filter = .svn
-# Filter out files from tarball passed to pristine tar:
-#filter-pristine-tar = True
-# Name used in storing tarballs in pristine-tar branch
-#pristine-tarball-name = %(name)s_%(version)s%(filename_ext)s
-# Run hook after the import
-#postimport = my_postimport.sh
-# Commit message for new upstream version
-#import-msg = New upstream version %(version)s
-
-###
-### Options only affecting git-import-srpm
-###
-[git-import-srpm]
-# Set a different upstream branch
-#upstream-branch = svn-upstream
-# Filter out files when importing
-#filter = [ 'CVS', '.cvsignore' ]
-# Force committer of upstream source / packaging to be the same as author
-#author-is-committer = True
-
-###
-### Options only affecting gbp-pq-rpm
-###
-[gbp-pq-rpm]
-# Name of the patch-queue / development branch
-#pq-branch = %(branch)s-devel
-
-###
-### Options only affecting gbp-clone
-###
-[gbp-clone]
-# Track pristine-tar branch
-#pristine-tar = True
-
-###
-### Options only affecting gbp-pull
-###
-[gbp-pull]
-# Pull pristine-tar branch
-#pristine-tar = True
-
-###
-### Options only affecting gbp-create-remote-repo
-###
-[gbp-create-remote-repo]
-# Disable remote branch tracking
-#track = False
-
-# Options only affecting git-rpm-changelog
-[git-rpm-changelog]
-# Changelog filename, relative to the git topdir
-#changelog-file = git-buildpackage.changelog
-# Format string for the revision part of the changelog header
-#changelog-revision = %(tagname)s
-# Preferred editor
-#editor-cmd = vim
#tarball-dir = ../tarballs/
#ignore-new = True
#export = HEAD
-# compress with bzip2
-#compression = bzip2
+# compress with xz
+#compression = xz
# use best compression
#compression-level = best
# Don't send notifications, alternatives: on/true, off/false or auto
#notify = off
# Transparently handle submodules
# submodules = True
-# Wheter to use cowbuilder via git-pbuilder(1)
+# Whether to use cowbuilder via git-pbuilder(1)
#pbuilder = True
# Which distribution to use with git-pbuilder
#dist = testing
#meta = False
# what tags to look for to generate bug-closing changelog entries:
#meta-closes = Closes|LP
+# what regex should be used to parse the bug number
+#meta-closes-bugnum = '(?:bug|issue)?\#?\s?\d+'
# include the full commit message in the changelog:
#full = True
# ignore Signed-off-by: lines:
#ignore-regex=(Signed-off|Acked)-by:
# use author name and email from git-config:
#git-author = True
+# Customizatons can e.g. be used for line wrapping
+#customizations=/usr/share/doc/git-buildpackage/examples/wrap_cl.py
+# Options to pass to dch verbatim
+#dch-opt = ['--mainttrailer']
# Options only affecting gbp pq
[pq]
#patch-numbers = False
+# The format specifier for patch number prefixes
+#patch-num-format = '%04d-'
+# Whether to renumber patches when exporting patch queues
+#renumber = False
# Whether to drop patch queue after export
#drop = False
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""The various things needed by git-buildpackage and friends"""
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2014 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Bitbake helper functionality"""
-
-import os
-import re
-import shutil
-import string
-import subprocess
-import sys
-import tempfile
-from collections import defaultdict
-
-import gbp.log
-from gbp.errors import GbpError
-from gbp.git.repository import GitRepository, GitRepositoryError
-from gbp.scripts.common.buildpackage import dump_tree
-
-bb = None
-
-def import_bb():
- """Import bitbake lib"""
- bb_bin = subprocess.Popen(['which', 'bitbake'], stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).communicate()[0]
- if bb_bin:
- bb_lib_path = os.path.dirname(bb_bin) + '/../lib'
- sys.path.insert(0, bb_lib_path)
- try:
- return __import__('bb')
- except ImportError:
- print("ERROR: Unable to find bitbake/lib, try initializing build " \
- "environment with the 'oe-init-build-env' script\n")
- # Return None instead of raising (ImportError) so that building of
- # this package succeeds in Debian. Otherwise dpkg-buildpackage fails
- # because of an import error in epydoc.
- return None
-
-def init_tinfoil(config_only=False, tracking=False):
- """Initialize the Bitbake tinfoil module"""
- import bb.tinfoil #pylint: disable=import-error
- try:
- tinfoil = bb.tinfoil.Tinfoil(tracking=tracking)
- except (SystemExit, bb.BBHandledException):
- raise GbpError("Failed to initialize tinfoil")
- tinfoil.prepare(config_only=config_only)
- return tinfoil
-
-
-def pkg_version(data):
- """Get package version as a dict"""
- return {'upstreamversion': data.getVar('PV', True),
- 'release': data.getVar('PR', True),
- 'version': data.getVar('PV', True) + '-' + data.getVar('PR', True)}
-
-
-class BBFile(object):
- """Class representing .bb meta data"""
- var_ops = r'\+=|=\+|\?=|\?\?=|:=|='
- vardef_re = re.compile(
- r'(^(?P<name>\w+)\s*(?P<op>%s)\s*)(?P<value>\S.*)' % var_ops)
-
-
- def __init__(self, path, cfg_data=None):
- self.bb_file = os.path.basename(path)
- self.bb_dir = os.path.abspath(os.path.dirname(path))
-
- self._pkg_data = None
- self._variables = {}
- self.includes = []
- self.localfiles = []
-
- if cfg_data is not None:
- self.parse_bb(path, cfg_data)
- else:
- self.naive_parse_bb(path)
-
- @property
- def version(self):
- """Get version information as a dict"""
- return {'upstreamversion': self.getVar('PV', True),
- 'release': self.getVar('PR', True)}
-
- @property
- def bb_path(self):
- """Full path of the bb file"""
- return os.path.join(self.bb_dir, self.bb_file)
-
- def parse_bb(self, path, cfg_data):
- """Parse bb meta file"""
- self._pkg_data = bb.cache.Cache.loadDataFull(path, [], cfg_data)
-
- # Determine local packaging files
- uris = (self.getVar('SRC_URI', True) or "").split()
- fetcher = bb.fetch2.Fetch(uris, self._pkg_data)
- bb_dir = os.path.dirname(self.getVar('FILE'))
- # Also check for file existence as fetcher incorrecly returns some
- # non-existent .bbclass files under the recipe directory
- self.includes = [path for path in self.getVar('BBINCLUDED').split() if
- path.startswith(bb_dir) and os.path.exists(path)]
- self.localfiles = [path for path in fetcher.localpaths() if
- path.startswith(bb_dir)]
-
- def naive_parse_bb(self, path):
- """Naive parsing of standalone recipes"""
- # Some variable defaults
- # e.g. take package name and version directly from recipe file name
- self._variables['FILE'] = os.path.abspath(path)
- fn_base, _fn_ext = os.path.splitext(os.path.basename(path))
- split_base = fn_base.rsplit('_', 1)
- if len(split_base) == 2:
- self._variables['PN'] = split_base[0]
- self._variables['PV'] = split_base[1]
- else:
- self._variables['PN'] = fn_base
- self._variables['PV'] = '1.0'
- self._variables['PR'] = 'r0'
-
- def var_parse_cb(lines):
- """Callback function for parsing variables"""
- unwrapped = self.unwrap_lines(lines)
- match = self.vardef_re.match(unwrapped)
- if match:
- var = match.groupdict()
- value = self.unquote_val(var['value'])
-
- if (var['name'] not in self._variables or
- var['op'] in ('=', ':=')):
- self._variables[var['name']] = value
- elif var['op'] in ('+=', '=+'):
- self._variables[var['name']] += ' ' + value
- else:
- splitted = unwrapped.split(None, 1)
- if (len(splitted) > 1 and
- splitted[0] in ('include', 'require')):
- inc_fname = splitted[1].strip()
- inc_path = os.path.join(os.path.dirname(path),
- inc_fname)
- self.includes.append(os.path.abspath(inc_path))
- return lines + self.parse_file(inc_path, var_parse_cb)
- return lines
-
- # Parse variables from file
- self.parse_file(path, var_parse_cb)
-
- # Find local files
- filedirs = [self.getVar('PN') + '-' + self.getVar('PV'),
- self.getVar('PN'), 'files']
- uris = (self.getVar('SRC_URI') or "").split()
- for uri_str in uris:
- uri = bb.fetch2.URI(uri_str)
- if uri.scheme == 'file':
- found = False
- for path in [os.path.join(self.bb_dir, dirn, uri.path) for dirn
- in filedirs]:
- if os.path.exists(path):
- self.localfiles.append(path)
- found = True
- break
- if not found:
- gbp.log.warn("Seemingly local file '%s' not found under "
- "'%s'" % (uri_str, self.bb_dir))
-
- def _expand_single(self, match):
- """Expand single occurrence of a variable reference"""
- if match.group(1) in self._variables:
- return self._variables[match.group(1)]
- return match.group(0)
-
- def expand_val(self, val, rec=0):
- """Expand variable"""
- expanded = re.sub(r'\${(\w+)}', self._expand_single, val)
- if expanded == val:
- return expanded
- elif rec < 20:
- return self.expand_val(expanded, rec +1)
- else:
- raise GbpError("Too many recursions when expanding variable value")
-
- def getVar(self, var, expand=True):
- """Get variable"""
- if self._pkg_data:
- return self._pkg_data.getVar(var, expand)
- elif var in self._variables:
- if expand:
- return self.expand_val(self._variables[var])
- else:
- return self._variables[var]
- return None
-
- @staticmethod
- def unquote_val(val):
- """Unquote / strip variable value"""
- return val.strip(string.whitespace + r'"\'\\')
-
- @staticmethod
- def unwrap_lines(lines):
- """Return a joined string of multiple lines"""
- return ''.join([re.sub(r'\\\s*$', '', line) for line in lines])
-
- @staticmethod
- def var_to_str(var, values, oper='+='):
- """Create a well formatted string buffer containing a multiline variable
- assignment"""
- indent = ' ' * (len(var) + 2 + len(oper))
- linebuf = ['%s %s "%s \\\n' % (var, oper, values[0])]
- for val in values[1:]:
- linebuf.append(indent + ' ' + val + '\\\n')
- linebuf.append(indent + '"\n')
- return linebuf
-
- @staticmethod
- def parse_file(filepath, cb_func):
- """Parse recipe"""
- ret_buf = []
- with open(filepath) as fobj:
- multiline = []
- for line in fobj.readlines():
- stripped = line.rstrip()
- if not multiline:
- if not stripped.endswith('\\'):
- ret_buf.extend(cb_func([line]))
- else:
- multiline = [line]
- else:
- multiline.append(line)
- if not stripped.endswith('\\'):
- ret_buf.extend(cb_func(multiline))
- multiline = []
- return ret_buf
-
- @staticmethod
- def set_var_val(filepath, var, val):
- """Set variable value in a recipe"""
- class _Setter(object):
- """Class for handling variable injections"""
- def __init__(self):
- self.was_set = False
-
- def set_cb(self, lines):
- """Parser callback for setting variable value"""
- unwrapped = BBFile.unwrap_lines(lines)
- match = BBFile.vardef_re.match(unwrapped)
- if match and match.group('name') == var:
- if not self.was_set:
- self.was_set = True
- print("Setting value %s = %s" % (var, val))
- return ['%s = "%s"\n' % (var, val)]
- else:
- return []
- return lines
-
- # Parse file and set values
- setter = _Setter()
- linebuf = BBFile.parse_file(filepath, setter.set_cb)
-
- # Write file
- with open(filepath, 'w') as fobj:
- if not setter.was_set:
- fobj.write('%s = "%s"\n')
- fobj.writelines(linebuf)
-
- @staticmethod
- def substitute_var_val(filepath, var, pattern, repl):
- """Update variable in a recipe"""
- def subst_cb(lines):
- """Parser callback for substituting variable values"""
- unwrapped = BBFile.unwrap_lines(lines)
- match = BBFile.vardef_re.match(unwrapped)
- if match and match.group('name') == var:
- filtered = []
- for line in lines:
- line = re.sub(pattern, repl, line)
- # Drop empty lines
- if not re.match(r'\s*\\\s*', line):
- filtered.append(line)
- return filtered
- return lines
-
- # Parse file and substitute values
- linebuf = BBFile.parse_file(filepath, subst_cb)
-
- # Write file
- with open(filepath, 'w') as fobj:
- fobj.writelines(linebuf)
-
- @staticmethod
- def append_var_val(filepath, var, new_vals):
- """Update variable in a recipe"""
- if not new_vals:
- return
-
- class _Finder(object):
- """Class for recording definitions of variables"""
- def __init__(self):
- self.line_ind = 0
- self.last_occurrence = -1
-
- def find_last_occurrence_cb(self, lines):
- """Get the point of insertion for the variable"""
- unwrapped = BBFile.unwrap_lines(lines)
- match = BBFile.vardef_re.match(unwrapped)
- if match and match.group('name') == var:
- self.last_occurrence = self.line_ind + len(lines) - 1
- self.line_ind += len(lines)
- return lines
-
- finder = _Finder()
- linebuf = BBFile.parse_file(filepath, finder.find_last_occurrence_cb)
-
- # Prepare for appending values
- quote = None
- if finder.last_occurrence >= 0:
- last_line = linebuf[finder.last_occurrence].rstrip()
- # Guess indentation
- match = BBFile.vardef_re.match(last_line)
- if match:
- indent = ' ' * (len(match.group(1)) + 1)
- else:
- indent = re.match(r'(\s*)', last_line).group(1)
-
- # Guess point of insertion for new values and mangle the last line
- if re.match(r'^\s*$', last_line[:-1]):
- # Insert before the last line if it's an empty line (with a
- # quotation character only)
- insert_ind = finder.last_occurrence
- indent += ' '
- else:
- # Else, remove the quotation character and append after the
- # last line
- quote = last_line[-1]
- last_line = last_line[:-1] + ' \\\n'
- linebuf[finder.last_occurrence] = last_line
- insert_ind = finder.last_occurrence + 1
- else:
- indent = ' ' * (len(var) + 4)
-
- # Write file
- with open(filepath, 'w') as fobj:
- if finder.last_occurrence > -1:
- fobj.writelines(linebuf[:insert_ind])
- for val in new_vals:
- fobj.write(indent + val + ' \\\n')
- if quote:
- fobj.write(indent + quote + '\n')
- fobj.writelines(linebuf[insert_ind:])
- else:
- fobj.writelines(BBFile.var_to_str(var, new_vals, '+='))
- fobj.writelines(linebuf)
-
-def guess_bb_file(file_list, bbappend):
- """Guess bb recipe from a list of filenames"""
- recipes = []
- file_exts = ['.bb'] if not bbappend else ['.bb', '.bbappend']
- for ext in file_exts:
- for filepath in file_list:
- if filepath.endswith(ext):
- gbp.log.debug("Found bb recipe file %s" % filepath)
- recipes.append(filepath)
- if len(recipes) == 0:
- raise GbpError("No recipes found.")
- return sorted(recipes)[-1]
-
-def bb_from_repo(cfg_data, repo, treeish, bb_path):
- """Get and parse a bb recipe from a Git treeish"""
- try:
- tmpdir = tempfile.mkdtemp(prefix='gbp-bb_')
- # Dump whole bb directory
- dump_tree(repo, tmpdir, '%s:%s' % (treeish, os.path.dirname(bb_path)),
- False)
- fpath = os.path.join(tmpdir, os.path.basename(bb_path))
- return BBFile(fpath, cfg_data)
- except GitRepositoryError as err:
- raise GbpError("Git error: %s" % err)
- finally:
- shutil.rmtree(tmpdir)
-
-def guess_bb_path_from_fs(topdir, recursive=True, bbappend=False):
- """Guess a bitbake recipe file"""
- file_list = []
- if not topdir:
- topdir = '.'
- for root, dirs, files in os.walk(topdir):
- file_list.extend([os.path.join(root, fname) for fname in files])
- if not recursive:
- del dirs[:]
- # Skip .git dir in any case
- if '.git' in dirs:
- dirs.remove('.git')
- return guess_bb_file(file_list, bbappend)
-
-def guess_bb_path_from_repo(repo, treeish=None, topdir='', recursive=True,
- bbappend=False):
- """Guess a bitbake recipe path from a git repository"""
- topdir = topdir.rstrip('/') + ('/') if topdir else ''
- # Search from working copy
- if not treeish:
- abspath = guess_bb_path_from_fs(os.path.join(repo.path, topdir),
- recursive, bbappend)
- return os.path.relpath(abspath, repo.path)
-
- # Search from treeish
- try:
- file_list = [nam for (mod, typ, sha, nam) in
- repo.list_tree(treeish, recursive, topdir) if typ == 'blob']
- except GitRepositoryError as err:
- raise GbpError("Failed to search bb recipe from treeish %s, "
- "Git error: %s" % (treeish, err))
- return guess_bb_file(file_list, bbappend)
-
-def guess_bb_path(options, repo, treeish=None, bbappend=False):
- """Guess recipe path, relative to repo rootdir"""
- bb_path = options.bb_file
- if options.bb_file:
- if not treeish:
- path = os.path.join(repo.path, bb_path)
- if not os.path.exists(path):
- raise GbpError("'%s' does not exist" % bb_path)
- else:
- try:
- repo.show("%s:%s" % (treeish, bb_path))
- except GbpError as err:
- raise GbpError(str(err))
- else:
- bb_path = guess_bb_path_from_repo(repo, treeish, options.meta_dir,
- bbappend=bbappend)
- return bb_path
-
-def parse_bb(cfg_data, options, repo, treeish=None, bbappend=False):
- """Find and parse a bb recipe from a repository"""
- try:
- bb_path = guess_bb_path(options, repo, treeish, bbappend=bbappend)
- gbp.log.debug("Using recipe '%s'" % bb_path)
- options.meta_dir = os.path.dirname(bb_path)
- if treeish:
- pkg_data = bb_from_repo(cfg_data, repo, treeish, bb_path)
- else:
- full_path = os.path.join(repo.path, bb_path)
- pkg_data = BBFile(full_path, cfg_data)
- except GbpError as err:
- raise GbpError("Can't parse bb recipe: %s" % err)
- return pkg_data
-
-
-def guess_pkg_from_dir(pkg_dir, tinfoil):
- """Guess a package from a directory in configured bitbake environment"""
- abspath = os.path.abspath(pkg_dir)
- layer_dirs = tinfoil.config_data.getVar('BBLAYERS').split()
- gbp.log.debug("Checking if %s is in %s" % (abspath, layer_dirs))
- layer_dir = ''
- for path in layer_dirs:
- if abspath.startswith(path):
- layer_dir = path
- if not layer_dir:
- raise GbpError("%s not under configured layers" % abspath)
-
- bb_files = [path for path in tinfoil.cooker_data.pkg_fn
- if os.path.dirname(path) == abspath]
- if len(bb_files):
- bb_file = bb_files[-1]
- gbp.log.debug("Found %d recipes in %s, choosing %s" %
- (len(bb_files), pkg_dir, os.path.basename(bb_file)))
- else:
- raise GbpError("No recipes found in %s" % pkg_dir)
- return bb_file
-
-def guess_pkg(tinfoil, pkg):
- """Guess package (recipe) from configured bitbake environment"""
- if pkg in tinfoil.cooker_data.pkg_pn:
- pkg_bb = tinfoil.cooker_data.pkg_pn[pkg][0]
- elif not os.path.isdir(pkg):
- abspath = os.path.abspath(pkg)
- if abspath in tinfoil.cooker_data.pkg_fn:
- pkg_bb = abspath
- else:
- raise GbpError("Package %s not found in any configured layer" % pkg)
- elif os.path.exists(pkg):
- pkg_bb = guess_pkg_from_dir(pkg, tinfoil)
- else:
- raise GbpError("Unable to find %s" % pkg)
- return pkg_bb
-
-
-# Initialize module
-bb = import_bb()
# vim: set fileencoding=utf-8 :
#
-# (C) 2007,2009 Guido Guenther <agx@sigxcpu.org>
+# (C) 2007,2009,2015,2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""
Simple class wrappers for the various external commands needed by
git-buildpackage and friends
import subprocess
import os
-import os.path
import signal
+import sys
+from contextlib import contextmanager
+from tempfile import TemporaryFile
+
import gbp.log as log
+
class CommandExecFailed(Exception):
"""Exception raised by the Command class"""
pass
+@contextmanager
+def proxy_stdf():
+ """
+ Circulate stdout/stderr via a proper file object. Designed to work around a
+ problem where Python nose replaces sys.stdout/stderr with a custom 'Tee'
+ object that is not a file object (compatible) and thus causes a crash with
+ Popen.
+ """
+ tmp_stdout = sys.stdout
+ try:
+ tmp_stdout.fileno()
+ except Exception:
+ tmp_stdout = TemporaryFile()
+
+ tmp_stderr = sys.stderr
+ try:
+ tmp_stderr.fileno()
+ except Exception:
+ tmp_stderr = TemporaryFile()
+
+ try:
+ yield tmp_stdout, tmp_stderr
+ finally:
+ if tmp_stdout != sys.stdout:
+ tmp_stdout.seek(0)
+ sys.stdout.write(tmp_stdout.read().decode())
+ if tmp_stderr != sys.stderr:
+ tmp_stderr.seek(0)
+ sys.stderr.write(tmp_stderr.read().decode())
+
+
class Command(object):
"""
Wraps a shell command, so we don't have to store any kind of command
line options in one of the git-buildpackage commands
- """
+ Note that it does not do any shell quoting even with shell=True so
+ you have to quote arguments yourself if necessary.
+
+ If cmd doesn't contain a path component it will be looked up in $PATH.
+ """
def __init__(self, cmd, args=[], shell=False, extra_env=None, cwd=None,
- capture_stderr=False):
+ capture_stderr=False,
+ capture_stdout=False):
self.cmd = cmd
self.args = args
- self.run_error = "'%s' failed" % (" ".join([self.cmd] + self.args))
+ self.run_error = self._f("'%s' failed: {err_reason}",
+ (" ".join([self.cmd] + self.args)))
self.shell = shell
- self.retcode = 1
- self.stderr = b''
+ self.capture_stdout = capture_stdout
self.capture_stderr = capture_stderr
self.cwd = cwd
if extra_env is not None:
self.env.update(extra_env)
else:
self.env = None
+ self._reset_state()
+
+ @staticmethod
+ def _f(format, *args):
+ """Build error string template
+
+ '%' expansion is performed while curly braces in args are
+ quoted so we don't accidentally try to expand them when
+ printing an error message later that uses one of our
+ predefined error variables stdout, stderr, stderr_or_reason
+ and self.err_reason.
+
+ >>> Command._f("foo %s", "bar")
+ 'foo bar'
+ >>> Command._f("{foo} %s %s", "bar", "baz")
+ '{foo} bar baz'
+ >>> Command._f("{foo} bar")
+ '{foo} bar'
+
+ """
+ def _q(arg):
+ return arg.replace('{', '{{').replace('}', '}}')
+ return format % tuple([_q(arg) for arg in args])
+
+ def _reset_state(self):
+ self.retcode = 1
+ self.stdout, self.stderr, self.err_reason = [''] * 3
def __call(self, args):
"""
- Wraps subprocess.call so we can be verbose and fix python's
+ Wraps subprocess.call so we can be verbose and fix Python's
SIGPIPE handling
"""
def default_sigpipe():
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
log.debug("%s %s %s" % (self.cmd, self.args, args))
- self.stderr = b''
- stderr_arg = subprocess.PIPE if self.capture_stderr else None
- cmd = [ self.cmd ] + self.args + args
+ self._reset_state()
+ cmd = [self.cmd] + self.args + args
if self.shell:
# subprocess.call only cares about the first argument if shell=True
cmd = " ".join(cmd)
- popen = subprocess.Popen(cmd,
- cwd=self.cwd,
- shell=self.shell,
- env=self.env,
- preexec_fn=default_sigpipe,
- stderr=stderr_arg)
- (dummy, stderr) = popen.communicate()
- self.stderr = stderr
- return popen.returncode
-
- def __run(self, args, quiet=False):
+ with proxy_stdf() as (stdout, stderr):
+ stdout_arg = subprocess.PIPE if self.capture_stdout else stdout
+ stderr_arg = subprocess.PIPE if self.capture_stderr else stderr
+
+ try:
+ popen = subprocess.Popen(cmd,
+ cwd=self.cwd,
+ shell=self.shell,
+ env=self.env,
+ preexec_fn=default_sigpipe,
+ stdout=stdout_arg,
+ stderr=stderr_arg)
+ (self.stdout, self.stderr) = popen.communicate()
+ if self.stdout is not None:
+ self.stdout = self.stdout.decode()
+ if self.stderr is not None:
+ self.stderr = self.stderr.decode()
+ except OSError as err:
+ self.err_reason = "execution failed: %s" % str(err)
+ self.retcode = 1
+ raise
+
+ self.retcode = popen.returncode
+ if self.retcode < 0:
+ self.err_reason = "it was terminated by signal %d" % -self.retcode
+ elif self.retcode > 0:
+ self.err_reason = "it exited with %d" % self.retcode
+ return self.retcode
+
+ def _log_err(self):
+ "Log an error message"
+ log.err(self._format_err())
+
+ def _format_err(self):
+ """Log an error message
+
+ This allows to replace stdout, stderr and err_reason in
+ the self.run_error.
"""
- run self.cmd adding args as additional arguments
+ stdout = self.stdout.rstrip() if self.stdout else self.stdout
+ stderr = self.stderr.rstrip() if self.stderr else self.stderr
+ stderr_or_reason = self.stderr.rstrip() if self.stderr else self.err_reason
+ return self.run_error.format(stdout=stdout,
+ stderr=stderr,
+ stderr_or_reason=stderr_or_reason,
+ err_reason=self.err_reason)
- @param quiet: don't log errors to stderr Mostly useful during unit testing.
+ def __call__(self, args=[], quiet=False):
+ """Run the command and raise exception on errors
- Be verbose about errors and encode them in the return value, don't pass
- on exceptions.
- """
- try:
- retcode = self.__call(args)
- if retcode < 0:
- err_detail = "it was terminated by signal %d" % -retcode
- elif retcode > 0:
- err_detail = "it exited with %d" % retcode
- except OSError as err:
- err_detail = "execution failed: %s" % err
- retcode = 1
- if retcode and not quiet:
- log.err("%s: %s" % (self.run_error, err_detail))
- self.retcode = retcode
- return retcode
+ If run quietly it will not print an error message via the
+ L{gbp.log} logging API.
- def __call__(self, args=[], quiet=False):
- """
- Run the command and convert all errors into CommandExecFailed. Assumes
- that the lower levels printed an error message (the command itself and
- also via our logging api) - only useful if you only expect 0 as result.
+ Whether the command prints anything to stdout/stderr depends on
+ the I{capture_stderr}, I{capture_stdout} instance variables.
+
+ All errors will be reported as subclass of the
+ L{CommandExecFailed} exception including a non zero exit
+ status of the run command.
+ @param args: additional command line arguments
+ @type args: C{list} of C{strings}
@param quiet: don't log failed execution to stderr. Mostly useful during
unit testing
@type quiet: C{bool}
>>> Command("/bin/true")(["foo", "bar"])
- >>> Command("/foo/bar")(quiet=True)
+ >>> Command("/foo/bar")(quiet=True) # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
...
- CommandExecFailed
+ gbp.command_wrappers.CommandExecFailed
"""
- if self.__run(args, quiet):
- raise CommandExecFailed
+ try:
+ ret = self.__call(args)
+ except OSError:
+ ret = 1
+ if ret:
+ if not quiet:
+ self._log_err()
+ raise CommandExecFailed(self._format_err())
- def call(self, args):
- """
- Like __call__ but let the caller handle the return status and don't
- use the logging api for errors.
+ def call(self, args, quiet=True):
+ """Like L{__call__} but let the caller handle the return status.
+
+ Only raise L{CommandExecFailed} if we failed to launch the command
+ at all (i.e. if it does not exist) not if the command returned
+ nonzero.
+
+ Logs errors using L{gbp.log} by default.
+
+ @param args: additional command line arguments
+ @type args: C{list} of C{strings}
+ @param quiet: don't log failed execution to stderr. Mostly useful during
+ unit testing
+ @type quiet: C{bool}
+ @returns: the exit status of the run command
+ @rtype: C{int}
>>> Command("/bin/true").call(["foo", "bar"])
0
>>> Command("/foo/bar").call(["foo", "bar"]) # doctest:+ELLIPSIS
Traceback (most recent call last):
...
- CommandExecFailed: Execution failed: ...
+ gbp.command_wrappers.CommandExecFailed: execution failed: ...
+ >>> c = Command("/bin/true", capture_stdout=True,
+ ... extra_env={'LC_ALL': 'C'})
+ >>> c.call(["--version"])
+ 0
+ >>> c.stdout.startswith('true')
+ True
+ >>> c = Command("/bin/false", capture_stdout=True,
+ ... extra_env={'LC_ALL': 'C'})
+ >>> c.call(["--help"])
+ 1
+ >>> c.stdout.startswith('Usage:')
+ True
"""
+ ret = 1
try:
ret = self.__call(args)
- except OSError as err:
- raise CommandExecFailed("Execution failed: %s" % err)
+ except OSError:
+ raise CommandExecFailed(self.err_reason)
+ finally:
+ if ret and not quiet:
+ self._log_err()
return ret
try:
os.chdir(dir)
Command.__call__(self, list(*args))
+ finally:
os.chdir(curdir)
- except Exception:
- os.chdir(curdir)
- raise
class UnpackTarArchive(Command):
compression = '-a'
Command.__init__(self, 'tar', exclude +
- ['-C', dir, compression, '-xf', archive ])
- self.run_error = 'Couldn\'t unpack "%s"' % self.archive
+ ['-C', dir, compression, '-xf', archive])
+ self.run_error = self._f("Couldn't unpack '%s': {err_reason}", self.archive)
class PackTarArchive(Command):
"""Wrap tar to pack a compressed tar archive"""
- def __init__(self, archive, dir, dest, filters=[], compression=None,
- transform=None):
+ def __init__(self, archive, dir, dest, filters=[], compression=None):
self.archive = archive
self.dir = dir
exclude = [("--exclude=%s" % _filter) for _filter in filters]
if not compression:
compression = '-a'
- args = exclude + ['-C', dir, compression, '-cf', archive ]
-
- if transform != None:
- args.append('--transform=%s' % transform)
-
- args.append(dest)
-
- Command.__init__(self, 'tar', args)
- self.run_error = 'Couldn\'t repack "%s"' % self.archive
+ Command.__init__(self, 'tar', exclude +
+ ['-C', dir, compression, '-cf', archive, dest])
+ self.run_error = self._f("Couldn't repack '%s': {err_reason}", self.archive)
class CatenateTarArchive(Command):
"Wrap rm to remove a whole directory tree"
def __init__(self, tree):
self.tree = tree
- Command.__init__(self, 'rm', [ '-rf', tree ])
- self.run_error = 'Couldn\'t remove "%s"' % self.tree
-
-
-class Dch(Command):
- """Wrap dch and set a specific version"""
- def __init__(self, version, msg):
- args = ['-v', version]
- if msg:
- args.append(msg)
- Command.__init__(self, 'dch', args)
- self.run_error = "Dch failed."
+ Command.__init__(self, 'rm', ['-rf', tree])
+ self.run_error = self._f("Couldn't remove '%s': {err_reason}", self.tree)
class DpkgSourceExtract(Command):
"""
Wrap dpkg-source to extract a Debian source package into a certain
- directory, this needs
+ directory
"""
def __init__(self):
Command.__init__(self, 'dpkg-source', ['-x'])
def __call__(self, dsc, output_dir):
- self.run_error = 'Couldn\'t extract "%s"' % dsc
+ self.run_error = self._f("Couldn't extract '%s': {err_reason}", dsc)
Command.__call__(self, [dsc, output_dir])
self.archive = archive
self.dir = dir
- Command.__init__(self, 'unzip', [ "-q", archive, '-d', dir ])
- self.run_error = 'Couldn\'t unpack "%s"' % self.archive
+ Command.__init__(self, 'unzip', ["-q", archive, '-d', dir])
+ self.run_error = self._f("Couldn't unpack '%s': {err_reason}", self.archive)
class CatenateZipArchive(Command):
Command.__init__(self, 'zipmerge', [archive], **kwargs)
def __call__(self, target):
+ self.run_error = self._f("Couldn't append '%s' to '%s': {err_reason}",
+ target, self.archive)
Command.__call__(self, [target])
"Mother/Father of all git commands"
def __init__(self, cmd, args=[], **kwargs):
Command.__init__(self, 'git', [cmd] + args, **kwargs)
- self.run_error = "Couldn't run git %s" % cmd
+ self.run_error = self._f("Couldn't run git %s: {err_reason}", cmd)
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
-# vim: set fileencoding=utf-8 :
+# vim: set fileencoding=utf-8:
#
-# (C) 2006,2007,2010-2012 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006,2007,2010-2012,2015,2016,2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""handles command line and config file option parsing for the gbp commands"""
from optparse import OptionParser, OptionGroup, Option, OptionValueError
-from configparser import SafeConfigParser, NoSectionError
+import configparser
from copy import copy
+import errno
import os.path
-import tempfile
+import sys
+
+from gbp.errors import GbpError
try:
from gbp.version import gbp_version
except ImportError:
gbp_version = "[Unknown version]"
import gbp.tristate
+import gbp.log
from gbp.git import GitRepositoryError, GitRepository
no_upstream_branch_msg = """
Repository does not have branch '%s' for upstream sources. If there is none see
file:///usr/share/doc/git-buildpackage/manual-html/gbp.import.html#GBP.IMPORT.CONVERT
-on howto create it or check the --create-missing-branches option. Otherwise,
-use --upstream-branch to specify it.
+on howto create it otherwise use --upstream-branch to specify it.
"""
+no_debian_branch_msg = """
+Repository does not have branch '%s' for packaging sources. If there is none see
+file:///usr/share/doc/git-buildpackage/manual-html/gbp.import.html#GBP.IMPORT.CONVERT
+on howto create it otherwise use --debian-branch to specify it.
+"""
+
+
def expand_path(option, opt, value):
value = os.path.expandvars(value)
return os.path.expanduser(value)
+
def check_tristate(option, opt, value):
try:
val = gbp.tristate.Tristate(value)
return val
-def safe_option(f):
+def save_option(f):
+ """save options on the underlying parser"""
def _decorator(self, *args, **kwargs):
obj = self
option_name = kwargs.get('option_name')
if not option_name and len(args):
option_name = args[0]
- # We're decorating GbpOption not GbpOptionParser
+ # We're decorating GbpOption but store valid_options on
+ # GbpOptionParser
if not hasattr(obj, 'valid_options'):
if not hasattr(obj, 'parser'):
raise ValueError("Can only decorete GbpOptionParser and GbpOptionGroup not %s" % obj)
TYPE_CHECKER['path'] = expand_path
TYPE_CHECKER['tristate'] = check_tristate
+
class GbpOptionParser(OptionParser):
"""
Handles commandline options and parsing of config files
@type defaults: dict
@cvar help: help messages
@type help: dict
- @cvar def_config_files: list of default config files we parse
- @type def_config_files: list
+ @cvar def_config_files: config files we parse
+ @type def_config_files: dict (type, path)
"""
- defaults = { 'debian-branch' : 'master',
- 'packaging-branch' : 'master',
- 'upstream-branch' : 'upstream',
- 'upstream-tree' : 'TAG',
- 'pristine-tar' : 'False',
- 'pristine-tar-commit': 'False',
- 'filter-pristine-tar' : 'False',
- 'sign-tags' : 'False',
- 'force-create' : 'False',
- 'no-create-orig' : 'False',
- 'keyid' : '',
- 'posttag' : '',
- 'postbuild' : '',
- 'prebuild' : '',
- 'postexport' : '',
- 'postimport' : '',
- 'build' : 'True',
- 'hooks' : 'True',
- 'debian-tag' : 'debian/%(version)s',
- 'debian-tag-msg' : '%(pkg)s Debian release %(version)s',
- 'upstream-tag' : 'upstream/%(version)s',
- 'import-msg' : 'Imported Upstream version %(version)s',
- 'commit-msg' : 'Update changelog for %(version)s release',
- 'filter' : [],
- 'snapshot-number' : 'snapshot + 1',
- 'git-log' : '--no-merges',
- 'export' : 'HEAD',
- 'overlay' : 'False',
- 'tarball-dir' : '',
- 'ignore-new' : 'False',
- 'ignore-branch' : 'False',
- 'meta' : 'True',
- 'meta-closes' : 'Closes|LP',
- 'full' : 'False',
- 'id-length' : '0',
- 'git-author' : 'False',
- 'ignore-regex' : '',
- 'compression' : 'auto',
- 'compression-level': '9',
- 'remote-url-pattern' : 'ssh://git.debian.org/git/collab-maint/%(pkg)s.git',
- 'multimaint' : 'True',
- 'multimaint-merge': 'False',
- 'pbuilder' : 'False',
- 'qemubuilder' : 'False',
- 'dist' : 'sid',
- 'arch' : '',
- 'interactive' : 'True',
- 'color' : 'auto',
- 'color-scheme' : '',
- 'customizations' : '',
- 'spawn-editor' : 'release',
- 'patch-numbers' : 'True',
- 'notify' : 'auto',
- 'merge' : 'True',
- 'track' : 'True',
- 'author-is-committer': 'False',
- 'author-date-is-committer-date': 'False',
- 'create-missing-branches': 'False',
- 'submodules' : 'False',
- 'time-machine' : 1,
- 'pbuilder-autoconf' : 'True',
- 'pbuilder-options': '',
- 'template-dir': '',
- 'remote-config': '',
- 'allow-unauthenticated': 'False',
- 'symlink-orig': 'True',
- 'purge': 'True',
- 'drop': 'False',
- 'commit': 'False',
- 'tmp-dir' : '/var/tmp/gbp/',
- }
+ defaults = {'abbrev': 7,
+ 'add-upstream-vcs': 'False',
+ 'aliases': 'True',
+ 'allow-unauthenticated': 'False',
+ 'arch': '',
+ 'author-date-is-committer-date': 'False',
+ 'author-is-committer': 'False',
+ 'bare': 'True',
+ 'cleaner': '/bin/true',
+ 'color': 'auto',
+ 'color-scheme': '',
+ 'commit': 'False',
+ 'commit-msg': 'Update changelog for %(version)s release',
+ 'component': [],
+ 'compression': 'auto',
+ 'compression-level': '',
+ 'create-missing-branches': 'False',
+ 'customizations': '',
+ 'dch-opt': [],
+ 'debian-branch': 'master',
+ 'debian-tag': 'debian/%(version)s',
+ 'debian-tag-msg': '%(pkg)s Debian release %(version)s',
+ 'defuse-gitattributes': 'auto',
+ 'dist': 'sid',
+ 'drop': 'False',
+ 'export': 'HEAD',
+ 'export-dir': '',
+ 'filter': [],
+ 'filter-pristine-tar': 'False',
+ 'force-create': 'False',
+ 'full': 'False',
+ 'git-author': 'False',
+ 'git-log': '--no-merges',
+ 'git-ref': 'upstream/latest',
+ 'hooks': 'True',
+ 'id-length': '0',
+ 'ignore-branch': 'False',
+ 'ignore-new': 'False',
+ 'ignore-regex': '',
+ 'import-msg': 'New upstream version %(version)s',
+ 'interactive': 'True',
+ 'keyid': '',
+ 'merge': 'True',
+ 'merge-mode': 'auto',
+ 'meta': 'True',
+ 'meta-closes': 'Closes|LP',
+ 'meta-closes-bugnum': r'(?:bug|issue)?\#?\s?\d+',
+ 'multimaint': 'True',
+ 'multimaint-merge': 'False',
+ 'no-create-orig': 'False',
+ 'notify': 'auto',
+ 'overlay': 'False',
+ 'patch-num-format': '%04d-',
+ 'patch-numbers': 'True',
+ 'pbuilder': 'False',
+ 'pbuilder-autoconf': 'True',
+ 'pbuilder-options': '',
+ 'postbuild': '',
+ 'postclone': '',
+ 'postedit': '',
+ 'postexport': '',
+ 'postimport': '',
+ 'postunpack': '',
+ 'posttag': '',
+ 'pq-from': 'DEBIAN',
+ 'prebuild': '',
+ 'preexport': '',
+ 'pristine-tar': 'False',
+ 'pristine-tar-commit': 'False',
+ 'purge': 'True',
+ 'qemubuilder': 'False',
+ 'remote-config': '',
+ 'remote-url-pattern': 'ssh://git.debian.org/git/collab-maint/%(pkg)s.git',
+ 'renumber': 'False',
+ 'repo-email': 'DEBIAN',
+ 'repo-user': 'DEBIAN',
+ 'rollback': 'True',
+ 'sign-tags': 'False',
+ 'snapshot-number': 'snapshot + 1',
+ 'spawn-editor': 'release',
+ 'submodules': 'False',
+ 'symlink-orig': 'True',
+ 'tarball-dir': '',
+ 'upstream-signatures': 'auto',
+ 'template-dir': '',
+ 'time-machine': 1,
+ 'track': 'True',
+ 'track-missing': 'False',
+ 'upstream-branch': 'upstream',
+ 'upstream-tag': 'upstream/%(version)s',
+ 'upstream-tree': 'TAG',
+ 'upstream-vcs-tag': '',
+ 'urgency': 'medium',
+ }
help = {
- 'debian-branch':
- ("Branch the Debian package is being developed on, "
- "default is '%(debian-branch)s'"),
- 'packaging-branch':
- ("Branch the packaging is being maintained on, "
- "rpm counterpart of the 'debian-branch' option, "
- "default is '%(packaging-branch)s'"),
- 'upstream-branch':
- "Upstream branch, default is '%(upstream-branch)s'",
- 'upstream-tree':
- ("Where to generate the upstream tarball from "
- "(tag or branch), default is '%(upstream-tree)s'"),
- 'debian-tag':
- ("Format string for debian tags, "
- "default is '%(debian-tag)s'"),
- 'debian-tag-msg':
- ("Format string for signed debian-tag messages, "
- "default is '%(debian-tag-msg)s'"),
- 'upstream-tag':
- ("Format string for upstream tags, "
- "default is '%(upstream-tag)s'"),
- 'sign-tags':
- "Whether to sign tags, default is '%(sign-tags)s'",
- 'keyid':
- "GPG keyid to sign tags with, default is '%(keyid)s'",
- 'import-msg':
- ("Format string for commit message used to commit "
- "the upstream tarball, default is '%(import-msg)s'"),
- 'commit-msg':
- ("Format string for commit messag used to commit, "
- "the changelog, default is '%(commit-msg)s'"),
- 'pristine-tar':
- ("Use pristine-tar to create orig tarball, "
- "default is '%(pristine-tar)s'"),
- 'pristine-tar-commit':
- ("When generating a tarball commit it to the pristine-tar branch '%(pristine-tar-commit)s' "
- "default is '%(pristine-tar-commit)s'"),
- 'filter-pristine-tar':
- "Filter pristine-tar when filter option is used, default is '%(filter-pristine-tar)s'",
- 'filter':
- "Files to filter out during import (can be given multiple times), default is %(filter)s",
- 'git-author':
- "Use name and email from git-config for changelog trailer, default is '%(git-author)s'",
- 'full':
- "Include the full commit message instead of only the first line, default is '%(full)s'",
- 'meta':
- "Parse meta tags in commit messages, default is '%(meta)s'",
- 'meta-closes':
- "Meta tags for the bts close commands, default is '%(meta-closes)s'",
- 'ignore-new':
- "Build with uncommited changes in the source tree, default is '%(ignore-new)s'",
- 'ignore-branch':
- ("Build although debian-branch != current branch, "
- "default is '%(ignore-branch)s'"),
- 'overlay':
- ("extract orig tarball when using export-dir option, "
- "default is '%(overlay)s'"),
- 'remote-url-pattern':
- ("Remote url pattern to create the repo at, "
- "default is '%(remote-url-pattern)s'"),
- 'multimaint':
- "Note multiple maintainers, default is '%(multimaint)s'",
- 'multimaint-merge':
- ("Merge commits by maintainer, "
- "default is '%(multimaint-merge)s'"),
- 'pbuilder':
- ("Invoke git-pbuilder for building, "
- "default is '%(pbuilder)s'"),
- 'dist':
- ("Build for this distribution when using git-pbuilder, "
- "default is '%(dist)s'"),
- 'arch':
- ("Build for this architecture when using git-pbuilder, "
- "default is '%(arch)s'"),
- 'qemubuilder':
- ("Invoke git-pbuilder with qemubuilder for building, "
- "default is '%(qemubuilder)s'"),
- 'interactive':
- "Run command interactively, default is '%(interactive)s'",
- 'color':
- "Whether to use colored output, default is '%(color)s'",
- 'color-scheme':
- ("Colors to use in output (when color is enabled), format "
- "is '<debug>:<info>:<warning>:<error>', e.g. "
- "'cyan:34::'. Numerical values and color names are "
- "accepted, empty fields indicate using the default."),
- 'spawn-editor':
- ("Whether to spawn an editor after adding the "
- "changelog entry, default is '%(spawn-editor)s'"),
- 'patch-numbers':
- ("Whether to number patch files, "
- "default is %(patch-numbers)s"),
- 'notify':
- ("Whether to send a desktop notification after the build, "
- "default is '%(notify)s'"),
- 'merge':
- ("After the import merge the result to the debian branch, "
- "default is '%(merge)s'"),
- 'track':
- ("Set up tracking for remote branches, "
- "default is '%(track)s'"),
- 'author-is-committer':
- ("Use the authors's name also as the committer's name, "
- "default is '%(author-is-committer)s'"),
- 'author-date-is-committer-date':
- ("Use the authors's date as the committer's date, "
- "default is '%(author-date-is-committer-date)s'"),
- 'create-missing-branches':
- ("Create missing branches automatically, "
- "default is '%(create-missing-branches)s'"),
- 'submodules':
- ("Transparently handle submodules in the upstream tree, "
- "default is '%(submodules)s'"),
- 'postimport':
- ("hook run after a successful import, "
- "default is '%(postimport)s'"),
- 'build':
- ("Enable running builder, default is %(build)s"),
- 'hooks':
- ("Enable running all hooks, default is %(hooks)s"),
- 'time-machine':
- ("don't try head commit only to apply the patch queue "
- "but look TIME_MACHINE commits back, "
- "default is '%(time-machine)d'"),
- 'pbuilder-autoconf':
- ("Wheter to configure pbuilder automatically, "
- "default is '%(pbuilder-autoconf)s'"),
- 'pbuilder-options':
- ("Options to pass to pbuilder, "
- "default is '%(pbuilder-options)s'"),
- 'template-dir':
- ("Template directory used by git init, "
- "default is '%(template-dir)s'"),
- 'remote-config':
- ("Remote defintion in gbp.conf used to create the remote "
- "repository, default is '%(remote-config)s'"),
- 'allow-unauthenticated':
- ("Don't verify integrity of downloaded source, "
- "default is '%(allow-unauthenticated)s'"),
- 'symlink-orig':
- ("Whether to creat a symlink from the upstream tarball "
- "to the orig.tar.gz if needed, default is "
- "'%(symlink-orig)s'"),
- 'purge':
- "Purge exported package build directory. Default is '%(purge)s'",
- 'drop':
- ("In case of 'export' drop the patch-queue branch "
- "after export. Default is '%(drop)s'"),
- 'commit':
- "commit changes after export, Default is '%(commit)s'",
- 'tmp-dir':
- ("Base directory under which temporary directories are "
- "created, default is '%(tmp-dir)s'"),
- }
-
- def_config_files = [ '/etc/git-buildpackage/gbp.conf',
- '~/.gbp.conf',
- '%(top_dir)s/.gbp.conf',
- '%(top_dir)s/debian/gbp.conf',
- '%(git_dir)s/gbp.conf' ]
+ 'add-upstream-vcs':
+ "Whether to add the upstream vcs as additional remote "
+ "default is '%(add-upstream-vcs)s'",
+ 'aliases':
+ "Whether to expand gbp specific aliases like `salsa:`,"
+ "default is '%(aliases)s'",
+ 'debian-branch':
+ "Branch the Debian package is being developed on, "
+ "default is '%(debian-branch)s'",
+ 'upstream-branch':
+ "Upstream branch, default is '%(upstream-branch)s'",
+ 'upstream-tree':
+ "Where to generate the upstream tarball from "
+ "(tag or branch), default is '%(upstream-tree)s'",
+ 'pq-from':
+ "How to find the patch queue base. DEBIAN or TAG, "
+ "the default is '%(pq-from)s'",
+ 'debian-tag':
+ "Format string for debian tags, "
+ "default is '%(debian-tag)s'",
+ 'debian-tag-msg':
+ "Format string for signed debian-tag messages, "
+ "default is '%(debian-tag-msg)s'",
+ 'upstream-tag':
+ "Format string for upstream tags, "
+ "default is '%(upstream-tag)s'",
+ 'sign-tags':
+ "Whether to sign tags, default is '%(sign-tags)s'",
+ 'keyid':
+ "GPG keyid to sign tags with, default is '%(keyid)s'",
+ 'import-msg':
+ "Format string for commit message used to commit "
+ "the upstream tarball, default is '%(import-msg)s'",
+ 'commit-msg':
+ "Format string for commit message used to commit, "
+ "the changelog, default is '%(commit-msg)s'",
+ 'pristine-tar':
+ "Use pristine-tar to create orig tarball, "
+ "default is '%(pristine-tar)s'",
+ 'pristine-tar-commit':
+ "When generating a tarball, commit it to the pristine-tar branch '%(pristine-tar-commit)s' "
+ "default is '%(pristine-tar-commit)s'",
+ 'filter-pristine-tar':
+ "Filter pristine-tar when filter option is used, default is '%(filter-pristine-tar)s'",
+ 'filter':
+ "Files to filter out during import (can be given multiple times), default is %(filter)s",
+ 'git-author':
+ "Use name and email from git-config for changelog trailer, default is '%(git-author)s'",
+ 'full':
+ "Include the full commit message instead of only the first line, default is '%(full)s'",
+ 'meta':
+ "Parse meta tags in commit messages, default is '%(meta)s'",
+ 'meta-closes':
+ "Meta tags for the bts close commands, default is '%(meta-closes)s'",
+ 'meta-closes-bugnum':
+ "Meta bug number format, default is '%(meta-closes-bugnum)s'",
+ 'ignore-new':
+ "Build with uncommitted changes in the source tree, default is '%(ignore-new)s'",
+ 'ignore-branch':
+ "Build although debian-branch != current branch, "
+ "default is '%(ignore-branch)s'",
+ 'overlay':
+ "extract orig tarball when using export-dir option, "
+ "default is '%(overlay)s'",
+ 'remote-url-pattern':
+ "Remote url pattern to create the repo at, "
+ "default is '%(remote-url-pattern)s'",
+ 'multimaint':
+ "Note multiple maintainers, default is '%(multimaint)s'",
+ 'multimaint-merge':
+ "Merge commits by maintainer, "
+ "default is '%(multimaint-merge)s'",
+ 'pbuilder':
+ "Invoke git-pbuilder for building, "
+ "default is '%(pbuilder)s'",
+ 'dist':
+ "Build for this distribution when using git-pbuilder, "
+ "default is '%(dist)s'",
+ 'arch':
+ "Build for this architecture when using git-pbuilder, "
+ "default is '%(arch)s'",
+ 'qemubuilder':
+ "Invoke git-pbuilder with qemubuilder for building, "
+ "default is '%(qemubuilder)s'",
+ 'interactive':
+ "Run command interactively, default is '%(interactive)s'",
+ 'color':
+ "Whether to use colored output, default is '%(color)s'",
+ 'color-scheme':
+ "Colors to use in output (when color is enabled), format "
+ "is '<debug>:<info>:<warning>:<error>', e.g. "
+ "'cyan:34::'. Numerical values and color names are "
+ "accepted, empty fields indicate using the default.",
+ 'spawn-editor':
+ "Whether to spawn an editor after adding the "
+ "changelog entry, default is '%(spawn-editor)s'",
+ 'patch-numbers':
+ "Whether to number patch files, "
+ "default is %(patch-numbers)s",
+ 'patch-num-format':
+ "The format specifier for patch number prefixes, "
+ "default is %(patch-num-format)s",
+ 'renumber':
+ "Whether to renumber patches exported from patch queues, "
+ "instead of preserving the number specified in "
+ "'Gbp-Pq: Name' tags, default is %(renumber)s",
+ 'notify':
+ "Whether to send a desktop notification after the build, "
+ "default is '%(notify)s'",
+ 'merge':
+ "After the import merge the result to the debian branch, "
+ "default is '%(merge)s'",
+ 'merge-mode':
+ "Howto merge the new upstream sources onto the debian branch, "
+ "default is '%(merge-mode)s'",
+ 'track':
+ "Set up tracking for remote branches, "
+ "default is '%(track)s'",
+ 'track-missing':
+ "Track missing remote branches, "
+ "default is '%(track-missing)s'",
+ 'author-is-committer':
+ "Use the authors's name also as the committer's name, "
+ "default is '%(author-is-committer)s'",
+ 'author-date-is-committer-date':
+ "Use the authors's date as the committer's date, "
+ "default is '%(author-date-is-committer-date)s'",
+ 'create-missing-branches':
+ "Create missing branches automatically, "
+ "default is '%(create-missing-branches)s'",
+ 'submodules':
+ "Transparently handle submodules in the upstream tree, "
+ "default is '%(submodules)s'",
+ 'postimport':
+ "hook run after a successful import, "
+ "default is '%(postimport)s'",
+ 'postunpack':
+ "hook run after a unpacking the tarballs, "
+ "default is '%(postunpack)s'",
+ 'hooks':
+ "Enable running all hooks, default is %(hooks)s",
+ 'upstream-signatures':
+ "Whether to import/export upstream tarball signatures",
+ 'time-machine':
+ "don't try to apply patch queue to head commit only. "
+ "Try at most TIME_MACHINE commits back, "
+ "default is '%(time-machine)d'",
+ 'pbuilder-autoconf':
+ "Whether to configure pbuilder automatically, "
+ "default is '%(pbuilder-autoconf)s'",
+ 'pbuilder-options':
+ "Options to pass to pbuilder, "
+ "default is '%(pbuilder-options)s'",
+ 'template-dir':
+ "Template directory used by git init, "
+ "default is '%(template-dir)s'",
+ 'remote-config':
+ "Remote definition in gbp.conf used to create the remote "
+ "repository, default is '%(remote-config)s'",
+ 'allow-unauthenticated':
+ "Don't verify integrity of downloaded source, "
+ "default is '%(allow-unauthenticated)s'",
+ 'symlink-orig':
+ "Whether to create a symlink from the upstream tarball "
+ "to the orig.tar.gz if needed, default is "
+ "'%(symlink-orig)s'",
+ 'purge':
+ "Purge exported package build directory. Default is '%(purge)s'",
+ 'drop':
+ "In case of 'export' drop the patch-queue branch "
+ "after export. Default is '%(drop)s'",
+ 'abbrev':
+ "abbreviate commits to this length. default is '%(abbrev)s'",
+ 'commit':
+ "commit changes after export, Default is '%(commit)s'",
+ 'rollback':
+ "Rollback repository changes when encountering an error",
+ 'component':
+ 'component name for additional tarballs',
+ 'bare':
+ "wether to create a bare repository on the remote side. "
+ "'Default is '%(bare)s'.",
+ 'urgency':
+ "Set urgency level, default is '%(urgency)s'",
+ 'repo-user':
+ "Set repo username from the DEBFULLNAME and DEBEMAIL "
+ "environment variables ('DEBIAN') or fallback to the "
+ "git configuration ('GIT'), default is '%(repo-user)s'",
+ 'repo-email':
+ "Set repo email from the DEBFULLNAME and DEBEMAIL "
+ "environment variables ('DEBIAN') or fallback to the "
+ "git configuration ('GIT'), default is '%(repo-email)s'",
+ 'upstream-vcs-tag':
+ "Upstream VCS tag added to the merge commit, "
+ "default is '%(upstream-vcs-tag)s'",
+ }
+
+ short_opts = {
+ 'urgency': '-U',
+ }
+
+ def_config_files = [('/etc/git-buildpackage/gbp.conf', 'system'),
+ ('~/.gbp.conf', 'global'),
+ ('%(top_dir)s/.gbp.conf', None),
+ ('%(top_dir)s/debian/gbp.conf', 'debian'),
+ ('%(git_dir)s/gbp.conf', None)]
+
+ list_opts = ['filter', 'component', 'dch-opt']
@classmethod
- def get_config_files(klass, no_local=False):
+ def get_config_files(cls, no_local=False):
"""
Get list of config files from the I{GBP_CONF_FILES} environment
variable.
@param no_local: don't return the per-repo configuration files
- @type no_local: C{str}
+ @type no_local: C{bool}
@return: list of config files we need to parse
@rtype: C{list}
+ >>> import re
>>> conf_backup = os.getenv('GBP_CONF_FILES')
>>> if conf_backup is not None: del os.environ['GBP_CONF_FILES']
>>> homedir = os.path.expanduser("~")
>>> files = GbpOptionParser.get_config_files()
- >>> files_mangled = [file.replace(homedir, 'HOME') for file in files]
- >>> files_mangled
- ['/etc/git-buildpackage/gbp.conf', 'HOME/.gbp.conf', '%(top_dir)s/.gbp.conf', '%(top_dir)s/debian/gbp.conf', '%(git_dir)s/gbp.conf']
+ >>> files_mangled = [re.sub("^%s" % homedir, 'HOME', file) for file in files]
+ >>> sorted(files_mangled)
+ ['%(git_dir)s/gbp.conf', '%(top_dir)s/.gbp.conf', '%(top_dir)s/debian/gbp.conf', '/etc/git-buildpackage/gbp.conf', 'HOME/.gbp.conf']
>>> files = GbpOptionParser.get_config_files(no_local=True)
- >>> files_mangled = [file.replace(homedir, 'HOME') for file in files]
- >>> files_mangled
+ >>> files_mangled = [re.sub("^%s" % homedir, 'HOME', file) for file in files]
+ >>> sorted(files_mangled)
['/etc/git-buildpackage/gbp.conf', 'HOME/.gbp.conf']
>>> os.environ['GBP_CONF_FILES'] = 'test1:test2'
>>> GbpOptionParser.get_config_files()
>>> if conf_backup is not None: os.environ['GBP_CONF_FILES'] = conf_backup
"""
envvar = os.environ.get('GBP_CONF_FILES')
- files = envvar.split(':') if envvar else klass.def_config_files
+ files = envvar.split(':') if envvar else [f for (f, _) in cls.def_config_files]
files = [os.path.expanduser(fname) for fname in files]
if no_local:
files = [fname for fname in files if fname.startswith('/')]
return files
- def _read_config_file(self, parser, repo, filename, git_treeish):
+ def _read_config_file(self, repo, filename):
"""Read config file"""
str_fields = {}
if repo:
str_fields['git_dir'] = repo.git_dir
if not repo.bare:
str_fields['top_dir'] = repo.path
-
- # Read per-tree config file
- if repo and git_treeish and filename.startswith('%(top_dir)s/'):
- with tempfile.NamedTemporaryFile() as tmp:
- relpath = filename.replace('%(top_dir)s/', '')
- try:
- config = repo.show('%s:%s' % (git_treeish, relpath))
- tmp.write(config)
- except GitRepositoryError:
- pass
- tmp.seek(0)
- parser.read(tmp.name)
- return
try:
filename = filename % str_fields
except KeyError:
# Skip if filename wasn't expanded, i.e. we're not in git repo
return
- parser.read(filename)
+ if (repo and
+ filename == os.path.join(repo.path, '.gbp.conf') and
+ os.path.exists(filename)):
+ self._warn_old_gbp_conf(filename)
+ self.config_parser.read(filename)
+
+ def _warn_old_config_section(self, oldcmd, cmd):
+ if not os.getenv("GBP_DISABLE_SECTION_DEPRECATION"):
+ gbp.log.warn("Old style config section [%s] found "
+ "please rename to [%s]" % (oldcmd, cmd))
+
+ def _warn_old_gbp_conf(self, gbp_conf):
+ if (not os.getenv("GBP_DISABLE_GBP_CONF_DEPRECATION") and
+ not self._warned_old_gbp_conf):
+ gbp.log.warn("Deprecated configuration file found at %s, "
+ "check gbp.conf(5) for alternatives" % gbp_conf)
+ self._warned_old_gbp_conf = True
+
+ @property
+ def config_file_sections(self):
+ """List of all found config file sections"""
+ return self.config_parser.sections()
+
+ @staticmethod
+ def _listify(value):
+ """
+ >>> GbpOptionParser._listify(None)
+ []
+ >>> GbpOptionParser._listify('string')
+ ['string']
+ >>> GbpOptionParser._listify('["q", "e", "d"] ')
+ ['q', 'e', 'd']
+ >>> GbpOptionParser._listify('[')
+ Traceback (most recent call last):
+ ...
+ configparser.Error: [ is not a proper list
+ """
+ # filter can be either a list or a string, always build a list:
+ if value:
+ if value.startswith('['):
+ try:
+ return eval(value)
+ except SyntaxError:
+ raise configparser.Error("%s is not a proper list" % value)
+ else:
+ return [value]
+ else:
+ return []
+
+ def parse_lists(self):
+ """
+ Parse options that can be given as lists
- def parse_config_files(self, git_treeish=None):
+ Since they take multiple arguments they can also be given in plural form
+ e.g. components instead of component.
+ """
+ for opt in self.list_opts:
+ try:
+ plural_opt = opt + 's'
+ valp = self._listify(self.config.get(plural_opt, None))
+ vals = self._listify(self.config[opt])
+ if valp and vals:
+ raise configparser.Error("Found %s and %s - use only one" % (valp, vals))
+ self.config[opt] = valp or vals
+ except ValueError:
+ raise configparser.Error("Failed to parse %s: %s" % (opt, self.config[opt]))
+
+ def parse_config_files(self):
"""
Parse the possible config files and set appropriate values
default values
"""
- parser = SafeConfigParser()
+ parser = self.config_parser
# Fill in the built in values
self.config = dict(self.__class__.defaults)
- # Update with the values from the defaults section. This is needed
- # in case the config file doesn't have a [<command>] section at all
config_files = self.get_config_files()
try:
- repo = GitRepository(".")
+ repo = GitRepository(".", toplevel=False)
except GitRepositoryError:
repo = None
# Read all config files
for filename in config_files:
- self._read_config_file(parser, repo, filename, git_treeish)
+ self._read_config_file(repo, filename)
+ # Update with the values from the defaults section. This is needed
+ # in case the config file doesn't have a [<command>] section at all
self.config.update(dict(parser.defaults()))
# Make sure we read any legacy sections prior to the real subcommands
# section i.e. read [gbp-pull] prior to [pull]
if (self.command.startswith('gbp-') or
- self.command.startswith('git-')):
+ self.command.startswith('git-')):
+ cmd = self.command[4:]
oldcmd = self.command
if parser.has_section(oldcmd):
self.config.update(dict(parser.items(oldcmd, raw=True)))
- cmd = self.command[4:]
+ self._warn_old_config_section(oldcmd, cmd)
else:
+ cmd = self.command
for prefix in ['gbp', 'git']:
oldcmd = '%s-%s' % (prefix, self.command)
if parser.has_section(oldcmd):
self.config.update(dict(parser.items(oldcmd, raw=True)))
- cmd = self.command
+ self._warn_old_config_section(oldcmd, cmd)
# Update with command specific settings
if parser.has_section(cmd):
# Don't use items() until we got rid of the compat sections
# since this pulls in the defaults again
- self.config.update(dict(list(parser._sections[cmd].items())))
+ self.config.update(dict(parser._sections[cmd].items()))
for section in self.sections:
if parser.has_section(section):
- self.config.update(dict(list(parser._sections[section].items())))
+ self.config.update(dict(parser._sections[section].items()))
else:
- raise NoSectionError("Mandatory section [%s] does not exist."
- % section)
+ raise configparser.NoSectionError(
+ "Mandatory section [%s] does not exist." % section)
- # filter can be either a list or a string, always build a list:
- if self.config['filter']:
- if self.config['filter'].startswith('['):
- self.config['filter'] = eval(self.config['filter'])
- else:
- self.config['filter'] = [ self.config['filter'] ]
- else:
- self.config['filter'] = []
+ self.parse_lists()
- def __init__(self, command, prefix='', usage=None, sections=[],
- git_treeish=None):
+ def __init__(self, command, prefix='', usage=None, sections=[]):
"""
@param command: the command to build the config parser for
@type command: C{str}
to parse
@type sections: C{list} of C{str}
"""
- self.command = command
+ self.command = command[:-3] if command.endswith('.py') else command
self.sections = sections
self.prefix = prefix
self.config = {}
- self.parse_config_files(git_treeish)
self.valid_options = []
+ self.config_parser = configparser.ConfigParser()
+ self._warned_old_gbp_conf = False
+
+ try:
+ self.parse_config_files()
+ except configparser.ParsingError as err:
+ raise GbpError(str(err) + "\nSee 'man gbp.conf' for the format.")
- if self.command.startswith('git-') or self.command.startswith('gbp-'):
- prog = self.command
- else:
- prog = "gbp %s" % self.command
OptionParser.__init__(self, option_class=GbpOption,
- prog=prog,
+ prog="gbp %s" % self.command,
usage=usage, version='%s %s' % (self.command,
gbp_version))
"""is option_name a boolean option"""
ret = False
try:
- if kwargs['action'] in [ 'store_true', 'store_false' ]:
- ret=True
+ if kwargs['action'] in ['store_true', 'store_false']:
+ ret = True
except KeyError:
- ret=False
+ ret = False
return ret
def _get_bool_default(self, option_name):
except KeyError:
default = self.config[neg]
- if default.lower() in ["true", "1" ]:
+ default = default.strip()
+ parts = default.split(" ", 2)
+ if len(parts) > 1 and parts[1] == '#':
+ default = parts[0]
+
+ if default.lower() in ["true", "1"]:
val = 'True'
- elif default.lower() in ["false", "0" ]:
+ elif default.lower() in ["false", "0"]:
val = 'False'
else:
- raise ValueError("Boolean options must be True or False")
+ raise ValueError("Boolean options must be True or False, not '%s'" % default)
return eval(val)
def get_default(self, option_name, **kwargs):
default = self.config[option_name]
return default
- @safe_option
- def add_config_file_option(self, option_name, help=None, **kwargs):
+ def get_opt_names(self, option_name):
+ names = ["--%s%s" % (self.prefix, option_name)]
+ if option_name in self.short_opts:
+ if self.prefix:
+ raise ValueError("Options with prefix cannot have a short option")
+ names.insert(0, self.short_opts[option_name])
+ return names
+
+ @save_option
+ def add_config_file_option(self, option_name, dest, help=None, **kwargs):
"""
set a option for the command line parser, the default is read from the config file
param option_name: name of the option
type option_name: string
+ param dest: where to store this option
+ type dest: string
param help: help text
type help: string
"""
if not help:
help = self.help[option_name]
- OptionParser.add_option(self, "--%s%s" % (self.prefix, option_name),
- default=self.get_default(option_name, **kwargs),
+ opt_names = self.get_opt_names(option_name)
+ default = kwargs.pop('default', None)
+ if default is None:
+ default = self.get_default(option_name, **kwargs)
+ OptionParser.add_option(self, *opt_names, dest=dest,
+ default=default,
help=help % self.config, **kwargs)
- def add_boolean_config_file_option(self, option_name, dest=None):
+ def add_boolean_config_file_option(self, option_name, dest):
self.add_config_file_option(option_name=option_name, dest=dest, action="store_true")
neg_help = "negates '--%s%s'" % (self.prefix, option_name)
self.add_config_file_option(option_name="no-%s" % option_name, dest=dest, help=neg_help, action="store_false")
"""
return self.config.get(option_name)
+ def print_help(self, file=None):
+ """
+ Print an extended help message, listing all options and any
+ help text provided with them, to 'file' (default stdout).
+ """
+ if file is None:
+ file = sys.stdout
+
+ encoding = file.encoding if hasattr(file, 'encoding') else 'utf-8'
+ try:
+ msg = self.format_help()
+ if hasattr(file, 'mode') and 'b' in file.mode:
+ msg = msg.encode(encoding, "replace")
+ file.write(msg)
+ except OSError as e:
+ if e.errno != errno.EPIPE:
+ raise
+
+ @classmethod
+ def _name_to_filename(cls, name):
+ """
+ Translate a name like 'system' to a config file name
+
+ >>> GbpOptionParser._name_to_filename('foo')
+ >>> GbpOptionParser._name_to_filename('system')
+ '/etc/git-buildpackage/gbp.conf'
+ >>> GbpOptionParser._name_to_filename('global')
+ '~/.gbp.conf'
+ >>> GbpOptionParser._name_to_filename('debian')
+ '%(top_dir)s/debian/gbp.conf'
+ """
+ for k, v in cls.def_config_files:
+ if name == v:
+ return k
+ else:
+ return None
+
+ @classmethod
+ def _set_config_file_value(cls, section, option, value, name=None, filename=None):
+ """
+ Write a config value to a file creating it if needed
+
+ On errors a ConfigParserError is raised
+ """
+ if not name and not filename:
+ raise configparser.Error("Either 'name' or 'filename' must be given")
+ if not filename:
+ filename = os.path.expanduser(cls._name_to_filename(name))
+
+ # Create e new config parser since we only operate on a single file
+ cfg = configparser.RawConfigParser()
+ cfg.read(filename)
+ if not cfg.has_section(section):
+ cfg.add_section(section)
+ cfg.set(section, option, value)
+ with open(filename, 'w') as fp:
+ cfg.write(fp)
+
class GbpOptionGroup(OptionGroup):
- @safe_option
+ @save_option
def add_config_file_option(self, option_name, dest, help=None, **kwargs):
"""
set a option for the command line parser, the default is read from the config file
"""
if not help:
help = self.parser.help[option_name]
- OptionGroup.add_option(self, "--%s%s" % (self.parser.prefix, option_name), dest=dest,
- default=self.parser.get_default(option_name, **kwargs),
- help=help % self.parser.config, **kwargs)
+ opt_names = self.parser.get_opt_names(option_name)
+ default = kwargs.pop('default', None)
+ if default is None:
+ default = self.parser.get_default(option_name, **kwargs)
+ OptionGroup.add_option(self, *opt_names, dest=dest,
+ default=default,
+ help=help % self.parser.config, **kwargs)
def add_boolean_config_file_option(self, option_name, dest):
self.add_config_file_option(option_name=option_name, dest=dest, action="store_true")
Handles commandline options and parsing of config files for Debian tools
"""
defaults = dict(GbpOptionParser.defaults)
- defaults.update( {
- 'builder' : 'debuild -i -I',
- 'cleaner' : '/bin/true',
- 'export-dir' : '',
- } )
+ defaults.update({
+ 'builder': 'debuild -i -I',
+ })
+
+ def _warn_old_gbp_conf(self, gbp_conf):
+ if os.path.exists("debian/control"):
+ GbpOptionParser._warn_old_gbp_conf(self, gbp_conf)
+
class GbpOptionParserRpm(GbpOptionParser):
"""
"""
defaults = dict(GbpOptionParser.defaults)
defaults.update({
- 'tmp-dir' : '/var/tmp/gbp/',
- 'vendor' : 'vendor',
- 'native' : 'auto',
- 'builder' : 'rpmbuild',
- 'cleaner' : '/bin/true',
- 'merge' : 'False',
- 'packaging-dir' : '',
- 'packaging-branch' : 'master',
- 'packaging-tag' : '%(vendor)s/%(version)s',
- 'upstream-tag' : 'upstream/%(upstreamversion)s',
- 'pq-branch' : 'development/%(branch)s',
- 'import-files' : ['.gbp.conf',
- 'debian/gbp.conf'],
- 'spec-file' : 'auto',
-
- 'export-dir' : '../rpmbuild',
- 'ignore-untracked' : 'False',
- 'rpmbuild-builddir' : 'BUILD',
- 'rpmbuild-rpmdir' : 'RPMS',
- 'rpmbuild-sourcedir' : 'SOURCES',
- 'rpmbuild-specdir' : 'SPECS',
- 'rpmbuild-srpmdir' : 'SRPMS',
- 'rpmbuild-buildrootdir' : 'BUILDROOT',
- 'patch-export' : 'False',
- 'patch-export-ignore-path' : '',
- 'patch-export-compress' : '0',
- 'patch-export-squash-until' : '',
- 'pristine-tarball-name' : 'auto',
- 'orig-prefix' : 'auto',
- 'patch-import' : 'True',
- 'spec-vcs-tag' : '',
-
-
- 'changelog-file' : 'auto',
- 'changelog-revision' : '',
- 'spawn-editor' : 'always',
- 'editor-cmd' : 'vim',
- 'meta-bts' : '(Close|Closes|Fixes|Fix)',
- })
+ 'tmp-dir': '/var/tmp/gbp/',
+ 'vendor': 'Downstream',
+ 'packaging-branch': 'master',
+ 'packaging-dir': '',
+ 'packaging-tag-msg': '%(pkg)s (vendor)s release %(version)s',
+ 'packaging-tag': 'packaging/%(version)s',
+ 'export-sourcedir': 'SOURCES',
+ 'export-specdir': 'SPECS',
+ 'export-dir': '../rpmbuild',
+ 'builder': 'rpmbuild',
+ 'spec-file': '',
+ 'mock': 'False',
+ 'dist': '',
+ 'arch': '',
+ 'mock-root': '',
+ 'mock-options': '',
+ 'native': 'auto',
+ 'changelog-file': 'auto',
+ 'changelog-revision': '',
+ 'spawn-editor': 'always',
+ 'editor-cmd': 'vim',
+ 'spec-vcs-tag': '',
+ })
help = dict(GbpOptionParser.help)
- help.update({
-
+ help.update(
+ {
+ 'tmp-dir':
+ "Base directory under which temporary directories are "
+ "created, default is '%(tmp-dir)s'",
'vendor':
"Distribution vendor name, default is '%(vendor)s'",
- 'native':
- "Treat this package as native, default is '%(native)s'",
'packaging-branch':
"Branch the packaging is being maintained on, rpm counterpart "
"of the 'debian-branch' option, default is "
"'%(packaging-branch)s'",
'packaging-dir':
- "Subdir for RPM packaging files, default is '%(packaging-dir)s'",
+ "Subdir for RPM packaging files, default is "
+ "'%(packaging-dir)s'",
'packaging-tag':
"Format string for packaging tags, RPM counterpart of the "
"'debian-tag' option, default is '%(packaging-tag)s'",
- 'pq-branch':
- "format string for the patch-queue branch name, default is '%(pq-branch)s'",
- 'import-files':
- "Comma-separated list of additional file(s) to import from "
- "packaging branch. These will appear as one monolithic patch "
- "in the pq/development branch. Default is %(import-files)s",
+ 'packaging-tag-msg':
+ "Format string for packaging tag messages, "
+ "default is '%(packaging-tag-msg)s'",
'spec-file':
- "Spec file to use, 'auto' makes gbp to guess, other values "
- "make the packaging-dir option to be ignored, default is "
- "'%(spec-file)s'",
-
- 'ignore-untracked':
- "build with untracked files in the source tree, default is "
- "'%(ignore-untracked)s'",
- 'patch-export':
- "Create patches between upstream and export-treeish, default "
- "is '%(patch-export)s'",
- 'patch-export-compress':
- "Compress (auto-generated) patches larger than given number of "
- "bytes, 0 never compresses, default is "
- "'%(patch-export-compress)s'",
- 'patch-export-ignore-path':
- "Exclude changes to path(s) matching regex, default is "
- "'%(patch-export-ignore-path)s'",
- 'patch-export-squash-until':
- "Squash commits (from upstream) until given tree-ish into one "
- "big diff, format is '<commit_ish>[:<filename_base>]'. "
- "Default is '%(patch-export-squash-until)s'",
- 'patch-import':
- "Import patches to the packaging branch, default is "
- "'%(patch-import)s'",
- 'spec-vcs-tag':
- "Set/update the 'VCS:' tag in the spec file, empty value "
- "removes the tag entirely, default is '%(spec-vcs-tag)s'",
- 'pristine-tarball-name':
- "Filename to record to pristine-tar, set to 'auto' to not "
- "mangle the file name, default is '%(pristine-tarball-name)s'",
- 'orig-prefix':
- "Prefix (dir) to be used when generating/importing tarballs, "
- "default is '%(orig-prefix)s'",
+ "Spec file to use, causes the packaging-dir option to be "
+ "ignored, default is '%(spec-file)s'",
+ 'export-sourcedir':
+ "Subdir (under EXPORT_DIR) where packaging sources (other than "
+ "the spec file) are exported, default is "
+ "'%(export-sourcedir)s'",
+ 'export-specdir':
+ "Subdir (under EXPORT_DIR) where package spec file is "
+ "exported default is '%(export-specdir)s'",
+ 'mock':
+ "Invoke mock for building using gbp-builder-mock, "
+ "default is '%(mock)s'",
+ 'dist':
+ "Build for this distribution when using mock. E.g.: epel-6, "
+ "default is '%(dist)s'",
+ 'arch':
+ "Build for this architecture when using mock, "
+ "default is '%(arch)s'",
+ 'mock-root':
+ "The mock root (-r) name for building with mock: <dist>-<arch>, "
+ "default is '%(mock-root)s'",
+ 'mock-options':
+ "Options to pass to mock, "
+ "default is '%(mock-options)s'",
+ 'native':
+ "Treat this package as native, default is '%(native)s'",
'changelog-file':
"Changelog file to be used, default is '%(changelog-file)s'",
'changelog-revision':
'git-author':
"Use name and email from git-config for the changelog header, "
"default is '%(git-author)s'",
- 'meta-bts':
- "Meta tags for the bts commands, default is '%(meta-bts)s'",
- 'tmp-dir':
- "Base directory under which temporary directories are "
- "created, default is '%(tmp-dir)s'",
- })
-
-class GbpOptionParserBB(GbpOptionParserRpm):
- """Commandline and config file option parser for the -bb commands"""
- defaults = dict(GbpOptionParserRpm.defaults)
- defaults.update( {
- 'builder' : 'bitbake',
- 'export-dir' : '',
- 'meta-dir' : '',
- 'bb-file' : '',
- 'bb-vcs-info' : '',
- 'submit-tag' : 'submit/%(target)s/%(nowtime)s',
- 'target' : 'tizen',
- } )
-
- help = dict(GbpOptionParserRpm.help)
- help.update( {
- 'meta-dir':
- "Subdir where bitbake meta files are stored, default "
- "is '%(meta-dir)s'",
- 'bb-file':
- "Bitbake recipe file to build",
- 'bb-vcs-info':
- "Format string for the VCS information automatically "
- "set in the recipe file, default is '%(bb-vcs-info)s'",
- 'submit-tag':
- "Submit tag format, default is '%(submit-tag)s'",
- 'target':
- "Submit target used in submit tag, default is "
- "'%(target)s'",
- } )
+ 'spec-vcs-tag':
+ "Set/update the 'VCS:' tag in the spec file, empty value "
+ "removes the tag entirely, default is '%(spec-vcs-tag)s'",
+ })
+
+ def _warn_old_gbp_conf(self, gbp_conf):
+ # The rpm based tools use $repo/.gbp.conf a lot, don't
+ # warn there yet
+ pass
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""provides git-dch helpers"""
import re
MAX_CHANGELOG_LINE_LENGTH = 76
+
def extract_git_dch_cmds(lines, options):
"""Return a dictionary of all Git-Dch: commands found in lines.
The command keys will be lowercased, i.e. {'ignore' : True,
commands = {}
other_lines = []
for line in lines:
- if line.startswith('Git-Dch: '):
+ if line.startswith('Git-Dch: ') or line.startswith('Gbp-Dch: '):
cmd = line.split(' ', 1)[1].strip().lower()
commands[cmd] = True
else:
return lines
-_bug_r = r'(?:bug|issue)?\#?\s?\d+'
-_bug_re = re.compile(_bug_r, re.I)
-
def extract_bts_cmds(lines, opts):
"""Return a dictionary of the bug tracking system commands
contained in the the given lines. i.e. {'closed' : [1], 'fixed':
[3, 4]}. Right now, this will only notice a single directive
clause on a line. Also return all of the lines that do not
contain bug tracking system commands."""
- bts_rx = re.compile(r'(?P<bts>%s):\s+%s' % (opts.meta_closes, _bug_r), re.I)
+ _bug_re = re.compile(opts.meta_closes_bugnum, re.I)
+ bts_rx = re.compile(r'(?P<bts>%s):\s+%s' % (opts.meta_closes, opts.meta_closes_bugnum), re.I)
commands = {}
other_lines = []
for line in lines:
m = bts_rx.match(line)
if m:
- bug_nums = [ bug.strip() for bug in _bug_re.findall(line, re.I) ]
+ bug_nums = [bug.strip() for bug in _bug_re.findall(line, re.I)]
try:
commands[m.group('bts')] += bug_nums
except KeyError:
"""Return a list of all of the Thanks: entries, and a list of all
of the lines that do not contain Thanks: entries."""
thanks = []
+ thanks_re = re.compile(r'thanks:\s+', re.I)
other_lines = []
for line in lines:
- if line.startswith('Thanks: '):
+ if thanks_re.match(line):
thanks.append(line.split(' ', 1)[1].strip())
else:
other_lines.append(line)
entry[0] = '[%s] ' % commitid[0:options.idlen] + entry[0]
bts_cmds = {}
- thanks = []
+ thanks = []
if options.meta:
(bts_cmds, body) = extract_bts_cmds(body, options)
(thanks, body) = extract_thanks_info(body, options)
body = filter_ignore_rx_matches(body, options)
- if 'full' in git_dch_cmds or (options.full and not 'short' in git_dch_cmds):
+ if 'full' in git_dch_cmds or (options.full and 'short' not in git_dch_cmds):
# Add all non-blank body lines.
entry.extend([line for line in body if line.strip()])
if thanks:
# vim: set fileencoding=utf-8 :
#
-# (C) 2006,2007,2011 Guido Günther <agx@sigxcpu.org>
+# (C) 2006,2007,2011,2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""provides some debian source package related helpers"""
import os
# Make sure these are available with 'import gbp.deb'
from gbp.deb.changelog import ChangeLog, NoChangeLogError
-from gbp.deb.policy import DebianPkgPolicy
+from gbp.deb.policy import DebianPkgPolicy # noqa: F401
+
+
+Releases = ("buzz",
+ "rez",
+ "bo",
+ "hamm",
+ "slink",
+ "potato",
+ "woody",
+ "sarge",
+ "etch",
+ "lenny",
+ "squeeze",
+ "wheezy",
+ "jessie",
+ "stretch",
+ "buster",
+ "bullseye",
+ "sid")
+
class DpkgCompareVersions(gbpc.Command):
dpkg = '/usr/bin/dpkg'
def __call__(self, version1, version2):
"""
Compare two package versions. Return 0 if the versions are equal, -1 1 if version1 < version2,
- and 1 oterwise.
+ and 1 otherwise.
@raises CommandExecFailed: if the version comparison fails
"""
self.run_error = "Couldn't compare %s with %s" % (version1, version2)
- res = self.call([ version1, 'lt', version2 ])
- if res not in [ 0, 1 ]:
+ res = self.call([version1, 'lt', version2])
+ if res not in [0, 1]:
if self.stderr:
self.run_error += ' (%s)' % self.stderr
raise gbpc.CommandExecFailed("%s: bad return code %d" % (self.run_error, res))
if res == 0:
return -1
elif res == 1:
- res = self.call([ version1, 'gt', version2 ])
- if res not in [ 0, 1 ]:
+ res = self.call([version1, 'gt', version2])
+ if res not in [0, 1]:
if self.stderr:
self.run_error += ' (%s)' % self.stderr
raise gbpc.CommandExecFailed("%s: bad return code %d" % (self.run_error, res))
except GitRepositoryError:
raise NoChangeLogError("Changelog %s not found in branch %s" % (filename, branch))
- return ChangeLog(repo.show(sha))
+ return ChangeLog(repo.show(sha).decode('utf-8'))
-def orig_file(cp, compression):
- """
- The name of the orig file belonging to changelog cp
-
- >>> orig_file({'Source': 'foo', 'Upstream-Version': '1.0'}, "bzip2")
- 'foo_1.0.orig.tar.bz2'
- >>> orig_file({'Source': 'bar', 'Upstream-Version': '0.0~git1234'}, "xz")
- 'bar_0.0~git1234.orig.tar.xz'
- """
- return DebianPkgPolicy.build_tarball_name(cp['Source'],
- cp['Upstream-Version'],
- compression)
def get_arch():
pipe = subprocess.Popen(["dpkg", "--print-architecture"], shell=False, stdout=subprocess.PIPE)
arch = pipe.stdout.readline().strip()
- return arch
+ return arch.decode('ascii')
def compare_versions(version1, version2):
- """compares to Debian versionnumbers suitable for sort()"""
+ """compares to Debian version numbers suitable for sort()"""
return DpkgCompareVersions()(version1, version2)
+def get_vendor():
+ pipe = subprocess.Popen(["dpkg-vendor", "--query", "Vendor"], shell=False, stdout=subprocess.PIPE)
+ vendor = pipe.stdout.readline().strip()
+ return vendor.decode('ascii')
+
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""A Debian Changelog"""
import email
import subprocess
from gbp.command_wrappers import Command
+
class NoChangeLogError(Exception):
"""No changelog found"""
pass
+
class ParseChangeLogError(Exception):
"""Problem parsing changelog"""
pass
return self._version
@classmethod
- def parse(klass, section):
+ def parse(cls, section):
"""
Parse one changelog section
header = section.split('\n')[0]
package = header.split()[0]
version = header.split()[1][1:-1]
- return klass(package, version)
+ return cls(package, version)
class ChangeLog(object):
# Check that either contents or filename is passed (but not both)
if (not filename and not contents) or (filename and contents):
- raise Exception("Either filename or contents must be passed")
+ raise ValueError("Either filename or contents must be passed")
if filename and not os.access(filename, os.F_OK):
raise NoChangeLogError("Changelog %s not found" % (filename, ))
self._read()
self._parse()
- def _parse(self):
- """Parse a changelog based on the already read contents."""
- cmd = subprocess.Popen(['dpkg-parsechangelog', '-l-'],
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- (output, errors) = cmd.communicate(self._contents.encode())
+ def _run_parsechangelog(self, options=None):
+ options = options if options is not None else []
+ cmd = subprocess.Popen(['dpkg-parsechangelog', '-l-'] + options,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ (stdout, stderr) = cmd.communicate(self._contents.encode('utf-8'))
if cmd.returncode:
raise ParseChangeLogError("Failed to parse changelog. "
- "dpkg-parsechangelog said:\n%s" % errors.decode().strip())
+ "dpkg-parsechangelog said:\n%s" % stderr.decode().strip())
+ return stdout.decode().replace('\0', '')
+
+ def _parse(self):
+ """Parse a changelog based on the already read contents."""
+ output = self._run_parsechangelog()
# Parse the result of dpkg-parsechangelog (which looks like
# email headers)
- output = output.decode()
cp = email.message_from_string(output)
try:
if ':' in cp['Version']:
cp['Upstream-Version'], cp['Debian-Version'] = cp['NoEpoch-Version'].rsplit('-', 1)
else:
cp['Debian-Version'] = cp['NoEpoch-Version']
+
+ # py3's email.message_from_string() saves dpkg-parsechangelog's
+ # first newline from the "Changes" field.
+ changes = cp['Changes'].lstrip("\n")
+ del cp['Changes']
+ cp['Changes'] = changes
except TypeError:
raise ParseChangeLogError(output.split('\n')[0])
self._cp = cp
def _read(self):
- with open(self.filename, encoding='utf-8') as f:
- self._contents = f.read()
+ try:
+ with open(self.filename, encoding='utf-8') as f:
+ self._contents = f.read()
+ except UnicodeDecodeError:
+ with open(self.filename, encoding='iso-8859-1') as f:
+ self._contents = f.read()
def __getitem__(self, item):
return self._cp[item]
@property
def version(self):
- """The full version string"""
- return self._cp['Version']
+ """The full version string"""
+ return self._cp['Version']
+
+ @property
+ def distribution(self):
+ return self._cp['Distribution']
@property
def upstream_version(self):
"""
The author of the last modification
"""
- return email.Utils.parseaddr(self._cp['Maintainer'])[0]
+
+ return self._parse_maint(self._cp['Maintainer'])[0]
@property
def email(self):
"""
The author's email
"""
- return email.Utils.parseaddr(self._cp['Maintainer'])[1]
+ return self._parse_maint(self._cp['Maintainer'])[1]
@property
def date(self):
"""
section = ''
for line in self._contents.split('\n'):
- if line and line[0] not in [ ' ', '\t' ]:
+ if line and line[0] not in [' ', '\t']:
section += line
else:
if section:
@staticmethod
def spawn_dch(msg=[], author=None, email=None, newversion=False, version=None,
- release=False, distribution=None, dch_options=[]):
+ release=False, distribution=None, dch_options=None):
"""
Spawn dch
args.extend(["--release", "--no-force-save-on-release"])
msg = None
- if author and email:
- env = {'DEBFULLNAME': author, 'DEBEMAIL': email}
+ if author:
+ env['DEBFULLNAME'] = author.encode('utf-8')
+ if email:
+ env['DEBEMAIL'] = email.encode('utf-8')
if distribution:
args.append("--distribution=%s" % distribution)
- args.extend(dch_options)
+ args.extend(dch_options or [])
+
+ if '--create' in args:
+ env['EDITOR'] = env['VISUAL'] = '/bin/true'
+
args.append('--')
if msg:
args.append('[[[insert-git-dch-commit-message-here]]]')
else:
args.append('')
- dch = Command('dch', args, extra_env=env)
- dch.call([])
+ dch = Command('debchange', args, extra_env=env, capture_stderr=True)
+ dch.run_error = Command._f("Dch failed: {stderr_or_reason}")
+ dch([], quiet=True)
if msg:
- old_cl = open("debian/changelog", "r")
- new_cl = open("debian/changelog.bak", "w")
+ old_cl = open("debian/changelog", "r", encoding='utf-8')
+ new_cl = open("debian/changelog.bak", "w", encoding='utf-8')
for line in old_cl:
if line == " * [[[insert-git-dch-commit-message-here]]]\n":
print(" * " + msg[0], file=new_cl)
for line in msg[1:]:
print(" " + line, file=new_cl)
else:
- print(line, end=' ', file=new_cl)
+ print(line, end='', file=new_cl)
os.rename("debian/changelog.bak", "debian/changelog")
def add_entry(self, msg, author=None, email=None, dch_options=[]):
"""
self.spawn_dch(msg=msg, newversion=True, version=version, author=author,
email=email, distribution=distribution, dch_options=dch_options)
+
+ def get_changes(self, since='0~'):
+ return self._run_parsechangelog(['-v%s' % since, '-SChanges'])
+
+ @staticmethod
+ def _parse_maint(maintainer):
+ """
+ Parse maintainer
+
+ Mostly rfc822 but we allow for commas
+ """
+ def _quote(u):
+ return u.replace(',', '##comma##')
+
+ def _unquote(q):
+ return q.replace('##comma##', ',')
+
+ name, mail = email.utils.parseaddr(_quote(maintainer or ''))
+ return (_unquote(name), _unquote(mail))
+
+ @classmethod
+ def create(cls, package=None, version=None):
+ """
+ Create a new, empty changelog
+ """
+ dch_options = ['--create']
+ if package:
+ dch_options.extend(['--package', package])
+ if version:
+ dch_options.extend(['--newversion', version])
+
+ cls.spawn_dch(dch_options=dch_options)
+ return cls(filename='debian/changelog')
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""A Debian Control file"""
import email
import os
+
class NoControlError(Exception):
"""No control found"""
pass
+
class ParseControlError(Exception):
"""Problem parsing control"""
pass
+
class Control(object):
"""A Debian control"""
with open(filename) as f:
control = email.message_from_file(f)
- if not list(control.items()):
+ if not control.items():
raise ParseControlError("Empty or invalid control file or contents")
self._control = control
@property
def name(self):
- """The packges name"""
+ """The name of the package"""
return self._control['Source']
@property
def section(self):
- """The packges section"""
+ """The section of the package"""
return self._control['Section']
@property
def priority(self):
- """The packges priority"""
+ """The priority of the package"""
return self._control['Priority']
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""provides some debian source package related helpers"""
import os
from gbp.deb.upstreamsource import DebianUpstreamSource
from gbp.deb.policy import DebianPkgPolicy
+
class DscFile(object):
- """Keeps all needed data read from a dscfile"""
+ """Keeps data read from a dscfile"""
compressions = r"(%s)" % '|'.join(DebianUpstreamSource.known_compressions())
pkg_re = re.compile(r'Source:\s+(?P<pkg>.+)\s*')
version_re = re.compile(r'Version:\s((?P<epoch>\d+)\:)?'
- '(?P<version>[%s]+)\s*$'
+ r'(?P<version>[%s]+)\s*$'
% DebianPkgPolicy.debianversion_chars)
tar_re = re.compile(r'^\s\w+\s\d+\s+(?P<tar>[^_]+_[^_]+'
- '(\.orig)?\.tar\.%s)' % compressions)
+ r'(\.orig)?\.tar\.%s)$' % compressions)
+ add_tar_re = re.compile(r'^\s\w+\s\d+\s+(?P<tar>[^_]+_[^_]+'
+ r'\.orig-(?P<dir>[a-zA-Z0-9-]+)\.tar\.%s)$' % compressions)
diff_re = re.compile(r'^\s\w+\s\d+\s+(?P<diff>[^_]+_[^_]+'
- '\.diff.(gz|bz2))')
+ r'\.diff.(gz|bz2))$')
deb_tgz_re = re.compile(r'^\s\w+\s\d+\s+(?P<deb_tgz>[^_]+_[^_]+'
- '\.debian.tar.%s)' % compressions)
+ r'\.debian.tar.%s)$' % compressions)
format_re = re.compile(r'Format:\s+(?P<format>[0-9.]+)\s*')
+ sig_re = re.compile(r'^\s\w+\s\d+\s+(?P<sig>[^_]+_[^_]+'
+ r'\.orig(-[a-z0-9-]+)?\.tar\.%s.asc)$' % compressions)
def __init__(self, dscfile):
self.pkg = ""
self.upstream_version = ""
self.native = False
self.dscfile = os.path.abspath(dscfile)
+ sigs = []
+ add_tars = []
- f = open(self.dscfile)
+ f = open(self.dscfile, encoding='utf-8')
fromdir = os.path.dirname(os.path.abspath(dscfile))
for line in f:
m = self.version_re.match(line)
self.upstream_version = "-".join(m.group('version').split("-")[0:-1])
self.native = False
else:
- self.native = True # Debian native package
+ self.native = True # Debian native package
self.upstream_version = m.group('version')
if m.group('epoch'):
self.epoch = m.group('epoch')
if m:
self.deb_tgz = os.path.join(fromdir, m.group('deb_tgz'))
continue
+ m = self.add_tar_re.match(line)
+ if m:
+ add_tars.append((m.group('dir'),
+ os.path.join(fromdir, m.group('tar'))))
+ continue
m = self.tar_re.match(line)
if m:
self.tgz = os.path.join(fromdir, m.group('tar'))
continue
+ m = self.sig_re.match(line)
+ if m:
+ sigs.append(os.path.join(fromdir, m.group('sig')))
+ continue
m = self.diff_re.match(line)
if m:
self.diff = os.path.join(fromdir, m.group('diff'))
continue
f.close()
+ # Source format 1.0 can have non-native packages without a Debian revision:
+ # e.g. http://snapshot.debian.org/archive/debian/20090801T192339Z/pool/main/l/latencytop/latencytop_0.5.dsc
+ if self.pkgformat == "1.0" and self.diff:
+ self.native = False
+ elif not self.native and not self.debian_version:
+ raise GbpError("Cannot parse Debian version number from '%s'" % self.dscfile)
+
if not self.pkg:
raise GbpError("Cannot parse package name from '%s'" % self.dscfile)
elif not self.tgz:
raise GbpError("Cannot parse archive name from '%s'" % self.dscfile)
if not self.upstream_version:
raise GbpError("Cannot parse version number from '%s'" % self.dscfile)
- if not self.native and not self.debian_version:
- raise GbpError("Cannot parse Debian version number from '%s'" % self.dscfile)
+ self.additional_tarballs = dict(add_tars)
+ self.sigs = list(set(sigs))
- def _get_version(self):
- version = [ "", self.epoch + ":" ][len(self.epoch) > 0]
+ @property
+ def version(self):
+ version = ["", self.epoch + ":"][len(self.epoch) > 0]
if self.native:
version += self.upstream_version
else:
- version += "%s-%s" % (self.upstream_version, self.debian_version)
+ if self.debian_version != '':
+ version += "%s-%s" % (self.upstream_version, self.debian_version)
+ else: # possible in 1.0
+ version += "%s" % self.upstream_version
return version
- version = property(_get_version)
-
def __str__(self):
return "<%s object %s>" % (self.__class__.__name__, self.dscfile)
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Parse debian/source/format"""
+
class DebianSourceFormatError(Exception):
pass
+
class DebianSourceFormat(object):
"""
Contents of debian/source/format
>>> d = DebianSourceFormat("1.0 broken")
Traceback (most recent call last):
...
- DebianSourceFormatError: Cannot get source format from '1.0 broken'
+ gbp.deb.format.DebianSourceFormatError: Cannot get source format from '1.0 broken'
"""
format_file = 'debian/source/format'
self._version = parts[0]
if len(parts) == 2:
- if (parts[1][0] == '(' and
- parts[1][-1] == ')'):
+ if (parts[1][0] == '(' and parts[1][-1] == ')'):
self._type = parts[1][1:-1]
else:
raise DebianSourceFormatError("Cannot get source format from "
return "%s (%s)" % (self._version, self._type)
@classmethod
- def parse_file(klass, filename):
+ def parse_file(cls, filename):
"""
Parse debian/source/format file
>>> os.unlink(t.name)
"""
with open(filename) as f:
- return klass(f.read())
+ return cls(f.read())
@classmethod
- def from_content(klass, version, type, format_file=None):
+ def from_content(cls, version, type, format_file=None):
"""
Write a format file from I{type} and I{format} at
I{format_file}
@param format_file: the format file to create with
the above parameters
"""
- format_file = format_file or klass.format_file
- with open(klass.format_file, 'w') as f:
+ format_file = format_file or cls.format_file
+ with open(cls.format_file, 'w') as f:
f.write("%s (%s)" % (version, type))
- return klass.parse_file(klass.format_file)
+ return cls.parse_file(cls.format_file)
+
if __name__ == "__main__":
import doctest
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""A Git Repository that keeps a Debian Package"""
+import os
import re
-from gbp.git import GitRepository, GitRepositoryError
+
+from gbp.command_wrappers import CommandExecFailed
+from gbp.git import GitRepositoryError
from gbp.deb.pristinetar import DebianPristineTar
-from gbp.format import format_msg
+from gbp.paths import to_bin
+from gbp.pkg.git import PkgGitRepository
+from gbp.pkg.pkgpolicy import PkgPolicy
+
+import gbp.log
-class DebianGitRepository(GitRepository):
+
+class DebianGitRepository(PkgGitRepository):
"""A git repository that holds the source of a Debian package"""
- def __init__(self, path):
- super(DebianGitRepository, self).__init__(path)
+ version_mangle_re = PkgPolicy.version_mangle_re
+
+ def __init__(self, *args, **kwargs):
+ super(DebianGitRepository, self).__init__(*args, **kwargs)
self.pristine_tar = DebianPristineTar(self)
+ def tree_drop_dirs(self, tree, dirs):
+ """
+ Drop the given top level dirs from the given git tree
+ returning a new tree object.
+ """
+ objs = self.list_tree(tree)
+ new_tree_objs = []
+ dirs = [to_bin(d) for d in dirs]
+
+ for m, t, s, n in objs:
+ if not (n in dirs and t == 'tree'):
+ new_tree_objs.append((m, t, s, n))
+ new_tree = self.make_tree(new_tree_objs)
+ return new_tree
+
+ def tree_get_dir(self, tree, dir):
+ """
+ Get the SHA1 of directory in a given tree
+ """
+ dir = to_bin(dir)
+ toplevel = self.list_tree(tree)
+ for m, t, s, n in toplevel:
+ if n == dir and t == 'tree':
+ return s
+ return None
+
def find_version(self, format, version):
"""
Check if a certain version is stored in this repo and return the SHA1
"""
tag = self.version_to_tag(format, version)
legacy_tag = self._build_legacy_tag(format, version)
- if self.has_tag(tag): # new tags are injective
+ if self.has_tag(tag): # new tags are injective
# dereference to a commit object
return self.rev_parse("%s^0" % tag)
elif self.has_tag(legacy_tag):
if ret:
return None
for line in out:
+ line = line.decode()
if line.endswith(" %s\n" % version):
# dereference to a commit object
return self.rev_parse("%s^0" % legacy_tag)
- elif line.startswith('---'): # GPG signature start
+ elif line.startswith('---'): # GPG signature start
return None
return None
- def debian_version_from_upstream(self, upstream_tag_format, commit='HEAD',
- epoch=None):
+ def debian_version_from_upstream(self, upstream_tag_format,
+ upstream_branch, commit='HEAD',
+ epoch=None, debian_release=True):
"""
Build the Debian version that a package based on upstream commit
I{commit} would carry taking into account a possible epoch.
@param upstream_tag_format: the tag format on the upstream branch
@type upstream_tag_format: C{str}
+ @param upstream_branch: the upstream branch
+ @type upstream_branch: C{str}
@param commit: the commit to search for the latest upstream version
@param epoch: an epoch to use
+ @param debian_release: If set to C{False} don't append a Debian release
+ number to the version number
@returns: a new debian version
@raises GitRepositoryError: if no upstream tag was found
"""
- pattern = upstream_tag_format % dict(version='*')
- tag = self.find_tag(commit, pattern=pattern)
+ pattern = self._unmangle_format(upstream_tag_format) % dict(version='*')
+ tag = self.find_branch_tag(commit, upstream_branch, pattern=pattern)
version = self.tag_to_version(tag, upstream_tag_format)
- version += "-1"
+ if debian_release:
+ version += "-1"
+
if epoch:
version = "%s:%s" % (epoch, version)
return version
>>> DebianGitRepository._build_legacy_tag('upstream/%(version)s', '1:2.0~3')
'upstream/2.0.3'
"""
- if ':' in version: # strip of any epochs
+ if ':' in version: # strip of any epochs
version = version.split(':', 1)[1]
version = version.replace('~', '.')
return format % dict(version=version)
- @staticmethod
- def version_to_tag(format, version):
+ @classmethod
+ def version_to_tag(cls, format, version):
"""Generate a tag from a given format and a version
+ %(version)s provides a clean version that works as a git tag.
+
+ %(hversion)s provides the same thing, but with '.' replaced with '-'.
+ hversion is useful for upstreams with tagging policies that prohibit .
+ characters.
+
+ %(version%A%B)s provides %(version)s with string 'A' replaced by 'B'.
+ This way, simple version mangling is possible via substitution.
+ Inside the substition string, '%' needs to be escaped. See the
+ examples below.
+
>>> DebianGitRepository.version_to_tag("debian/%(version)s", "0:0~0")
'debian/0%0_0'
+ >>> DebianGitRepository.version_to_tag("libfoo-%(hversion)s", "1.8.1")
+ 'libfoo-1-8-1'
+ >>> DebianGitRepository.version_to_tag("v%(version%.%_)s", "1.2.3")
+ 'v1_2_3'
+ >>> DebianGitRepository.version_to_tag(r'%(version%-%\\%)s', "0-1.2.3")
+ '0%1.2.3'
"""
- return format_msg(format, dict(version=DebianGitRepository._sanitize_version(version)))
+ return PkgPolicy.version_subst(format, version, cls._sanitize_version)
+
+ @classmethod
+ def _mangle_version(cls, format, version):
+ """
+ Basic version mangling to replace single characters
+
+ >>> DebianGitRepository._mangle_version(r'%(version%-%\\%)s', "0-1.2.3")
+ ('%(version)s', '0%1.2.3')
+ """
+ r = re.search(cls.version_mangle_re, format)
+ if r:
+ f = re.sub(cls.version_mangle_re, "%(version)s", format)
+ v = version.replace(r.group('M'), r.group('R').replace(r'\%', '%'))
+ return f, v
+ else:
+ return format, version
+
+ @classmethod
+ def _unmangle_format(cls, format):
+ """
+ Reverse of _mangle_version for format
+ """
+ r = re.search(cls.version_mangle_re, format)
+ if r:
+ return re.sub(cls.version_mangle_re, "%(version)s", format)
+ else:
+ return format
+
+ @classmethod
+ def _unmangle_version(cls, format, tag):
+ """
+ Reverse of _mangle_version for version
+ """
+ r = re.search(cls.version_mangle_re, format)
+ if r:
+ v = tag.replace(r.group('R').replace(r'\%', '%'), r.group('M'))
+ return v
+ else:
+ return tag
@staticmethod
def _sanitize_version(version):
"""sanitize a version so git accepts it as a tag
+ as described in DEP14
+
>>> DebianGitRepository._sanitize_version("0.0.0")
'0.0.0'
>>> DebianGitRepository._sanitize_version("0.0~0")
'0%0.0'
>>> DebianGitRepository._sanitize_version("0%0~0")
'0%0_0'
+ >>> DebianGitRepository._sanitize_version("0....0")
+ '0.#.#.#.0'
+ >>> DebianGitRepository._sanitize_version("0.lock")
+ '0.#lock'
"""
- return version.replace('~', '_').replace(':', '%')
+ v = re.sub(r'\.(?=\.|$|lock$)', '.#', version)
+ return v.replace('~', '_').replace(':', '%')
@staticmethod
- def tag_to_version(tag, format):
+ def _unsanitize_version(tag):
+ """Reverse _sanitize_version
+
+ as described in DEP14
+
+ >>> DebianGitRepository._unsanitize_version("1%0_bpo3")
+ '1:0~bpo3'
+ >>> DebianGitRepository._unsanitize_version("1%0_bpo3.#.")
+ '1:0~bpo3..'
+ """
+ return tag.replace('_', '~').replace('%', ':').replace('#', '')
+
+ @classmethod
+ def tag_to_version(cls, tag, format):
"""Extract the version from a tag
>>> DebianGitRepository.tag_to_version("upstream/1%2_3-4", "upstream/%(version)s")
'1:2~3-4'
>>> DebianGitRepository.tag_to_version("foo/2.3.4", "foo/%(version)s")
'2.3.4'
+ >>> DebianGitRepository.tag_to_version("v1-2-3", "v%(version%.%-)s")
+ '1.2.3'
+ >>> DebianGitRepository.tag_to_version("v1.#.2", "v%(version%.%-)s")
+ '1..2'
>>> DebianGitRepository.tag_to_version("foo/2.3.4", "upstream/%(version)s")
"""
- version_re = format.replace('%(version)s',
- '(?P<version>[\w_%+-.]+)')
+ f = cls._unmangle_format(format)
+ version_re = f.replace('%(version)s', r'(?P<version>[\w_%+-.#]+)')
r = re.match(version_re, tag)
if r:
- version = r.group('version').replace('_', '~').replace('%', ':')
- return version
+ v = cls._unsanitize_version(r.group('version'))
+ return cls._unmangle_version(format, v)
return None
@property
def has_pristine_tar_branch(self):
"""
- Wheter the repo has a I{pristine-tar} branch.
+ Whether the repo has a I{pristine-tar} branch.
@return: C{True} if the repo has pristine-tar commits already, C{False}
otherwise
"""
return True if self.has_branch(self.pristine_tar_branch) else False
+ def create_pristine_tar_commits(self, upstream_tree, sources):
+ """
+ Create pristine-tar commits for a package with main tarball
+ and (optional) component tarballs based on upstream_tree
+
+ @param upstream_tree: the treeish in the git repo to create the commits against
+ @param soures: C{list} of tarball as I{UpstreamSource}. First one being the main
+ tarball the other ones additional tarballs.
+ """
+ components = [t.component for t in sources[1:]]
+ main_tree = self.tree_drop_dirs(upstream_tree, components)
+
+ try:
+ for source in sources[1:]:
+ subtree = self.tree_get_dir(upstream_tree, source.component)
+ if not subtree:
+ raise GitRepositoryError("No tree for '%s' found in '%s' to create "
+ "pristine tar commit from" % (source.component,
+ upstream_tree))
+ gbp.log.debug("Creating pristine tar commit '%s' from '%s'" % (source.path, subtree))
+ self.pristine_tar.commit(source.path, subtree, signaturefile=source.signaturefile, quiet=True)
+ self.pristine_tar.commit(sources[0].path, main_tree, signaturefile=sources[0].signaturefile, quiet=True)
+ except CommandExecFailed as e:
+ raise GitRepositoryError(str(e))
+
+ def get_pristine_tar_commit(self, source, component=None):
+ """
+ Get the pristine-tar commit for the given source package's latest version.
+ """
+ def _esc(s):
+ return s.replace('.', '\\.')
+
+ comp = '-%s' % component if component else ''
+ source_esc = _esc(source.sourcepkg)
+ ver_esc = _esc(source.upstream_version)
+ return self.pristine_tar.get_commit('%s_%s\\.orig%s\\.tar.*' % (source_esc,
+ ver_esc,
+ comp))
+
+ def create_upstream_tarball_via_pristine_tar(self, source, output_dir, comp, upstream_signatures, component=None):
+ output = source.upstream_tarball_name(comp.type, component=component)
+ gbp.log.debug("upstream signature state: %s" % upstream_signatures)
+ commit, found_signature = self.get_pristine_tar_commit(source, component)
+ if not commit and self.has_pristine_tar_branch():
+ raise GitRepositoryError("Cannot find pristine tar commit for archive '%s'" % output)
+ if not found_signature and upstream_signatures.is_on():
+ raise GitRepositoryError("Cannot find requested upstream signature for archive '%s' in pristine tar commit." % output)
+ try:
+ signature = False if upstream_signatures.is_off() else found_signature
+ self.pristine_tar.checkout(source.name, source.upstream_version, comp.type, output_dir,
+ component=component, quiet=True, signature=signature)
+ except Exception as e:
+ raise GitRepositoryError("Error creating %s%s: %s" % (output,
+ " with attached signature file" if signature else "",
+ e))
+ return True
+
+ def create_upstream_tarball_via_git_archive(self, source, output_dir, treeish,
+ comp, with_submodules, component=None):
+ """
+ Create a compressed orig tarball in output_dir using git archive
+
+ @param source: debian source package
+ @type source: L{DebianSource}
+ @param output_dir: output directory
+ @param type: C{str}
+ @param treeish: git treeish
+ @type treeish: C{str}
+ @param comp: compressor
+ @type comp: L{Compressor}
+ @param with_submodules: wether to add submodules
+ @type with_submodules: C{bool}
+ @param component: component to add to tarball name
+ @type component: C{str}
+
+ Raises GitRepositoryError in case of an error
+ """
+ submodules = False
+ output = os.path.join(output_dir,
+ source.upstream_tarball_name(comp.type, component=component))
+ prefix = "%s-%s" % (source.name, source.upstream_version)
+
+ try:
+ if self.has_submodules() and with_submodules:
+ submodules = True
+ self.update_submodules()
+ self.archive_comp(treeish, output, prefix, comp, submodules=submodules)
+ except Exception as e:
+ raise GitRepositoryError("Error creating %s: %s" % (output, e))
+ return True
+
+ def vcs_tag_parent(self, vcs_tag_format, version):
+ """If linking to the upstream VCS get the commit id"""
+ if not vcs_tag_format:
+ return None
+ try:
+ tag = self.version_to_tag(vcs_tag_format, version)
+ return [self.rev_parse("%s^{}" % tag)]
+ except GitRepositoryError:
+ raise GitRepositoryError("Can't find upstream vcs tag at '%s'" % tag)
+
+
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""
Debian Packaging policies
import os
import re
-from gbp.pkg import (PkgPolicy, compressor_opts)
+from gbp.errors import GbpError
+from gbp.pkg.pkgpolicy import PkgPolicy
+from gbp.pkg.compressor import Compressor
class DebianPkgPolicy(PkgPolicy):
# must consist only of lower case letters (a-z), digits (0-9), plus (+)
# and minus (-) signs, and periods (.). They must be at least two
# characters long and must start with an alphanumeric character."
- packagename_re = re.compile("^[a-zA-Z0-9][a-zA-Z0-9\.\+\-~]+$")
+ packagename_re = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9\.\+\-~]+$')
packagename_msg = """Package names must be at least two characters long, start with an
- alphanumeric and can only containg letters (a-z,A-Z), digits
+ alphanumeric and can only contain letters (a-z,A-Z), digits
(0-9), plus signs (+), minus signs (-), periods (.) and hyphens (~)"""
# Valid upstream versions according to Debian Policy Manual 5.6.12:
# are not allowed; if there is no epoch then colons are not allowed."
# Since we don't know about any epochs and debian revisions yet, the
# last two conditions are not checked.
- upstreamversion_re = re.compile("^[0-9][a-zA-Z0-9\.\+\-\:\~]*$")
- upstreamversion_msg = """Upstream version numbers must start with a digit and can only containg lower case
+ upstreamversion_re = re.compile(r'^[0-9][a-zA-Z0-9\.\+\-\:\~]*$')
+ upstreamversion_msg = """Upstream version numbers must start with a digit and can only contain lower case
letters (a-z), digits (0-9), full stops (.), plus signs (+), minus signs
(-), colons (:) and tildes (~)"""
debianversion_chars = 'a-zA-Z\\d.~+-'
@staticmethod
- def build_tarball_name(name, version, compression, dir=None):
+ def build_tarball_name(name, version, compression, dir=None, component=None):
"""
Given a source package's I{name}, I{version} and I{compression}
return the name of the corresponding upstream tarball.
'foo_1.0.orig.tar.bz2'
>>> DebianPkgPolicy.build_tarball_name('bar', '0.0~git1234', 'xz')
'bar_0.0~git1234.orig.tar.xz'
+ >>> DebianPkgPolicy.build_tarball_name('bar', '0.0~git1234', 'xz', component="foo")
+ 'bar_0.0~git1234.orig-foo.tar.xz'
@param name: the source package's name
@type name: C{str}
@return: the tarballs name corresponding to the input parameters
@rtype: C{str}
"""
- ext = compressor_opts[compression][1]
- tarball = "%s_%s.orig.tar.%s" % (name, version, ext)
+ try:
+ ext = Compressor.Exts[compression]
+ except KeyError:
+ raise GbpError("Unknown compression type '%s'" % compression)
+ sub = '-{0}'.format(component) if component else ''
+ tarball = "%s_%s.orig%s.tar.%s" % (name, version, sub, ext)
if dir:
tarball = os.path.join(dir, tarball)
return tarball
+
+ @staticmethod
+ def build_signature_name(*args, **kwargs):
+ """
+ Given a source package's I{name}, I{version} and I{compression}
+ return the name of the corresponding upstream tarball signature file.
+ """
+ return DebianPkgPolicy.build_tarball_name(*args, **kwargs) + '.asc'
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Handle checkin and checkout of archives from the pristine-tar branch"""
-from gbp.pkg import compressor_opts
+from gbp.pkg.compressor import Compressor
from gbp.pkg.pristinetar import PristineTar
from gbp.deb import DebianPkgPolicy
+
class DebianPristineTar(PristineTar):
"""The pristine-tar branch in a Debian git repository"""
def has_commit(self, package, version, comp_type=None):
@type comp_type: C{str}
"""
if not comp_type:
- ext = '\w\+'
+ ext = r'\w\+'
else:
- ext = compressor_opts[comp_type][1]
+ ext = Compressor.Exts[comp_type]
- name_regexp = '%s_%s\.orig\.tar\.%s' % (package, version, ext)
+ name_regexp = r'%s_%s\.orig\.tar\.%s' % (package, version, ext)
return super(DebianPristineTar, self).has_commit(name_regexp)
- def checkout(self, package, version, comp_type, output_dir):
+ def checkout(self, package, version, comp_type, output_dir, component=None,
+ quiet=False, signature=False):
"""
Checkout the orig tarball for package I{package} of I{version} and
compression type I{comp_type} to I{output_dir}
@param output_dir: the directory to put the tarball into
@type output_dir: C{str}
"""
+ signaturefile = None
name = DebianPkgPolicy.build_tarball_name(package,
version,
comp_type,
- output_dir)
- super(DebianPristineTar, self).checkout(name)
-
+ output_dir,
+ component=component)
+ if signature:
+ signaturefile = DebianPkgPolicy.build_signature_name(package,
+ version,
+ comp_type,
+ output_dir,
+ component=component)
+ super(DebianPristineTar, self).checkout(name,
+ quiet=quiet,
+ signaturefile=signaturefile)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2018 Guido Günther <agx@sigxcpu.org>
+"""A git repository for Debian packages that can roll back operations"""
+
+
+from .. import log
+from .. git import GitRepositoryError
+from . git import DebianGitRepository
+
+
+class RollbackError(GitRepositoryError):
+ """
+ Error raised if the rollback failed
+ """
+ def __init__(self, errors):
+ self.msg = "Automatic rollback failed"
+ super(RollbackError, self).__init__(self.msg)
+ self.errors = errors
+
+ def __str__(self):
+ return "%s %s" % (self.msg, self.errors)
+
+
+class RollbackDebianGitRepository(DebianGitRepository):
+ """
+ Like a DebianGitRepository but can also perform rollbacks and knows
+ about some of the inner workings upstream vcs_tag, …
+ """
+ def __init__(self, *args, **kwargs):
+ self.rollbacks = []
+ self.rollback_errors = []
+ DebianGitRepository.__init__(self, *args, **kwargs)
+
+ def has_rollbacks(self):
+ return len(self.rollbacks) > 0
+
+ def rrr(self, refname, action, reftype):
+ """
+ Remember ref for rollback
+
+ @param refname: ref to roll back
+ @param action: the rollback action (delete, reset, ...)
+ @param reftype: the reference type (tag, branch, ...)
+ """
+ sha = None
+
+ if action == 'reset':
+ try:
+ sha = self.rev_parse(refname)
+ except GitRepositoryError as err:
+ log.warn("Failed to rev-parse '%s': %s" % (refname, err))
+ elif action == 'delete':
+ pass
+ elif action == 'abortmerge':
+ pass
+ else:
+ raise GitRepositoryError("Unknown action '%s' for %s '%s'" % (action, reftype, refname))
+ self.rollbacks.append((refname, reftype, action, sha))
+
+ def rrr_branch(self, branchname, action='reset-or-delete'):
+ if action == 'reset-or-delete':
+ if self.has_branch(branchname):
+ return self.rrr(branchname, 'reset', 'branch')
+ else:
+ return self.rrr(branchname, 'delete', 'branch')
+ else:
+ return self.rrr(branchname, action, 'branch')
+
+ def rrr_tag(self, tagname, action='delete'):
+ return self.rrr(tagname, action, 'tag')
+
+ def rrr_merge(self, commit, action='abortmerge'):
+ return self.rrr(commit, action, 'commit')
+
+ def rollback(self):
+ """
+ Perform a complete rollback
+
+ Try to roll back as much as possible and remember what failed.
+ """
+ for (name, reftype, action, sha) in self.rollbacks:
+ try:
+ if action == 'delete':
+ log.info("Rolling back %s '%s' by deleting it" % (reftype, name))
+ if reftype == 'tag':
+ self.delete_tag(name)
+ elif reftype == 'branch':
+ self.delete_branch(name)
+ else:
+ raise GitRepositoryError("Don't know how to delete %s '%s'" % (reftype, name))
+ elif action == 'reset' and reftype == 'branch':
+ log.info('Rolling back branch %s by resetting it to %s' % (name, sha))
+ self.update_ref("refs/heads/%s" % name, sha, msg="gbp import-orig: failure rollback of %s" % name)
+ elif action == 'abortmerge':
+ if self.is_in_merge():
+ log.info('Rolling back failed merge of %s' % name)
+ self.abort_merge()
+ else:
+ log.info("Nothing to rollback for merge of '%s'" % name)
+ else:
+ raise GitRepositoryError("Don't know how to %s %s '%s'" % (action, reftype, name))
+ except GitRepositoryError as e:
+ self.rollback_errors.append((name, reftype, action, sha, e))
+ if self.rollback_errors:
+ raise RollbackError(self.rollback_errors)
+
+ # Wrapped methods for rollbacks
+ def create_tag(self, *args, **kwargs):
+ name = kwargs['name']
+ ret = super(RollbackDebianGitRepository, self).create_tag(*args, **kwargs)
+ self.rrr_tag(name)
+ return ret
+
+ def commit_dir(self, *args, **kwargs):
+ import_branch = kwargs['branch']
+ self.rrr_branch(import_branch)
+ return super(RollbackDebianGitRepository, self).commit_dir(*args, **kwargs)
+
+ def create_branch(self, *args, **kwargs):
+ branch = kwargs['branch']
+ ret = super(RollbackDebianGitRepository, self).create_branch(*args, **kwargs)
+ self.rrr_branch(branch, 'delete')
+ return ret
+
+ def merge(self, *args, **kwargs):
+ commit = args[0] if args else kwargs['commit']
+ try:
+ return super(RollbackDebianGitRepository, self).merge(*args, **kwargs)
+ except GitRepositoryError:
+ # Only cleanup in the error case to undo working copy
+ # changes. Resetting the refs handles the other cases.
+ self.rrr_merge(commit)
+ raise
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""provides some debian source package related helpers"""
import os
+from gbp.deb import DebianPkgPolicy as Policy
from gbp.deb.format import DebianSourceFormat
from gbp.deb.changelog import ChangeLog
+from gbp.deb.control import Control
+
class FileVfs(object):
def __init__(self, dir):
"""
- Access files in a unpaced Debian source package.
+ Access files in an unpacked Debian source package.
@param dir: the toplevel of the source tree
@type dir: C{str}
flags = flags or 'r'
return open(os.path.join(self._dir, path), flags)
+
class DebianSourceError(Exception):
pass
+
class DebianSource(object):
"""
A debianized source tree
"""
def __init__(self, vfs):
"""
- @param vfs: a class that implemented GbpVFS interfacce or
- a directory (which will used the DirGbpVFS class.
+ @param vfs: a class that implements L{GitVfs} interface or a directory
+ (which will use the L{FileVfs} class. The directory must be the
+ toplevel of a Debian source package.
"""
self._changelog = None
+ self._control = None
if isinstance(vfs, str):
self._vfs = FileVfs(vfs)
def is_native(self):
"""
- Whether this is a native debian package
+ Whether this is a native Debian package
"""
try:
- ff = self._vfs.open('debian/source/format')
- f = DebianSourceFormat(ff.read())
+ with self._vfs.open('debian/source/format') as ff:
+ f = DebianSourceFormat(ff.read())
if f.type:
return f.type == 'native'
- except IOError as e:
- pass # Fall back to changelog parsing
+ except IOError:
+ pass # Fall back to changelog parsing
try:
- return not '-' in self.changelog.version
+ return '-' not in self.changelog.version
except IOError as e:
raise DebianSourceError("Failed to determine source format: %s" % e)
+ def is_releasable(self):
+ """
+ Check if package is releasable
+
+ Debian's current practice is to check for UNRELEASED in the distribution.
+ """
+ return self.changelog.distribution != 'UNRELEASED'
+
@property
def changelog(self):
"""
"""
if not self._changelog:
try:
- clf = self._vfs.open('debian/changelog')
- self._changelog = ChangeLog(clf.read())
+ with self._vfs.open('debian/changelog', 'rb') as clf:
+ self._changelog = ChangeLog(clf.read().decode('utf-8'))
except IOError as err:
raise DebianSourceError('Failed to read changelog: %s' % err)
return self._changelog
+ @property
+ def control(self):
+ """
+ Return the L{gbp.deb.Control}
+ """
+ if not self._control:
+ try:
+ with self._vfs.open('debian/control', 'rb') as cf:
+ self._control = Control(cf.read().decode('utf-8'))
+ except IOError as err:
+ raise DebianSourceError('Failed to read control file: %s' % err)
+ return self._control
+
@property
def sourcepkg(self):
"""
The source package's name
"""
return self.changelog['Source']
+
+ @property
+ def name(self):
+ return self.sourcepkg
+
+ @property
+ def version(self):
+ return self.changelog.version
+
+ @property
+ def upstream_version(self):
+ return self.changelog.upstream_version
+
+ @property
+ def debian_version(self):
+ return self.changelog.debian_version
+
+ def upstream_tarball_name(self, compression, component=None):
+ """
+ Possible upstream tarball name for this source package
+
+ Gives the name of the main tarball if component is None
+ """
+ if self.is_native():
+ return None
+ return Policy.build_tarball_name(self.name,
+ self.upstream_version,
+ compression=compression,
+ component=component)
+
+ def upstream_tarball_names(self, comp_type, components=None):
+ """
+ Possible upstream tarballs names for this source package
+
+ This includes component tarballs names. with the given
+ component names
+ """
+ names = [self.upstream_tarball_name(comp_type)]
+ names += [self.upstream_tarball_name(comp_type, c) for c in (components or [])]
+ return names
# vim: set fileencoding=utf-8 :
#
# (C) 2013 Intel Corporation <markus.lehtonen@linux.intel.com>
+# (C) 2016 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Debian-specific upstream sources"""
from gbp.pkg import UpstreamSource
from gbp.deb.policy import DebianPkgPolicy
+import gbp.command_wrappers
+
+import os
+import shutil
+import tempfile
class DebianUpstreamSource(UpstreamSource):
"""Upstream source class for Debian"""
- def __init__(self, name, unpacked=None, **kwargs):
+ def __init__(self, name, unpacked=None, sig=None):
super(DebianUpstreamSource, self).__init__(name,
- unpacked,
- DebianPkgPolicy,
- **kwargs)
+ unpacked=unpacked,
+ sig=sig,
+ pkg_policy=DebianPkgPolicy)
+
+
+class DebianAdditionalTarball(DebianUpstreamSource):
+ """Upstream source class for additional tarballs"""
+ def __init__(self, name, component, unpacked=None, sig=None):
+ self.component = component
+ super(DebianAdditionalTarball, self).__init__(name,
+ unpacked=unpacked,
+ sig=sig)
+
+ def unpack(self, dest, filters):
+ """
+ Unpack the additional tarball into {dir} naming it
+ I{component}. Apply filters during unpack.
+
+ @param dir: the main tarball dir
+ @param filters: filters to apply
+
+ We can't simply use unpack since we need to remove any preexisting dirs and
+ name the target directory after the component name.
+ """
+ olddir = os.path.abspath(os.path.curdir)
+ tmpdir = None
+ try:
+ tmpdir = os.path.abspath(tempfile.mkdtemp(dir=os.path.join(dest, '..')))
+ super(DebianAdditionalTarball, self).unpack(tmpdir, filters)
+
+ newdest = os.path.join(dest, self.component)
+ if os.path.exists(newdest):
+ shutil.rmtree(newdest)
+ shutil.move(self.unpacked, newdest)
+ finally:
+ os.chdir(olddir)
+ if tmpdir is not None:
+ gbp.command_wrappers.RemoveTree(tmpdir)()
# vim: set fileencoding=utf-8 :
#
-# (C) 2012 Guido Günther <agx@sigxcpu.org>
+# (C) 2012,2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Interface to uscan"""
-import os, re, subprocess
+import os
+import re
+import subprocess
+
class UscanError(Exception):
pass
+
class Uscan(object):
cmd = '/usr/bin/uscan'
def _parse(self, out):
r"""
- Parse the uscan output return and update the object's properties
+ Parse the uscan output and update the object's properties
@param out: uscan output
@type out: string
>>> u._parse('')
Traceback (most recent call last):
...
- UscanError: Couldn't find 'upstream-url' in uscan output
+ gbp.deb.uscan.UscanError: Couldn't find source in uscan output
"""
source = None
self._uptodate = False
- # Check if uscan downloaded something
for row in out.split("\n"):
- # uscan >= 2.10.70 has a target element:
m = re.match(r"<target>(.*)</target>", row)
if m:
source = '../%s' % m.group(1)
- break
- elif row.startswith('<messages>'):
- m = re.match(r".*symlinked ([^\s]+) to it", row)
- if m:
- source = "../%s" % m.group(1)
- break
- m = re.match(r"Successfully downloaded updated package "
- "([^<]+)", row)
- if m:
- source = "../%s" % m.group(1)
- break
- # Try to determine the already downloaded sources name
- else:
- d = {}
-
- try:
- for row in out.split("\n"):
- for n in ('package',
- 'upstream-version',
- 'upstream-url'):
- m = re.match("<%s>(.*)</%s>" % (n,n), row)
- if m:
- d[n] = m.group(1)
- d["ext"] = os.path.splitext(d['upstream-url'])[1]
- # We want the name of the orig tarball if possible
- source = ("../%(package)s_%(upstream-version)s."
- "orig.tar%(ext)s" % d)
-
- # Fall back to the upstream source name otherwise
- if not os.path.exists(source):
- source = "../%s" % d['upstream-url'].rsplit('/',1)[1]
- if not os.path.exists(source):
- raise UscanError("Couldn't find tarball at '%s'" %
- source)
- except KeyError as e:
- raise UscanError("Couldn't find '%s' in uscan output" %
- e.args[0])
+ if not source:
+ raise UscanError("Couldn't find source in uscan output")
self._tarball = source
def _parse_uptodate(self, out):
@param out: uscan output
@type out: string
+ @returns: C{True} if package is uptodate
>>> u = Uscan('http://example.com/')
>>> u._parse_uptodate('<status>up to date</status>')
+ True
>>> u.tarball
>>> u.uptodate
True
>>> u._parse_uptodate('')
+ False
>>> u.tarball
>>> u.uptodate
False
self._uptodate = True
else:
self._uptodate = False
+ return self._uptodate
def _raise_error(self, out):
r"""
... "to example.com:80 (Bad hostname)</warnings>")
Traceback (most recent call last):
...
- UscanError: Uscan failed: uscan warning: In watchfile debian/watch, reading webpage
+ gbp.deb.uscan.UscanError: Uscan failed: uscan warning: In watchfile debian/watch, reading webpage
http://a.b/ failed: 500 Cant connect to example.com:80 (Bad hostname)
>>> u._raise_error("<errors>uscan: Can't use --verbose if "
... "you're using --dehs!</errors>")
Traceback (most recent call last):
...
- UscanError: Uscan failed: uscan: Can't use --verbose if you're using --dehs!
+ gbp.deb.uscan.UscanError: Uscan failed: uscan: Can't use --verbose if you're using --dehs!
>>> u = u._raise_error('')
Traceback (most recent call last):
...
- UscanError: Uscan failed - debug by running 'uscan --verbose'
+ gbp.deb.uscan.UscanError: Uscan failed - debug by running 'uscan --verbose'
"""
msg = None
for n in ('errors', 'warnings'):
- m = re.search("<%s>(.*)</%s>" % (n,n), out, re.DOTALL)
+ m = re.search("<%s>(.*)</%s>" % (n, n), out, re.DOTALL)
if m:
msg = "Uscan failed: %s" % m.group(1)
break
msg = "Uscan failed - debug by running 'uscan --verbose'"
raise UscanError(msg)
+ def scan(self, destdir='..', download_version=None):
+ """
+ Invoke uscan to fetch a new upstream version
- def scan(self, destdir='..'):
- """Invoke uscan to fetch a new upstream version"""
- p = subprocess.Popen(['uscan', '--symlink', '--destdir=%s' % destdir,
- '--dehs'],
- cwd=self._dir,
- stdout=subprocess.PIPE)
- out = p.communicate()[0]
- # uscan exits with 1 in case of uptodate and when an error occured.
+ @returns: C{True} if a new version was downloaded
+ """
+ cmd = ['uscan', '--symlink', '--destdir=%s' % destdir, '--dehs']
+ if download_version:
+ cmd += ['--download-debversion', download_version]
+ p = subprocess.Popen(cmd, cwd=self._dir, stdout=subprocess.PIPE)
+ out = p.communicate()[0].decode()
+ # uscan exits with 1 in case of uptodate and when an error occurred.
# Don't fail in the uptodate case:
- self._parse_uptodate(out)
- if not self.uptodate:
- if p.returncode:
- self._raise_error(out)
- else:
- self._parse(out)
+ if self._parse_uptodate(out):
+ return False
+
+ if p.returncode:
+ self._raise_error(out)
+
+ self._parse(out)
+ return True
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Errors raised in gbp commands"""
+
class GbpError(Exception):
"""Generic exception raised in git-buildpackage commands"""
pass
# vim: set fileencoding=utf-8 :
#
-# (C) 2014 Guido Guenther <agx@sigxcpu.org>
+# (C) 2014 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Format a message"""
from gbp.errors import GbpError
-def format_msg(msg, args):
+
+def format_str(msg, args):
"""
- Format a strin with the given dict. Be a bit more verbose than
+ Format a string with the given dict. Be a bit more verbose than
default python about the error cause.
- >>> format_msg("%(foo)", {})
+ >>> format_str("%(foo)", {})
Traceback (most recent call last):
...
- GbpError: Failed to format %(foo): Missing value 'foo' in {}
- >>> format_msg("%(foo)", {'foo': 'bar'})
+ gbp.errors.GbpError: Failed to format %(foo): Missing value 'foo' in {}
+ >>> format_str("%(foo)", {'foo': 'bar'})
Traceback (most recent call last):
...
- GbpError: Failed to format %(foo) with {'foo': 'bar'}: incomplete format
- >>> format_msg("A %(foo)s is a %(bar)s", {'foo': 'dog', 'bar': 'mamal'})
+ gbp.errors.GbpError: Failed to format %(foo) with {'foo': 'bar'}: incomplete format
+ >>> format_str("A %(foo)s is a %(bar)s", {'foo': 'dog', 'bar': 'mamal'})
'A dog is a mamal'
"""
try:
except ValueError as e:
raise GbpError("Failed to format %s with %s: %s" % (msg, args, e))
except KeyError as e:
- raise GbpError("Failed to format %s: Missing value %s in %s" % (msg, e, args))
+ raise GbpError("Failed to format %s: Missing value %s in %s" %
+ (msg, e, args))
def format_b(fmtstr, *args):
"""
fmtstr = fmtstr.decode()
strargs = tuple([(a.decode() if isinstance(a, bytes) else a) for a in args])
- return (fmtstr % strargs).encode()
\ No newline at end of file
+ return (fmtstr % strargs).encode()
# vim: set fileencoding=utf-8 :
#
-# (C) 2006,2007,2008,2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006,2007,2008,2011 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Accessing Git from python"""
import calendar
import dateutil.parser
-from gbp.git.modifier import GitModifier
-from gbp.git.commit import GitCommit
-from gbp.git.errors import GitError
-from gbp.git.repository import GitRepository, GitRepositoryError
-from gbp.git.fastimport import FastImport
-from gbp.git.args import GitArgs
-from gbp.git.vfs import GitVfs
+from gbp.git.modifier import GitModifier # noqa: F401
+from gbp.git.commit import GitCommit # noqa: F401
+from gbp.git.errors import GitError # noqa: F401
+from gbp.git.repository import ( # noqa: F401
+ GitRepository, GitRepositoryError)
+from gbp.git.fastimport import FastImport # noqa: F401
+from gbp.git.args import GitArgs # noqa: F401
+from gbp.git.vfs import GitVfs # noqa: F401
-def rfc822_date_to_git(rfc822_date):
+def rfc822_date_to_git(rfc822_date, fuzzy=False):
"""Parse a date in RFC822 format, and convert to a 'seconds tz' C{str}ing.
+
>>> rfc822_date_to_git('Thu, 1 Jan 1970 00:00:01 +0000')
'1 +0000'
>>> rfc822_date_to_git('Thu, 20 Mar 2008 01:12:57 -0700')
'1206000777 -0700'
>>> rfc822_date_to_git('Sat, 5 Apr 2008 17:01:32 +0200')
'1207407692 +0200'
+ >>> rfc822_date_to_git('So, 26 Feb 1998 8:50:00 +0100', fuzzy=True)
+ '888479400 +0100'
"""
- d = dateutil.parser.parse(rfc822_date)
+ d = dateutil.parser.parse(rfc822_date, fuzzy=fuzzy)
seconds = calendar.timegm(d.utctimetuple())
tz = d.strftime("%z")
return '%d %s' % (seconds, tz)
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
-
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2011 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""
Git command argument handling helpers
"""
-import collections
+import collections.abc
+
class GitArgs(object):
"""
else:
self.add(noopt)
return self
-
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2011 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Git commit class and helpers"""
import re
-from gbp.git.errors import GitError
class GitCommit(object):
"""A git commit"""
@rtype: C{bool}
"""
return True if GitCommit.sha1_re.match(value) else False
-
-
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2011 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Git base error exception"""
+
class GitError(Exception):
"""Exception thrown by Git related classes"""
pass
-
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2011 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Git fast import class"""
import subprocess
_bufsize = 1024
m_regular = 644
- m_exec = 755
+ m_exec = 755
m_symlink = 120000
def __init__(self, repo):
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2011 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""
Someone who modifiers something in git
from gbp.git.errors import GitError
+
class GitModifierError(GitError):
"""Exception thrown by L{GitModifier}"""
pass
+
class GitTz(datetime.tzinfo):
"""Simple class to store the utc offset only"""
def __init__(self, offset_sec=0, *args, **kwargs):
def dst(self, dt):
return datetime.timedelta(0)
+
class GitModifier(object):
"""Stores authorship/committer information"""
def __init__(self, name=None, email=None, date=None):
timestamp, offset = date.split()
offset_h = int(offset[:-2])
offset_m = int(offset[-2:])
- tz = GitTz(offset_h*3600 + offset_m*60)
+ tz = GitTz(offset_h * 3600 + offset_m * 60)
self._date = datetime.datetime.fromtimestamp(int(timestamp), tz)
- elif type(date) in [ type(0), type(0.0) ]:
+ elif type(date) in [type(0), type(0.0)]:
self._date = datetime.datetime.fromtimestamp(date, tz)
elif isinstance(date, datetime.datetime):
if date.tzinfo:
@staticmethod
def keys():
- return [ 'name', 'email', 'date' ]
+ return ['name', 'email', 'date']
def items(self):
items = []
- for key in list(self.keys()):
+ for key in self.keys():
val = self.__getitem__(key)
if val:
items.append((key, val))
# vim: set fileencoding=utf-8 :
#
-# (C) 2006,2007,2008,2011,2013 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006,2007,2008,2011,2013,2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""A Git repository"""
import subprocess
import re
import sys
from collections import defaultdict
-import select
import gbp.log as log
+from gbp.errors import GbpError
from gbp.format import format_b
from gbp.git.modifier import GitModifier
from gbp.git.commit import GitCommit
all methods.
"""
- def _check_dirs(self):
- """Get top level dir and git meta data dir"""
- out, dummy, ret = self._git_inout('rev-parse', ['--git-dir'],
- capture_stderr=True)
+ def _check_bare(self):
+ """Check whether this is a bare repository"""
+ out, dummy, ret = self._git_inout('rev-parse', ['--is-bare-repository'],
+ capture_stderr=True)
if ret:
raise GitRepositoryError(
- "Failed to get repository git dir at '%s'" % self.path)
+ "Failed to get repository state at '%s'" % self.path)
+ self._bare = False if out.decode().strip() != 'true' else True
- # Set git meta data dir
+ def _get_git_dir(self):
+ out, dummy, ret = self._git_inout('rev-parse', ['--git-dir'],
+ capture_stderr=True)
+ if ret:
+ raise GitRepositoryError(
+ "Failed to determine repos git-dir at '%s'" % self.path)
git_dir = out.strip().decode(sys.getfilesystemencoding())
if os.path.isabs(git_dir):
self._git_dir = git_dir
else:
self._git_dir = os.path.abspath(os.path.join(self.path, git_dir))
- # Set top level dir correctly (in case repo was initialized
- # from a subdir, for example)
- if self.bare:
- self._path = self._git_dir
- else:
- out, dummy, ret = self._git_inout('rev-parse', ['--show-toplevel'],
- capture_stderr=True)
- self._path = os.path.abspath(out.decode().strip())
-
- def __init__(self, path):
- self._path = os.path.abspath(path)
+ def _check_repo(self, path, toplevel):
try:
- # Check for bare repository
- out, dummy, ret = self._git_inout('rev-parse', ['--is-bare-repository'],
+ out, dummy, ret = self._git_inout('rev-parse', ['--show-cdup'],
+ cwd=path,
capture_stderr=True)
cdup = out.strip().decode(sys.getfilesystemencoding())
if ret:
- raise GitRepositoryError("No Git repository at '%s': '%s'" % (self.path, out.decode().strip()))
- self._bare = False if out.decode().strip() != 'true' else True
-
- self._check_dirs()
-
+ raise GitRepositoryError("No Git repository at '%s': '%s'" % (path, cdup))
+ if toplevel and cdup:
+ raise GitRepositoryError("Not the toplevel of a Git repository at '%s': '%s'" % (path, cdup))
+ ret = os.path.abspath(os.path.join(path, cdup or '.'))
except GitRepositoryError:
- raise # We already have a useful error message
- except:
- raise GitRepositoryError("No Git repository at '%s' (or any parent dir)" % self.path)
+ raise # We already have a useful error message
+ except Exception:
+ raise GitRepositoryError("No Git repository at '%s'" % path)
+ return ret
+ def __init__(self, path, toplevel=True):
+ """
+ @param path: path to git repo (or subdir)
+ @type path: C{str}
+ @param toplevel: whether path points to the toplevel dir of
+ git repository
+ @type toplevel: C{bool}
+ """
+ self._bare = False
+ self._path = self._check_repo(path, toplevel)
+ self._check_bare()
+ self._get_git_dir()
@staticmethod
def __build_env(extra_env):
@type args: C{list}
@param extra_env: extra environment variables to pass
@type extra_env: C{dict}
- @param cwd: directory to swith to when running the command, defaults to I{self.path}
+ @param cwd: directory to switch to when running the command, defaults to I{self.path}
@type cwd: C{str}
@return: stdout, return code
@rtype: C{tuple} of C{list} of C{bytestr} and C{int}
cmd = ['git', command] + args
log.debug(cmd)
popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env, cwd=cwd)
- while popen.poll() == None:
+ while popen.poll() is None:
output += popen.stdout.readlines()
output += popen.stdout.readlines()
return output, popen.returncode
def _git_inout(self, command, args, input=None, extra_env=None, cwd=None,
- capture_stderr=False, capture_stdout=True):
+ capture_stderr=False, config_args=None):
"""
Run a git command with input and return output
@type args: C{list}
@param extra_env: extra environment variables to pass
@type extra_env: C{dict}
+ @param cwd: directory to switch to when running the command, defaults to I{self.path}
+ @type cwd: C{str}
@param capture_stderr: whether to capture stderr
@type capture_stderr: C{bool}
@return: stdout, stderr, return code
"""
if not cwd:
cwd = self.path
- ret = 0
- stdout = b''
- stderr = b''
- try:
- for outdata in self.__git_inout(command, args, input, extra_env,
- cwd, capture_stderr,
- capture_stdout):
- stdout += outdata[0]
- stderr += outdata[1]
- except GitRepositoryError as err:
- ret = err.returncode
- return stdout, stderr, ret
-
- def _git_inout2(self, command, args, stdin=None, extra_env=None, cwd=None,
- capture_stderr=False):
- """
- Quite similar to C{_git_inout()} but returns stdout output of the git
- command as a Python generator object, instead. Also, stderr is not
- returned.
-
- @note: The caller must consume the iterator that is returned, in order
- to make sure that the git command runs and terminates.
- """
- if not cwd:
- cwd = self.path
- stderr = b''
- try:
- for outdata in self.__git_inout(command, args, stdin, extra_env,
- cwd, capture_stderr, True):
- stderr += outdata[1]
- yield outdata[0]
- except GitRepositoryError as err:
- err.stderr = stderr
- raise err
+ return self.git_inout(command, args, input, extra_env, cwd, capture_stderr, config_args)
@classmethod
- def __git_inout(cls, command, args, stdin, extra_env, cwd, capture_stderr,
- capture_stdout):
+ def git_inout(cls, command, args, input, extra_env, cwd, capture_stderr, config_args=None):
"""
- Run a git command without a a GitRepostitory instance.
-
- Returns the git command output (stdout, stderr) as a Python generator
- object.
-
- @note: The caller must consume the iterator that is returned, in order
- to make sure that the git command runs and terminates.
+ As _git_inout but can be used without an instance
"""
- def rm_polled_fd(file_obj, select_list):
- file_obj.close()
- select_list.remove(file_obj)
+ config_opts = []
+ config_args = config_args or []
+ for arg in config_args:
+ config_opts.extend(['-c', arg])
- cmd = ['git', command] + args
+ cmd = ['git'] + config_opts + [command] + args
env = cls.__build_env(extra_env)
- stdout_arg = subprocess.PIPE if capture_stdout else None
- stdin_arg = subprocess.PIPE if stdin else None
stderr_arg = subprocess.PIPE if capture_stderr else None
+ stdin_arg = subprocess.PIPE if input is not None else None
log.debug(cmd)
popen = subprocess.Popen(cmd,
stdin=stdin_arg,
- stdout=stdout_arg,
+ stdout=subprocess.PIPE,
stderr=stderr_arg,
env=env,
close_fds=True,
cwd=cwd)
- out_fds = [popen.stdout] if capture_stdout else []
- if capture_stderr:
- out_fds.append(popen.stderr)
- in_fds = [popen.stdin] if stdin else []
- w_ind = 0
- while out_fds or in_fds:
- ready = select.select(out_fds, in_fds, [])
- # Write in chunks of 512 bytes
- if ready[1]:
- try:
- popen.stdin.write(stdin[w_ind:w_ind+512])
- except IOError:
- # Ignore, we want to read buffers to e.g. get error message
- # Git should give an error code so that we catch an error
- pass
- w_ind += 512
- if w_ind > len(stdin):
- rm_polled_fd(popen.stdin, in_fds)
- # Read in chunks of 4k
- stdout = popen.stdout.read(4096) if popen.stdout in ready[0] else b''
- stderr = popen.stderr.read(4096) if popen.stderr in ready[0] else b''
- if popen.stdout in ready[0] and not stdout:
- rm_polled_fd(popen.stdout, out_fds)
- if popen.stderr in ready[0] and not stderr:
- rm_polled_fd(popen.stderr, out_fds)
- yield stdout, stderr
-
- if popen.wait():
- err = GitRepositoryError('git-%s failed' % command)
- err.returncode = popen.returncode
- raise err
-
- def _git_command(self, command, args=[], extra_env=None, interactive=False):
+ (stdout, stderr) = popen.communicate(input)
+ return stdout, stderr, popen.returncode
+
+ def _git_command(self, command, args=[], extra_env=None):
"""
Execute git command with arguments args and environment env
at path.
@param extra_env: extra environment variables to set when running command
@type extra_env: C{dict}
"""
- capture_stdout = not interactive
try:
stdout, stderr, ret = self._git_inout(command=command,
args=args,
input=None,
extra_env=extra_env,
- capture_stderr=True,
- capture_stdout=capture_stdout)
+ capture_stderr=True)
except Exception as excobj:
raise GitRepositoryError("Error running git %s: %s" % (command, excobj))
if ret:
section_re = re.compile(r'^(?P<section>[A-Z].*)')
option_re = re.compile(r'--?(?P<name>[a-zA-Z\-]+).*')
optopt_re = re.compile(r'--\[(?P<prefix>[a-zA-Z\-]+)\]-?')
- backspace_re = re.compile(".\b")
man_section = None
for line in help.decode().splitlines():
if man_section == "OPTIONS" and line.startswith(' -'):
# Check man section
match = section_re.match(line)
if match:
- man_section = backspace_re.sub('', match.group('section'))
+ man_section = match.group('section')
return False
@property
@param rev: where to start the branch from
@param force: reset branch HEAD to start point, if it already exists
- If rev is None the branch starts form the current HEAD.
+ If rev is None the branch starts from the current HEAD.
"""
args = GitArgs(branch)
args.add_true(force, '--force')
@param remote: delete a remote branch
@param remote: C{bool}
"""
+ if not self.has_branch(branch):
+ return
+
args = GitArgs('-D')
args.add_true(remote, '-r')
args.add(branch)
# Check if ref really exists
try:
- self._git_command('show-ref', [ ref ])
- branch = ref[11:] # strip /refs/heads
+ self._git_command('show-ref', [ref])
+ branch = ref[11:] # strip /refs/heads
except GitRepositoryError:
branch = None # empty repo
return branch
-
def has_branch(self, branch, remote=False):
"""
Check if the repository has branch named I{branch}.
@return: C{True} if the repository has this branch, C{False} otherwise
@rtype: C{bool}
"""
- if remote:
- ref = 'refs/remotes/%s' % branch
- else:
- ref = 'refs/heads/%s' % branch
+ args = GitArgs('--verify')
+
+ branch_pattern = 'refs/remotes/%s' if remote else 'refs/heads/%s'
+ args.add(branch_pattern % branch)
try:
- self._git_command('show-ref', [ ref ])
+ self._git_command('show-ref', args.args)
except GitRepositoryError:
return False
return True
if self.bare:
self._git_command("symbolic-ref",
- [ 'HEAD', 'refs/heads/%s' % branch ])
+ ['HEAD', 'refs/heads/%s' % branch])
else:
- self._git_command("checkout", [ branch ])
+ self._git_command("checkout", [branch])
def get_merge_branch(self, branch):
"""
merge = self.get_config("branch.%s.merge" % branch)
except KeyError:
return None
- remote += merge.replace("refs/heads","", 1)
+ remote += merge.replace("refs/heads", "", 1)
return remote
def get_merge_base(self, commit1, commit2):
args = GitArgs()
args.add(commit1)
args.add(commit2)
- sha1, stderr, ret = self._git_inout('merge-base', args.args, capture_stderr=True)
+ sha1, stderr, ret = self._git_inout('merge-base',
+ args.args,
+ extra_env={'LC_ALL': 'C'},
+ capture_stderr=True)
if not ret:
return self.strip_sha1(sha1.decode())
else:
else:
log.debug("Your git suite doesn't support --edit/--no-edit "
"option for git-merge ")
-
- if (self._cmd_has_feature('merge', 'allow-unrelated-histories')):
- args.add_cond(True, '--allow-unrelated-histories')
- else:
- log.debug("Your git suite doesn't support --allow-unrelated-histories "
- "option for git-merge ")
-
args.add(commit)
self._git_command("merge", args.args)
+ def abort_merge(self):
+ """
+ Abort a merge
+ """
+ self._git_command("merge", ["--abort"])
+
+ def is_in_merge(self):
+ return os.path.exists(os.path.join(self.git_dir, 'MERGE_HEAD'))
+
def is_fast_forward(self, from_branch, to_branch):
"""
Check if an update I{from from_branch} to I{to_branch} would be a fast
if not out: # both branches have the same commits
return True, True
- for line in (l.decode() for l in out):
+ for line in (li.decode() for li in out):
if line.startswith("<"):
has_local = True
elif line.startswith(">"):
"""
return self._get_branches(remote=False)
-
def get_remote_branches(self):
"""
Get a list of remote branches
@param msg: the reason for the update
@type msg: C{str}
"""
- args = [ ref, new ]
- if old:
- args += [ old ]
- if msg:
- args = [ '-m', msg ] + args
- self._git_command("update-ref", args)
+ args = GitArgs()
+ args.add_true(msg, '-m', msg)
+ args.add(ref, new)
+ args.add_true(old, old)
+ self._git_command("update-ref", args.args)
def branch_contains(self, branch, commit, remote=False):
"""
args.add(commit)
out, ret = self._git_getoutput('branch', args.args)
- for line in [l.decode() for l in out]:
+ for line in [li.decode() for li in out]:
# remove prefix '*' for current branch before comparing
line = line.replace('*', '')
if line.strip() == branch:
@param local_branch: name of the local branch
@type local_branch: C{str}
- @param upstream: remote/branch, for example origin/master
+ @param upstream: Remote branch in the form remote/branch, e.g. origin/master
@type upstream: C{str}
"""
dummy, err, ret = self._git_inout('branch',
args,
+ extra_env={'LC_ALL': 'C'},
capture_stderr=True)
if ret:
raise GitRepositoryError(
return out[0].decode().strip()
+ @staticmethod
+ def ensure_refs_heads(branch):
+ """
+ Make sure a branch name is prefixed with `refs/heads'
+ """
+ if (branch.startswith('refs/heads/')):
+ return branch
+ #return f'refs/heads/{branch}'
+ return f'{branch}'
+
#{ Tags
- def create_tag(self, name, msg=None, commit=None, sign=False, keyid=None,
- annotate=False):
+ def create_tag(self, name, msg=None, commit=None, sign=False, keyid=None):
"""
Create a new tag.
@type sign: C{bool}
@param keyid: the GPG keyid used to sign the tag
@type keyid: C{str}
- @param annotate: Create an annotated tag
- @type annotate: C{bool}
"""
- args = GitArgs()
- args.add_true(msg, ['-m', msg])
+ args = []
+ args += ['-m', msg] if msg else []
if sign:
- args.add('-s')
- args.add_true(keyid, ['-u', keyid])
- args.add_true(annotate, '-a')
- args.add(name)
- args.add_true(commit, commit)
- self._git_command("tag", args.args, interactive=True)
+ args += ['-s']
+ args += ['-u', keyid] if keyid else []
+ args += [name]
+ args += [commit] if commit else []
+ self._git_command("tag", args)
def delete_tag(self, tag):
"""
@type tag: C{str}
"""
if self.has_tag(tag):
- self._git_command("tag", [ "-d", tag ])
+ self._git_command("tag", ["-d", tag])
def move_tag(self, old, new):
- self._git_command("tag", [ new, old ])
+ self._git_command("tag", [new, old])
self.delete_tag(old)
def has_tag(self, tag):
@return: C{True} if the repository has that tag, C{False} otherwise
@rtype: C{bool}
"""
- out, ret = self._git_getoutput('tag', [ '-l', tag ])
- return [ False, True ][len(out)]
+ out, ret = self._git_getoutput('tag', ['-l', tag])
+ return [False, True][len(out)]
def describe(self, commitish, pattern=None, longfmt=False, always=False,
abbrev=None, tags=False, exact_match=False):
@rtype: C{str}
"""
args = GitArgs()
- args.add_true(pattern, ['--match' , pattern])
+ args.add_true(pattern, ['--match', pattern])
args.add_true(longfmt, '--long')
# 'long' and 'abbrev=0' are incompatible, behave similar to
# 'always' and 'abbrev=0'
args.add(commitish)
tag, err, ret = self._git_inout('describe', args.args,
+ extra_env={'LC_ALL': 'C'},
capture_stderr=True)
if ret:
raise GitRepositoryError("Can't describe %s. Git error: %s" %
"""
return self.describe(commit, pattern, abbrev=0)
+ def find_branch_tag(self, commit, branch, pattern=None):
+ """
+ Find the closest tag on a certain branch to a given commit
+
+ @param commit: the commit to describe
+ @type commit: C{str}
+ @type branch: C{str}
+ @param pattern: only look for tags matching I{pattern}
+ @type pattern: C{str}
+ @return: the found tag
+ @rtype: C{str}
+ """
+ base_commit = self.get_merge_base(commit, branch)
+ return self.describe(base_commit, pattern, abbrev=0)
+
def get_tags(self, pattern=None):
"""
List tags
if self.bare:
ref = "refs/heads/%s" % self.get_branch()
- self._git_command("update-ref", [ ref, commit ])
+ self._git_command("update-ref", [ref, commit])
else:
- args = ['--quiet']
- if hard:
- args += [ '--hard' ]
- args += [ commit, '--' ]
- self._git_command("reset", args)
+ args = GitArgs('--quiet')
+ args.add_true(hard, '--hard')
+ args.add(commit, '--')
+ self._git_command("reset", args.args)
- def _status(self, porcelain, ignore_untracked):
+ def _status(self, porcelain, ignore_untracked, paths):
args = GitArgs()
args.add_true(ignore_untracked, '-uno')
args.add_true(porcelain, '--porcelain')
+ if paths is None:
+ paths = []
+ elif isinstance(paths, str):
+ paths = [paths]
+
out, ret = self._git_getoutput('status',
- args.args,
+ args.args + paths,
extra_env={'LC_ALL': 'C'})
if ret:
raise GitRepositoryError("Can't get repository status")
return out
- def is_clean(self, ignore_untracked=False):
+ def is_clean(self, ignore_untracked=False, paths=None):
"""
Does the repository contain any uncommitted modifications?
@param ignore_untracked: whether to ignore untracked files when
checking the repository status
@type ignore_untracked: C{bool}
+ @param paths: only check changes on paths
+ @type paths: C{list} of C{stings}
@return: C{True} if the repository is clean, C{False} otherwise
and Git's status message
@rtype: C{tuple}
return (True, '')
out = self._status(porcelain=True,
- ignore_untracked=ignore_untracked)
+ ignore_untracked=ignore_untracked,
+ paths=paths)
if out:
# Get a more helpful error message.
out = self._status(porcelain=False,
- ignore_untracked=ignore_untracked)
+ ignore_untracked=ignore_untracked,
+ paths=paths)
return (False, "".join([e.decode() for e in out]))
else:
return (True, '')
# Expect to have two filenames for renames and copies
if status[0] in ['R', 'C']:
filepath = elements.pop(0) + b'\x00' + filepath
- result[status].append(filepath.decode())
+ result[status].append(filepath)
return result
@rtype: C{bool}
"""
# an empty repo has no branches:
- return False if self.branch else True
+ return len(self.get_local_branches()) == 0
def rev_parse(self, name, short=0):
"""
args = GitArgs("--quiet", "--verify")
args.add_cond(short, '--short=%d' % short)
args.add(name)
- sha, stderr, ret = self._git_inout('rev-parse', args.args,
- capture_stderr=True)
+ sha, ret = self._git_getoutput('rev-parse', args.args)
if ret:
raise GitRepositoryError("revision '%s' not found" % name)
- return self.strip_sha1(sha.decode().splitlines()[0], short)
+ return self.strip_sha1(sha[0].decode(), short)
@staticmethod
def strip_sha1(sha1, length=0):
@rtype: C{str}
"""
if index_file:
- extra_env = {'GIT_INDEX_FILE': index_file }
+ extra_env = {'GIT_INDEX_FILE': index_file}
else:
extra_env = None
raise GitRepositoryError("Not a Git repository object: '%s'" % obj)
return out[0].decode().strip()
- def list_tree(self, treeish, recurse=False, paths=None):
+ def list_tree(self, treeish, recurse=False, paths=None, sizes=False):
"""
- Get a trees content. It returns a list of objects that match the
- 'ls-tree' output: [mode, type, sha1, path].
+ Get a trees content. It yields tuples that match the
+ 'ls-tree' output: (mode, type, sha1, path). When sizes is True,
+ includes object sizes: (mode, type, sha1, size, path)
@param treeish: the treeish object to list
@type treeish: C{str}
@param recurse: whether to list the tree recursively
@type recurse: C{bool}
+ @param sizes: whether to include object sizes
+ @type recurse: C{bool}
@return: the tree
@rtype: C{list} of objects. See above.
"""
args = GitArgs('-z')
args.add_true(recurse, '-r')
+ args.add_true(sizes, '-l')
args.add(treeish)
args.add("--")
args.add_cond(paths, paths)
if ret:
raise GitRepositoryError("Failed to ls-tree '%s': '%s'" % (treeish, err.decode().strip()))
- tree = []
for line in out.split(b'\0'):
if line:
- parts = line.split(None, 3)
+ parts = line.split(None, 4 if sizes else 3)
# decode everything but the file name
- for i in range(len(parts) - 1):
- parts[i] = parts[i].decode()
- tree.append(parts)
- return tree
+ filename = parts.pop()
+ if sizes:
+ mode, type, sha1, size = (part.decode() for part in parts)
+ # Git submodules report '-' instead of a size
+ size = size if size != '-' else 0
+ yield mode, type, sha1, int(size), filename
+ else:
+ mode, type, sha1 = (part.decode() for part in parts)
+ yield mode, type, sha1, filename
#}
@return: fetched config value
@rtype: C{str}
"""
- value, ret = self._git_getoutput('config', [ name ])
+ value, ret = self._git_getoutput('config', [name])
if ret:
- raise KeyError("'%s' not found in git config")
+ raise KeyError("'%s' not found in git config" % name)
return value[0].decode()[:-1] # first line with \n ending removed
+ def set_config(self, name, value):
+ """
+ Set a git config value in this repository
+ """
+ args = GitArgs(name, value)
+ self._git_command("config", args.args)
+
+ def set_user_name(self, name):
+ """
+ Sets the full name to use for git commits.
+
+ @param name: full name to use
+ """
+ self.set_config('user.name', name)
+
+ def set_user_email(self, email):
+ """
+ Sets the email address to use for git commits.
+
+ @param email: email address to use
+ """
+ self.set_config('user.email', email)
+
def get_author_info(self):
"""
Determine a sane values for author name and author email from git's
@rtype: L{GitModifier}
"""
try:
- name = self.get_config("user.name")
+ name = self.get_config("user.name")
except KeyError:
name = os.getenv("USER")
try:
@return: remote repositories
@rtype: C{dict} of C{GitRemote}
"""
- out, err, ret = self._git_inout('remote', [], capture_stderr=True)
+ out, err, ret = self._git_inout('remote', [],
+ extra_env={'LC_ALL': 'C'},
+ capture_stderr=True)
if ret:
raise GitRepositoryError('Failed to get list of remotes: %s' % err.decode().strip())
remotes = {}
for remote in out.decode().splitlines():
out, err, _ret = self._git_inout('remote', ['show', '-n', remote],
+ extra_env={'LC_ALL': 'C'},
capture_stderr=True)
if ret:
raise GitRepositoryError('Failed to get information for remote '
fetch_url = None
push_urls = []
for line in out.decode().splitlines():
- match = re.match('\s*Fetch\s+URL:\s*(\S.*)', line)
+ match = re.match(r'\s*Fetch\s+URL:\s*(\S.*)', line)
if match:
fetch_url = match.group(1)
- match = re.match('\s*Push\s+URL:\s*(\S.*)', line)
+ match = re.match(r'\s*Push\s+URL:\s*(\S.*)', line)
if match:
push_urls.append(match.group(1))
remotes[remote] = GitRemote(remote, fetch_url, push_urls)
@deprecated: Use get_remotes() instead
@return: remote repositories
- @rtype: C{dict} of C{list} of C{str}
+ @rtype: C{list} of C{str}
"""
- stdout, stderr, ret = self._git_inout('remote', ['-v'],
- capture_stderr=True)
- if ret:
- raise GitRepositoryError('Failed to get remotes: %s' % stderr.decode().strip())
-
- remotes = {}
- for rem in stdout.splitlines():
- name, url_urltype = rem.decode().strip().split('\t', 1)
- url, urltype = url_urltype.rsplit(' ', 1)
- urltype = urltype.strip('()')
- if not name in remotes:
- remotes[name] = ['']
- if urltype == 'fetch':
- remotes[name][0] = url
- else:
- remotes[name].append(url)
- return remotes
+ out = self._git_getoutput('remote')[0]
+ return [remote.decode().strip() for remote in out]
def has_remote_repo(self, name):
"""
self._git_command("pull", args.args)
def push(self, repo=None, src=None, dst=None, ff_only=True, force=False,
- tags=False):
+ tags=False, dry_run=False):
"""
Push changes to the remote repo
@type force: C{bool}
@param tags: push all refs under refs/tags, in addition to other refs
@type tags: C{bool}
+ @param dry_run: dry run
+ @type dry_run: C{bool}
"""
args = GitArgs()
args.add_cond(repo, repo)
args.add_true(force, "-f")
args.add_true(tags, "--tags")
+ args.add_true(dry_run, "--dry-run")
# Allow for src == '' to delete dst on the remote
- if src != None:
+ if src is not None:
refspec = src
if dst:
refspec += ':%s' % dst
self._git_command("push", args.args)
- def push_tag(self, repo, tag):
+ def push_tag(self, repo, tag, dry_run=False):
"""
Push a tag to the remote repo
@type repo: C{str}
@param tag: the name of the tag
@type tag: C{str}
+ @param dry_run: dry run
+ @type dry_run: C{bool}
"""
args = GitArgs(repo, 'tag', tag)
+ args.add_true(dry_run, "--dry-run")
self._git_command("push", args.args)
#{ Files
- def add_files(self, paths, force=False, untracked=True, index_file=None, work_tree=None):
+ def add_files(self, paths, force=False, index_file=None, work_tree=None):
"""
Add files to a the repository
@type paths: list or C{str}
@param force: add files even if they would be ignored by .gitignore
@type force: C{bool}
- @param untracked: add also previously untracked files
- @type untracked: C{bool}
@param index_file: alternative index file to use
@param work_tree: alternative working tree to use
"""
extra_env = {}
- args = GitArgs()
- args.add_true(force, '-f')
- args.add_cond(untracked, '-A', '-u')
- args.add(paths)
+ if isinstance(paths, str):
+ paths = [paths]
+
+ args = ['-f'] if force else []
if index_file:
- extra_env['GIT_INDEX_FILE'] = index_file
+ extra_env['GIT_INDEX_FILE'] = index_file
if work_tree:
extra_env['GIT_WORK_TREE'] = work_tree
- self._git_command("add", args.args, extra_env)
+ self._git_command("add", args + paths, extra_env)
def remove_files(self, paths, verbose=False):
"""
@type verbose: C{bool}
"""
if isinstance(paths, str):
- paths = [ paths ]
+ paths = [paths]
- args = [] if verbose else ['--quiet']
+ args = [] if verbose else ['--quiet']
self._git_command("rm", args + paths)
def list_files(self, types=['cached']):
for t in types:
if t in all_types:
- args += [ '--%s' % t ]
+ args += ['--%s' % t]
else:
raise GitRepositoryError("Unknown type '%s'" % t)
out, ret = self._git_getoutput('ls-files', args)
else:
return []
-
def write_file(self, filename, filters=True):
"""
Hash a single file and write it into the object database
if not ret:
return self.strip_sha1(sha1.decode())
else:
- raise GitRepositoryError("Failed to hash %s: %s" % (filename, stderr.decode().strip()))
+ raise GbpError("Failed to hash %s: %s" % (filename, stderr.decode().strip()))
+
+ def rename_file(self, old, new):
+ """
+ Rename file, directory, or symlink
+ """
+ args = GitArgs(old, new)
+ _, stderr, ret = self._git_inout('mv',
+ args.args,
+ capture_stderr=True)
+ if ret:
+ raise GbpError("Failed to move '%s' to '%s': %s" % (old, new, stderr.decode().rstrip()))
#}
#{ Comitting
- def _commit(self, msg, args=[], author_info=None,
- committer_info=None, edit=False):
+ def _commit(self, msg, args=[], author_info=None):
extra_env = author_info.get_author_env() if author_info else None
- if committer_info:
- extra_env.update(committer_info.get_committer_env())
- default_args = ['-q', '-m', msg] + (['--edit'] if edit else [])
- self._git_command("commit", default_args + args, extra_env=extra_env,
- interactive=edit)
+ self._git_command("commit", ['-q', '-m', msg] + args, extra_env=extra_env)
- def commit_staged(self, msg, author_info=None, edit=False,
- committer_info=None):
+ def commit_staged(self, msg, author_info=None, edit=False):
"""
Commit currently staged files to the repository
@type author_info: L{GitModifier}
@param edit: whether to spawn an editor to edit the commit info
@type edit: C{bool}
- @param committer_info: committer information
- @type committer_info: L{GitModifier}
"""
- self._commit(msg=msg, author_info=author_info,
- committer_info=committer_info, edit=edit)
+ args = GitArgs()
+ args.add_true(edit, '--edit')
+ self._commit(msg=msg, args=args.args, author_info=author_info)
def commit_all(self, msg, author_info=None, edit=False):
"""
@param author_info: authorship information
@type author_info: L{GitModifier}
"""
- self._commit(msg=msg, args=['-a'], author_info=author_info, edit=edit)
+ args = GitArgs('-a')
+ args.add_true(edit, '--edit')
+ self._commit(msg=msg, args=args.args, author_info=author_info)
- def commit_files(self, files, msg, author_info=None, committer_info=None,
- edit=False):
+ def commit_files(self, files, msg, author_info=None):
"""
Commit the given files to the repository
@type msg: C{str}
@param author_info: authorship information
@type author_info: L{GitModifier}
- @param committer_info: committer information
- @type committer_info: L{GitModifier}
- @param edit: whether to spawn an editor to edit the commit info
- @type edit: C{bool}
- """
- args = GitArgs('--')
- args.add(files)
- self._commit(msg=msg, args=args.args, author_info=author_info,
- committer_info=committer_info, edit=edit)
-
- def create_tree(self, unpack_dir):
- """
- Create a tree object out of a directory content
-
- @param unpack_dir: content to add
- @type unpack_dir: C{str}
- @return: the tree object hash
- @rtype: C{str}
"""
- git_index_file = os.path.join(self.path, self._git_dir, 'gbp_index')
- try:
- os.unlink(git_index_file)
- except OSError:
- pass
- self.add_files('.', force=True, index_file=git_index_file,
- work_tree=unpack_dir)
- return self.write_tree(git_index_file)
+ if isinstance(files, str):
+ files = [files]
+ self._commit(msg=msg, args=files, author_info=author_info)
def commit_dir(self, unpack_dir, msg, branch, other_parents=None,
author={}, committer={}, create_missing_branch=False):
doesn't already exist.
@type create_missing_branch: C{bool}
"""
- tree = self.create_tree(unpack_dir)
+
+ git_index_file = os.path.join(self.path, self._git_dir, 'gbp_index')
+ try:
+ os.unlink(git_index_file)
+ except OSError:
+ pass
+ self.add_files('.', force=True, index_file=git_index_file,
+ work_tree=unpack_dir)
+ tree = self.write_tree(git_index_file)
if branch:
try:
cur = None
else:
raise
- else: # emtpy repo
+ else: # empty repo
cur = None
- branch = 'master'
+ out, _, ret = self._git_inout('symbolic-ref', ['HEAD'],
+ capture_stderr=True)
+ if ret:
+ raise GitRepositoryError("Currently not on a branch")
+ ref = out.decode().split('\n')[0]
+ branch = ref[len('/refs/heads'):]
# Build list of parents:
parents = []
if cur:
- parents = [ cur ]
+ parents.append(cur)
if other_parents:
for parent in other_parents:
sha = self.rev_parse(parent)
if sha not in parents:
- parents += [ sha ]
+ parents.append(sha)
commit = self.commit_tree(tree=tree, msg=msg, parents=parents,
author=author, committer=committer)
if not commit:
raise GitRepositoryError("Failed to commit tree")
- self.update_ref("refs/heads/%s" % branch, commit, cur)
+ self.update_ref("refs/heads/%s" % branch, commit, cur,
+ msg="gbp: %s" % msg.split('\n')[0])
return commit
def commit_tree(self, tree, msg, parents, author={}, committer={}):
@type committer: C{dict} with keys 'name' and 'email'
"""
extra_env = {}
- for key, val in list(author.items()):
+ for key, val in author.items():
if val:
extra_env['GIT_AUTHOR_%s' % key.upper()] = val
- for key, val in list(committer.items()):
+ for key, val in committer.items():
if val:
extra_env['GIT_COMMITTER_%s' % key.upper()] = val
- args = [ tree ]
+ args = [tree]
for parent in parents:
- args += [ '-p' , parent ]
+ args += ['-p', parent]
sha1, stderr, ret = self._git_inout('commit-tree',
args,
msg.encode(),
if not ret:
return self.strip_sha1(sha1.decode())
else:
- raise GitRepositoryError("Failed to commit tree: %s" % stderr.decode().strip())
+ raise GbpError("Failed to commit tree: %s" % stderr.decode().strip())
#{ Commit Information
merge commit
@type first_parent: C{bool}
"""
- args = GitArgs('--pretty=format:%H')
+ args = GitArgs('--pretty=format:%H', '--no-show-signature')
args.add_true(num, '-%d' % num)
args.add_true(first_parent, '--first-parent')
if since:
raise GitRepositoryError("can't get %s: %s" % (id, stderr.decode().rstrip()))
return obj
- def grep_log(self, regex, since=None):
+ def grep_log(self, regex, since=None, merges=True):
"""
Get commmits matching I{regex}
@param since: where to start grepping (e.g. a branch)
@type since: C{str}
"""
- args = ['--pretty=format:%H']
- args.append("--grep=%s" % regex)
- if since:
- args.append(since)
- args.append('--')
+ args = GitArgs('--pretty=format:%H')
+ args.add("--no-show-signature")
+ args.add_false(merges, '--no-merges')
+ args.add('--grep=%s' % regex)
+ args.add_true(since, since)
+ args.add('--')
- stdout, stderr, ret = self._git_inout('log', args,
+ stdout, stderr, ret = self._git_inout('log', args.args,
capture_stderr=True)
if ret:
raise GitRepositoryError("Error grepping log for %s: %s" %
commit_sha1 = self.rev_parse("%s^0" % commitish)
args = GitArgs('--pretty=format:%an%x00%ae%x00%ad%x00%cn%x00%ce%x00%cd%x00%s%x00%f%x00%b%x00',
'-z', '--date=raw', '--no-renames', '--name-status',
- commit_sha1)
+ '--no-show-signature', commit_sha1)
out, err, ret = self._git_inout('show', args.args)
if ret:
raise GitRepositoryError("Unable to retrieve commit info for %s"
while len(file_fields) and file_fields[0] != b'':
status = file_fields.pop(0).decode().strip()
path = file_fields.pop(0)
- files[status].append(path.decode())
+ files[status].append(path)
return {'id': commitish,
'author': author,
options.add_cond(thread, '--thread=%s' % thread, '--no-thread')
output, ret = self._git_getoutput('format-patch', options.args)
- return [ line.strip() for line in output ]
+ return [line.strip() for line in output]
- def apply_patch(self, patch, index=True, context=None, strip=None):
+ def apply_patch(self, patch, index=True, context=None, strip=None, fix_ws=False):
"""Apply a patch using git apply"""
args = []
if context:
- args += [ '-C', context ]
+ args += ['-C', context]
if index:
args.append("--index")
- if strip != None:
- args += [ '-p', str(strip) ]
+ if fix_ws:
+ args.append("--whitespace=fix")
+ if strip is not None:
+ args += ['-p', str(strip)]
args.append(patch)
self._git_command("apply", args)
def diff(self, obj1, obj2=None, paths=None, stat=False, summary=False,
- text=False, ignore_submodules=True):
+ text=False, ignore_submodules=True, abbrev=None, renames=False):
"""
Diff two git repository objects
@rtype: C{binary}
"""
options = GitArgs('-p', '--no-ext-diff')
+ config_args = GitArgs()
if stat is True:
options.add('--stat')
elif stat:
options.add('--stat=%s' % stat)
options.add_true(summary, '--summary')
options.add_true(text, '--text')
- options.add_true(ignore_submodules, '--ignore-submodules')
+ options.add_true(ignore_submodules, '--ignore-submodules=all')
+ if isinstance(renames, bool):
+ options.add('-M' if renames else '--no-renames')
+ else:
+ options.add('-M=%s', renames)
options.add(obj1)
options.add_true(obj2, obj2)
if paths:
options.add('--', paths)
- output, stderr, ret = self._git_inout('diff', options.args)
+ if abbrev is not None:
+ config_args.add('core.abbrev=%d' % abbrev)
+ output, stderr, ret = self._git_inout('diff',
+ options.args,
+ config_args=config_args.args)
if ret:
raise GitRepositoryError("Git diff failed")
return output
while elements[0] != b'':
status = elements.pop(0).decode()[0]
- filepath = elements.pop(0).decode()
+ filepath = elements.pop(0)
# Expect to have two filenames for renames and copies
if status in ['R', 'C']:
- result[status].append(filepath)
- filepath = elements.pop(0).decode()
+ filepath = elements.pop(0) + '\x00' + filepath
result[status].append(filepath)
return result
#}
- def archive(self, format, prefix, output, treeish, paths=None):
+ def archive(self, format, prefix, output, treeish, cwd=None):
"""
Create an archive from a treeish
@type format: C{str}
@param prefix: prefix to prepend to each filename in the archive
@type prefix: C{str}
- @param output: the name of the archive to create, empty string or
- C{None} gives data as return value
- @type output: C{str} or C{None}
+ @param output: the name of the archive to create
+ @type output: C{str}
@param treeish: the treeish to create the archive from
@type treeish: C{str}
- @param paths: List of paths to include in the archive
- @type paths: C{list} of C{str}
-
- @return: archive data as a generator object
- @rtype: C{None} or C{generator} of C{str}
+ @param cwd: The directory to run in. Defaults to the current dir
+ @type cwd: C{str}
"""
- args = GitArgs('--format=%s' % format, '--prefix=%s' % prefix)
- args.add_true(output, '--output=%s' % output)
- args.add(treeish)
- args.add("--")
- args.add_cond(paths, paths)
-
- if output:
- out, err, ret = self._git_inout('archive', args.args)
- if ret:
- raise GitRepositoryError("Unable to archive %s: %s" % (treeish, err.decode().strip()))
- else:
- return self._git_inout2('archive', args.args)
+ args = ['--format=%s' % format,
+ '--prefix=%s' % prefix,
+ '--output=%s' % output,
+ treeish]
+ out, err, ret = self._git_inout('archive', args, cwd=cwd, capture_stderr=True)
+ if ret:
+ raise GitRepositoryError("Unable to archive %s: %s" % (treeish, err.decode().strip()))
- def collect_garbage(self, auto=False):
+ def collect_garbage(self, auto=False, prune=False, aggressive=False):
"""
Cleanup unnecessary files and optimize the local repository
param auto: only cleanup if required
param auto: C{bool}
"""
- args = [ '--auto' ] if auto else []
- self._git_command("gc", args)
+ args = GitArgs('--quiet')
+ if prune is True:
+ args.add('--prune')
+ else:
+ args.add_true(prune, '--prune=%s' % prune)
+ args.add_true(aggressive, '--aggressive')
+ args.add_true(auto, '--auto')
+ self._git_command("gc", args.args)
#{ Submodules
return True
return os.path.exists(os.path.join(self.path, '.gitmodules'))
-
def add_submodule(self, repo_path):
"""
Add a submodule
@param repo_path: path to submodule
@type repo_path: C{str}
"""
- self._git_command("submodule", [ "add", repo_path ])
-
+ self._git_command("submodule", ["add", repo_path])
def update_submodules(self, init=True, recursive=True, fetch=False):
"""
if not self.has_submodules():
return
- args = [ "update" ]
+ args = ["update"]
if recursive:
args.append("--recursive")
if init:
self._git_command("submodule", args)
-
def get_submodules(self, treeish, path=None, recursive=True):
"""
List the submodules of treeish
if path is None:
path = self.path
- args = [ treeish ]
+ args = [treeish]
if recursive:
args += ['-r']
- out, ret = self._git_getoutput('ls-tree', args, cwd=path)
+ out, err, ret = self._git_inout('ls-tree',
+ args,
+ cwd=path,
+ capture_stderr=True)
+ if ret:
+ raise GitRepositoryError("Failed to list submodules of %s: %s" %
+ (treeish, err.decode().strip()))
for line in out.split(b'\n'):
if not line:
continue
# A submodules is shown as "commit" object in ls-tree:
if objtype == "commit":
nextpath = os.path.join(path, name)
- submodules.append((nextpath.replace(self.path, '').lstrip('/'),
- commit))
+ if nextpath.startswith(self.path):
+ nextpath = nextpath[len(self.path):].lstrip('/')
+ submodules.append((nextpath, commit))
if recursive:
submodules += self.get_submodules(commit, path=nextpath,
recursive=recursive)
#{ Repository Creation
@classmethod
- def create(klass, path, description=None, bare=False):
+ def create(cls, path, description=None, bare=False):
"""
Create a repository at path
try:
if not os.path.exists(abspath):
os.makedirs(abspath)
- stderr = b''
try:
- for out in klass.__git_inout(command='init',
- args=args.args,
- stdin=None,
- extra_env=None,
- cwd=abspath,
- capture_stderr=True,
- capture_stdout=True):
- stderr += out[1]
- except GitRepositoryError:
- raise GitRepositoryError("Error running git init: %s" % stderr.decode().strip())
+ stdout, stderr, ret = cls.git_inout(command='init',
+ args=args.args,
+ input=None,
+ extra_env=None,
+ cwd=abspath,
+ capture_stderr=True)
except Exception as excobj:
raise GitRepositoryError("Error running git init: %s" % excobj)
+ if ret:
+ raise GitRepositoryError("Error running git init: %s" % stderr.decode().strip())
+
if description:
with open(os.path.join(abspath, git_dir, "description"), 'w') as f:
description += '\n' if description[-1] != '\n' else ''
f.write(description)
- return klass(abspath)
+ return cls(abspath)
except OSError as err:
raise GitRepositoryError("Cannot create Git repository at '%s': %s"
% (abspath, err))
return None
@classmethod
- def clone(klass, path, remote, depth=0, recursive=False, mirror=False,
- bare=False, auto_name=True):
+ def clone(cls, path, remote, depth=0, recursive=False, mirror=False,
+ bare=False, auto_name=True, reference=None):
"""
Clone a git repository at I{remote} to I{path}.
@param auto_name: If I{True} create a directory below I{path} based on
the I{remote}s name. Otherwise create the repo directly at I{path}.
@type auto_name: C{bool}
+ @param reference: create a clone using local objects from I{reference} repository
+ @type reference: C{str}
@return: git repository object
@rtype: L{GitRepository}
"""
abspath, name = abspath.rsplit('/', 1)
args = GitArgs('--quiet')
- args.add_true(depth, '--depth', depth)
+ args.add_true(depth, '--depth', depth)
args.add_true(recursive, '--recursive')
args.add_true(mirror, '--mirror')
args.add_true(bare, '--bare')
+ args.add_true(reference, '--reference', reference)
args.add(remote)
args.add_true(name, name)
try:
if not os.path.exists(abspath):
os.makedirs(abspath)
- stderr = b''
+
try:
- for out in klass.__git_inout(command='clone',
- args=args.args,
- stdin=None,
- extra_env=None,
- cwd=abspath,
- capture_stderr=True,
- capture_stdout=True):
- stderr += out[1]
- except GitRepositoryError:
- raise GitRepositoryError("Error running git clone: %s" % stderr.decode())
+ stdout, stderr, ret = cls.git_inout(command='clone',
+ args=args.args,
+ input=None,
+ extra_env=None,
+ cwd=abspath,
+ capture_stderr=True)
except Exception as excobj:
raise GitRepositoryError("Error running git clone: %s" % excobj)
+ if ret:
+ raise GitRepositoryError("Error running git clone: %s" % stderr.decode())
if not name:
try:
- name = remote.rstrip('/').rsplit('/',1)[1]
+ name = remote.rstrip('/').rsplit('/', 1)[1]
except IndexError:
name = remote.split(':', 1)[1]
if (mirror or bare):
name = "%s.git" % name
elif name.endswith('.git'):
name = name[:-4]
- return klass(os.path.join(abspath, name))
+ return cls(os.path.join(abspath, name))
except OSError as err:
raise GitRepositoryError("Cannot clone Git repository "
"'%s' to '%s': %s"
% (remote, abspath, err[1]))
return None
#}
-
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Make blobs in a git repository accessible as file like objects"""
import io
-from gbp.git.repository import GitRepositoryError
+from gbp.git.repository import GitRepositoryError
+
class GitVfs(object):
@todo: We don't support any byte ranges yet.
"""
- def __init__(self, content):
+ def __init__(self, content, binary=False):
self._iter = iter
- try:
- self._data = io.StringIO(content.decode())
- except UnicodeDecodeError:
- self._data = io.StringIO(content.decode("iso-8859-1"))
+ if binary:
+ self._data = io.BytesIO(content)
+ else:
+ try:
+ self._data = io.StringIO(content.decode())
+ except UnicodeDecodeError:
+ self._data = io.StringIO(content.decode("iso-8859-1"))
+
def readline(self):
return self._data.readline()
def close(self):
return self._data.close()
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.close()
+
def __init__(self, repo, committish=None):
"""
- Access files in a unpaced Debian source package.
-
@param repo: the git repository to act on
@param committish: the committish to act on
"""
def open(self, path, flags=None):
flags = flags or 'r'
- if flags != 'r':
- raise NotImplementedError("Only reading supported so far")
+ for flag in flags:
+ if flag not in ['r', 't', 'b']:
+ raise NotImplementedError("Flag '%s' unsupported so far" % flag)
try:
return GitVfs._File(self._repo.show(
- "%s:%s" % (self._committish, path)))
+ "%s:%s" % (self._committish, path)),
+ True if 'b' in flags else False)
except GitRepositoryError as e:
- raise IOError(e)
+ raise OSError(e)
# vim: set fileencoding=utf-8 :
#
-# (C) 2010 Guido Guenther <agx@sigxcpu.org>
+# (C) 2010 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
"""Simple colored logging classes"""
import os
import sys
import logging
-from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL
+from logging import (DEBUG, INFO, WARNING, ERROR, CRITICAL, getLogger)
import gbp.tristate
-# Initialize default logger
-LOGGER = logging.getLogger(__name__)
COLORS = dict([('none', 0)] + list(zip(['black', 'red', 'green', 'yellow', 'blue',
- 'magenta', 'cyan', 'white'], list(range(30, 38)))))
+ 'magenta', 'cyan', 'white'], range(30, 38))))
DEFAULT_COLOR_SCHEME = {DEBUG: COLORS['green'],
INFO: COLORS['green'],
WARNING: COLORS['red'],
OFF_SEQ = "\033[0m"
def __init__(self, stream=None, color='auto'):
- logging.StreamHandler.__init__(self, stream)
+ super(GbpStreamHandler, self).__init__(stream)
self._color = gbp.tristate.Tristate(color)
self._color_scheme = DEFAULT_COLOR_SCHEME.copy()
- msg_fmt = "%(color)s%(name)s:%(levelname)s: %(message)s%(coloroff)s"
+ msg_fmt = "%(color)s%(name)s:%(levelname)s:%(coloroff)s %(message)s"
self.setFormatter(logging.Formatter(fmt=msg_fmt))
def set_color(self, color):
record.color = self.COLOR_SEQ % self._color_scheme[record.levelno]
record.coloroff = self.OFF_SEQ
record.levelname = record.levelname.lower()
- return logging.StreamHandler.format(self, record)
+ return super(GbpStreamHandler, self).format(record)
class GbpLogger(logging.Logger):
"""Logger class for git-buildpackage"""
- def __init__(self, name, *args, **kwargs):
- logging.Logger.__init__(self, name, *args, **kwargs)
- self.default_handlers = []
-
- def init_default_handlers(self, color='auto'):
- """Initialize and set default handlers to logger"""
- self.default_handlers = [GbpStreamHandler(sys.stdout, color),
- GbpStreamHandler(sys.stderr, color)]
- self.default_handlers[0].addFilter(GbpFilter([DEBUG, INFO]))
- self.default_handlers[1].addFilter(GbpFilter([WARNING, ERROR,
- CRITICAL]))
- for hdlr in self.default_handlers:
+ def __init__(self, name, color='auto', *args, **kwargs):
+ super(GbpLogger, self).__init__(name, *args, **kwargs)
+ self._default_handlers = [GbpStreamHandler(sys.stdout, color),
+ GbpStreamHandler(sys.stderr, color)]
+ self._default_handlers[0].addFilter(GbpFilter([DEBUG, INFO]))
+ self._default_handlers[1].addFilter(GbpFilter([WARNING, ERROR,
+ CRITICAL]))
+ for hdlr in self._default_handlers:
self.addHandler(hdlr)
- # We don't want to propagate as we add our own handlers
- self.propagate = False
def set_color(self, color):
"""Set/unset colorized output of the default handlers"""
- for hdlr in self.default_handlers:
+ for hdlr in self._default_handlers:
hdlr.set_color(color)
def set_color_scheme(self, color_scheme={}):
"""Set the color scheme of the default handlers"""
- for hdlr in self.default_handlers:
+ for hdlr in self._default_handlers:
hdlr.set_color_scheme(color_scheme)
def set_format(self, fmt):
"""Set the format of the default handlers"""
- for hdlr in self.default_handlers:
+ for hdlr in self._default_handlers:
hdlr.set_format(fmt)
"""Logs a message with level ERROR on the GBP logger"""
LOGGER.error(msg)
-def error(msg):
- err(msg)
def warn(msg):
"""Logs a message with level WARNING on the GBP logger"""
LOGGER.warning(msg)
-def warning(msg):
- warn(msg)
def info(msg):
"""Logs a message with level INFO on the GBP logger"""
LOGGER.info(msg)
+
def debug(msg):
"""Logs a message with level DEBUG on the GBP logger"""
LOGGER.debug(msg)
+
def _parse_color_scheme(color_scheme=""):
"""Set logging colors"""
scheme = {}
except ValueError:
try:
scheme[level] = COLORS[color.lower()]
- except KeyError: pass
+ except KeyError:
+ pass
return scheme
-def getLogger(*args, **kwargs):
- """Gbp-specific function"""
- if not issubclass(logging.getLoggerClass(), GbpLogger):
- logging.setLoggerClass(GbpLogger)
- color = kwargs.pop('color') if 'color' in kwargs else 'auto'
- logger = logging.getLogger(*args, **kwargs)
- if hasattr(logger, 'default_handlers') and not logger.default_handlers:
- logger.init_default_handlers(color)
- return logger
def setup(color, verbose, color_scheme=""):
"""Basic logger setup"""
- # Initialize, if not done yet
- if not isinstance(LOGGER, GbpLogger):
- initialize()
-
LOGGER.set_color(color)
LOGGER.set_color_scheme(_parse_color_scheme(color_scheme))
if verbose:
else:
LOGGER.setLevel(INFO)
-def initialize():
- """Initialize the logger module"""
- global LOGGER
- LOGGER = getLogger("gbp")
+# Initialize the module
+logging.setLoggerClass(GbpLogger)
+
+LOGGER = getLogger("gbp")
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2011 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
import warnings
notify_module = None
+
def enable_notifications():
global notify_module
# Avoid GTK+ cannot open display warning:
warnings.simplefilter("ignore")
try:
- import pynotify
- notify_module = pynotify
+ import notify2 # type: ignore
+ notify_module = notify2
except (ImportError, RuntimeError):
return False
- return notify_module.init("git-buildpackage")
+ try:
+ return notify_module.init("git-buildpackage")
+ except Exception:
+ return False
def build_msg(cp, success):
summary = "Gbp %s" % ["failed", "successful"][success]
msg = ("Build of %s %s %s" %
- (cp['Source'], cp['Version'], ["failed", "succeeded"][success]))
+ (cp['Source'], cp['Version'], ["failed", "succeeded"][success]))
return summary, msg
try:
if not n.show():
return False
- except:
+ except Exception:
return False
return True
return [True, False][notify_opt.is_on()]
return notify_opt.do(send_notification, summary, message)
-
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2011,2015,2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Handle Patches and Patch Series"""
+import collections
import os
import re
-import subprocess
import tempfile
from gbp.errors import GbpError
+from gbp.git.repository import GitRepository
+
+VALID_DEP3_ENDS = re.compile(r'(?:---|\*\*\*|Index:)[ \t][^ \t]|^diff -|^---')
+
class Patch(object):
"""
return repr
def _read_info(self):
+ self._read_git_mailinfo()
+
+ def _read_git_mailinfo(self):
"""
Read patch information into a structured form
using I{git mailinfo}
"""
self.info = {}
+ self.long_desc = ''
+
body = tempfile.NamedTemporaryFile(prefix='gbp_')
- pipe = subprocess.Popen("git mailinfo -k '%s' /dev/null 2>/dev/null < '%s'" %
- (body.name, self.path),
- shell=True,
- stdout=subprocess.PIPE).stdout
- for line in pipe:
- line = line.decode()
+
+ # No patch yet, file name information only
+ if not os.path.exists(self.path):
+ return
+ # The patch description might contain UTF-8 while the actual patch is ascii.
+ # To unconfuse git-mailinfo stop at the patch separator
+ toparse = []
+ for line in open(self.path, 'rb'):
+ if line == b'---\n':
+ break
+ toparse.append(line)
+
+ input = b''.join(toparse)
+ if input.strip():
+ out, err, ret = GitRepository.git_inout(command='mailinfo',
+ args=['-k', body.name, '/dev/null'],
+ input=input,
+ extra_env=None,
+ cwd=None,
+ capture_stderr=True)
+ if ret != 0:
+ raise GbpError("Failed to read patch header of '%s': %s" %
+ (self.path, err))
+ else:
+ out = b''
+
+ # Header
+ for line in out.decode().split('\n'):
if ':' in line:
rfc_header, value = line.split(" ", 1)
header = rfc_header[:-1].lower()
self.info[header] = value.strip()
+ # Body
try:
- self.long_desc = "".join([l.decode("utf-8", "backslashreplace") for l in body])
+ self.long_desc = "".join([li.decode("utf-8", "backslashreplace") for li in body])
except (IOError, UnicodeDecodeError) as msg:
raise GbpError("Failed to read patch header of '%s': %s" %
(self.path, msg))
def _get_subject_from_filename(self):
"""
- Determine the patch's subject based on the it's filename
+ Determine the patch's subject based on the its filename
>>> p = Patch('debian/patches/foo.patch')
>>> p._get_subject_from_filename()
if ext in self.patch_exts:
subject = base
except ValueError:
- pass # No ext so keep subject as is
+ pass # No ext so keep subject as is
return subject.lstrip('0123456789-') or subject
def _get_info_field(self, key, get_val=None):
else:
return get_val() if get_val else None
-
@property
def subject(self):
"""
return self._get_info_field('date')
+class Dep3Patch(Patch):
+ def _read_info(self):
+ super(Dep3Patch, self)._read_info()
+ self._check_dep3()
+
+ def _dep3_get_value(self, lines):
+ value = []
+ for line in lines:
+ if line.startswith(' '):
+ line = line[1:]
+ if line == '.\n':
+ line = line[1:]
+ else:
+ line = line.split(':', 1)[1].lstrip()
+ value.append(line)
+ return ''.join(value)
+
+ def _dep3_to_info(self, headers):
+ """
+ Process the ordered dict generated by check_dep3 and add the
+ information to self.info
+ """
+
+ def add_author(lines):
+ if 'email' in self.info and 'author' in self.info:
+ return 0
+ value = self._dep3_get_value(lines).strip()
+ m = re.match('(.*)<([^<>]+)>', value)
+ if m:
+ value = m.group(1).strip()
+ self.info['email'] = m.group(2)
+ self.info['author'] = value
+ return 1
+
+ def add_subject(lines, long_desc, changes):
+ if 'subject' in self.info:
+ return long_desc, 0
+ value = self._dep3_get_value(lines).lstrip()
+ if '\n' in value:
+ value, description = value.split('\n', 1)
+ # prepend the continuation lines
+ long_desc = description + long_desc
+ self.info['subject'] = value
+ return long_desc, changes + 1
+
+ def add_date(lines):
+ if 'date' in self.info:
+ return 0
+ self.info['date'] = self._dep3_get_value(lines).strip()
+ return 1
+
+ changes = 0
+ pseudo_headers = ''
+ long_desc = self._dep3_get_value(headers.get('long_desc', list()))
+
+ for k, v in headers.items():
+ if k in ('author', 'from'):
+ changes += add_author(v)
+ elif k in ('subject', 'description'):
+ long_desc, changes = add_subject(v, long_desc, changes)
+ elif k in ['date']:
+ changes += add_date(v)
+ elif k == 'long_desc':
+ pass
+ elif k in (
+ 'content-transfer-encoding',
+ 'content-type',
+ 'mime-version',
+ ):
+ # These can appear in `git format-patch` or `gbp pq export`
+ # output. They are not semantically significant: they're
+ # part of the encoding of the patch as an email, rather
+ # than real patch metadata.
+ pass
+ else:
+ pseudo_headers += ''.join(v)
+ changes += 1
+ if changes:
+ self.long_desc = (pseudo_headers +
+ ('\n' if pseudo_headers else '') +
+ long_desc + self.long_desc)
+
+ def _check_dep3(self):
+ """
+ Read DEP3 patch information into a structured form
+ """
+ if not os.path.exists(self.path):
+ return
+
+ # patch_header logic from quilt plus any line starting with ---
+ # which is the dep3 stop processing and the git separation between the
+ # header and diff stat
+ headers = collections.OrderedDict()
+ current = 'long_desc'
+ with open(self.path, errors='replace') as file:
+ for line in file:
+ if VALID_DEP3_ENDS.search(line):
+ break
+
+ if line.startswith(' '):
+ # continuation
+ headers.setdefault(current, list()).append(line)
+ elif ':' in line:
+ current = line.split(':', 1)[0].lower()
+ headers.setdefault(current, list()).append(line)
+ else:
+ # end of paragraph or not a header, read_info already left
+ # everything else in the long_desc, nothing else to do
+ break
+ self._dep3_to_info(headers)
+
+
class PatchSeries(list):
"""
A series of L{Patch}es as read from a quilt series file).
"""
+ comment_re = re.compile(r'\s+#.*$')
+ level_re = re.compile(r'-p(?P<level>[0-9]+)')
@classmethod
- def read_series_file(klass, seriesfile):
+ def read_series_file(cls, seriesfile):
"""Read a series file into L{Patch} objects"""
patch_dir = os.path.dirname(seriesfile)
except Exception as err:
raise GbpError("Cannot open series file: %s" % err)
- queue = klass._read_series(s, patch_dir)
+ queue = cls._read_series(s, patch_dir)
s.close()
return queue
@classmethod
- def _read_series(klass, series, patch_dir):
+ def _read_series(cls, series, patch_dir):
"""
Read patch series
- >>> PatchSeries._read_series(['a/b', \
- 'a -p1', \
- 'a/b -p2'], '.') # doctest:+NORMALIZE_WHITESPACE
+ >>> PatchSeries._read_series(['a/b',
+ ... 'a -p1 # comment',
+ ... 'a/b -p2'], '.')
+ ... # doctest:+NORMALIZE_WHITESPACE
[<gbp.patch_series.Patch path='./a/b' topic='a' >,
<gbp.patch_series.Patch path='./a' strip=1 >,
<gbp.patch_series.Patch path='./a/b' topic='a' strip=2 >]
@param patch_dir: path prefix to prepend to each patch path
@type patch_dir: string
"""
-
queue = PatchSeries()
for line in series:
try:
topic = None
return topic
- @staticmethod
- def _split_strip(line):
+ @classmethod
+ def _strip_comment(cls, line):
+ """
+ Strip a comment from a series file line
+
+ >>> PatchSeries._strip_comment("does/not matter")
+ 'does/not matter'
+ >>> PatchSeries._strip_comment("remove/the # comment # text")
+ 'remove/the'
+ >>> PatchSeries._strip_comment("leave/level/intact -p1 # comment # text")
+ 'leave/level/intact -p1'
+ """
+ return re.sub(cls.comment_re, '', line)
+
+ @classmethod
+ def _split_strip(cls, line):
"""
Separate the -p<num> option from the patch name
split = line.rsplit(None, 1)
if len(split) > 1:
- m = re.match('-p(?P<level>[0-9]+)', split[1])
+ m = cls.level_re.match(split[1])
if m:
patch = split[0]
strip = int(m.group('level'))
return (patch, strip)
@classmethod
- def _parse_line(klass, line, patch_dir):
+ def _parse_line(cls, line, patch_dir):
"""
Parse a single line from a series file
>>> PatchSeries._parse_line("a/b", '.')
<gbp.patch_series.Patch path='./a/b' topic='a' >
"""
- line = line.rstrip()
- topic = klass._get_topic(line)
- (patch, split) = klass._split_strip(line)
- return Patch(os.path.join(patch_dir, patch), topic, split)
-
-
+ line = cls._strip_comment(line.rstrip())
+ topic = cls._get_topic(line)
+ (patch, split) = cls._split_strip(line)
+ return Dep3Patch(os.path.join(patch_dir, patch), topic, split)
# vim: set fileencoding=utf-8 :
#
-# (C) 2006,2007 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006,2007 Guido Günther <agx@sigxcpu.org>
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Common functionality of the Debian/RPM package helpers"""
-import os
-import re
-import glob
-import stat
-import subprocess
-import zipfile
-
-import gbp.command_wrappers as gbpc
-from gbp.errors import GbpError
-
-# compression types, extra options and extensions
-compressor_opts = { 'gzip' : [ ['-n'], 'gz' ],
- 'bzip2' : [ [], 'bz2' ],
- 'lzma' : [ [], 'lzma' ],
- 'xz' : [ [], 'xz' ] }
-
-# Map frequently used names of compression types to the internal ones:
-compressor_aliases = { 'bz2' : 'bzip2',
- 'gz' : 'gzip', }
-
-# Supported archive formats
-archive_formats = [ 'tar', 'zip' ]
-
-# Map combined file extensions to archive and compression format
-archive_ext_aliases = { 'tgz' : ('tar', 'gzip'),
- 'tbz2' : ('tar', 'bzip2'),
- 'tlz' : ('tar', 'lzma'),
- 'txz' : ('tar', 'xz')}
-
-def parse_archive_filename(filename):
- """
- Given an filename return the basename (i.e. filename without the
- archive and compression extensions), archive format and compression
- method used.
-
- @param filename: the name of the file
- @type filename: string
- @return: tuple containing basename, archive format and compression method
- @rtype: C{tuple} of C{str}
-
- >>> parse_archive_filename("abc.tar.gz")
- ('abc', 'tar', 'gzip')
- >>> parse_archive_filename("abc.tar.bz2")
- ('abc', 'tar', 'bzip2')
- >>> parse_archive_filename("abc.def.tbz2")
- ('abc.def', 'tar', 'bzip2')
- >>> parse_archive_filename("abc.def.tar.xz")
- ('abc.def', 'tar', 'xz')
- >>> parse_archive_filename("abc.zip")
- ('abc', 'zip', None)
- >>> parse_archive_filename("abc.lzma")
- ('abc', None, 'lzma')
- >>> parse_archive_filename("abc.tar.foo")
- ('abc.tar.foo', None, None)
- >>> parse_archive_filename("abc")
- ('abc', None, None)
- """
- (base_name, archive_fmt, compression) = (filename, None, None)
-
- # Split filename to pieces
- split = filename.split(".")
- if len(split) > 1:
- if split[-1] in archive_ext_aliases:
- base_name = ".".join(split[:-1])
- (archive_fmt, compression) = archive_ext_aliases[split[-1]]
- elif split[-1] in archive_formats:
- base_name = ".".join(split[:-1])
- (archive_fmt, compression) = (split[-1], None)
- else:
- for (c, o) in compressor_opts.items():
- if o[1] == split[-1]:
- base_name = ".".join(split[:-1])
- compression = c
- if len(split) > 2 and split[-2] in archive_formats:
- base_name = ".".join(split[:-2])
- archive_fmt = split[-2]
-
- return (base_name, archive_fmt, compression)
-
-
-class PkgPolicy(object):
- """
- Common helpers for packaging policy.
- """
- packagename_re = None
- packagename_msg = None
- upstreamversion_re = None
- upstreamversion_msg = None
-
- @classmethod
- def is_valid_packagename(cls, name):
- """
- Is this a valid package name?
-
- >>> PkgPolicy.is_valid_packagename('doesnotmatter')
- Traceback (most recent call last):
- ...
- NotImplementedError: Class needs to provide packagename_re
- """
- if cls.packagename_re is None:
- raise NotImplementedError("Class needs to provide packagename_re")
- return True if cls.packagename_re.match(name) else False
-
- @classmethod
- def is_valid_upstreamversion(cls, version):
- """
- Is this a valid upstream version number?
-
- >>> PkgPolicy.is_valid_upstreamversion('doesnotmatter')
- Traceback (most recent call last):
- ...
- NotImplementedError: Class needs to provide upstreamversion_re
- """
- if cls.upstreamversion_re is None:
- raise NotImplementedError("Class needs to provide upstreamversion_re")
- return True if cls.upstreamversion_re.match(version) else False
-
- @classmethod
- def is_valid_orig_archive(cls, filename):
- "Is this a valid orig source archive"
- (base, arch_fmt, compression) = parse_archive_filename(filename)
- if arch_fmt == 'tar' and compression:
- return True
- return False
-
- @staticmethod
- def guess_upstream_src_version(filename, extra_regex=r''):
- """
- Guess the package name and version from the filename of an upstream
- archive.
-
- @param filename: filename (archive or directory) from which to guess
- @type filename: C{string}
- @param extra_regex: additional regex to apply, needs a 'package' and a
- 'version' group
- @return: (package name, version) or ('', '')
- @rtype: tuple
-
- >>> PkgPolicy.guess_upstream_src_version('foo-bar_0.2.orig.tar.gz')
- ('foo-bar', '0.2')
- >>> PkgPolicy.guess_upstream_src_version('foo-Bar_0.2.orig.tar.gz')
- ('', '')
- >>> PkgPolicy.guess_upstream_src_version('git-bar-0.2.tar.gz')
- ('git-bar', '0.2')
- >>> PkgPolicy.guess_upstream_src_version('git-bar-0.2-rc1.tar.gz')
- ('git-bar', '0.2-rc1')
- >>> PkgPolicy.guess_upstream_src_version('git-bar-0.2:~-rc1.tar.gz')
- ('git-bar', '0.2:~-rc1')
- >>> PkgPolicy.guess_upstream_src_version('git-Bar-0A2d:rc1.tar.bz2')
- ('git-Bar', '0A2d:rc1')
- >>> PkgPolicy.guess_upstream_src_version('git-1.tar.bz2')
- ('git', '1')
- >>> PkgPolicy.guess_upstream_src_version('kvm_87+dfsg.orig.tar.gz')
- ('kvm', '87+dfsg')
- >>> PkgPolicy.guess_upstream_src_version('foo-Bar-a.b.tar.gz')
- ('', '')
- >>> PkgPolicy.guess_upstream_src_version('foo-bar_0.2.orig.tar.xz')
- ('foo-bar', '0.2')
- >>> PkgPolicy.guess_upstream_src_version('foo-bar_0.2.orig.tar.lzma')
- ('foo-bar', '0.2')
- >>> PkgPolicy.guess_upstream_src_version('foo-bar-0.2.zip')
- ('foo-bar', '0.2')
- >>> PkgPolicy.guess_upstream_src_version('foo-bar-0.2.tlz')
- ('foo-bar', '0.2')
- >>> PkgPolicy.guess_upstream_src_version('foo-bar_0.2.tar.gz')
- ('foo-bar', '0.2')
- """
- version_chars = r'[a-zA-Z\d\.\~\-\:\+]'
- basename = parse_archive_filename(os.path.basename(filename))[0]
-
- version_filters = [x % version_chars for x in ( # Debian upstream tarball: package_'<version>.orig.tar.gz'
- r'^(?P<package>[a-z\d\.\+\-]+)_(?P<version>%s+)\.orig',
- # Debian native: 'package_<version>.tar.gz'
- r'^(?P<package>[a-z\d\.\+\-]+)_(?P<version>%s+)',
- # Upstream 'package-<version>.tar.gz'
- # or directory 'package-<version>':
- r'^(?P<package>[a-zA-Z\d\.\+\-]+)(-)(?P<version>[0-9]%s*)')]
- if extra_regex:
- version_filters = extra_regex + version_filters
-
- for filter in version_filters:
- m = re.match(filter, basename)
- if m:
- return (m.group('package'), m.group('version'))
- return ('', '')
-
- @staticmethod
- def has_orig(orig_file, dir):
- "Check if orig tarball exists in dir"
- try:
- os.stat( os.path.join(dir, orig_file) )
- except OSError:
- return False
- return True
-
- @staticmethod
- def symlink_orig(orig_file, orig_dir, output_dir, force=False):
- """
- symlink orig tarball from orig_dir to output_dir
- @return: True if link was created or src == dst
- False in case of error or src doesn't exist
- """
- orig_dir = os.path.abspath(orig_dir)
- output_dir = os.path.abspath(output_dir)
-
- if orig_dir == output_dir:
- return True
-
- src = os.path.join(orig_dir, orig_file)
- dst = os.path.join(output_dir, orig_file)
- if not os.access(src, os.F_OK):
- return False
- try:
- if os.access(dst, os.F_OK) and force:
- os.unlink(dst)
- os.symlink(src, dst)
- except OSError:
- return False
- return True
-
-
-class UpstreamSource(object):
- """
- Upstream source. Can be either an unpacked dir, a tarball or another type
- of archive
-
- @cvar _orig: are the upstream sources already suitable as an upstream
- tarball
- @type _orig: boolean
- @cvar _path: path to the upstream sources
- @type _path: string
- @cvar _unpacked: path to the unpacked source tree
- @type _unpacked: string
- """
- def __init__(self, name, unpacked=None, pkg_policy=PkgPolicy, prefix=None):
- self._orig = False
- self._tarball = False
- self._pkg_policy = pkg_policy
- self._path = os.path.abspath(name)
- if not os.path.exists(self._path):
- raise GbpError('UpstreamSource: unable to find %s' % self._path)
- self.unpacked = unpacked
- self._filename_base, \
- self._archive_fmt, \
- self._compression = parse_archive_filename(os.path.basename(self.path))
- self._prefix = prefix
- if self._prefix is None:
- self._determine_prefix()
-
- self._check_orig()
- if self.is_dir():
- self.unpacked = self.path
-
- def _check_orig(self):
- """
- Check if upstream source format can be used as orig tarball.
- This doesn't imply that the tarball is correctly named.
-
- @return: C{True} if upstream source format is suitable
- as upstream tarball, C{False} otherwise.
- @rtype: C{bool}
- """
- if self.is_dir():
- self._orig = False
- self._tarball = False
- return
-
- self._tarball = True if self.archive_fmt == 'tar' else False
- self._orig = self._pkg_policy.is_valid_orig_archive(os.path.basename(self.path))
-
- def is_orig(self):
- """
- @return: C{True} if sources are suitable as upstream source,
- C{False} otherwise
- @rtype: C{bool}
- """
- return self._orig
-
- def is_tarball(self):
- """
- @return: C{True} if source is a tarball, C{False} otherwise
- @rtype: C{bool}
- """
- return self._tarball
-
- def is_dir(self):
- """
- @return: C{True} if if upstream sources are an unpacked directory,
- C{False} otherwise
- @rtype: C{bool}
- """
- return True if os.path.isdir(self._path) else False
-
- @property
- def path(self):
- return self._path.rstrip('/')
-
-
- @staticmethod
- def _get_topdir_files(file_list):
- """Parse content of the top directory from a file list
-
- >>> UpstreamSource._get_topdir_files([])
- set([])
- >>> UpstreamSource._get_topdir_files([('-', 'foo/bar')])
- set([('d', 'foo')])
- >>> UpstreamSource._get_topdir_files([('d', 'foo/'), ('-', 'foo/bar')])
- set([('d', 'foo')])
- >>> UpstreamSource._get_topdir_files([('d', 'foo'), ('-', 'foo/bar')])
- set([('d', 'foo')])
- >>> UpstreamSource._get_topdir_files([('-', 'fob'), ('d', 'foo'), ('d', 'foo/bar'), ('-', 'foo/bar/baz')])
- set([('-', 'fob'), ('d', 'foo')])
- >>> UpstreamSource._get_topdir_files([('-', './foo/bar')])
- set([('d', 'foo')])
- >>> UpstreamSource._get_topdir_files([('-', 'foo/bar'), ('-', '.foo/bar')])
- set([('d', '.foo'), ('d', 'foo')])
- """
- topdir_files = set()
- for typ, path in file_list:
- split = re.sub('^(?:./|../)*', '', path).split('/')
- if len(split) == 1:
- topdir_files.add((typ, path))
- else:
- topdir_files.add(('d', split[0]))
- return topdir_files
-
- def _determine_prefix(self):
- """Determine the prefix, i.e. the "leading directory name"""
- self._prefix = ''
- if self.is_dir():
- # For directories we presume that the prefix is just the dirname
- self._prefix = os.path.basename(self.path.rstrip('/'))
- else:
- files = []
- if self._archive_fmt == 'zip':
- archive = zipfile.ZipFile(self.path)
- for info in archive.infolist():
- typ = 'd' if stat.S_ISDIR(info.external_attr >> 16) else '?'
- files.append((typ, info.filename))
- elif self._archive_fmt == 'tar':
- popen = subprocess.Popen(['tar', '-t', '-v', '-f', self.path],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- out, _err = popen.communicate()
- if popen.returncode:
- raise GbpError("Listing tar archive content failed")
- for line in out.splitlines():
- fields = line.split(None, 5)
- files.append((fields[0][0], fields[-1].decode()))
- else:
- raise GbpError("Unsupported archive format %s, unable to "
- "determine prefix for '%s'" %
- (self._archive_fmt, self.path))
- # Determine prefix from the archive content
- topdir_files = self._get_topdir_files(files)
- if len(topdir_files) == 1:
- typ, name = topdir_files.pop()
- if typ == 'd':
- self._prefix = name
-
- @property
- def archive_fmt(self):
- """Archive format of the sources, e.g. 'tar'"""
- """
- >>> UpstreamSource('foo/bar.tar.gz').archive_fmt
- 'tar'
- >>> UpstreamSource('foo.bar.zip').archive_fmt
- 'zip'
- >>> UpstreamSource('foo.bar.baz').archive_fmt
- """
- return self._archive_fmt
-
- @property
- def compression(self):
- """Compression format of the sources, e.g. 'gzip'"""
- """
- >>> UpstreamSource('foo/bar.tar.gz').compression
- 'gzip'
- >>> UpstreamSource('foo.bar.zip').compression
- >>> UpstreamSource('foo.bz2').compression
- 'bzip2'
- """
- return self._compression
-
- @property
- def prefix(self):
- """Prefix, i.e. the 'leading directory name' of the sources"""
- return self._prefix
-
- def unpack(self, dir, filters=[]):
- """
- Unpack packed upstream sources into a given directory
- and determine the toplevel of the source tree.
- """
- if self.is_dir():
- raise GbpError("Cannot unpack directory %s" % self.path)
-
- if not filters:
- filters = []
-
- if type(filters) != type([]):
- raise GbpError("Filters must be a list")
-
- if self._unpack_archive(dir, filters):
- ret = type(self)(dir, prefix=self._prefix)
- else:
- ret = self
- src_dir = os.path.join(dir, self._prefix)
- ret.unpacked = src_dir if os.path.isdir(src_dir) else dir
- return ret
-
- def _unpack_archive(self, dir, filters):
- """
- Unpack packed upstream sources into a given directory. Return True if
- the output was filtered, otherwise False.
- """
- ext = os.path.splitext(self.path)[1]
- if ext in [ ".zip", ".xpi" ]:
- self._unpack_zip(dir)
- else:
- self._unpack_tar(dir, filters)
- if filters:
- return True
- return False
-
- def _unpack_zip(self, dir):
- try:
- gbpc.UnpackZipArchive(self.path, dir)()
- except gbpc.CommandExecFailed:
- raise GbpError("Unpacking of %s failed" % self.path)
-
- def _unpack_tar(self, dir, filters):
- """
- Unpack a tarball to I{dir} applying a list of I{filters}. Leave the
- cleanup to the caller in case of an error.
- """
- try:
- unpackArchive = gbpc.UnpackTarArchive(self.path, dir, filters)
- unpackArchive()
- except gbpc.CommandExecFailed:
- # unpackArchive already printed an error message
- raise GbpError
-
- def pack(self, newarchive, filters=[], newprefix=None):
- """
- Recreate a new archive from the current one
-
- @param newarchive: the name of the new archive
- @type newarchive: string
- @param filters: tar filters to apply
- @type filters: array of strings
- @param newprefix: new prefix, None implies that prefix is not mangled
- @type newprefix: string or None
- @return: the new upstream source
- @rtype: UpstreamSource
- """
- if not self.unpacked:
- raise GbpError("Need an unpacked source tree to pack")
-
- if not filters:
- filters = []
-
- if type(filters) != type([]):
- raise GbpError("Filters must be a list")
-
- run_dir = os.path.dirname(self.unpacked.rstrip('/'))
- pack_this = os.path.basename(self.unpacked.rstrip('/'))
- transform = None
- if newprefix is not None:
- newprefix = newprefix.strip('/.')
- if newprefix:
- transform = 's!%s!%s!' % (pack_this, newprefix)
- else:
- transform = 's!%s!%s!' % (pack_this, '.')
- try:
- repackArchive = gbpc.PackTarArchive(newarchive,
- run_dir,
- pack_this,
- filters,
- transform=transform)
- repackArchive()
- except gbpc.CommandExecFailed:
- # repackArchive already printed an error
- raise GbpError
- new = type(self)(newarchive)
- # Reuse the same unpacked dir if the content matches
- if not filters:
- new.unpacked = self.unpacked
- return new
-
- @staticmethod
- def known_compressions():
- return [ args[1][-1] for args in list(compressor_opts.items()) ]
-
- def guess_version(self, extra_regex=r''):
- return self._pkg_policy.guess_upstream_src_version(self.path,
- extra_regex)
+from gbp.pkg.pkgpolicy import PkgPolicy # noqa: F401
+from gbp.pkg.compressor import Compressor # noqa: F401
+from gbp.pkg.archive import Archive # noqa: F401
+from gbp.pkg.upstreamsource import UpstreamSource # noqa: F401
+from gbp.pkg.pristinetar import PristineTar # noqa: F401
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+from .compressor import Compressor
+
+
+class Archive(object):
+ # Supported archive formats
+ Formats = ['tar', 'zip']
+
+ # Map combined file extensions to archive and compression format
+ Ext_aliases = {'tgz': ('tar', 'gzip'),
+ 'tbz2': ('tar', 'bzip2'),
+ 'tlz': ('tar', 'lzma'),
+ 'txz': ('tar', 'xz')}
+
+ @staticmethod
+ def parse_filename(filename):
+ """
+ Given an filename return the basename (filename without the
+ archive and compression extensions), archive format and
+ compression method used.
+
+ @param filename: the name of the file
+ @type filename: string
+ @return: tuple containing basename, archive format and compression method
+ @rtype: C{tuple} of C{str}
+
+ >>> Archive.parse_filename("abc.tar.gz")
+ ('abc', 'tar', 'gzip')
+ >>> Archive.parse_filename("abc.tar.bz2")
+ ('abc', 'tar', 'bzip2')
+ >>> Archive.parse_filename("abc.def.tbz2")
+ ('abc.def', 'tar', 'bzip2')
+ >>> Archive.parse_filename("abc.def.tar.xz")
+ ('abc.def', 'tar', 'xz')
+ >>> Archive.parse_filename("abc.zip")
+ ('abc', 'zip', None)
+ >>> Archive.parse_filename("abc.lzma")
+ ('abc', None, 'lzma')
+ >>> Archive.parse_filename("abc.tar.foo")
+ ('abc.tar.foo', None, None)
+ >>> Archive.parse_filename("abc")
+ ('abc', None, None)
+ """
+ (base_name, archive_fmt, compression) = (filename, None, None)
+
+ # Split filename into pieces
+ split = filename.split(".")
+ if len(split) > 1:
+ if split[-1] in Archive.Ext_aliases:
+ base_name = ".".join(split[:-1])
+ (archive_fmt, compression) = Archive.Ext_aliases[split[-1]]
+ elif split[-1] in Archive.Formats:
+ base_name = ".".join(split[:-1])
+ (archive_fmt, compression) = (split[-1], None)
+ else:
+ for (c, ext) in Compressor.Exts.items():
+ if ext == split[-1]:
+ base_name = ".".join(split[:-1])
+ compression = c
+ if len(split) > 2 and split[-2] in Archive.Formats:
+ base_name = ".".join(split[:-2])
+ archive_fmt = split[-2]
+
+ return (base_name, archive_fmt, compression)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+
+class Compressor(object):
+ # Map frequently used names of compression types to the internal ones:
+ Aliases = {'bz2': 'bzip2',
+ 'gz': 'gzip', }
+
+ Opts = {'gzip': '-n',
+ 'bzip2': '',
+ 'lzma': '',
+ 'xz': ''}
+
+ Exts = {'gzip': 'gz',
+ 'bzip2': 'bz2',
+ 'lzma': 'lzma',
+ 'xz': 'xz'}
+
+ def __init__(self, type_, level=None):
+ self._type = type_
+ self._level = int(level) if level not in [None, ''] else None
+
+ def is_known(self):
+ return self.type in self.Opts.keys()
+
+ @property
+ def type(self):
+ return self._type
+
+ @property
+ def level(self):
+ return self._level
+
+ @property
+ def _level_opt(self):
+ return '-%d' % self.level if self.level is not None else ''
+
+ @property
+ def _more_opts(self):
+ return self.Opts.get(self._type, '')
+
+ def cmdline(self, stdout=True):
+ """
+ >>> Compressor('gzip', level=9).cmdline()
+ 'gzip -9 -n -c'
+ >>> Compressor('gzip').cmdline(True)
+ 'gzip -n -c'
+ """
+ return "%s %s %s %s" % (self.type, self._level_opt, self._more_opts,
+ "-c" if stdout else '')
+
+ def __repr__(self):
+ """
+ >>> Compressor('gzip').__repr__()
+ "<compressor type='gzip' >"
+ >>> Compressor('gzip', 9).__repr__()
+ "<compressor type='gzip' level=9>"
+ """
+ level_str = "level=%s" % self.level if self.level is not None else ''
+ return "<compressor type='%s' %s>" % (self.type, level_str)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+"""A Git Repository that keeps a Distro Package"""
+
+import os
+import pipes
+import shutil
+import tempfile
+
+from gbp.command_wrappers import (CatenateTarArchive, CatenateZipArchive)
+from gbp.git import GitRepository, GitRepositoryError
+from gbp.deb.pristinetar import DebianPristineTar
+
+
+import gbp.log
+
+
+class PkgGitRepository(GitRepository):
+ """A git repository that holds the source of a Distro package"""
+
+ def __init__(self, *args, **kwargs):
+ super(PkgGitRepository, self).__init__(*args, **kwargs)
+ self.pristine_tar = DebianPristineTar(self)
+
+ @staticmethod
+ def sanitize_prefix(prefix):
+ """
+ Make sure git-archive prefix ends with a slash
+
+ >>> PkgGitRepository.sanitize_prefix('')
+ '/'
+ >>> PkgGitRepository.sanitize_prefix('foo/')
+ 'foo/'
+ >>> PkgGitRepository.sanitize_prefix('/foo/bar')
+ 'foo/bar/'
+ """
+ if prefix:
+ return prefix.strip('/') + '/'
+ return '/'
+
+ def archive_comp(self, treeish, output, prefix, comp, format='tar', submodules=False):
+ """Create a compressed source tree archive with the given options"""
+ if comp and not comp.is_known():
+ raise GitRepositoryError("Unsupported compression type '%s'" % comp.type)
+
+ if submodules:
+ return self._archive_comp_submodules(treeish, output, prefix, comp, format)
+ else:
+ return self._archive_comp_single(treeish, output, prefix, comp, format)
+
+ def _archive_comp_submodules(self, treeish, output, prefix, comp, format='tar'):
+ """
+ Create a compressed source tree archive with submodules.
+
+ Concatenates the archives generated by git-archive into one and compresses
+ the end result.
+
+ Exception handling is left to the caller.
+ """
+ prefix = self.sanitize_prefix(prefix)
+ tempdir = tempfile.mkdtemp()
+ main_archive = os.path.join(tempdir, "main.%s" % format)
+ submodule_archive = os.path.join(tempdir, "submodule.%s" % format)
+ try:
+ # generate main (tmp) archive
+ self.archive(format=format, prefix=prefix,
+ output=main_archive, treeish=treeish)
+
+ # generate each submodule's archive and append it to the main archive
+ for (subdir, commit) in self.get_submodules(treeish):
+ tarpath = [subdir, subdir[2:]][subdir.startswith("./")]
+
+ gbp.log.debug("Processing submodule %s (%s)" % (subdir, commit[0:8]))
+ self.archive(format=format, prefix='%s%s/' % (prefix, tarpath),
+ output=submodule_archive, treeish=commit, cwd=subdir)
+ if format == 'tar':
+ CatenateTarArchive(main_archive)(submodule_archive)
+ elif format == 'zip':
+ CatenateZipArchive(main_archive)(submodule_archive)
+
+ # compress the output
+ if comp and comp.type:
+ # Redirect through stdout directly to the correct output file in
+ # order to avoid determining the output filename of the compressor
+ ret = os.system("%s %s > %s" % (comp.cmdline(), main_archive, output))
+ if ret:
+ raise GitRepositoryError("Error creating %s: %d" % (output, ret))
+ else:
+ shutil.move(main_archive, output)
+ finally:
+ shutil.rmtree(tempdir)
+
+ def _archive_comp_single(self, treeish, output, prefix, comp, format='tar'):
+ """
+ Create a compressed source tree archive without submodules
+
+ We have this as a special case since it avoids a temporary file
+ """
+ prefix = self.sanitize_prefix(prefix)
+ pipe = pipes.Template()
+ pipe.prepend("git archive --format=%s --prefix=%s %s" % (format, prefix, treeish), '.-')
+ if comp and comp.type:
+ pipe.append(comp.cmdline(), '--')
+ ret = pipe.copy('', output)
+ if ret:
+ raise GitRepositoryError("Error creating %s: %d" % (output, ret))
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+
+import os
+import re
+import typing
+
+
+from gbp.pkg.archive import Archive
+from gbp.format import format_str
+
+
+class PkgPolicy(object):
+ """
+ Common helpers for packaging policy.
+ """
+ version_mangle_re = (r'%\(version'
+ r'%(?P<M>[^%])'
+ r'%(?P<R>([^%]|\\%))+'
+ r'\)s')
+ packagename_re: typing.Optional[typing.Pattern[str]] = None
+ packagename_msg: typing.Optional[str] = None
+ upstreamversion_re: typing.Optional[typing.Pattern[str]] = None
+ upstreamversion_msg: typing.Optional[str] = None
+
+ @classmethod
+ def is_valid_packagename(cls, name):
+ """
+ Is this a valid package name?
+
+ >>> PkgPolicy.is_valid_packagename('doesnotmatter')
+ Traceback (most recent call last):
+ ...
+ NotImplementedError: Class needs to provide packagename_re
+ """
+ if cls.packagename_re is None:
+ raise NotImplementedError("Class needs to provide packagename_re")
+ return True if cls.packagename_re.match(name) else False
+
+ @classmethod
+ def is_valid_upstreamversion(cls, version):
+ """
+ Is this a valid upstream version number?
+
+ >>> PkgPolicy.is_valid_upstreamversion('doesnotmatter')
+ Traceback (most recent call last):
+ ...
+ NotImplementedError: Class needs to provide upstreamversion_re
+ """
+ if cls.upstreamversion_re is None:
+ raise NotImplementedError("Class needs to provide upstreamversion_re")
+ return True if cls.upstreamversion_re.match(version) else False
+
+ @staticmethod
+ def guess_upstream_src_version(filename, extra_regex=r''):
+ """
+ Guess the package name and version from the filename of an upstream
+ archive.
+
+ @param filename: filename (archive or directory) from which to guess
+ @type filename: C{string}
+ @param extra_regex: additional regex to apply, needs a 'package' and a
+ 'version' group
+ @return: (package name, version) or ('', '')
+ @rtype: tuple
+
+ >>> PkgPolicy.guess_upstream_src_version('foo-bar_0.2.orig.tar.gz')
+ ('foo-bar', '0.2')
+ >>> PkgPolicy.guess_upstream_src_version('foo-Bar_0.2.orig.tar.gz')
+ ('', '')
+ >>> PkgPolicy.guess_upstream_src_version('git-bar-0.2.tar.gz')
+ ('git-bar', '0.2')
+ >>> PkgPolicy.guess_upstream_src_version('git-bar-0.2-rc1.tar.gz')
+ ('git-bar', '0.2-rc1')
+ >>> PkgPolicy.guess_upstream_src_version('git-bar-0.2:~-rc1.tar.gz')
+ ('git-bar', '0.2:~-rc1')
+ >>> PkgPolicy.guess_upstream_src_version('git-Bar-0A2d:rc1.tar.bz2')
+ ('git-Bar', '0A2d:rc1')
+ >>> PkgPolicy.guess_upstream_src_version('git-1.tar.bz2')
+ ('git', '1')
+ >>> PkgPolicy.guess_upstream_src_version('kvm_87+dfsg.orig.tar.gz')
+ ('kvm', '87+dfsg')
+ >>> PkgPolicy.guess_upstream_src_version('foo-Bar-a.b.tar.gz')
+ ('', '')
+ >>> PkgPolicy.guess_upstream_src_version('foo-bar_0.2.orig.tar.xz')
+ ('foo-bar', '0.2')
+ >>> PkgPolicy.guess_upstream_src_version('foo-bar_0.2.orig.tar.lzma')
+ ('foo-bar', '0.2')
+ >>> PkgPolicy.guess_upstream_src_version('foo-bar-0.2.zip')
+ ('foo-bar', '0.2')
+ >>> PkgPolicy.guess_upstream_src_version('foo-bar-0.2.tlz')
+ ('foo-bar', '0.2')
+ >>> PkgPolicy.guess_upstream_src_version('foo-bar_0.2.tar.gz')
+ ('foo-bar', '0.2')
+ """
+ version_chars = r'[a-zA-Z\d\.\~\-\:\+]'
+ basename = Archive.parse_filename(os.path.basename(filename))[0]
+
+ version_filters = map(
+ lambda x: x % version_chars,
+ ( # Debian upstream tarball: package_'<version>.orig.tar.gz'
+ r'^(?P<package>[a-z\d\.\+\-]+)_(?P<version>%s+)\.orig',
+ # Debian native: 'package_<version>.tar.gz'
+ r'^(?P<package>[a-z\d\.\+\-]+)_(?P<version>%s+)',
+ # Upstream 'package-<version>.tar.gz'
+ # or directory 'package-<version>':
+ r'^(?P<package>[a-zA-Z\d\.\+\-]+)(-)(?P<version>[0-9]%s*)'))
+ if extra_regex:
+ version_filters = extra_regex + version_filters
+
+ for filter in version_filters:
+ m = re.match(filter, basename)
+ if m:
+ return (m.group('package'), m.group('version'))
+ return ('', '')
+
+ @staticmethod
+ def has_origs(orig_files, dir):
+ "Check orig tarball and additional tarballs exists in dir"
+ for o in orig_files:
+ if not os.path.exists(os.path.join(dir, o)):
+ return False
+ return True
+
+ @classmethod
+ def has_orig(cls, orig_file, dir):
+ return cls.has_origs([orig_file], dir)
+
+ @staticmethod
+ def symlink_origs(orig_files, orig_dir, output_dir, force=False):
+ """
+ symlink orig tarball from orig_dir to output_dir
+ @return: [] if all links were created, list of
+ failed links otherwise
+ """
+ orig_dir = os.path.abspath(orig_dir)
+ output_dir = os.path.abspath(output_dir)
+ err = []
+
+ if orig_dir == output_dir:
+ return []
+
+ for f in orig_files:
+ src = os.path.join(orig_dir, f)
+ dst = os.path.join(output_dir, f)
+ if not os.access(src, os.F_OK):
+ err.append(f)
+ continue
+ try:
+ if os.path.lexists(dst) and force:
+ os.unlink(dst)
+ os.symlink(src, dst)
+ except OSError:
+ err.append(f)
+ return err
+
+ @classmethod
+ def symlink_orig(cls, orig_file, orig_dir, output_dir, force=False):
+ return cls.symlink_origs([orig_file], orig_dir, output_dir, force=force)
+
+ @classmethod
+ def version_subst(cls, format, version, sanitizer=lambda arg: arg):
+ """Generate a string from a given format and a version. The extracted
+ version can be passed through the sanitizer function argument before
+ being formatted into a string.
+
+ %(version)s provides a clean version.
+
+ %(hversion)s provides the same thing, but with '.' replaced with '-'.
+ hversion is useful for upstreams with tagging policies that prohibit .
+ characters.
+
+ %(version%A%B)s provides %(version)s with string 'A' replaced by 'B'.
+ This way, simple version mangling is possible via substitution.
+ Inside the substition string, '%' needs to be escaped. See the
+ examples below.
+
+ >>> PkgPolicy.version_subst("debian/%(version)s", "0:0~0")
+ 'debian/0:0~0'
+ >>> PkgPolicy.version_subst("libfoo-%(hversion)s", "1.8.1")
+ 'libfoo-1-8-1'
+ >>> PkgPolicy.version_subst("v%(version%.%_)s", "1.2.3")
+ 'v1_2_3'
+ >>> PkgPolicy.version_subst(r'%(version%-%\\%)s', "0-1.2.3")
+ '0%1.2.3'
+ """
+ r = re.search(cls.version_mangle_re, format)
+ if r:
+ format = re.sub(cls.version_mangle_re, "%(version)s", format)
+ version = version.replace(r.group('M'), r.group('R').replace(r'\%', '%'))
+ return format_str(format, dict(version=sanitizer(version),
+ hversion=sanitizer(version).replace('.', '-')))
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Handle checkin and checkout of archives from the pristine-tar branch"""
+import re
import os
import gbp.log
from gbp.command_wrappers import Command
+
class PristineTar(Command):
"""The pristine-tar branch in a git repository"""
- cmd='/usr/bin/pristine-tar'
branch = 'pristine-tar'
def __init__(self, repo):
self.repo = repo
- super(PristineTar, self).__init__(self.cmd, cwd=repo.path)
+ super(PristineTar, self).__init__('pristine-tar',
+ cwd=repo.path,
+ capture_stderr=True)
+
+ def _has_in_output(self, match):
+ """
+ Check if pristine_tar has a certain feature enabled.
+
+ @param feature: feature / command option to check
+ @type feature: C{str}
+ @return: True if feature is supported
+ @rtype: C{bool}
+ """
+ self.call(['--help'], quiet=True) # There's no --help so we always exit 1
+ r = re.compile(match)
+ for line in self.stderr.splitlines():
+ if r.match(line):
+ return True
+ return False
+
+ def has_feature_verify(self):
+ """Does this pristine-tar support tarball verification"""
+ return self._has_in_output(".* pristine-tar .* verify")
+
+ def has_feature_sig(self):
+ """Does this pristine-tar support detached upstream signatures"""
+ return self._has_in_output(r'.*--signature-file')
def has_commit(self, archive_regexp):
"""
- Do we have a pristine-tar commit for package I{package} at version
- {version} with compression type I{comp_type}?
+ Do we have a pristine-tar commit for a package matching I{archive_regexp}.
@param archive_regexp: archive name to look for (regexp wildcards allowed)
@type archive_regexp: C{str}
"""
- return True if self.get_commit(archive_regexp) else False
+ return True if self.get_commit(archive_regexp)[0] else False
+
+ def _commit_contains_file(self, commit, regexp):
+ """Does the given commit contain a file with the given regex"""
+ files = self.repo.get_commit_info(commit)['files']
+ # CPython wants '+' (which is valid in source package names)
+ # escaped but git-grep doesn't so we do it that late:
+ cregex = re.compile(regexp.replace('+', '\\+'))
+ for _, v in files.items():
+ for f in v:
+ if cregex.match(f.decode()):
+ return True
+ return False
def get_commit(self, archive_regexp):
"""
- Get the pristine-tar commit of package I{package} in version I{version}
- and compression type I{comp_type}
+ Get the pristine-tar commit of a package matching I{archive_regexp}.
+ Checks also whether the commit contains a signature file.
@param archive_regexp: archive name to look for (regexp wildcards allowed)
@type archive_regexp: C{str}
+ @return: Commit, True if commit contains a signature file
+ @rtype: C{tuple} of C{str} and C{bool}
"""
if not self.repo.has_pristine_tar_branch():
- return None
+ return None, False
regex = ('pristine-tar .* %s' % archive_regexp)
- commits = self.repo.grep_log(regex, self.branch)
+ commits = self.repo.grep_log(regex, self.branch, merges=False)
if commits:
commit = commits[-1]
gbp.log.debug("Found pristine-tar commit at '%s'" % commit)
- return commit
- return None
+ return commit, self._commit_contains_file(commit, '%s.asc' % archive_regexp)
+ return None, False
- def checkout(self, archive):
+ def checkout(self, archive, quiet=False, signaturefile=None):
"""
Checkout an orig archive from pristine-tar branch
@param archive: the name of the orig archive
@type archive: C{str}
"""
- self.run_error = 'Couldn\'t checkout "%s"' % os.path.basename(archive)
- self.__call__(['checkout', archive])
+ args = ['checkout', archive]
+ self.run_error = 'Pristine-tar couldn\'t checkout "%s": {stderr_or_reason}' % os.path.basename(archive)
+ if signaturefile and self.has_feature_sig():
+ args += ['-s', signaturefile]
+ self.__call__(args, quiet=quiet)
- def commit(self, archive, upstream):
+ def commit(self, archive, upstream, quiet=False, signaturefile=None):
"""
Commit an archive I{archive} to the pristine tar branch using upstream
branch ${upstream}.
@param upstream: the upstream branch to diff against
@type upstream: C{str}
"""
- ref = 'refs/heads/%s' % upstream
-
- self.run_error = ("Couldn't commit to '%s' with upstream '%s'" %
+ args = ['commit', archive, upstream]
+ self.run_error = ("Couldn't commit to '%s' with upstream '%s': {stderr_or_reason}" %
(self.branch, upstream))
- self.__call__(['commit', archive, upstream])
+ if signaturefile and self.has_feature_sig():
+ args += ['-s', signaturefile]
+ self.__call__(args, quiet=quiet)
+
+ def verify(self, archive, quiet=False):
+ """Verify an archive's I{archive} checksum using to the pristine tar branch"""
+ self.run_error = 'Pristine-tar couldn\'t verify "%s": {stderr_or_reason}' % os.path.basename(archive)
+ self.__call__(['verify', archive], quiet=quiet)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import glob
+import os
+
+import gbp.command_wrappers as gbpc
+
+from gbp.pkg.compressor import Compressor
+from gbp.pkg.pkgpolicy import PkgPolicy
+
+from gbp.errors import GbpError
+
+
+class UpstreamSource(object):
+ """
+ Upstream source. Can be either an unpacked dir, a tarball or another type
+ of archive
+
+ @cvar _orig: are the upstream sources already suitable as an upstream
+ tarball
+ @type _orig: boolean
+ @cvar _path: path to the upstream sources
+ @type _path: string
+ @cvar _unpacked: path to the unpacked source tree
+ @type _unpacked: string
+ """
+ def __init__(self, name, unpacked=None, pkg_policy=PkgPolicy, sig=None):
+ self._orig = False
+ self._pkg_policy = pkg_policy
+ self._path = name
+ self.unpacked = unpacked
+ self._sig = sig
+
+ self._check_orig()
+ if self.is_dir():
+ self.unpacked = self.path
+
+ def __repr__(self):
+ path = "'%s'" % self.path if self.path is not None else None
+ sig = "'%s'" % self.signaturefile if self.signaturefile is not None else None
+ return "<%s path=%s signaturefile=%s>" % (self.__class__.__name__,
+ path, sig)
+
+ def _check_orig(self):
+ """
+ Check if upstream source format can be used as orig tarball.
+ This doesn't imply that the tarball is correctly named.
+
+ @return: C{True} if upstream source format is suitable
+ as upstream tarball, C{False} otherwise.
+ @rtype: C{bool}
+ """
+ if self.is_dir():
+ self._orig = False
+ return
+
+ parts = self._path.split('.')
+ try:
+ if parts[-1] == 'tgz':
+ self._orig = True
+ elif parts[-2] == 'tar':
+ if (parts[-1] in Compressor.Opts or
+ parts[-1] in Compressor.Aliases):
+ self._orig = True
+ except IndexError:
+ self._orig = False
+
+ def is_orig(self):
+ """
+ @return: C{True} if sources are suitable as orig tarball,
+ C{False} otherwise
+ @rtype: C{bool}
+ """
+ return self._orig
+
+ def is_dir(self):
+ """
+ @return: C{True} if if upstream sources are an unpacked directory,
+ C{False} otherwise
+ @rtype: C{bool}
+ """
+ return True if os.path.isdir(self._path) else False
+
+ @property
+ def path(self):
+ return self._path.rstrip('/')
+
+ @property
+ def signaturefile(self):
+ return self._sig
+
+ @signaturefile.setter
+ def signaturefile(self, sig):
+ self._sig = sig
+
+ def unpack(self, dir, filters=None):
+ """
+ Unpack packed upstream sources into a given directory
+ (filtering out files specified by filters) and determine the
+ toplevel of the source tree.
+ """
+ if self.is_dir():
+ raise GbpError("Cannot unpack directory %s" % self.path)
+
+ if not filters:
+ filters = []
+
+ if not isinstance(filters, list):
+ raise GbpError("Filters must be a list")
+
+ self._unpack_archive(dir, filters)
+ self.unpacked = self._unpacked_toplevel(dir)
+
+ def _unpack_archive(self, dir, filters):
+ """
+ Unpack packed upstream sources into a given directory
+ allowing to filter out files in case of tar archives.
+ """
+ ext = os.path.splitext(self.path)[1]
+ if ext in [".zip", ".xpi"]:
+ if filters:
+ raise GbpError("Can only filter tar archives: %s", (ext, self.path))
+ self._unpack_zip(dir)
+ else:
+ self._unpack_tar(dir, filters)
+
+ def _unpack_zip(self, dir):
+ try:
+ gbpc.UnpackZipArchive(self.path, dir)()
+ except gbpc.CommandExecFailed:
+ raise GbpError("Unpacking of %s failed" % self.path)
+
+ def _unpacked_toplevel(self, dir):
+ """unpacked archives can contain a leading directory or not"""
+ unpacked = glob.glob('%s/*' % dir)
+ unpacked.extend(glob.glob("%s/.*" % dir)) # include hidden files and folders
+ # Check that dir contains nothing but a single folder:
+ if len(unpacked) == 1 and os.path.isdir(unpacked[0]):
+ return unpacked[0]
+ else:
+ return dir
+
+ def _unpack_tar(self, dir, filters):
+ """
+ Unpack a tarball to I{dir} applying a list of I{filters}. Leave the
+ cleanup to the caller in case of an error.
+ """
+ try:
+ unpackArchive = gbpc.UnpackTarArchive(self.path, dir, filters)
+ unpackArchive()
+ except gbpc.CommandExecFailed:
+ # unpackArchive already printed an error message
+ raise GbpError
+
+ def pack(self, newarchive, filters=None):
+ """
+ Recreate a new archive from the current one
+
+ @param newarchive: the name of the new archive
+ @type newarchive: string
+ @param filters: tar filters to apply
+ @type filters: array of strings
+ @return: the new upstream source
+ @rtype: UpstreamSource
+ """
+ if not self.unpacked:
+ raise GbpError("Need an unpacked source tree to pack")
+
+ if not filters:
+ filters = []
+
+ if not isinstance(filters, list):
+ raise GbpError("Filters must be a list")
+
+ try:
+ unpacked = self.unpacked.rstrip('/')
+ repackArchive = gbpc.PackTarArchive(newarchive,
+ os.path.dirname(unpacked),
+ os.path.basename(unpacked),
+ filters)
+ repackArchive()
+ except gbpc.CommandExecFailed:
+ # repackArchive already printed an error
+ raise GbpError
+ return type(self)(newarchive)
+
+ @staticmethod
+ def known_compressions():
+ return Compressor.Exts.values()
+
+ def guess_version(self, extra_regex=r''):
+ return self._pkg_policy.guess_upstream_src_version(self.path,
+ extra_regex)
# vim: set fileencoding=utf-8 :
#
-# (C) 2006,2007 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006,2007 Guido Günther <agx@sigxcpu.org>
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""provides some rpm source package related helpers"""
-import subprocess
-import sys
import os
import re
import tempfile
-import glob
-import shutil as shutil
from optparse import OptionParser
from collections import defaultdict
from gbp.git import GitRepositoryError
from gbp.patch_series import (PatchSeries, Patch)
import gbp.log
-from gbp.pkg import (UpstreamSource, compressor_opts, parse_archive_filename)
+from gbp.pkg import (UpstreamSource, Archive)
from gbp.rpm.policy import RpmPkgPolicy
from gbp.rpm.linkedlist import LinkedList
from gbp.rpm.lib_rpm import librpm, get_librpm_log
-def _decode(s):
- if s is not None:
- return s.decode()
-
-
class NoSpecError(Exception):
"""Spec file parsing error"""
pass
+
class MacroExpandError(Exception):
"""Macro expansion in spec file failed"""
pass
"""Keeps all needed data read from a source rpm"""
def __init__(self, srpmfile):
# Do not required signed packages to be able to import
- ts_vsflags = (librpm.RPMVSF_NOSHA256HEADER | librpm.RPMVSF_NORSAHEADER |
- librpm.RPMVSF_NOSHA1HEADER | librpm.RPMVSF_NODSAHEADER |
- librpm.RPMVSF_NOMD5 | librpm.RPMVSF_NORSA |
- librpm.RPMVSF_NOPAYLOAD | librpm.RPMVSF_NODSA)
- srpmfp = open(srpmfile)
- self.rpmhdr = librpm.ts(vsflags=ts_vsflags).hdrFromFdno(srpmfp.fileno())
- srpmfp.close()
+ ts_vsflags = 0
+ for flag in ['RPMVSF_NOMD5HEADER', 'RPMVSF_NORSAHEADER',
+ 'RPMVSF_NOSHA1HEADER', 'RPMVSF_NODSAHEADER',
+ 'RPMVSF_NOMD5', 'RPMVSF_NORSA', 'RPMVSF_NOSHA1',
+ 'RPMVSF_NODSA']:
+ try:
+ # Ignore flags not present in different librpm versions
+ ts_vsflags |= getattr(librpm, flag)
+ except AttributeError:
+ pass
+ with open(srpmfile) as srpmfp:
+ self.rpmhdr = librpm.ts(vsflags=ts_vsflags).hdrFromFdno(srpmfp.fileno())
self.srpmfile = os.path.abspath(srpmfile)
@property
Unpack the source rpm to tmpdir.
Leave the cleanup to the caller in case of an error.
"""
- gbpc.RunAtCommand('rpm2cpio',
- [self.srpmfile, '|', 'cpio', '-id'],
- shell=True, capture_stderr=True)(dir=dest_dir)
+ c = gbpc.RunAtCommand('rpm2cpio',
+ [self.srpmfile, '|', 'cpio', '-id'],
+ shell=True, capture_stderr=True)
+ c.run_error = "'%s' failed: {stderr_or_reason}" % (" ".join([c.cmd] + c.args))
+ c(dir=dest_dir)
class SpecFile(object):
"""Class for parsing/modifying spec files"""
tag_re = re.compile(r'^(?P<name>[a-z]+)(?P<num>[0-9]+)?\s*:\s*'
- '(?P<value>\S(.*\S)?)\s*$', flags=re.I)
+ r'(?P<value>\S(.*\S)?)\s*$', flags=re.I)
directive_re = re.compile(r'^%(?P<name>[a-z]+)(?P<num>[0-9]+)?'
- '(\s+(?P<args>.*))?$', flags=re.I)
+ r'(\s+(?P<args>.*))?$', flags=re.I)
gbptag_re = re.compile(r'^\s*#\s*gbp-(?P<name>[a-z-]+)'
- '(\s*:\s*(?P<args>\S.*))?$', flags=re.I)
+ r'(\s*:\s*(?P<args>\S.*))?$', flags=re.I)
# Here "sections" stand for all scripts, scriptlets and other directives,
# but not macros
section_identifiers = ('package', 'description', 'prep', 'build', 'install',
- 'clean', 'check', 'pre', 'preun', 'post', 'postun', 'verifyscript',
- 'files', 'changelog', 'triggerin', 'triggerpostin', 'triggerun',
- 'triggerpostun')
+ 'clean', 'check', 'pre', 'preun', 'post', 'postun', 'verifyscript',
+ 'files', 'changelog', 'triggerin', 'triggerpostin', 'triggerun',
+ 'triggerpostun')
def __init__(self, filename=None, filedata=None):
self.specfile = os.path.basename(filename)
self.specdir = os.path.dirname(os.path.abspath(filename))
try:
- with open(filename, errors='ignore') as spec_file:
+ with open(filename) as spec_file:
for line in spec_file.readlines():
self._content.append(line)
except IOError as err:
# Use rpm-python to parse the spec file content
self._filtertags = ("excludearch", "excludeos", "exclusivearch",
- "exclusiveos","buildarch")
+ "exclusiveos", "buildarch")
self._listtags = self._filtertags + ('source', 'patch',
- 'requires', 'conflicts', 'recommends',
- 'suggests', 'supplements', 'enhances',
- 'provides', 'obsoletes', 'buildrequires',
- 'buildconflicts', 'buildrecommends',
- 'buildsuggests', 'buildsupplements',
- 'buildenhances', 'collections',
- 'nosource', 'nopatch')
+ 'requires', 'conflicts', 'recommends',
+ 'suggests', 'supplements', 'enhances',
+ 'provides', 'obsoletes', 'buildrequires',
+ 'buildconflicts', 'buildrecommends',
+ 'buildsuggests', 'buildsupplements',
+ 'buildenhances', 'collections',
+ 'nosource', 'nopatch')
self._specinfo = self._parse_filtered_spec(self._filtertags)
# Other initializations
skip_tags = [tag.lower() for tag in skip_tags]
with tempfile.NamedTemporaryFile(prefix='gbp', mode='w+') as filtered:
filtered.writelines(str(line) for line in self._content
- if str(line).split(":")[0].strip().lower() not in skip_tags)
+ if str(line).split(":")[0].strip().lower() not in skip_tags)
filtered.flush()
try:
# Parse two times to circumvent a rpm-python problem where
librpm.spec(filtered.name)
return librpm.spec(filtered.name)
except ValueError as err:
- rpmlog = [log.decode() for log in get_librpm_log()]
+ rpmlog = get_librpm_log()
gbp.log.debug("librpm log:\n %s" %
- "\n ".join(rpmlog))
+ "\n ".join(rpmlog))
raise GbpError("RPM error while parsing %s: %s (%s)" %
- (self.specfile, err, rpmlog[-1]))
+ (self.specfile, err, rpmlog[-1]))
@property
def version(self):
"""Get the (downstream) version"""
- version = dict(upstreamversion = self.upstreamversion,
- release = self.release)
- if self.epoch != None:
+ version = dict(upstreamversion=self.upstreamversion,
+ release=self.release)
+ if self.epoch is not None:
version['epoch'] = self.epoch
return version
def _patches(self):
"""Get all patch tags as a dict"""
- patches = {}
if 'patch' not in self._tags:
return {}
- for patch in self._tags['patch']['lines']:
- patches[patch['num']] = patch
- return patches
+ return {patch['num']: patch for patch in self._tags['patch']['lines']}
def _sources(self):
"""Get all source tags as a dict"""
- sources = {}
if 'source' not in self._tags:
return {}
- for src in self._tags['source']['lines']:
- sources[src['num']] = src
- return sources
+ return {src['num']: src for src in self._tags['source']['lines']}
def sources(self):
"""Get all source tags as a dict"""
- sources = {}
- for src in list(self._sources().values()):
- sources[src['num']] = src['linevalue']
- return sources
+ return {src['num']: src['linevalue']
+ for src in self._sources().values()}
def _macro_replace(self, matchobj):
macro_dict = {'name': self.name,
self._tags[tagname]['value'] = tagvalue
self._tags[tagname]['lines'].append(linerecord)
else:
+ if tagvalue and not isinstance(tagvalue, str):
+ tagvalue = tagvalue.decode()
self._tags[tagname] = {'value': tagvalue, 'lines': [linerecord]}
return tagname
def _patch_macro_opts(args):
"""Parse arguments of the '%patch' macro"""
- patchparser = OptionParser()
+ patchparser = OptionParser(
+ prog="%s internal patch macro opts parser" % __name__,
+ usage="%prog for " + args)
patchparser.add_option("-p", dest="strip")
patchparser.add_option("-s", dest="silence")
patchparser.add_option("-P", dest="patchnum")
patchparser.add_option("-b", dest="backup")
patchparser.add_option("-E", dest="removeempty")
+ patchparser.add_option("-F", dest="fuzz")
arglist = args.split()
return patchparser.parse_args(arglist)[0]
def _setup_macro_opts(args):
"""Parse arguments of the '%setup' macro"""
- setupparser = OptionParser()
+ setupparser = OptionParser(
+ prog="%s internal setup macro opts parser" % __name__,
+ usage="%prog for " + args)
setupparser.add_option("-n", dest="name")
setupparser.add_option("-c", dest="create_dir", action="store_true")
setupparser.add_option("-D", dest="no_delete_dir", action="store_true")
directiveid = -1
# Record special directive/scriptlet/macro locations
- if directivename in self.section_identifiers + ('setup', 'patch'):
+ if directivename in self.section_identifiers + ('setup', 'patch',
+ 'autosetup'):
linerecord = {'line': lineobj,
'id': directiveid,
'args': matchobj.group('args')}
elif typ == 2 or typ == 10:
# Patch tag without any number defined is treated by RPM as
# having number (2^31-1), we use number -1
- if num >= pow(2,30):
+ if num >= pow(2, 30):
num = -1
if num in patches:
patches[num]['linevalue'] = name
if key in ('patch', 'vcs'):
if key in self._tags:
insertafter = key
- elif not insertafter in self._tags:
+ elif insertafter not in self._tags:
insertafter = 'name'
after_line = self._tags[insertafter]['lines'][-1]['line']
if value:
macro_prev = None
ignored = self.ignorepatches
# Remove 'Patch:̈́' tags
- for tag in list(self._patches().values()):
+ for tag in self._patches().values():
if not tag['num'] in ignored:
tag_prev = self._delete_tag('patch', tag['num'])
# Remove a preceding comment if it seems to originate from GBP
- if re.match("^\s*#.*patch.*auto-generated",
+ if re.match(r'^\s*#.*patch.*auto-generated',
str(tag_prev), flags=re.I):
tag_prev = self._content.delete(tag_prev)
# Remove a preceding comment line if it ends with '.patch' or
# '.diff' plus an optional compression suffix
- if re.match("^\s*#.+(patch|diff)(\.(gz|bz2|xz|lzma))?\s*$",
+ if re.match(r'^\s*#.+(patch|diff)(\.(gz|bz2|xz|lzma))?\s*$',
str(macro_prev), flags=re.I):
macro_prev = self._content.delete(macro_prev)
tag_line = self._tags['name']['lines'][-1]['line']
# Determine where to add %patch macro lines
- if 'patch-macros' in self._gbp_tags:
+ if self._special_directives['autosetup']:
+ gbp.log.debug("Found '%autosetup, skip adding %patch macros")
+ macro_line = None
+ elif 'patch-macros' in self._gbp_tags:
gbp.log.debug("Adding '%patch' macros after the start marker")
macro_line = self._gbp_tags['patch-macros'][-1]['line']
elif macro_prev:
cmds = commands[patch] if patch in commands else {}
patchnum = startnum + ind
tag_line = self._set_tag("Patch", patchnum, patch, tag_line)
+
# Add '%patch' macro and a preceding comment line
- comment_text = "# %s\n" % patch
- macro_line = self._content.insert_after(macro_line, comment_text)
- macro_line = self._set_special_macro('patch', patchnum, '-p1',
- macro_line)
- for cmd, args in cmds.items():
- if cmd in ('if', 'ifarch'):
- self._content.insert_before(macro_line, '%%%s %s\n' %
- (cmd, args))
- macro_line = self._content.insert_after(macro_line,
- '%endif\n')
- # We only support one command per patch, for now
- break
+ if macro_line is not None:
+ comment_text = "# %s\n" % patch
+ macro_line = self._content.insert_after(macro_line, comment_text)
+ macro_line = self._set_special_macro('patch', patchnum, '-p1',
+ macro_line)
+ for cmd, args in cmds.items():
+ if cmd in ('if', 'ifarch'):
+ self._content.insert_before(macro_line, '%%%s %s\n' %
+ (cmd, args))
+ macro_line = self._content.insert_after(macro_line,
+ '%endif\n')
+ # We only support one command per patch, for now
+ break
def patchseries(self, unapplied=False, ignored=False):
"""Return non-ignored patches of the RPM as a gbp patchseries"""
series = PatchSeries()
- if 'patch' in self._tags:
- tags = self._patches()
+
+ ignored = set() if ignored else set(self.ignorepatches)
+ tags = dict([(k, v) for k, v in self._patches().items() if k not in ignored])
+
+ if self._special_directives['autosetup']:
+ # Return all patchses if %autosetup is used
+ for num in sorted(tags):
+ filename = os.path.basename(tags[num]['linevalue'])
+ series.append(Patch(os.path.join(self.specdir, filename)))
+ else:
applied = []
for macro in self._special_directives['patch']:
if macro['id'] in tags:
applied.append((macro['id'], macro['args']))
- ignored = set() if ignored else set(self.ignorepatches)
# Put all patches that are applied first in the series
for num, args in applied:
- if num not in ignored:
- opts = self._patch_macro_opts(args)
- strip = int(opts.strip) if opts.strip else 0
- filename = os.path.basename(tags[num]['linevalue'])
- series.append(Patch(os.path.join(self.specdir, filename),
- strip=strip))
+ opts = self._patch_macro_opts(args)
+ strip = int(opts.strip) if opts.strip else 0
+ filename = os.path.basename(tags[num]['linevalue'])
+ series.append(Patch(os.path.join(self.specdir, filename),
+ strip=strip))
# Finally, append all unapplied patches to the series, if requested
if unapplied:
applied_nums = set([num for num, _args in applied])
unapplied = set(tags.keys()).difference(applied_nums)
for num in sorted(unapplied):
- if num not in ignored:
- filename = os.path.basename(tags[num]['linevalue'])
- series.append(Patch(os.path.join(self.specdir,
- filename), strip=0))
+ filename = os.path.basename(tags[num]['linevalue'])
+ series.append(Patch(os.path.join(self.specdir, filename),
+ strip=0))
return series
def _guess_orig_prefix(self, orig):
try:
prefix = self.macro_expand(opts.name) + '/'
except MacroExpandError as err:
- gbp.log.warn("Couldn't determine prefix from %%setup "\
- "macro (%s). Using filename base as a " \
+ gbp.log.warn("Couldn't determine prefix from %%setup "
+ "macro (%s). Using filename base as a "
"fallback" % err)
prefix = orig['filename_base'] + '/'
else:
src = {'num': num, 'filename': os.path.basename(filename),
'uri': filename}
src['filename_base'], src['archive_fmt'], src['compression'] = \
- parse_archive_filename(os.path.basename(filename))
+ Archive.parse_filename(os.path.basename(filename))
if (src['filename_base'].startswith(self.name) and
- src['archive_fmt']):
+ src['archive_fmt']):
# Take the first archive that starts with pkg name
orig = src
break
def spec_from_repo(repo, treeish, spec_path):
"""Get and parse a spec file from a give Git treeish"""
try:
- spec = SpecFile(filedata=repo.show('%s:%s' % (treeish, spec_path)).decode(errors='ignore'))
+ spec = SpecFile(filedata=repo.show('%s:%s' % (treeish, spec_path)).decode())
spec.specdir = os.path.dirname(spec_path)
spec.specfile = os.path.basename(spec_path)
return spec
else:
return int(val_str)
+
+def split_version_str(version):
+ """
+ Parse full version string and split it into individual "version
+ components", i.e. upstreamversion, epoch and release
+
+ @param version: full version of a package
+ @type version: C{str}
+ @return: individual version components
+ @rtype: C{dict}
+
+ >>> sorted(split_version_str("1").items())
+ [('epoch', None), ('release', None), ('upstreamversion', '1')]
+ >>> sorted(split_version_str("1.2.3-5.3").items())
+ [('epoch', None), ('release', '5.3'), ('upstreamversion', '1.2.3')]
+ >>> sorted(split_version_str("3:1.2.3").items())
+ [('epoch', '3'), ('release', None), ('upstreamversion', '1.2.3')]
+ >>> sorted(split_version_str("3:1-0").items())
+ [('epoch', '3'), ('release', '0'), ('upstreamversion', '1')]
+ """
+ ret = {'epoch': None, 'upstreamversion': None, 'release': None}
+
+ e_vr = version.split(":", 1)
+ if len(e_vr) == 1:
+ v_r = e_vr[0].split("-", 1)
+ else:
+ ret['epoch'] = e_vr[0]
+ v_r = e_vr[1].split("-", 1)
+ ret['upstreamversion'] = v_r[0]
+ if len(v_r) > 1:
+ ret['release'] = v_r[1]
+
+ return ret
+
+
+def compose_version_str(evr):
+ """
+ Compose a full version string from individual "version components",
+ i.e. epoch, version and release
+
+ @param evr: dict of version components
+ @type evr: C{dict} of C{str}
+ @return: full version
+ @rtype: C{str}
+
+ >>> compose_version_str({'epoch': '', 'upstreamversion': '1.0'})
+ '1.0'
+ >>> compose_version_str({'epoch': '2', 'upstreamversion': '1.0', 'release': None})
+ '2:1.0'
+ >>> compose_version_str({'epoch': None, 'upstreamversion': '1', 'release': '0'})
+ '1-0'
+ >>> compose_version_str({'epoch': '2', 'upstreamversion': '1.0', 'release': '2.3'})
+ '2:1.0-2.3'
+ >>> compose_version_str({'epoch': '2', 'upstreamversion': '', 'release': '2.3'})
+ """
+ if 'upstreamversion' in evr and evr['upstreamversion']:
+ version = ""
+ if 'epoch' in evr and evr['epoch']:
+ version += "%s:" % evr['epoch']
+ version += evr['upstreamversion']
+ if 'release' in evr and evr['release']:
+ version += "-%s" % evr['release']
+ if version:
+ return version
+ return None
+
+
+def filter_version(evr, *keys):
+ """
+ Remove entry from the version dict
+
+ @param evr: dict of version components
+ @type evr: C{dict} of C{str}
+ @param keys: keys to remove
+ @type keys: C{str}s
+ @return: new version dict
+ @rtype: C{dict} of C{str}
+
+ >>> sorted(list(filter_version({'epoch': 'foo', 'upstreamversion': 'bar', 'vendor': 'baz'}, 'vendor').keys()))
+ ['epoch', 'upstreamversion']
+ >>> list(filter_version({'epoch': 'foo', 'upstreamversion': 'bar', 'revision': 'baz'}, 'epoch', 'revision').keys())
+ ['upstreamversion']
+ """
+ return {k: evr[k] for k in evr if k not in keys}
+
+
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
-# (C) 2014 Intel Corporation <markus.lehtonen@linux.intel.com>
+# (C) 2014-2015 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""An RPM Changelog"""
+import locale
import datetime
import re
+from functools import wraps
+
import gbp.log
+def c_locale(category):
+ def _decorator(f):
+ @wraps(f)
+ def wrapper(*args, **kwargs):
+ saved = locale.setlocale(category, None)
+ locale.setlocale(category, 'C')
+ ret = f(*args, **kwargs)
+ locale.setlocale(category, saved)
+ return ret
+ return wrapper
+ return _decorator
+
+
class ChangelogError(Exception):
"""Problem parsing changelog"""
pass
return self._data[key]
return None
+ @c_locale(locale.LC_TIME)
def __str__(self):
keys = dict(self._data)
keys['time'] = self._data['time'].strftime(
- self._pkgpolicy.Changelog.header_time_format)
+ self._pkgpolicy.Changelog.header_time_format)
try:
return self._pkgpolicy.Changelog.header_format % keys + '\n'
except KeyError as err:
@param author: author of the change
@type author: C{str}
@param text: message of the changelog entry
- @type text: C{str} or C{list} of C{str}
+ @type text: C{str} or C{list} of C{str}
"""
self._pkgpolicy = pkgpolicy
self.author = author
self.entries = []
self._trailer = '\n'
-
def __str__(self):
text = str(self.header)
for entry in self.entries:
except IOError as err:
raise ChangelogError("Unable to read changelog file: %s" % err)
+ @c_locale(locale.LC_TIME)
def _parse_section_header(self, text):
"""Parse one changelog section header"""
# Try to split out time stamp and "changelog name"
raise ChangelogError("Unable to parse changelog header: %s" % text)
try:
time = datetime.datetime.strptime(match.group('ch_time'),
- "%a %b %d %Y")
+ "%a %b %d %Y")
except ValueError:
raise ChangelogError("Unable to parse changelog header: invalid "
"timestamp '%s'" % match.group('ch_time'))
return entries
-
def parse_section(self, text):
"""Parse one section"""
# Check that the first line(s) look like a changelog header
section.append_entry(entry)
return section
-
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-import re
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
-from gbp.git import GitRepository, GitRepositoryError
+from gbp.format import format_str
+from gbp.errors import GbpError
+from gbp.pkg.git import PkgGitRepository, GitRepositoryError # noqa: F401
from gbp.pkg.pristinetar import PristineTar
-from gbp.rpm.policy import RpmPkgPolicy
+from gbp.rpm import compose_version_str
-class RpmGitRepository(GitRepository):
+
+class RpmGitRepository(PkgGitRepository):
"""A git repository that holds the source of an RPM package"""
def __init__(self, path):
"""
try:
tag = self.version_to_tag(format, str_fields)
- except KeyError:
+ except GbpError:
return None
- if self.has_tag(tag): # new tags are injective
+ if self.has_tag(tag): # new tags are injective
# dereference to a commit object
return self.rev_parse("%s^0" % tag)
return None
>>> RpmGitRepository.version_to_tag("%(vendor)s/v%(version)s", dict(upstreamversion='1.0', release='2', vendor="myvendor"))
'myvendor/v1.0-2'
"""
- version_tag = format % dict(str_fields,
- version=RpmPkgPolicy.compose_full_version(str_fields))
+ version_tag = format_str(format,
+ dict(str_fields,
+ version=compose_version_str(str_fields)))
return RpmGitRepository._sanitize_tag(version_tag)
@staticmethod
def has_pristine_tar_branch(self):
"""
- Wheter the repo has a I{pristine-tar} branch.
+ Whether the repo has a I{pristine-tar} branch.
@return: C{True} if the repo has pristine-tar commits already, C{False}
otherwise
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Wrapper module for librpm"""
import tempfile
# Try to load special RPM lib to be used for GBP (only)
librpm = __import__(RpmPkgPolicy.python_rpmlib_module_name)
except ImportError:
- gbp.log.getLogger("gbp")
gbp.log.warn("Failed to import '%s' as rpm python module, using host's "
- "default rpm library instead" %
- RpmPkgPolicy.python_rpmlib_module_name)
- import rpm as librpm
+ "default rpm library instead" %
+ RpmPkgPolicy.python_rpmlib_module_name)
+ import rpm as librpm # type: ignore
# Module initialization
-_rpmlog = tempfile.NamedTemporaryFile(prefix='gbp_rpmlog')
+_rpmlog = tempfile.NamedTemporaryFile(mode='w+', prefix='gbp_rpmlog')
_rpmlogfd = _rpmlog.file
librpm.setVerbosity(librpm.RPMLOG_INFO)
librpm.setLogFile(_rpmlogfd)
if truncate:
_rpmlogfd.truncate(0)
return log
-
# <http://www.gnu.org/licenses/>
"""Simple implementation of a doubly linked list"""
-import collections
+import collections.abc
import gbp.log
"""Get data stored into node"""
if self._data is None:
gbp.log.debug("BUG: referencing a deleted node!")
- return("")
+ return ("")
return self._data
def set_data(self, data):
return ret
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
-
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Default packaging policy for RPM"""
import re
-from gbp.pkg import PkgPolicy, parse_archive_filename
+from gbp.pkg import PkgPolicy, Archive
from gbp.scripts.common.pq import parse_gbp_commands
+
class RpmPkgPolicy(PkgPolicy):
"""Packaging policy for RPM"""
# Special rpmlib python module for GBP (only)
- python_rpmlib_module_name = "rpm_tizen"
+ python_rpmlib_module_name = "rpm"
alnum = 'a-zA-Z0-9'
# Valid characters for RPM pkg name
- name_whitelist_chars = '._+%{}\-'
+ name_whitelist_chars = r'._+%{}\-'
# Valid characters for RPM pkg version
- version_whitelist_chars = '._+%{}~'
+ version_whitelist_chars = r'._+%{}~'
# Regexp for checking the validity of package name
packagename_re = re.compile("^[%s][%s%s]+$" %
- (alnum, alnum, name_whitelist_chars))
+ (alnum, alnum, name_whitelist_chars))
packagename_msg = ("Package names must be at least two characters long, "
"start with an alphanumeric and can only contain "
"alphanumerics or characters in %s" %
- list(name_whitelist_chars))
+ list(name_whitelist_chars))
# Regexp for checking the validity of package (upstream) version
upstreamversion_re = re.compile("^[0-9][%s%s]*$" %
- (alnum, version_whitelist_chars))
+ (alnum, version_whitelist_chars))
upstreamversion_msg = ("Upstream version numbers must start with a digit "
"and can only containg alphanumerics or characters "
"in %s" % list(version_whitelist_chars))
- # Time stamp format to be used in tagging
- tag_timestamp_format = "%Y%m%d"
-
@classmethod
def is_valid_orig_archive(cls, filename):
"""
>>> RpmPkgPolicy.is_valid_orig_archive("foo.gz")
False
"""
- _base, arch_fmt, _compression = parse_archive_filename(filename)
+ _base, arch_fmt, _compression = Archive.parse_filename(filename)
if arch_fmt:
return True
return False
- @classmethod
- def split_full_version(cls, version):
- """
- Parse full version string and split it into individual "version
- components", i.e. upstreamversion, epoch and release
-
- @param version: full version of a package
- @type version: C{str}
- @return: individual version components
- @rtype: C{dict}
-
- >>> RpmPkgPolicy.split_full_version("1")
- {'release': None, 'epoch': None, 'upstreamversion': '1'}
- >>> RpmPkgPolicy.split_full_version("1.2.3-5.3")
- {'release': '5.3', 'epoch': None, 'upstreamversion': '1.2.3'}
- >>> RpmPkgPolicy.split_full_version("3:1.2.3")
- {'release': None, 'epoch': '3', 'upstreamversion': '1.2.3'}
- >>> RpmPkgPolicy.split_full_version("3:1-0")
- {'release': '0', 'epoch': '3', 'upstreamversion': '1'}
- """
- epoch = None
- upstreamversion = None
- release = None
-
- e_vr = version.split(":", 1)
- if len(e_vr) == 1:
- v_r = e_vr[0].split("-", 1)
- else:
- epoch = e_vr[0]
- v_r = e_vr[1].split("-", 1)
- upstreamversion = v_r[0]
- if len(v_r) > 1:
- release = v_r[1]
-
- return {'epoch': epoch,
- 'upstreamversion': upstreamversion,
- 'release': release}
-
- @classmethod
- def compose_full_version(cls, evr):
- """
- Compose a full version string from individual "version components",
- i.e. epoch, version and release
-
- @param evr: dict of version components
- @type evr: C{dict} of C{str}
- @return: full version
- @rtype: C{str}
-
- >>> RpmPkgPolicy.compose_full_version({'epoch': '', 'upstreamversion': '1.0'})
- '1.0'
- >>> RpmPkgPolicy.compose_full_version({'epoch': '2', 'upstreamversion': '1.0', 'release': None})
- '2:1.0'
- >>> RpmPkgPolicy.compose_full_version({'epoch': None, 'upstreamversion': '1', 'release': '0'})
- '1-0'
- >>> RpmPkgPolicy.compose_full_version({'epoch': '2', 'upstreamversion': '1.0', 'release': '2.3'})
- '2:1.0-2.3'
- >>> RpmPkgPolicy.compose_full_version({'epoch': '2', 'upstreamversion': '', 'release': '2.3'})
- """
- if 'upstreamversion' in evr and evr['upstreamversion']:
- version = ""
- if 'epoch' in evr and evr['epoch']:
- version += "%s:" % evr['epoch']
- version += evr['upstreamversion']
- if 'release' in evr and evr['release']:
- version += "-%s" % evr['release']
- if version:
- return version
- return None
-
class Changelog(object):
"""Container for changelog related policy settings"""
# Regexps for splitting/parsing the changelog section (of
# Tizen / Fedora style changelogs)
- section_match_re = r'^\*'
+ section_match_re = r'^\*'
section_split_re = r'^\*\s*(?P<ch_header>\S.*?)$\n(?P<ch_body>.*)'
header_split_re = r'(?P<ch_time>\S.*\s[0-9]{4})\s+(?P<ch_name>\S.*$)'
header_name_split_re = r'(?P<name>[^<]*)\s+<(?P<email>[^>]+)>((\s*-)?\s+(?P<revision>\S+))?$'
header_time_format = "%a %b %d %Y"
header_rev_format = "%(version)s"
-
class ChangelogEntryFormatter(object):
"""Helper class for generating changelog entries from git commits"""
# Maximum length for a changelog entry line
max_entry_line_length = 76
+ # Bug tracking system related meta tags recognized from git commit msg
+ bts_meta_tags = ("Close", "Closes", "Fixes", "Fix")
# Regexp for matching bug tracking system ids (e.g. "bgo#123")
bug_id_re = r'[A-Za-z0-9#_\-]+'
@param lines: commit message
@type lines: C{list} of C{str}
- @param meta_tags: meta tags (regexp) to look for
- @type meta_tags: C{str}
+ @param meta_tags: meta tags to look for
+ @type meta_tags: C{tuple} of C{str}
@return: bts-ids per meta tag and the non-mathced lines
- @rtype: (C{dict}, C{list} of C{str})
+ @rtype: (C{dict}, C{list} of C{str})
"""
- if not meta_tags:
- return ({}, lines[:])
-
tags = {}
other_lines = []
- bts_re = re.compile(r'^(?P<tag>%s):\s*(?P<ids>.*)' % meta_tags,
- re.I)
+ bts_re = re.compile(r'^(?P<tag>%s):\s*(?P<ids>.*)' %
+ ('|'.join(meta_tags)), re.I)
bug_id_re = re.compile(cls.bug_id_re)
for line in lines:
match = bts_re.match(line)
tag = match.group('tag')
ids_str = match.group('ids')
bug_ids = [bug_id.strip() for bug_id in
- bug_id_re.findall(ids_str)]
+ bug_id_re.findall(ids_str)]
if tag in tags:
tags[tag] += bug_ids
else:
@param ignore_re: regexp for matching ignored lines
@type ignore_re: C{str}
@return: filtered commit message
- @rtype: C{list} of C{str}
+ @rtype: C{list} of C{str}
"""
if ignore_re:
match = re.compile(ignore_re)
currently we recognize 'full', 'id_len' and 'ignore_re'
@type kwargs: C{dict}
@return: formatted changelog entry
- @rtype: C{list} of C{str}
+ @rtype: C{list} of C{str}
"""
# Parse and filter out gbp command meta-tags
cmds, body = parse_gbp_commands(commit_info, 'gbp-rpm-ch',
('ignore', 'short', 'full'), ())
+ body = body.splitlines()
if 'ignore' in cmds:
return None
# Parse and filter out bts-related meta-tags
- bts_tags, body = cls._parse_bts_tags(body, kwargs['meta_bts'])
+ bts_tags, body = cls._parse_bts_tags(body, cls.bts_meta_tags)
# Additional filtering
body = cls._extra_filter(body, kwargs['ignore_re'])
text = ["- %s" % subject]
# Add all non-filtered-out lines from commit message, unless 'short'
- if (kwargs['full'] or 'full' in cmds) and not 'short' in cmds:
+ if (kwargs['full'] or 'full' in cmds) and 'short' not in cmds:
# Add all non-blank body lines.
text.extend([" " + line for line in body if line.strip()])
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""The gbp commands"""
# vim: set fileencoding=utf-8 :
#
-# (C) 2006-2014 Guido Günther <agx@sigxcpu.org>
+# (C) 2006-2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
-"""Build a debian package out of a GIT repository"""
+"""Build a Debian package out of a Git repository"""
-import configparser
import errno
-import os, os.path
+import os
+import pipes
+import shutil
+import shlex
import sys
import time
import gbp.deb as du
RemoveTree)
from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
-from gbp.deb.source import DebianSource, DebianSourceError
-from gbp.format import format_msg
+from gbp.deb.source import DebianSource, DebianSourceError, FileVfs
+from gbp.deb.format import DebianSourceFormat
from gbp.git.vfs import GitVfs
-from gbp.deb.upstreamsource import DebianUpstreamSource
+from gbp.deb.upstreamsource import DebianUpstreamSource, DebianAdditionalTarball
from gbp.errors import GbpError
import gbp.log
import gbp.notifications
-from gbp.scripts.common.buildpackage import (index_name, wc_names,
- git_archive_submodules,
- git_archive_single, dump_tree,
+from gbp.scripts.common.buildpackage import (index_name, wc_name,
+ dump_tree,
write_wc, drop_index)
-from gbp.pkg import compressor_opts, compressor_aliases, parse_archive_filename
-
-def git_archive(repo, cp, output_dir, tmpdir_base, treeish, comp_type,
- comp_level, with_submodules):
- "create a compressed orig tarball in output_dir using git_archive"
- try:
- comp_opts = compressor_opts[comp_type][0]
- except KeyError:
- raise GbpError("Unsupported compression type '%s'" % comp_type)
-
- output = os.path.join(output_dir, du.orig_file(cp, comp_type))
- prefix = "%s-%s" % (cp['Source'], cp['Upstream-Version'])
-
- try:
- if repo.has_submodules() and with_submodules:
- repo.update_submodules()
- git_archive_submodules(repo, treeish, output, tmpdir_base,
- prefix, comp_type, comp_level, comp_opts)
-
- else:
- git_archive_single(repo, treeish, output, prefix,
- comp_type, comp_level, comp_opts)
- except (GitRepositoryError, CommandExecFailed):
- gbp.log.err("Error generating submodules' archives")
- return False
- except OSError as err:
- gbp.log.err("Error creating %s: %s" % (output, err[0]))
- return False
- except GbpError:
- raise
- except Exception as e:
- gbp.log.err("Error creating %s: %s" % (output, e))
- return False
- return True
+from gbp.scripts.common import ExitCodes
+from gbp.scripts.common.hook import Hook
+from gbp.scripts.export_orig import prepare_upstream_tarballs, guess_comp_type
+from gbp.scripts.tag import perform_tagging
+from gbp.pkg.pkgpolicy import PkgPolicy
-def prepare_upstream_tarball(repo, cp, options, tarball_dir, output_dir):
- """
- Make sure we have an upstream tarball. This involves loooking in
- tarball_dir, symlinking or building it.
- """
- options.comp_type = guess_comp_type(repo,
- options.comp_type,
- cp,
- options.tarball_dir)
- orig_file = du.orig_file(cp, options.comp_type)
-
- # look in tarball_dir first, if found force a symlink to it
- if options.tarball_dir:
- gbp.log.debug("Looking for orig tarball '%s' at '%s'" % (orig_file, tarball_dir))
- if not du.DebianPkgPolicy.symlink_orig(orig_file, tarball_dir, output_dir, force=True):
- gbp.log.info("Orig tarball '%s' not found at '%s'" % (orig_file, tarball_dir))
- else:
- gbp.log.info("Orig tarball '%s' found at '%s'" % (orig_file, tarball_dir))
- # build an orig unless the user forbids it, always build (and overwrite pre-existing) if user forces it
- if options.force_create or (not options.no_create_orig and not du.DebianPkgPolicy.has_orig(orig_file, output_dir)):
- if not pristine_tar_build_orig(repo, cp, output_dir, options):
- upstream_tree = git_archive_build_orig(repo, cp, output_dir, options)
- if options.pristine_tar_commit:
- if repo.pristine_tar.has_commit(cp.name,
- cp.upstream_version,
- options.comp_type):
- gbp.log.debug("%s already on pristine tar branch" %
- orig_file)
- else:
- archive = os.path.join(output_dir, orig_file)
- gbp.log.debug("Adding %s to pristine-tar branch" %
- archive)
- repo.pristine_tar.commit(archive, upstream_tree)
-
-#{ Functions to handle export-dir
-def write_tree(repo, options):
+# Functions to handle export-dir
+def maybe_write_tree(repo, options):
"""
Write a tree of the index or working copy if necessary
if options.export_dir:
if options.export == index_name:
tree = repo.write_tree()
- elif options.export in wc_names:
- tree = write_wc(repo,
- force=wc_names[options.export]['force'],
- untracked=wc_names[options.export]['untracked'])
+ elif options.export == wc_name:
+ tree = write_wc(repo)
else:
tree = options.export
if not repo.has_treeish(tree):
if options.overlay:
if source.is_native():
raise GbpError("Cannot overlay Debian native package")
- extract_orig(os.path.join(tarball_dir,
- du.orig_file(source.changelog,
- options.comp_type)),
- dest_dir)
+ overlay_extract_origs(source, tarball_dir, dest_dir, options)
gbp.log.info("Exporting '%s' to '%s'" % (options.export, dest_dir))
if not dump_tree(repo, dest_dir, tree, options.with_submodules):
def move_old_export(target):
"""move a build tree away if it exists"""
try:
- os.mkdir(target)
- except OSError as msg:
- if msg.errno == errno.EEXIST:
+ os.makedirs(target)
+ except OSError as e:
+ if e.errno == errno.EEXIST:
os.rename(target, "%s.obsolete.%s" % (target, time.time()))
-def extract_orig(orig_tarball, dest_dir):
- """extract orig tarball to export dir before exporting from git"""
- gbp.log.info("Extracting %s to '%s'" % (os.path.basename(orig_tarball), dest_dir))
+def overlay_extract_origs(source, tarball_dir, dest_dir, options):
+ """Overlay extract orig tarballs to export dir before exporting debian dir from git"""
+
+ comp_type = guess_comp_type(options.comp_type,
+ source,
+ repo=None,
+ tarball_dir=tarball_dir)
+ tarball = os.path.join(tarball_dir, source.upstream_tarball_name(comp_type))
+ gbp.log.info("Extracting '%s' to '%s'" % (os.path.basename(tarball), dest_dir))
move_old_export(dest_dir)
- upstream = DebianUpstreamSource(orig_tarball)
+ upstream = DebianUpstreamSource(tarball)
upstream.unpack(dest_dir)
- # Check if tarball extracts into a single folder or not:
+ # Check if tarball extracts into a single folder:
if upstream.unpacked != dest_dir:
# If it extracts a single folder, move its contents to dest_dir:
gbp.log.debug("Moving %s to %s" % (upstream.unpacked, dest_dir))
os.rmdir(dest_dir)
os.rename(tmpdir, dest_dir)
-#}
+ # Remove debian/ from unpacked upstream tarball in case of non 1.0 format
+ underlay_debian_dir = os.path.join(dest_dir, 'debian')
+ format_file = os.path.join('debian', 'source', 'format')
+ if os.path.exists(underlay_debian_dir) and os.path.exists(format_file):
+ format = DebianSourceFormat.parse_file(format_file)
+ if format.version in ['2.0', '3.0']:
+ gbp.log.info("Removing debian/ from unpacked upstream "
+ "source at %s" % underlay_debian_dir)
+ shutil.rmtree(underlay_debian_dir)
+
+ # Unpack additional tarballs
+ for c in options.components:
+ tarball = DebianAdditionalTarball(os.path.join(tarball_dir,
+ source.upstream_tarball_name(
+ comp_type, component=c)),
+ component=c)
+ gbp.log.info("Extracting '%s' to '%s/%s'" % (os.path.basename(tarball.path),
+ dest_dir, c))
+ tarball.unpack(dest_dir, [])
+
def source_vfs(repo, options, tree):
"""Init source package info either from git or from working copy"""
- # FIXME: just init the correct vfs
+ vfs = GitVfs(repo, tree) if tree else FileVfs('.')
try:
- if tree:
- source = DebianSource(GitVfs(repo, tree))
- else:
- source = DebianSource('.')
- source.is_native() # check early if this works
+ source = DebianSource(vfs)
+ source.is_native() # check early if this works
except Exception as e:
raise GbpError("Can't determine package type: %s" % e)
return source
def prepare_output_dir(dir):
"""Prepare the directory where the build result will be put"""
- output_dir = dir
- if not dir:
- output_dir = '..'
- output_dir = os.path.abspath(output_dir)
+ output_dir = os.path.abspath(dir or '..')
try:
- os.mkdir(output_dir)
- except OSError as msg:
- if msg.errno != errno.EEXIST:
+ os.makedirs(output_dir)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
raise GbpError("Cannot create output dir %s" % output_dir)
return output_dir
-def pristine_tar_build_orig(repo, cp, output_dir, options):
+
+def clean_working_tree(options, repo):
+ """
+ Clean the working tree.
+
+ :param options: Program run-time options, as an `optparse.OptionContainer`.
+ :param repo: The Git repository, as a `DebianGitRepository`.
+ :raise GbpError: When the working tree has uncommitted changes.
+ :return: None.
+ """
+ Command(options.cleaner, shell=True)()
+ if not options.ignore_new:
+ (ret, out) = repo.is_clean()
+ if not ret:
+ gbp.log.err("You have uncommitted changes in your source tree:")
+ gbp.log.err(out)
+ raise GbpError("Use --git-ignore-new to ignore.")
+
+
+def check_tag(options, repo, source):
+ """Perform specified consistency checks on git history"""
+ tag = repo.version_to_tag(options.debian_tag, source.version)
+ if (options.tag or options.tag_only) and not options.retag:
+ if repo.has_tag(tag):
+ raise GbpError("Tag '%s' already exists" % tag)
+
+
+def get_pbuilder_dist(options, repo, native=False):
"""
- build orig using pristine-tar
- @return: True: orig tarball build, False: noop
+ Determin the dist to build for with pbuilder/cowbuilder
"""
- if options.pristine_tar:
- if not repo.has_branch(repo.pristine_tar_branch):
- gbp.log.warn('Pristine-tar branch "%s" not found' %
- repo.pristine_tar.branch)
- try:
- repo.pristine_tar.checkout(cp.name,
- cp.upstream_version,
- options.comp_type,
- output_dir)
- return True
- except CommandExecFailed:
- if options.pristine_tar_commit:
- gbp.log.debug("pristine-tar checkout failed, "
- "will commit tarball due to "
- "'--pristine-tar-commit'")
+ dist = None
+ if options.pbuilder_dist == 'DEP14':
+ vendor = du.get_vendor().lower()
+ branch = repo.branch
+ if not branch:
+ raise GbpError("Failed to setup DIST for %s. "
+ "Can't determine current branch." % options.builder)
+ parts = branch.rsplit('/')
+ if len(parts) == 2: # e.g. debian/stretch
+ suite = parts[1]
+ if vendor == parts[0]:
+ dist = '' if suite in ['sid', 'master', 'main', 'latest'] else suite
else:
- raise
- return False
-
-
-def get_upstream_tree(repo, cp, options):
- """Determine the upstream tree from the given options"""
- if options.upstream_tree.upper() == 'TAG':
- if cp['Upstream-Version'] is None:
- raise GitRepositoryError("Can't determine upstream version from changelog")
- upstream_tree = repo.version_to_tag(options.upstream_tag,
- cp['Upstream-Version'])
- elif options.upstream_tree.upper() == 'BRANCH':
- if not repo.has_branch(options.upstream_branch):
- raise GbpError("%s is not a valid branch" % options.upstream_branch)
- upstream_tree = options.upstream_branch
+ dist = '%s_%s' % (parts[0], suite)
+ # Branches in Debian often omit the debian/ prefix
+ elif len(parts) == 1 and vendor.lower() == "debian":
+ if branch in ['master', 'sid']:
+ dist = ''
+ elif branch in du.Releases:
+ dist = branch
+
+ if dist is None:
+ raise GbpError("DEP14 DIST: Current branch '%s' does not match vendor/suite" % branch)
else:
- upstream_tree = options.upstream_tree
- if not repo.has_treeish(upstream_tree):
- raise GbpError("%s is not a valid treeish" % upstream_tree)
- return upstream_tree
+ dist = options.pbuilder_dist
+ return dist
-def git_archive_build_orig(repo, cp, output_dir, options):
+def setup_pbuilder(options, repo, native):
"""
- Build orig tarball using git-archive
-
- @param cp: the changelog of the package we're acting on
- @type cp: L{ChangeLog}
- @param output_dir: where to put the tarball
- @type output_dir: C{Str}
- @param options: the parsed options
- @type options: C{dict} of options
- @return: the tree we built the tarball from
- @rtype: C{str}
+ Setup environment variables for git-pbuilder
+
+ We return two dictionaries (pbd_env, hook_env) that can be passed
+ as environment when running commands
+
+ *pbd_env* is used for the actual build command while *hook_env* is
+ passed to all hooks. They both contain the same information but
+ *pbd_env* contains the depreated variable names not starting with
+ *GBP_*.
"""
- upstream_tree = get_upstream_tree(repo, cp, options)
- gbp.log.info("%s does not exist, creating from '%s'" % (du.orig_file(cp,
- options.comp_type),
- upstream_tree))
- gbp.log.debug("Building upstream tarball with compression '%s -%s'" %
- (options.comp_type, options.comp_level))
- if not git_archive(repo, cp, output_dir, options.tmp_dir, upstream_tree,
- options.comp_type,
- options.comp_level,
- options.with_submodules):
- raise GbpError("Cannot create upstream tarball at '%s'" % output_dir)
- return upstream_tree
-
-
-def guess_comp_type(repo, comp_type, cp, tarball_dir):
- """Guess compression type"""
-
- srcpkg = cp['Source']
- upstream_version = cp['Upstream-Version']
-
- if comp_type != 'auto':
- comp_type = compressor_aliases.get(comp_type, comp_type)
- if comp_type not in compressor_opts:
- gbp.log.warn("Unknown compression type - guessing.")
- comp_type = 'auto'
-
- if comp_type == 'auto':
- if not repo.has_pristine_tar_branch():
- if not tarball_dir:
- tarball_dir = '..'
- detected = None
- for comp in list(compressor_opts.keys()):
- if du.DebianPkgPolicy.has_orig(du.orig_file(cp, comp), tarball_dir):
- if detected is not None:
- raise GbpError("Multiple orig tarballs found.")
- detected = comp
- if detected is not None:
- comp_type = detected
- else:
- comp_type = 'gzip'
- else:
- regex = 'pristine-tar .* %s_%s\.orig.tar\.' % (srcpkg, upstream_version)
- commits = repo.grep_log(regex, repo.pristine_tar_branch)
- if commits:
- commit = commits[-1]
- gbp.log.debug("Found pristine-tar commit at '%s'" % commit)
- else:
- commit = repo.pristine_tar_branch
- tarball = repo.get_commit_info(commit)['subject']
- (base_name, archive_fmt, comp_type) = parse_archive_filename(tarball)
- gbp.log.debug("Determined compression type '%s'" % comp_type)
- if not comp_type:
- comp_type = 'gzip'
- gbp.log.warn("Unknown compression type of %s, assuming %s" % (tarball, comp_type))
- return comp_type
-
-
-def setup_pbuilder(options):
- """setup everything to use git-pbuilder"""
+ pbd_env = {}
+
if options.use_pbuilder or options.use_qemubuilder:
options.builder = 'git-pbuilder'
+ pr_builder = os.getenv("BUILDER") or '(cowbuilder)'
options.cleaner = '/bin/true'
- os.environ['DIST'] = options.pbuilder_dist
+
+ dist = get_pbuilder_dist(options, repo, native)
+ pbd_env['GBP_PBUILDER_DIST'] = pbd_env['DIST'] = dist
+ pr_dist = dist or 'sid'
if options.pbuilder_arch:
- os.environ['ARCH'] = options.pbuilder_arch
+ arch = options.pbuilder_arch
+ pbd_env['GBP_PBUILDER_ARCH'] = pbd_env['ARCH'] = arch
+ pr_arch = ":%s" % arch
+ else:
+ pr_arch = ""
if options.use_qemubuilder:
- os.environ['BUILDER'] = "qemubuilder"
+ pbd_env['GBP_PBUILDER_BUILDER'] = pbd_env['BUILDER'] = "qemubuilder"
+ pr_builder = pbd_env["GBP_PBUILDER_BUILDER"]
if not options.pbuilder_autoconf:
- os.environ['GIT_PBUILDER_AUTOCONF'] = "no"
+ pbd_env['GBP_PBUILDER_AUTOCONF'] = pbd_env['GIT_PBUILDER_AUTOCONF'] = "no"
if options.pbuilder_options:
- os.environ['GIT_PBUILDER_OPTIONS'] = options.pbuilder_options
+ pbd_env['GBP_PBUILDER_OPTIONS'] = pbd_env['GIT_PBUILDER_OPTIONS'] = options.pbuilder_options
+ gbp.log.info("Building with %s for %s%s" % (pr_builder, pr_dist, pr_arch))
+ hook_env = dict([(k, pbd_env[k]) for k in pbd_env if k.startswith("GBP_")])
+ return pbd_env, hook_env
-def disable_builder(options):
- """Disable builder (and postbuild hook)"""
- gbp.log.info("Disabling builder and postbuild hook")
- options.builder = ''
- options.postbuild = ''
- options.pbuilder = None
- options.qemubuilder = None
+
+def mangle_export_wc_opts(options):
+ """
+ Make building with --export=WC simpler
+ """
+ if options.export == wc_name:
+ options.ignore_branch = True
+ options.ignore_new = True
def disable_hooks(options):
"""Disable all hooks (except for builder)"""
- for hook in ['cleaner', 'postexport', 'prebuild', 'postbuild', 'posttag']:
+ for hook in ['cleaner', 'preexport', 'postexport', 'prebuild', 'postbuild', 'posttag']:
if getattr(options, hook):
gbp.log.info("Disabling '%s' hook" % hook)
setattr(options, hook, '')
-def changes_file_suffix(dpkg_args):
+def changes_file_suffix(builder, dpkg_args, arch):
"""
- >>> changes_file_suffix(['-A'])
+ >>> changes_file_suffix('debuild', ['-A'], '')
+ 'all'
+ >>> changes_file_suffix('debuild', ['-S'], '')
+ 'source'
+ >>> changes_file_suffix('debuild -A', ['-uc', '-us'], '')
'all'
- >>> changes_file_suffix(['-S'])
+ >>> changes_file_suffix('debuild -S', ['-uc', '-us'], '')
'source'
- >>> changes_file_suffix([]) == du.get_arch()
+ >>> changes_file_suffix('debuild', [], '') == du.get_arch()
True
+ >>> changes_file_suffix('debuild', [], 'arm64')
+ 'arm64'
"""
- if '-S' in dpkg_args:
+ args = shlex.split(builder) + dpkg_args
+ if '-S' in args:
return 'source'
- elif '-A' in dpkg_args:
+ elif '-A' in args:
return 'all'
else:
- return os.getenv('ARCH', None) or du.get_arch()
+ return arch or os.getenv('ARCH', None) or du.get_arch()
+
+
+def changes_file_name(source, build_dir, builder, dpkg_args, arch):
+ return os.path.abspath("%s/../%s_%s_%s.changes" %
+ (build_dir,
+ source.changelog.name,
+ source.changelog.noepoch,
+ changes_file_suffix(builder, dpkg_args, arch)))
+
+
+def check_branch(repo, options):
+ """
+ Check if we're on the right branch and bail out otherwise
+
+ returns: the current branch or C{None} if in detached head mode
+ """
+ branch = None
+ try:
+ branch = repo.get_branch()
+ except GitRepositoryError as repo_error:
+ # Not being on any branch is o.k. with --git-ignore-branch
+ if not options.ignore_branch:
+ gbp.log.err(repo_error)
+ raise GitRepositoryError("Use --git-ignore-branch to ignore")
+
+ ignore = options.ignore_new or options.ignore_branch
+ if branch != options.debian_branch and not ignore:
+ gbp.log.err("You are not on branch '%s' but on '%s'" % (options.debian_branch, branch))
+ raise GbpError("Use --git-ignore-branch to ignore or --git-debian-branch to set the branch name.")
+ return branch
def build_parser(name, prefix=None):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix=prefix)
- except configparser.ParsingError as err:
+ except GbpError as err:
gbp.log.err(err)
return None
- tag_group = GbpOptionGroup(parser, "tag options", "options related to git tag creation")
- branch_group = GbpOptionGroup(parser, "branch options", "branch layout options")
- cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke external commands and hooks")
- orig_group = GbpOptionGroup(parser, "orig tarball options", "options related to the creation of the orig tarball")
- export_group = GbpOptionGroup(parser, "export build-tree options", "alternative build tree related options")
- parser.add_option_group(tag_group)
- parser.add_option_group(orig_group)
- parser.add_option_group(branch_group)
- parser.add_option_group(cmd_group)
- parser.add_option_group(export_group)
-
- parser.add_boolean_config_file_option(option_name = "ignore-new", dest="ignore_new")
+ tag_group = GbpOptionGroup(parser,
+ "tag options",
+ "options related to git tag creation")
+ orig_group = GbpOptionGroup(parser,
+ "orig tarball options",
+ "options related to the creation of the orig tarball")
+ branch_group = GbpOptionGroup(parser,
+ "branch options",
+ "branch layout options")
+ cmd_group = GbpOptionGroup(parser,
+ "external command options",
+ "how and when to invoke external commands and hooks")
+ export_group = GbpOptionGroup(parser,
+ "export build-tree options",
+ "alternative build tree related options")
+ for group in [tag_group, orig_group, branch_group, cmd_group, export_group]:
+ parser.add_option_group(group)
+
+ parser.add_boolean_config_file_option(option_name="ignore-new", dest="ignore_new")
parser.add_option("--git-verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
parser.add_config_file_option(option_name="notify", dest="notify", type='tristate')
- parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
tag_group.add_option("--git-tag", action="store_true", dest="tag", default=False,
- help="create a tag after a successful build")
+ help="create a tag after a successful build")
tag_group.add_option("--git-tag-only", action="store_true", dest="tag_only", default=False,
- help="don't build, only tag and run the posttag hook")
+ help="don't build, only tag and run the posttag hook")
tag_group.add_option("--git-retag", action="store_true", dest="retag", default=False,
- help="don't fail if the tag already exists")
+ help="don't fail if the tag already exists")
tag_group.add_boolean_config_file_option(option_name="sign-tags", dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid", dest="keyid")
- tag_group.add_config_file_option(option_name="debian-tag", dest="packaging_tag")
+ tag_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
tag_group.add_config_file_option(option_name="debian-tag-msg", dest="debian_tag_msg")
tag_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
orig_group.add_config_file_option(option_name="upstream-tree", dest="upstream_tree")
orig_group.add_boolean_config_file_option(option_name="pristine-tar-commit",
dest="pristine_tar_commit")
orig_group.add_config_file_option(option_name="force-create", dest="force_create",
- help="force creation of orig tarball", action="store_true")
+ help="force creation of orig tarball", action="store_true")
orig_group.add_config_file_option(option_name="no-create-orig", dest="no_create_orig",
- help="don't create orig tarball", action="store_true")
+ help="don't create orig tarball", action="store_true")
orig_group.add_config_file_option(option_name="tarball-dir", dest="tarball_dir", type="path",
- help="location to look for external tarballs")
+ help="location to look for external tarballs")
orig_group.add_config_file_option(option_name="compression", dest="comp_type",
- help="Compression type, default is '%(compression)s'")
+ help="Compression type, default is '%(compression)s'")
orig_group.add_config_file_option(option_name="compression-level", dest="comp_level",
- help="Compression level, default is '%(compression-level)s'")
+ help="Compression level, default is '%(compression-level)s'")
+ orig_group.add_config_file_option(option_name="upstream-signatures", dest="upstream_signatures",
+ help="use upstream signatures, default is auto", type='tristate')
+ orig_group.add_config_file_option("component", action="append", metavar='COMPONENT',
+ dest="components")
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
- branch_group.add_config_file_option(option_name="debian-branch", dest="packaging_branch")
- branch_group.add_boolean_config_file_option(option_name = "ignore-branch", dest="ignore_branch")
- branch_group.add_boolean_config_file_option(option_name = "submodules", dest="with_submodules")
+ branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
+ branch_group.add_boolean_config_file_option(option_name="ignore-branch", dest="ignore_branch")
+ branch_group.add_boolean_config_file_option(option_name="submodules", dest="with_submodules")
cmd_group.add_config_file_option(option_name="builder", dest="builder",
- help="command to build the Debian package, default is '%(builder)s'")
+ help="command to build the Debian package, "
+ "default is '%(builder)s'")
cmd_group.add_config_file_option(option_name="cleaner", dest="cleaner",
- help="command to clean the working copy, default is '%(cleaner)s'")
+ help="command to clean the working copy, "
+ "default is '%(cleaner)s'")
cmd_group.add_config_file_option(option_name="prebuild", dest="prebuild",
- help="command to run before a build, default is '%(prebuild)s'")
+ help="hook to run before a build, "
+ "default is '%(prebuild)s'")
+ cmd_group.add_config_file_option(option_name="preexport", dest="preexport",
+ help="hook to run before exporting the source tree, "
+ "default is '%(preexport)s'")
cmd_group.add_config_file_option(option_name="postexport", dest="postexport",
- help="command to run after exporting the source tree, default is '%(postexport)s'")
+ help="hook to run after exporting the source tree, "
+ "default is '%(postexport)s'")
cmd_group.add_config_file_option(option_name="postbuild", dest="postbuild",
- help="hook run after a successful build, default is '%(postbuild)s'")
+ help="hook run after a successful build, "
+ "default is '%(postbuild)s'")
cmd_group.add_config_file_option(option_name="posttag", dest="posttag",
- help="hook run after a successful tag operation, default is '%(posttag)s'")
+ help="hook run after a successful tag operation, "
+ "default is '%(posttag)s'")
cmd_group.add_boolean_config_file_option(option_name="pbuilder", dest="use_pbuilder")
cmd_group.add_boolean_config_file_option(option_name="qemubuilder", dest="use_qemubuilder")
cmd_group.add_config_file_option(option_name="dist", dest="pbuilder_dist")
cmd_group.add_config_file_option(option_name="arch", dest="pbuilder_arch")
- cmd_group.add_boolean_config_file_option(option_name = "pbuilder-autoconf", dest="pbuilder_autoconf")
+ cmd_group.add_boolean_config_file_option(option_name="pbuilder-autoconf",
+ dest="pbuilder_autoconf")
cmd_group.add_config_file_option(option_name="pbuilder-options", dest="pbuilder_options")
- cmd_group.add_boolean_config_file_option(option_name="build", dest="build")
cmd_group.add_boolean_config_file_option(option_name="hooks", dest="hooks")
export_group.add_config_file_option(option_name="export-dir", dest="export_dir", type="path",
- help="before building the package export the source into EXPORT_DIR, default is '%(export-dir)s'")
+ help="before building the package export the source into EXPORT_DIR, "
+ "default is '%(export-dir)s'")
export_group.add_config_file_option("export", dest="export",
- help="export treeish object TREEISH, default is '%(export)s'", metavar="TREEISH")
+ help="export treeish object TREEISH, "
+ "default is '%(export)s'", metavar="TREEISH")
export_group.add_boolean_config_file_option(option_name="purge", dest="purge")
- export_group.add_option("--git-dont-purge", action="store_true", dest="dont_purge", default=False,
- help="deprecated, use --git-no-purge instead")
export_group.add_boolean_config_file_option(option_name="overlay", dest="overlay")
return parser
def parse_args(argv, prefix):
- args = [ arg for arg in argv[1:] if arg.find('--%s' % prefix) == 0 ]
- dpkg_args = [ arg for arg in argv[1:] if arg.find('--%s' % prefix) == -1 ]
+ args = [arg for arg in argv[1:] if arg.find('--%s' % prefix) == 0]
+ dpkg_args = [arg for arg in argv[1:] if arg.find('--%s' % prefix) == -1]
# We handle these although they don't have a --git- prefix
- for arg in [ "--help", "-h", "--version" ]:
+ for arg in ["--help", "-h", "--version"]:
if arg in dpkg_args:
args.append(arg)
options, args = parser.parse_args(args)
gbp.log.setup(options.color, options.verbose, options.color_scheme)
- if not options.build:
- disable_builder(options)
- dpkg_args = []
if not options.hooks:
disable_hooks(options)
if options.retag:
if not options.tag and not options.tag_only:
- gbp.log.err("'--%sretag' needs either '--%stag' or '--%stag-only'" % (prefix, prefix, prefix))
+ gbp.log.err("'--%sretag' needs either '--%stag' or '--%stag-only'"
+ % (prefix, prefix, prefix))
return None, None, None
if options.overlay and not options.export_dir:
gbp.log.err("Overlay must be used with --git-export-dir")
return None, None, None
- # --git-dont-purge is deprecated:
- if options.dont_purge:
- gbp.log.warning("--git-dont-purge is depreceted, use --git-no-purge instead")
- options.purge = False
+ if options.components and options.pristine_tar_commit:
+ gbp.log.warn("Components specified, pristine-tar-commit not yet supported - disabling it.")
+ options.pristine_tar_commit = False
+ mangle_export_wc_opts(options)
return options, args, dpkg_args
-class Hook(RunAtCommand):
- "A hook run during the build"
- def __init__(self, name, *args, **kwargs):
- RunAtCommand.__init__(self, *args, **kwargs)
- self.run_error = '%s-hook %s' % (name, self.run_error)
-
-
def main(argv):
retval = 0
prefix = "git-"
source = None
- branch = None
+ hook_env = {}
options, gbp_args, dpkg_args = parse_args(argv, prefix)
if not options:
- return 1
+ return ExitCodes.parse_error
try:
repo = DebianGitRepository(os.path.curdir)
except GitRepositoryError:
gbp.log.err("%s is not a git repository" % (os.path.abspath('.')))
return 1
- else:
- repo_dir = os.path.abspath(os.path.curdir)
try:
- Command(options.cleaner, shell=True)()
- if not options.ignore_new:
- (ret, out) = repo.is_clean()
- if not ret:
- gbp.log.err("You have uncommitted changes in your source tree:")
- gbp.log.err(out)
- raise GbpError("Use --git-ignore-new to ignore.")
-
- try:
- branch = repo.get_branch()
- except GitRepositoryError:
- # Not being on any branch is o.k. with --git-ignore-branch
- if not options.ignore_branch:
- raise
-
- if not options.ignore_new and not options.ignore_branch:
- if branch != options.packaging_branch:
- gbp.log.err("You are not on branch '%s' but on '%s'" % (options.packaging_branch, branch))
- raise GbpError("Use --git-ignore-branch to ignore or --git-debian-branch to set the branch name.")
-
- tree = write_tree(repo, options)
+ clean_working_tree(options, repo)
+ check_branch(repo, options)
+ tree = maybe_write_tree(repo, options)
source = source_vfs(repo, options, tree)
+
+ check_tag(options, repo, source)
+
if not options.tag_only:
output_dir = prepare_output_dir(options.export_dir)
- tarball_dir = options.tarball_dir or output_dir
+ tarball_dir = output_dir
+ if options.tarball_dir and source.upstream_version is not None:
+ tarball_dir = PkgPolicy.version_subst(options.tarball_dir, source.upstream_version)
+ tmp_dir = os.path.join(output_dir, "%s-tmp" % source.sourcepkg)
+ build_env, hook_env = setup_pbuilder(options, repo, source.is_native())
+ major = (source.debian_version if source.is_native()
+ else source.upstream_version)
+ export_dir = os.path.join(output_dir, "%s-%s" % (source.sourcepkg, major))
+ build_dir = export_dir if options.export_dir else repo.path
+ changes_file = changes_file_name(source, build_dir, options.builder, dpkg_args,
+ options.pbuilder_arch)
+
+ # Run preexport hook
+ if options.export_dir and options.preexport:
+ Hook('Preexport', options.preexport,
+ extra_env=Hook.md(hook_env,
+ {'GBP_GIT_DIR': repo.git_dir,
+ 'GBP_BUILD_DIR': build_dir})
+ )()
# Get/build the upstream tarball if necessary. We delay this in
# case of a postexport hook so the hook gets a chance to modify the
if options.postexport:
gbp.log.info("Postexport hook set, delaying tarball creation")
else:
- prepare_upstream_tarball(repo, source.changelog, options, tarball_dir,
- output_dir)
+ prepare_upstream_tarballs(repo, source, options, tarball_dir,
+ output_dir)
# Export to another build dir if requested:
if options.export_dir:
- tmp_dir = os.path.join(output_dir, "%s-tmp" % source.sourcepkg)
- export_source(repo, tree, source, options, tmp_dir, output_dir)
+ export_source(repo, tree, source, options, tmp_dir, tarball_dir)
# Run postexport hook
if options.postexport:
- Hook('Postexport', options.postexport, shell=True,
- extra_env={'GBP_GIT_DIR': repo.git_dir,
- 'GBP_TMP_DIR': tmp_dir})(dir=tmp_dir)
+ Hook('Postexport', options.postexport,
+ extra_env=Hook.md(hook_env,
+ {'GBP_GIT_DIR': repo.git_dir,
+ 'GBP_TMP_DIR': tmp_dir})
+ )(dir=tmp_dir)
- major = (source.changelog.debian_version if source.is_native()
- else source.changelog.upstream_version)
- export_dir = os.path.join(output_dir, "%s-%s" % (source.sourcepkg, major))
gbp.log.info("Moving '%s' to '%s'" % (tmp_dir, export_dir))
move_old_export(export_dir)
os.rename(tmp_dir, export_dir)
# Delayed tarball creation in case a postexport hook is used:
if not source.is_native() and options.postexport:
- prepare_upstream_tarball(repo, source.changelog, options, tarball_dir,
- output_dir)
-
- if options.export_dir:
- build_dir = export_dir
- else:
- build_dir = repo_dir
-
+ prepare_upstream_tarballs(repo, source, options, tarball_dir,
+ output_dir)
if options.prebuild:
- Hook('Prebuild', options.prebuild, shell=True,
- extra_env={'GBP_GIT_DIR': repo.git_dir,
- 'GBP_BUILD_DIR': build_dir})(dir=build_dir)
+ Hook('Prebuild', options.prebuild,
+ extra_env=Hook.md(hook_env,
+ {'GBP_GIT_DIR': repo.git_dir,
+ 'GBP_BUILD_DIR': build_dir})
+ )(dir=build_dir)
- setup_pbuilder(options)
# Finally build the package:
- RunAtCommand(options.builder, dpkg_args, shell=True,
- extra_env={'GBP_BUILD_DIR': build_dir})(dir=build_dir)
+ gbp.log.info("Performing the build")
+ RunAtCommand(options.builder,
+ [pipes.quote(arg) for arg in dpkg_args],
+ shell=True,
+ extra_env=Hook.md(build_env,
+ {'GBP_BUILD_DIR': build_dir})
+ )(dir=build_dir)
if options.postbuild:
- changes = os.path.abspath("%s/../%s_%s_%s.changes" %
- (build_dir,
- source.sourcepkg,
- source.changelog.noepoch,
- changes_file_suffix(dpkg_args)))
- gbp.log.debug("Looking for changes file %s" % changes)
- Hook('Postbuild', options.postbuild, shell=True,
- extra_env={'GBP_CHANGES_FILE': changes,
- 'GBP_BUILD_DIR': build_dir})()
+ gbp.log.debug("Looking for changes file %s" % changes_file)
+ Hook('Postbuild', options.postbuild,
+ extra_env=Hook.md(hook_env,
+ {'GBP_CHANGES_FILE': changes_file,
+ 'GBP_BUILD_DIR': build_dir})
+ )()
if options.tag or options.tag_only:
- tag = repo.version_to_tag(options.packaging_tag, source.changelog.version)
- gbp.log.info("Tagging %s as %s" % (source.changelog.version, tag))
- if options.retag and repo.has_tag(tag):
- repo.delete_tag(tag)
- tag_msg = format_msg(options.debian_tag_msg,
- dict(pkg=source.sourcepkg,
- version=source.changelog.version))
- repo.create_tag(name=tag,
- msg=tag_msg,
- sign=options.sign_tags, keyid=options.keyid)
- if options.posttag:
- sha = repo.rev_parse("%s^{}" % tag)
- Hook('Posttag', options.posttag, shell=True,
- extra_env={'GBP_TAG': tag,
- 'GBP_BRANCH': branch or '(no branch)',
- 'GBP_SHA1': sha})()
+ perform_tagging(repo, source, options, hook_env)
+
+ except KeyboardInterrupt:
+ retval = 1
+ gbp.log.err("Interrupted. Aborting.")
except CommandExecFailed:
retval = 1
except (GbpError, GitRepositoryError) as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
retval = 1
except DebianSourceError as err:
return retval
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2014 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-"""Build an RPM package out of a Git repo with Bitbake meta data"""
-
-import configparser
-import os, os.path
-import sys
-import shutil
-import tempfile
-
-import gbp.rpm as rpm
-from gbp.rpm.policy import RpmPkgPolicy
-from gbp.command_wrappers import Command, RunAtCommand, CommandExecFailed
-from gbp.config import GbpOptionParserBB, GbpOptionGroup
-from gbp.rpm.git import (GitRepositoryError, RpmGitRepository)
-from gbp.errors import GbpError
-import gbp.log
-import gbp.notifications
-from gbp.scripts.common.buildpackage import (index_name, wc_names, dump_tree,
- drop_index)
-from gbp.scripts.buildpackage_rpm import (disable_hooks, get_tree,
- get_current_branch, get_upstream_tree, get_vcs_info,
- packaging_tag_name, create_packaging_tag, GbpAutoGenerateError)
-from gbp.scripts.import_bb import recursive_copy
-from gbp.scripts.pq_bb import update_patch_series
-from gbp.scripts.common.pq import is_pq_branch, pq_branch_base
-from gbp.bb import (bb, init_tinfoil, guess_bb_path, BBFile, bb_from_repo,
- pkg_version, parse_bb)
-
-def guess_export_params(repo, options):
- """Get commit and tree from where to export packaging and patches"""
- tree = None
- branch = None
- if options.export in list(wc_names.keys()) + [index_name, 'HEAD']:
- branch = get_current_branch(repo)
- elif options.export in repo.get_local_branches():
- branch = options.export
- if branch:
- if is_pq_branch(branch, options):
- packaging_branch = pq_branch_base(branch, options)
- if repo.has_branch(packaging_branch):
- gbp.log.info("It seems you're building a development/patch-"
- "queue branch. Export target changed to '%s' and "
- "patch-export enabled!" % packaging_branch)
- options.patch_export = True
- if not options.patch_export_rev:
- options.patch_export_rev = options.export
- options.export = packaging_branch
- else:
- gbp.log.warn("It seems you're building a development/patch-"
- "queue branch. No corresponding packaging branch "
- "found. Build may fail!")
- if tree is None:
- tree = get_tree(repo, options.export)
-
- # Get recipe path
- bb_path = guess_bb_path(options, repo, tree, bbappend=True)
- # Adjust meta-dir accordingly
- options.meta_dir = os.path.dirname(bb_path)
-
- # Filter out changes in recipe directory
- if options.patch_export:
- relpath = os.path.relpath(os.path.abspath(options.meta_dir), repo.path)
- if relpath != '.':
- gbp.log.info("Auto-excluding changes under meta-dir (%s/)" %
- relpath)
- if options.patch_export_ignore_path:
- options.patch_export_ignore_path += '|' + relpath + '/*'
- else:
- options.patch_export_ignore_path = relpath + '/*'
- return tree
-
-def guess_export_dir(options, tinfoil, repo, treeish):
- """Guess export directory"""
- if not tinfoil:
- gbp.log.err("Bitbake build environment (bb.tinfoil) not initialized, "
- "unable to guess export directory")
- gbp.log.err("Please use --git-export-dir or try initializing bitbake "
- "build environment with the 'oe-init-build-env' script")
- raise GbpError
-
- gbp.log.info('Guessing export directory')
- tinfoil.parseRecipes()
-
- # Parse recipe
- bb_path = guess_bb_path(options, repo, treeish, bbappend=True)
- #cfg_data = bb.data.createCopy(tinfoil.config_data)
- #bbfile = bb_from_repo(cfg_data, repo, treeish, bb_path)
- # Use naive parsing, at least for now as the file might be .bbappend
- bbfile = bb_from_repo(None, repo, treeish, bb_path)
-
- pkg_name = bbfile.getVar('PN', True)
- bb_name = os.path.basename(bb_path)
- if bb_name.endswith('.bb'):
- for name in tinfoil.cooker_data.pkg_fn:
- if os.path.basename(name) == bb_name and os.path.isabs(name):
- gbp.log.debug("Found matching recipe filename: %s" % name)
- return os.path.dirname(name)
- else:
- for name, appends in tinfoil.cooker.collection.appendlist.items():
- print(name, appends)
- if name.rsplit('_', 1)[0] == pkg_name:
- gbp.log.debug("Found %s from appends" % name)
- for append_name in appends:
- if os.path.basename(append_name) == bb_name:
- gbp.log.debug("Found matching recipe filename: %s" %
- append_name)
- return os.path.dirname(append_name)
- export_dir = os.path.dirname(appends[-1])
- gbp.log.debug("Using existing appends directory %s" %
- export_dir)
- return export_dir
- if pkg_name in tinfoil.cooker_data.pkg_pn:
- export_dir = os.path.dirname(tinfoil.cooker_data.pkg_pn[pkg_name][-1])
- gbp.log.debug("Using existing package directory %s" % export_dir)
- return export_dir
- else:
- pkg_ver = bbfile.getVar('PV', True)
- raise GbpError("Package %s-%s not found under any configured layer, "
- "please use --git-export-dir to define the export "
- "directory" % (pkg_name, pkg_ver))
-
-def export_patches(repo, bbfile, export_treeish, options):
- """Generate patches and update recipe"""
- try:
- if bbfile.getVar('SRCREV', True):
- upstream_tree = bbfile.getVar('SRCREV', True)
- else:
- upstream_version = bbfile.getVar('PV', True)
- upstream_tree = get_upstream_tree(repo, upstream_version, options)
- update_patch_series(repo, bbfile, upstream_tree, export_treeish,
- options)
- except (GitRepositoryError, GbpError) as err:
- raise GbpAutoGenerateError(str(err))
-
-
-def is_native(repo, options):
- """Determine whether a package is native or non-native"""
- if options.native.is_auto():
- if repo.has_branch(options.upstream_branch):
- return False
- # Check remotes, too
- for remote_branch in repo.get_remote_branches():
- remote, branch = remote_branch.split('/', 1)
- if branch == options.upstream_branch:
- gbp.log.debug("Found upstream branch '%s' from remote '%s'" %
- (remote, branch))
- return False
- return True
-
- return options.native.is_on()
-
-
-def setup_builder(options, builder_args):
- """Setup everything to use git-pbuilder"""
- # TODO: placeholder for Bitbake: implement or remove entirely
- pass
-
-def bb_get_local_files(bbfile, tgt_dir, whole_dir=False):
- """Get (local) packaging files"""
- if not whole_dir:
- for path in bbfile.localfiles + bbfile.includes + [bbfile.bb_path]:
- relpath = os.path.relpath(path, bbfile.bb_dir)
- subdir = os.path.join(tgt_dir, os.path.dirname(relpath))
- if not os.path.exists(subdir):
- os.makedirs(subdir)
- shutil.copy2(path, os.path.join(tgt_dir, relpath))
- else:
- # Simply copy whole meta dir, if requested
- recursive_copy(bbfile.bb_dir, tgt_dir)
-
-def dump_meta(cfg_data, options, repo, treeish, dump_dir):
- """Parse and dump meta information from a treeish"""
- tmpdir = tempfile.mkdtemp(prefix='gbp-bb_')
- try:
- bb_path = guess_bb_path(options, repo, treeish, bbappend=True)
- # Dump whole meta directory
- dump_tree(repo, tmpdir, '%s:%s' % (treeish, os.path.dirname(bb_path)),
- False)
- # Parse recipe
- full_path = os.path.join(tmpdir, os.path.basename(bb_path))
- bbfile = BBFile(full_path, cfg_data)
- bb_get_local_files(bbfile, dump_dir)
- except GitRepositoryError as err:
- raise GbpError("Git error: %s" % err)
- finally:
- shutil.rmtree(tmpdir)
-
- # Re-parse recipe from final location
- full_path = os.path.abspath(os.path.join(dump_dir,
- os.path.basename(bb_path)))
- return BBFile(full_path, cfg_data)
-
-
-def build_parser(name, prefix=None, git_treeish=None):
- """Create command line parser"""
- try:
- parser = GbpOptionParserBB(command=os.path.basename(name),
- prefix=prefix, git_treeish=git_treeish)
- except configparser.ParsingError as err:
- gbp.log.err(err)
- return None
-
- tag_group = GbpOptionGroup(parser, "tag options",
- "options related to git tag creation")
- branch_group = GbpOptionGroup(parser, "branch options",
- "branch layout options")
- cmd_group = GbpOptionGroup(parser, "external command options",
- "how and when to invoke external commands and hooks")
- orig_group = GbpOptionGroup(parser, "orig tarball options",
- "options related to the creation of the orig tarball")
- export_group = GbpOptionGroup(parser, "export build-tree options",
- "alternative build tree related options")
- parser.add_option_group(tag_group)
- parser.add_option_group(orig_group)
- parser.add_option_group(branch_group)
- parser.add_option_group(cmd_group)
- parser.add_option_group(export_group)
-
- parser.add_boolean_config_file_option(option_name = "ignore-untracked",
- dest="ignore_untracked")
- parser.add_boolean_config_file_option(option_name = "ignore-new",
- dest="ignore_new")
- parser.add_option("--git-verbose", action="store_true", dest="verbose",
- help="verbose command execution")
- parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
- parser.add_config_file_option(option_name="color", dest="color",
- type='tristate')
- parser.add_config_file_option(option_name="color-scheme",
- dest="color_scheme")
- parser.add_config_file_option(option_name="notify", dest="notify",
- type='tristate')
- parser.add_config_file_option(option_name="vendor", action="store",
- dest="vendor")
- parser.add_config_file_option(option_name="native", dest="native",
- type='tristate')
- tag_group.add_option("--git-tag", action="store_true", dest="tag",
- help="create a tag after a successful build")
- tag_group.add_option("--git-tag-only", action="store_true", dest="tag_only",
- help="don't build, only tag and run the posttag hook")
- tag_group.add_option("--git-retag", action="store_true", dest="retag",
- help="don't fail if the tag already exists")
- tag_group.add_boolean_config_file_option(option_name="sign-tags",
- dest="sign_tags")
- tag_group.add_config_file_option(option_name="keyid", dest="keyid")
- tag_group.add_config_file_option(option_name="packaging-tag",
- dest="packaging_tag")
- tag_group.add_config_file_option(option_name="upstream-tag",
- dest="upstream_tag")
- orig_group.add_config_file_option(option_name="upstream-tree",
- dest="upstream_tree")
- branch_group.add_config_file_option(option_name="upstream-branch",
- dest="upstream_branch")
- branch_group.add_config_file_option(option_name="packaging-branch",
- dest="packaging_branch")
- branch_group.add_config_file_option(option_name="pq-branch",
- dest="pq_branch")
- branch_group.add_boolean_config_file_option(option_name = "ignore-branch",
- dest="ignore_branch")
- cmd_group.add_config_file_option(option_name="builder", dest="builder",
- help="command to build the package, default is "
- "'%(builder)s'")
- cmd_group.add_config_file_option(option_name="cleaner", dest="cleaner",
- help="command to clean the working copy, default is "
- "'%(cleaner)s'")
- cmd_group.add_config_file_option(option_name="prebuild", dest="prebuild",
- help="command to run before a build, default is "
- "'%(prebuild)s'")
- cmd_group.add_config_file_option(option_name="postexport",
- dest="postexport",
- help="command to run after exporting the source tree, "
- "default is '%(postexport)s'")
- cmd_group.add_config_file_option(option_name="postbuild", dest="postbuild",
- help="hook run after a successful build, default is "
- "'%(postbuild)s'")
- cmd_group.add_config_file_option(option_name="posttag", dest="posttag",
- help="hook run after a successful tag operation, default "
- "is '%(posttag)s'")
- cmd_group.add_boolean_config_file_option(option_name="hooks", dest="hooks")
- export_group.add_option("--git-no-build", action="store_true",
- dest="no_build",
- help="Don't run builder or the associated hooks")
- export_group.add_config_file_option(option_name="export-dir",
- dest="export_dir", type="path",
- help="Build topdir, also export the sources under "
- "EXPORT_DIR, default is '%(export-dir)s'")
- export_group.add_config_file_option("export", dest="export",
- help="export treeish object TREEISH, default is "
- "'%(export)s'", metavar="TREEISH")
- export_group.add_config_file_option(option_name="meta-dir",
- dest="meta_dir")
- export_group.add_config_file_option(option_name="bb-file", dest="bb_file")
- export_group.add_boolean_config_file_option("patch-export",
- dest="patch_export")
- export_group.add_option("--git-patch-export-rev", dest="patch_export_rev",
- metavar="TREEISH",
- help="[experimental] Export patches from treeish object "
- "TREEISH")
- export_group.add_config_file_option("patch-export-ignore-path",
- dest="patch_export_ignore_path")
- export_group.add_config_file_option("patch-export-compress",
- dest="patch_export_compress")
- export_group.add_config_file_option("patch-export-squash-until",
- dest="patch_export_squash_until")
- export_group.add_boolean_config_file_option(option_name="patch-numbers",
- dest="patch_numbers")
- export_group.add_config_file_option("bb-vcs-info", dest="bb_vcs_info")
- return parser
-
-def parse_args(argv, prefix, git_treeish=None):
- """Parse config and command line arguments"""
- args = [arg for arg in argv[1:] if arg.find('--%s' % prefix) == 0]
- builder_args = [arg for arg in argv[1:] if arg.find('--%s' % prefix) == -1]
-
- # We handle these although they don't have a --git- prefix
- for arg in ["--help", "-h", "--version"]:
- if arg in builder_args:
- args.append(arg)
-
- parser = build_parser(argv[0], prefix=prefix, git_treeish=git_treeish)
- if not parser:
- return None, None, None
- options, args = parser.parse_args(args)
-
- options.patch_export_compress = rpm.string_to_int(
- options.patch_export_compress)
-
- gbp.log.setup(options.color, options.verbose, options.color_scheme)
- if not options.hooks:
- disable_hooks(options)
- if options.retag:
- if not options.tag and not options.tag_only:
- gbp.log.err("'--%sretag' needs either '--%stag' or '--%stag-only'" %
- (prefix, prefix, prefix))
- return None, None, None
-
- return options, args, builder_args
-
-
-def main(argv):
- """Entry point for git-buildpackage-bb"""
- retval = 0
- prefix = "git-"
- bbfile = None
- dump_dir = None
-
- if not bb:
- return 1
-
- options, gbp_args, builder_args = parse_args(argv, prefix)
- if not options:
- return 1
-
- try:
- repo = RpmGitRepository(os.path.curdir)
- except GitRepositoryError:
- gbp.log.err("%s is not a git repository" % (os.path.abspath('.')))
- return 1
-
- # Determine tree-ish to be exported
- try:
- tree = get_tree(repo, options.export)
- except GbpError as err:
- gbp.log.err('Failed to determine export treeish: %s' % err)
- return 1
- # Re-parse config options with using the per-tree config file(s) from the
- # exported tree-ish
- options, gbp_args, builder_args = parse_args(argv, prefix, tree)
-
- branch = get_current_branch(repo)
-
- try:
- tinfoil = init_tinfoil(config_only=True)
- #bb_cfg_data = bb.data.createCopy(tinfoil.config_data)
- except GbpError:
- tinfoil = None
-
- # Use naive parsing because repository might only have .bb file
- gbp.log.info("Using naive standalone parsing of recipes in package repo.")
- bb_cfg_data = None
-
- try:
- tree = guess_export_params(repo, options)
-
- Command(options.cleaner, shell=True)()
- if not options.ignore_new:
- (ret, out) = repo.is_clean(options.ignore_untracked)
- if not ret:
- gbp.log.err("You have uncommitted changes in your source tree:")
- gbp.log.err(out)
- raise GbpError("Use --git-ignore-new or --git-ignore-untracked "
- "to ignore.")
-
- if not options.ignore_new and not options.ignore_branch:
- if branch != options.packaging_branch:
- gbp.log.err("You are not on branch '%s' but on '%s'" %
- (options.packaging_branch, branch))
- raise GbpError("Use --git-ignore-branch to ignore or "
- "--git-packaging-branch to set the branch name.")
-
- if not options.tag_only:
- # Dump/parse meta to export dir
- if options.export_dir:
- export_dir = os.path.abspath(options.export_dir)
- else:
- export_dir = guess_export_dir(options, tinfoil, repo, tree)
- gbp.log.info("Dumping meta from tree '%s' to '%s'" %
- (options.export, export_dir))
- bbfile = dump_meta(bb_cfg_data, options, repo, tree,
- export_dir)
-
- # Setup builder opts
- setup_builder(options, builder_args)
-
- if is_native(repo, options) and bbfile.getVar('SRCREV') == 'HEAD':
- # Update SRCREV for native packages that are exported from
- # pristine repository
- BBFile.set_var_val(bbfile.bb_path, 'SRCREV',
- repo.rev_parse(tree))
-
- # TODO: Re-design the handling of native packages. Updating
- # SRCREV must probably be more explicit
- if options.patch_export:
- # Generate patches, if requested
- if options.patch_export_rev:
- patch_tree = get_tree(repo, options.patch_export_rev)
- else:
- patch_tree = tree
- export_patches(repo, bbfile, patch_tree, options)
-
- # Run postexport hook
- if options.postexport:
- RunAtCommand(options.postexport, shell=True,
- extra_env={'GBP_GIT_DIR': repo.git_dir,
- 'GBP_TMP_DIR': export_dir}
- )(dir=export_dir)
- # Do actual build
- if not options.no_build:
- if options.prebuild:
- RunAtCommand(options.prebuild, shell=True,
- extra_env={'GBP_GIT_DIR': repo.git_dir,
- 'GBP_BUILD_DIR': export_dir}
- )(dir=export_dir)
-
- # Unlock cooker so that we are able to run external bitbake
- if options.builder == 'bitbake' and tinfoil:
- bb.utils.unlockfile(tinfoil.cooker.lock)
-
- # Finally build the package:
- bb_path = bbfile.getVar('FILE', True)
- builder_args.extend(['-b', bb_path])
- RunAtCommand(options.builder, builder_args, shell=True,
- extra_env={'GBP_BUILD_DIR': export_dir})()
-
- if options.postbuild:
- Command(options.postbuild, shell=True,
- extra_env={'GBP_BUILD_DIR': export_dir})()
- else:
- # Tag-only: we just need to parse the meta
- bbfile = parse_bb(bb_cfg_data, options, repo, tree)
-
- # Tag (note: tags the exported version)
- if options.tag or options.tag_only:
- version = pkg_version(bbfile)
- gbp.log.info("Tagging %s" %
- RpmPkgPolicy.compose_full_version(version))
- commit_info = repo.get_commit_info(tree)
- tag = packaging_tag_name(repo, version, commit_info, options)
- if options.retag and repo.has_tag(tag):
- repo.delete_tag(tag)
- create_packaging_tag(repo, tag, commit=tree, version=version,
- options=options)
- vcs_info = get_vcs_info(repo, tag)
- if options.posttag:
- sha = repo.rev_parse("%s^{}" % tag)
- Command(options.posttag, shell=True,
- extra_env={'GBP_TAG': tag,
- 'GBP_BRANCH': branch,
- 'GBP_SHA1': sha})()
- else:
- vcs_info = get_vcs_info(repo, tree)
- # TODO: Put VCS information to recipe
- if options.bb_vcs_info:
- raise GbpError("Injecting VCS info into recipe not yet supported")
-
- except CommandExecFailed:
- retval = 1
- except GitRepositoryError as err:
- gbp.log.err("Git command failed: %s" % err)
- retval = 1
- except GbpAutoGenerateError as err:
- if len(err.__str__()):
- gbp.log.err(err)
- retval = 2
- except GbpError as err:
- if len(err.__str__()):
- gbp.log.err(err)
- retval = 1
- finally:
- drop_index(repo)
- if dump_dir and os.path.exists(dump_dir):
- shutil.rmtree(dump_dir)
-
- if not options.tag_only:
- if bbfile and options.notify:
- summary = "GBP buildpackage-bb %s" % \
- ["failed", "successful"][not retval]
- message = ("Build of %s %s %s" % (bbfile.getVar('PN', True),
- RpmPkgPolicy.compose_full_version(pkg_version(bbfile)),
- ["failed", "succeeded"][not retval]))
- if not gbp.notifications.notify(summary, message, options.notify):
- gbp.log.err("Failed to send notification")
- retval = 1
-
- return retval
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
# vim: set fileencoding=utf-8 :
#
-# (C) 2006-2011 Guido Guenther <agx@sigxcpu.org>
-# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
+# (C) 2006-2011,2015-2017 Guido Günther <agx@sigxcpu.org>
+# (C) 2012-2015 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
-"""run commands to build an RPM package out of a git repository"""
+"""Build an RPM package out of a Git repository"""
-import configparser
-import errno
-import os, os.path
-import sys
+import os
+import pipes
import shutil
-import re
-from datetime import datetime
+import sys
-import gbp.tmpfile as tempfile
+import gbp.log
+import gbp.notifications
import gbp.rpm as rpm
-from gbp.rpm.policy import RpmPkgPolicy
from gbp.command_wrappers import Command, RunAtCommand, CommandExecFailed
-from gbp.config import (GbpOptionParserRpm, GbpOptionGroup)
-from gbp.rpm.git import (GitRepositoryError, RpmGitRepository)
+from gbp.config import GbpOptionParserRpm, GbpOptionGroup
from gbp.errors import GbpError
-import gbp.log
-import gbp.notifications
-from gbp.scripts.common.buildpackage import (index_name, wc_names,
- git_archive_submodules,
- git_archive_single, dump_tree,
- write_wc, drop_index)
-from gbp.pkg import compressor_opts
-from gbp.scripts.pq_rpm import update_patch_series, parse_spec
-from gbp.scripts.common.pq import is_pq_branch, pq_branch_name, pq_branch_base
+from gbp.format import format_str
+from gbp.pkg import Compressor
+from gbp.rpm.git import GitRepositoryError, RpmGitRepository
+from gbp.rpm.policy import RpmPkgPolicy
+from gbp.tmpfile import init_tmpdir, del_tmpdir, tempfile
+from gbp.scripts.common import ExitCodes
+from gbp.scripts.common.buildpackage import (index_name, wc_name,
+ dump_tree, write_wc, drop_index)
+from gbp.scripts.pq_rpm import parse_spec
class GbpAutoGenerateError(GbpError):
- """Error for tarball and patch-generation failures"""
pass
-def git_archive(repo, spec, output_dir, tmpdir_base, treeish, prefix,
- comp_level, with_submodules):
- "create a compressed orig tarball in output_dir using git_archive"
- comp_opts = ''
- if spec.orig_src['compression']:
- comp_opts = compressor_opts[spec.orig_src['compression']][0]
+def makedir(path):
+ """Create directory"""
+ try:
+ if not os.path.exists(path):
+ os.makedirs(path)
+ except OSError as err:
+ raise GbpError("Cannot create dir %s: %s" % (path, err))
+ return path
+
+def git_archive(repo, spec, output_dir, treeish, prefix, comp, with_submodules):
+ "Create a compressed orig tarball in output_dir using git_archive"
output = os.path.join(output_dir, spec.orig_src['filename'])
# Remove extra slashes from prefix, will be added by git_archive_x funcs
prefix = prefix.strip('/')
try:
+ submodules = False
if repo.has_submodules(treeish) and with_submodules:
+ submodules = True
repo.update_submodules()
- git_archive_submodules(repo, treeish, output, tmpdir_base,
- prefix, spec.orig_src['compression'],
- comp_level, comp_opts,
- spec.orig_src['archive_fmt'])
-
- else:
- git_archive_single(repo, treeish, output, prefix,
- spec.orig_src['compression'], comp_level, comp_opts,
- spec.orig_src['archive_fmt'])
- except (GitRepositoryError, CommandExecFailed):
- gbp.log.err("Error generating submodules' archives")
+ repo.archive_comp(treeish, output, prefix, comp,
+ format=spec.orig_src['archive_fmt'],
+ submodules=submodules)
+ except (GitRepositoryError, CommandExecFailed) as e:
+ gbp.log.err("Error generating submodules' archives: %s" % e)
return False
return True
def prepare_upstream_tarball(repo, spec, options, output_dir):
- """
- Make sure we have an upstream tarball. This involves loooking in
- tarball_dir, symlinking or building it.
- """
+ """Make sure we have an upstream tarball"""
# look in tarball_dir first, if found force a symlink to it
orig_file = spec.orig_src['filename']
if options.tarball_dir:
- gbp.log.debug("Looking for orig tarball '%s' at '%s'" % (orig_file, options.tarball_dir))
- if not RpmPkgPolicy.symlink_orig(orig_file, options.tarball_dir, output_dir, force=True):
- gbp.log.info("Orig tarball '%s' not found at '%s'" % (orig_file, options.tarball_dir))
+ gbp.log.debug("Looking for orig tarball '%s' at '%s'" %
+ (orig_file, options.tarball_dir))
+ if not RpmPkgPolicy.symlink_orig(orig_file, options.tarball_dir,
+ output_dir, force=True):
+ gbp.log.info("Orig tarball '%s' not found at '%s'" %
+ (orig_file, options.tarball_dir))
else:
- gbp.log.info("Orig tarball '%s' found at '%s'" % (orig_file, options.tarball_dir))
- # build an orig unless the user forbids it, always build (and overwrite pre-existing) if user forces it
- if options.force_create or (not options.no_create_orig and not RpmPkgPolicy.has_orig(orig_file, output_dir)):
+ gbp.log.info("Orig tarball '%s' found at '%s'" %
+ (orig_file, options.tarball_dir))
+
+ # build an orig unless the user forbids it, always build (and overwrite
+ # pre-existing) if user forces it
+ if options.force_create or (not options.no_create_orig and not
+ RpmPkgPolicy.has_orig(orig_file, output_dir)):
if not pristine_tar_build_orig(repo, orig_file, output_dir, options):
- upstream_tree = git_archive_build_orig(repo, spec, output_dir, options)
+ upstream_tree = git_archive_build_orig(repo, spec, output_dir,
+ options)
if options.pristine_tar_commit:
if repo.pristine_tar.has_commit(orig_file):
gbp.log.debug("%s already on pristine tar branch" %
repo.pristine_tar.commit(archive, upstream_tree)
-def makedir(dir):
- """Create directory"""
- try:
- os.mkdir(dir)
- except OSError as msg:
- if msg.errno != errno.EEXIST:
- raise GbpError("Cannot create dir %s" % dir)
- return dir
-
-
def pristine_tar_build_orig(repo, orig_file, output_dir, options):
- """
- build orig using pristine-tar
- @return: True: orig tarball build, False: noop
- """
+ """Build orig using pristine-tar"""
if options.pristine_tar:
if not repo.has_branch(repo.pristine_tar_branch):
gbp.log.warn('Pristine-tar branch "%s" not found' %
raise
return False
-def get_upstream_tree(repo, spec, options):
+
+def get_upstream_tree(repo, version, options):
"""Determine the upstream tree from the given options"""
if options.upstream_tree.upper() == 'TAG':
- tag_str_fields = dict(upstreamversion=spec.upstreamversion, vendor="Upstream")
- upstream_tree = repo.version_to_tag(options.upstream_tag, tag_str_fields)
+ tag_str_fields = {'upstreamversion': version,
+ 'version': version}
+ upstream_tree = repo.version_to_tag(options.upstream_tag,
+ tag_str_fields)
elif options.upstream_tree.upper() == 'BRANCH':
if not repo.has_branch(options.upstream_branch):
raise GbpError("%s is not a valid branch" % options.upstream_branch)
if tree_name == index_name:
# Write a tree of the index
tree = repo.write_tree()
- elif tree_name in wc_names:
+ elif tree_name == wc_name:
# Write a tree of the working copy
- tree = write_wc(repo,
- force=wc_names[tree_name]['force'],
- untracked=wc_names[tree_name]['untracked'])
+ tree = write_wc(repo)
else:
tree = tree_name
except GitRepositoryError as err:
return info
-def guess_export_params(repo, options):
- """Get commit and tree from where to export packaging and patches"""
- tree = None
- branch = None
- if options.export in list(wc_names.keys()) + [index_name, 'HEAD']:
- branch = get_current_branch(repo)
- elif options.export in repo.get_local_branches():
- branch = options.export
- if branch:
- if is_pq_branch(branch, options):
- packaging_branch = pq_branch_base(branch, options)
- if repo.has_branch(packaging_branch):
- gbp.log.info("It seems you're building a development/patch-"
- "queue branch. Export target changed to '%s' and "
- "patch-export enabled!" % packaging_branch)
- options.patch_export = True
- if not options.patch_export_rev:
- options.patch_export_rev = options.export
- options.export = packaging_branch
- else:
- gbp.log.warn("It seems you're building a development/patch-"
- "queue branch. No corresponding packaging branch "
- "found. Build may fail!")
- elif options.patch_export and not options.patch_export_rev:
- tree = get_tree(repo, options.export)
- spec = parse_spec(options, repo, treeish=tree)
- pq_branch = pq_branch_name(branch, options, spec.version)
- if repo.has_branch(pq_branch):
- gbp.log.info("Exporting patches from development/patch-queue "
- "branch '%s'" % pq_branch)
- options.patch_export_rev = pq_branch
- if tree is None:
- tree = get_tree(repo, options.export)
- spec = parse_spec(options, repo, treeish=tree)
-
- # Return tree-ish object and relative spec path for for exporting packaging
- return tree, spec.specpath
-
def git_archive_build_orig(repo, spec, output_dir, options):
"""
Build orig tarball using git-archive
@return: the tree we built the tarball from
@rtype: C{str}
"""
+ comp = None
try:
- upstream_tree = get_upstream_tree(repo, spec, options)
- gbp.log.info("%s does not exist, creating from '%s'" % \
- (spec.orig_src['filename'], upstream_tree))
+ orig_prefix = spec.orig_src['prefix']
+ upstream_tree = get_upstream_tree(repo, spec.upstreamversion, options)
+ gbp.log.info("%s does not exist, creating from '%s'" %
+ (spec.orig_src['filename'], upstream_tree))
if spec.orig_src['compression']:
- gbp.log.debug("Building upstream source archive with compression "\
- "'%s -%s'" % (spec.orig_src['compression'],
- options.comp_level))
- if not git_archive(repo, spec, output_dir, options.tmp_dir,
- upstream_tree, options.orig_prefix,
- options.comp_level, options.with_submodules):
- raise GbpError("Cannot create upstream tarball at '%s'" % \
- output_dir)
- return upstream_tree
- except (GitRepositoryError, GbpError) as err:
- raise GbpAutoGenerateError(str(err))
-
-
-def export_patches(repo, spec, export_treeish, options):
- """
- Generate patches and update spec file
- """
- try:
- upstream_tree = get_upstream_tree(repo, spec, options)
- update_patch_series(repo, spec, upstream_tree, export_treeish, options)
+ comp = Compressor(spec.orig_src['compression'],
+ options.comp_level)
+ gbp.log.debug("Building upstream tarball with compression %s" % comp)
+ if not git_archive(repo, spec, output_dir, upstream_tree,
+ orig_prefix, comp, options.with_submodules):
+ raise GbpError("Cannot create upstream tarball at '%s'" %
+ output_dir)
except (GitRepositoryError, GbpError) as err:
raise GbpAutoGenerateError(str(err))
+ return upstream_tree
def is_native(repo, options):
remote, branch = remote_branch.split('/', 1)
if branch == options.upstream_branch:
gbp.log.debug("Found upstream branch '%s' from remote '%s'" %
- (remote, branch))
+ (remote, branch))
return False
return True
def setup_builder(options, builder_args):
- """setup everything to use git-pbuilder"""
- if options.builder.startswith('rpmbuild'):
+ """Setup args and options for builder script"""
+ if options.builder == 'rpmbuild':
if len(builder_args) == 0:
builder_args.append('-ba')
- builder_args.extend(['--define "_topdir %s"' % os.path.abspath(options.export_dir),
- '--define "_builddir %%_topdir/%s"' % options.build_dir,
- '--define "_rpmdir %%_topdir/%s"' % options.rpm_dir,
- '--define "_sourcedir %%_topdir/%s"' % options.source_dir,
- '--define "_specdir %%_topdir/%s"' % options.spec_dir,
- '--define "_srcrpmdir %%_topdir/%s"' % options.srpm_dir,
- '--define "_buildrootdir %%_topdir/%s"' % options.buildroot_dir])
- elif options.builder.startswith('osc'):
- builder_args.insert(0, 'build')
- options.source_dir = ''
- options.spec_dir = ''
-
-
-def update_tag_str_fields(fields, tag_format_str, repo, commit_info):
- """Update string format fields for packaging tag"""
- fields['nowtime'] = datetime.now().strftime(RpmPkgPolicy.tag_timestamp_format)
-
- fields['authortime'] = datetime.fromtimestamp(int(commit_info['author'].date.split()[0])).strftime(RpmPkgPolicy.tag_timestamp_format)
- fields['committime'] = datetime.fromtimestamp(int(commit_info['committer'].date.split()[0])).strftime(RpmPkgPolicy.tag_timestamp_format)
- fields['version'] = RpmPkgPolicy.compose_full_version(fields)
-
- # Parse tags with incremental numbering
- re_fields = dict(fields,
- nowtimenum=fields['nowtime'] + ".(?P<nownum>[0-9]+)",
- authortimenum=fields['authortime'] + ".(?P<authornum>[0-9]+)",
- committimenum=fields['committime'] + ".(?P<commitnum>[0-9]+)")
- try:
- tag_re = re.compile("^%s$" % (tag_format_str % re_fields))
- except KeyError as err:
- raise GbpError("Unknown field '%s' in packaging-tag format string" % err)
-
- fields['nowtimenum'] = fields['nowtime'] + ".1"
- fields['authortimenum'] = fields['authortime'] + ".1"
- fields['committimenum'] = fields['committime'] + ".1"
- for t in reversed(repo.get_tags()):
- m = tag_re.match(t)
- if m:
- if 'nownum' in m.groupdict():
- fields['nowtimenum'] = "%s.%s" % (fields['nowtime'], int(m.group('nownum'))+1)
- if 'authornum' in m.groupdict():
- fields['authortimenum'] = "%s.%s" % (fields['authortime'], int(m.group('authornum'))+1)
- if 'commitnum' in m.groupdict():
- fields['committimenum'] = "%s.%s" % (fields['committime'], int(m.group('commitnum'))+1)
- break
-
-
-def packaging_tag_name(repo, spec, commit_info, options):
- """Compose packaging tag as string"""
- tag_str_fields = dict(spec.version, vendor=options.vendor)
- update_tag_str_fields(tag_str_fields, options.packaging_tag, repo,
- commit_info)
- return repo.version_to_tag(options.packaging_tag, tag_str_fields)
-
-
-def create_packaging_tag(repo, tag, commit, version, options):
+ builder_args.extend([
+ '--define', "_topdir %s" % os.path.abspath(options.export_dir),
+ '--define', "_specdir %%_topdir/%s" % options.export_specdir,
+ '--define', "_sourcedir %%_topdir/%s" % options.export_sourcedir])
+
+
+def packaging_tag_data(repo, commit, name, version, options):
+ """Compose packaging tag name and msg"""
+ version_dict = dict(version, version=rpm.compose_version_str(version))
+
+ # Compose tag name and message
+ tag_name_fields = dict(version_dict, vendor=options.vendor.lower())
+ tag_name = repo.version_to_tag(options.packaging_tag, tag_name_fields)
+
+ tag_msg = format_str(options.packaging_tag_msg,
+ dict(version_dict, pkg=name,
+ vendor=options.vendor))
+ return (tag_name, tag_msg)
+
+
+def setup_mock(options):
+ """setup everything to use gbp-builder-mock"""
+ if options.use_mock:
+ options.builder = '/usr/share/git-buildpackage/gbp-builder-mock'
+ options.cleaner = '/bin/true'
+ os.environ['GBP_BUILDER_MOCK_DIST'] = options.mock_dist
+ if options.mock_arch:
+ os.environ['GBP_BUILDER_MOCK_ARCH'] = options.mock_arch
+ if options.mock_root:
+ os.environ['GBP_BUILDER_MOCK_ROOT'] = options.mock_root
+ os.environ['GBP_BUILDER_MOCK_EXPORT_DIR'] = options.export_dir
+ if options.mock_options:
+ os.environ['GBP_BUILDER_MOCK_OPTIONS'] = options.mock_options
+
+
+def create_packaging_tag(repo, commit, name, version, options):
"""Create a packaging/release Git tag"""
- msg = "%s release %s" % (options.vendor,
- RpmPkgPolicy.compose_full_version(version))
- repo.create_tag(name=tag, msg=msg, sign=options.sign_tags,
+ tag_name, tag_msg = packaging_tag_data(repo, commit, name, version, options)
+
+ if options.retag and repo.has_tag(tag_name):
+ repo.delete_tag(tag_name)
+ repo.create_tag(name=tag_name, msg=tag_msg, sign=options.sign_tags,
keyid=options.keyid, commit=commit)
+ return tag_name
def disable_hooks(options):
"""Disable all hooks (except for builder)"""
- for hook in ['cleaner', 'postexport', 'prebuild', 'postbuild', 'posttag']:
+ for hook in ['cleaner', 'preexport', 'postexport', 'prebuild', 'postbuild', 'posttag']:
if getattr(options, hook):
gbp.log.info("Disabling '%s' hook" % hook)
setattr(options, hook, '')
-def parse_args(argv, prefix, git_treeish=None):
- """Parse config and command line arguments"""
- args = [ arg for arg in argv[1:] if arg.find('--%s' % prefix) == 0 ]
- builder_args = [ arg for arg in argv[1:] if arg.find('--%s' % prefix) == -1 ]
-
- # We handle these although they don't have a --git- prefix
- for arg in [ "--help", "-h", "--version" ]:
- if arg in builder_args:
- args.append(arg)
-
+def build_parser(name, prefix=None, git_treeish=None):
+ """Construct config/option parser"""
try:
- parser = GbpOptionParserRpm(command=os.path.basename(argv[0]),
- prefix=prefix, git_treeish=git_treeish)
- except configparser.ParsingError as err:
+ parser = GbpOptionParserRpm(command=os.path.basename(name),
+ prefix=prefix)
+ except GbpError as err:
gbp.log.err(err)
- return None, None, None
-
- tag_group = GbpOptionGroup(parser, "tag options", "options related to git tag creation")
- branch_group = GbpOptionGroup(parser, "branch options", "branch layout options")
- cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke external commands and hooks")
- orig_group = GbpOptionGroup(parser, "orig tarball options", "options related to the creation of the orig tarball")
- export_group = GbpOptionGroup(parser, "export build-tree options", "alternative build tree related options")
+ return None
+
+ tag_group = GbpOptionGroup(parser, "tag options",
+ "options related to git tag creation")
+ branch_group = GbpOptionGroup(parser, "branch options",
+ "branch layout options")
+ cmd_group = GbpOptionGroup(parser, "external command options",
+ "how and when to invoke external commands and hooks")
+ orig_group = GbpOptionGroup(parser, "orig tarball options",
+ "options related to the creation of the orig tarball")
+ export_group = GbpOptionGroup(parser, "export build-tree options",
+ "alternative build tree related options")
parser.add_option_group(tag_group)
parser.add_option_group(orig_group)
parser.add_option_group(branch_group)
parser.add_option_group(cmd_group)
parser.add_option_group(export_group)
- parser.add_boolean_config_file_option(option_name = "ignore-untracked", dest="ignore_untracked")
- parser.add_boolean_config_file_option(option_name = "ignore-new", dest="ignore_new")
- parser.add_option("--git-verbose", action="store_true", dest="verbose", default=False,
- help="verbose command execution")
+ parser.add_boolean_config_file_option(option_name="ignore-new",
+ dest="ignore_new")
+ parser.add_option("--git-verbose", action="store_true", dest="verbose",
+ default=False, help="verbose command execution")
parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
- parser.add_config_file_option(option_name="color", dest="color", type='tristate')
+ parser.add_config_file_option(option_name="color", dest="color",
+ type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
- parser.add_config_file_option(option_name="notify", dest="notify", type='tristate')
- parser.add_config_file_option(option_name="vendor", action="store", dest="vendor")
+ parser.add_config_file_option(option_name="notify", dest="notify",
+ type='tristate')
+ parser.add_config_file_option(option_name="vendor", action="store",
+ dest="vendor")
parser.add_config_file_option(option_name="native", dest="native",
type='tristate')
- tag_group.add_option("--git-tag", action="store_true", dest="tag", default=False,
- help="create a tag after a successful build")
- tag_group.add_option("--git-tag-only", action="store_true", dest="tag_only", default=False,
- help="don't build, only tag and run the posttag hook")
- tag_group.add_option("--git-retag", action="store_true", dest="retag", default=False,
- help="don't fail if the tag already exists")
- tag_group.add_boolean_config_file_option(option_name="sign-tags", dest="sign_tags")
+ tag_group.add_option("--git-tag", action="store_true", dest="tag",
+ default=False,
+ help="create a tag after a successful build")
+ tag_group.add_option("--git-tag-only", action="store_true", dest="tag_only",
+ default=False,
+ help="don't build, only tag and run the posttag hook")
+ tag_group.add_option("--git-retag", action="store_true", dest="retag",
+ default=False, help="don't fail if the tag already exists")
+ tag_group.add_boolean_config_file_option(option_name="sign-tags",
+ dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid", dest="keyid")
- tag_group.add_config_file_option(option_name="packaging-tag", dest="packaging_tag")
- tag_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
- orig_group.add_config_file_option(option_name="upstream-tree", dest="upstream_tree")
- orig_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
+ tag_group.add_config_file_option(option_name="packaging-tag",
+ dest="packaging_tag")
+ tag_group.add_config_file_option(option_name="packaging-tag-msg",
+ dest="packaging_tag_msg")
+ tag_group.add_config_file_option(option_name="upstream-tag",
+ dest="upstream_tag")
+ orig_group.add_config_file_option(option_name="upstream-tree",
+ dest="upstream_tree")
+ orig_group.add_boolean_config_file_option(option_name="pristine-tar",
+ dest="pristine_tar")
orig_group.add_boolean_config_file_option(option_name="pristine-tar-commit",
dest="pristine_tar_commit")
- orig_group.add_config_file_option(option_name="force-create", dest="force_create",
- help="force creation of upstream source tarball", action="store_true")
- orig_group.add_config_file_option(option_name="no-create-orig", dest="no_create_orig",
- help="don't create upstream source tarball", action="store_true")
- orig_group.add_config_file_option(option_name="tarball-dir", dest="tarball_dir", type="path",
- help="location to look for external tarballs")
- orig_group.add_config_file_option(option_name="compression-level", dest="comp_level",
- help="Compression level, default is '%(compression-level)s'")
- orig_group.add_config_file_option(option_name="orig-prefix", dest="orig_prefix")
- branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
- branch_group.add_config_file_option(option_name="packaging-branch", dest="packaging_branch")
- branch_group.add_config_file_option(option_name="pq-branch", dest="pq_branch")
- branch_group.add_boolean_config_file_option(option_name = "ignore-branch", dest="ignore_branch")
- branch_group.add_boolean_config_file_option(option_name = "submodules", dest="with_submodules")
+ orig_group.add_config_file_option(option_name="force-create",
+ dest="force_create", action="store_true",
+ help="force creation of upstream source tarball")
+ orig_group.add_config_file_option(option_name="no-create-orig",
+ dest="no_create_orig", action="store_true",
+ help="don't create upstream source tarball")
+ orig_group.add_config_file_option(option_name="tarball-dir",
+ dest="tarball_dir", type="path",
+ help="location to look for external tarballs")
+ orig_group.add_config_file_option(option_name="compression-level",
+ dest="comp_level",
+ help="Compression level, default is "
+ "'%(compression-level)s'")
+ branch_group.add_config_file_option(option_name="upstream-branch",
+ dest="upstream_branch")
+ branch_group.add_config_file_option(option_name="packaging-branch",
+ dest="packaging_branch")
+ branch_group.add_boolean_config_file_option(option_name="ignore-branch",
+ dest="ignore_branch")
+ branch_group.add_boolean_config_file_option(option_name="submodules",
+ dest="with_submodules")
cmd_group.add_config_file_option(option_name="builder", dest="builder",
- help="command to build the package, default is '%(builder)s'")
+ help="command to build the package, default is "
+ "'%(builder)s'")
cmd_group.add_config_file_option(option_name="cleaner", dest="cleaner",
- help="command to clean the working copy, default is '%(cleaner)s'")
+ help="command to clean the working copy, default is "
+ "'%(cleaner)s'")
cmd_group.add_config_file_option(option_name="prebuild", dest="prebuild",
- help="command to run before a build, default is '%(prebuild)s'")
- cmd_group.add_config_file_option(option_name="postexport", dest="postexport",
- help="command to run after exporting the source tree, default is '%(postexport)s'")
+ help="command to run before a build, default is "
+ "'%(prebuild)s'")
+ cmd_group.add_config_file_option(option_name="preexport",
+ dest="preexport",
+ help="command to run before exporting the source tree, "
+ "default is '%(preexport)s'")
+ cmd_group.add_config_file_option(option_name="postexport",
+ dest="postexport",
+ help="command to run after exporting the source tree, "
+ "default is '%(postexport)s'")
cmd_group.add_config_file_option(option_name="postbuild", dest="postbuild",
- help="hook run after a successful build, default is '%(postbuild)s'")
+ help="hook run after a successful build, default is "
+ "'%(postbuild)s'")
cmd_group.add_config_file_option(option_name="posttag", dest="posttag",
- help="hook run after a successful tag operation, default is '%(posttag)s'")
+ help="hook run after a successful tag operation, default "
+ "is '%(posttag)s'")
+ cmd_group.add_boolean_config_file_option(option_name="mock", dest="use_mock")
+ cmd_group.add_config_file_option(option_name="dist", dest="mock_dist")
+ cmd_group.add_config_file_option(option_name="arch", dest="mock_arch")
+ cmd_group.add_config_file_option(option_name="mock-root", dest="mock_root")
+ cmd_group.add_config_file_option(option_name="mock-options", dest="mock_options")
cmd_group.add_boolean_config_file_option(option_name="hooks", dest="hooks")
export_group.add_option("--git-no-build", action="store_true",
- dest="no_build",
- help="Don't run builder or the associated hooks")
- export_group.add_config_file_option(option_name="export-dir", dest="export_dir", type="path",
- help="Build topdir, also export the sources under EXPORT_DIR, default is '%(export-dir)s'")
- export_group.add_config_file_option(option_name="rpmbuild-builddir", dest="build_dir", type="path",
- help="subdir where package is built (under EXPORT_DIR), i.e. rpmbuild builddir, default is '%(rpmbuild-builddir)s'")
- export_group.add_config_file_option(option_name="rpmbuild-rpmdir", dest="rpm_dir", type="path",
- help="subdir where ready binary packages are stored (under EXPORT_DIR), i.e. rpmbuild builddir, default is '%(rpmbuild-rpmdir)s'")
- export_group.add_config_file_option(option_name="rpmbuild-sourcedir", dest="source_dir", type="path",
- help="subdir where package sources are stored (under EXPORT_DIR), i.e. rpmbuild sourcedir, default is '%(rpmbuild-sourcedir)s'")
- export_group.add_config_file_option(option_name="rpmbuild-specdir", dest="spec_dir", type="path",
- help="subdir where package spec file is stored (under EXPORT_DIR), i.e. rpmbuild specdir, default is '%(rpmbuild-specdir)s'")
- export_group.add_config_file_option(option_name="rpmbuild-srpmdir", dest="srpm_dir", type="path",
- help="subdir where ready sources package is stored (under EXPORT_DIR), i.e. rpmbuild srpmdir, default is '%(rpmbuild-srpmdir)s'")
- export_group.add_config_file_option(option_name="rpmbuild-buildrootdir", dest="buildroot_dir", type="path",
- help="subdir for build-time alternative root (under EXPORT_DIR), i.e. rpmbuild buildrootdir, default is '%(rpmbuild-buildrootdir)s'")
+ dest="no_build",
+ help="Don't run builder or the associated hooks")
+ export_group.add_config_file_option(option_name="export-dir",
+ dest="export_dir", type="path",
+ help="Build topdir, also export the sources under "
+ "EXPORT_DIR, default is '%(export-dir)s'")
+ export_group.add_config_file_option(option_name="export-specdir",
+ dest="export_specdir", type="path")
+ export_group.add_config_file_option(option_name="export-sourcedir",
+ dest="export_sourcedir", type="path")
export_group.add_config_file_option("export", dest="export",
- help="export treeish object TREEISH, default is '%(export)s'", metavar="TREEISH")
+ metavar="TREEISH",
+ help="export treeish object TREEISH, default is "
+ "'%(export)s'")
export_group.add_config_file_option(option_name="packaging-dir",
- dest="packaging_dir")
- export_group.add_config_file_option(option_name="spec-file", dest="spec_file")
- export_group.add_option("--git-export-only", action="store_true", dest="export_only", default=False,
- help="only export packaging files, don't build")
- export_group.add_boolean_config_file_option("patch-export", dest="patch_export")
- export_group.add_option("--git-patch-export-rev", dest="patch_export_rev",
- metavar="TREEISH",
- help="[experimental] Export patches from treeish object "
- "TREEISH")
- export_group.add_config_file_option("patch-export-ignore-path",
- dest="patch_export_ignore_path")
- export_group.add_config_file_option("patch-export-compress", dest="patch_export_compress")
- export_group.add_config_file_option("patch-export-squash-until", dest="patch_export_squash_until")
- export_group.add_boolean_config_file_option(option_name="patch-numbers", dest="patch_numbers")
+ dest="packaging_dir")
+ export_group.add_config_file_option(option_name="spec-file",
+ dest="spec_file")
export_group.add_config_file_option("spec-vcs-tag", dest="spec_vcs_tag")
- options, args = parser.parse_args(args)
+ return parser
+
- options.patch_export_compress = rpm.string_to_int(options.patch_export_compress)
+def parse_args(argv, prefix, git_treeish=None):
+ """Parse config and command line arguments"""
+ args = [arg for arg in argv[1:] if arg.find('--%s' % prefix) == 0]
+ builder_args = [arg for arg in argv[1:] if arg.find('--%s' % prefix) == -1]
+
+ # We handle these although they don't have a --git- prefix
+ for arg in ["--help", "-h", "--version"]:
+ if arg in builder_args:
+ args.append(arg)
+
+ parser = build_parser(argv[0], prefix=prefix, git_treeish=git_treeish)
+ if not parser:
+ return None, None, None
+ options, args = parser.parse_args(args)
gbp.log.setup(options.color, options.verbose, options.color_scheme)
if not options.hooks:
disable_hooks(options)
if options.retag:
if not options.tag and not options.tag_only:
- gbp.log.err("'--%sretag' needs either '--%stag' or '--%stag-only'" % (prefix, prefix, prefix))
+ gbp.log.err("'--%sretag' needs either '--%stag' or '--%stag-only'" %
+ (prefix, prefix, prefix))
return None, None, None
- # Use git_treeish as a way to print the warning only on the second parsing
- # round
- if options.export_only and git_treeish:
- gbp.log.warn("Deprecated option '--git-export-only', please use "
- "'--no-build' instead!")
- options.no_build = True
return options, args, builder_args
def main(argv):
- """Entry point for git-buildpackage-rpm"""
+ """Entry point for gbp-buildpackage-rpm"""
retval = 0
prefix = "git-"
spec = None
options, gbp_args, builder_args = parse_args(argv, prefix)
+
if not options:
- return 1
+ return ExitCodes.parse_error
try:
repo = RpmGitRepository(os.path.curdir)
# exported tree-ish
options, gbp_args, builder_args = parse_args(argv, prefix, tree)
- try:
- # Create base temporary directory for this run
- options.tmp_dir = tempfile.mkdtemp(dir=options.tmp_dir,
- prefix='buildpackage-rpm_')
- except GbpError as err:
- gbp.log.err(err)
- return 1
-
branch = get_current_branch(repo)
try:
- tree, relative_spec_path = guess_export_params(repo, options)
+ init_tmpdir(options.tmp_dir, prefix='buildpackage-rpm_')
+
+ tree = get_tree(repo, options.export)
+ spec = parse_spec(options, repo, treeish=tree)
Command(options.cleaner, shell=True)()
if not options.ignore_new:
- (ret, out) = repo.is_clean(options.ignore_untracked)
+ ret, out = repo.is_clean()
if not ret:
gbp.log.err("You have uncommitted changes in your source tree:")
gbp.log.err(out)
- raise GbpError("Use --git-ignore-new or --git-ignore-untracked to ignore.")
+ raise GbpError("Use --git-ignore-new to ignore.")
if not options.ignore_new and not options.ignore_branch:
if branch != options.packaging_branch:
- gbp.log.err("You are not on branch '%s' but on '%s'" % (options.packaging_branch, branch))
- raise GbpError("Use --git-ignore-branch to ignore or --git-packaging-branch to set the branch name.")
+ gbp.log.err("You are not on branch '%s' but on '%s'" %
+ (options.packaging_branch, branch))
+ raise GbpError("Use --git-ignore-branch to ignore or "
+ "--git-packaging-branch to set the branch name.")
# Dump from git to a temporary directory:
- dump_dir = tempfile.mkdtemp(dir=options.tmp_dir,
- prefix='dump_tree_')
- gbp.log.debug("Dumping tree '%s' to '%s'" % (options.export, dump_dir))
- if not dump_tree(repo, dump_dir, tree, options.with_submodules):
+ packaging_tree = '%s:%s' % (tree, options.packaging_dir)
+ dump_dir = tempfile.mkdtemp(prefix='packaging_')
+ gbp.log.debug("Dumping packaging files to '%s'" % dump_dir)
+ if not dump_tree(repo, dump_dir, packaging_tree, False, False):
raise GbpError
- # Parse spec from dump dir to get version etc.
- spec = rpm.SpecFile(os.path.join(dump_dir, relative_spec_path))
+ # Re-parse spec from dump dir to get version etc.
+ spec = rpm.SpecFile(os.path.join(dump_dir, spec.specfile))
if not options.tag_only:
# Setup builder opts
setup_builder(options, builder_args)
-
- # Generate patches, if requested
- if options.patch_export and not is_native(repo, options):
- if options.patch_export_rev:
- patch_tree = get_tree(repo, options.patch_export_rev)
- else:
- patch_tree = tree
- export_patches(repo, spec, patch_tree, options)
+ if options.use_mock:
+ setup_mock(options)
# Prepare final export dirs
export_dir = makedir(options.export_dir)
- source_dir = makedir(os.path.join(export_dir, options.source_dir))
- spec_dir = makedir(os.path.join(export_dir, options.spec_dir))
-
- # Move packaging files
- gbp.log.debug("Exporting packaging files in '%s' to '%s'" % (spec.specdir, export_dir))
- pkgfiles = os.listdir(spec.specdir)
- for f in pkgfiles:
- src = os.path.join(spec.specdir, f)
- if f == spec.specfile:
- dst = os.path.join(spec_dir, f)
- else:
- dst = os.path.join(source_dir, f)
- if not os.path.isdir(src):
- try:
- shutil.copy2(src, dst)
- except IOError as err:
- raise GbpError("Error exporting files: %s" % err)
- spec.specdir = os.path.abspath(spec_dir)
+ source_dir = makedir(os.path.join(export_dir,
+ options.export_sourcedir))
+ spec_dir = makedir(os.path.join(export_dir, options.export_specdir))
- if options.orig_prefix != 'auto':
+ # Run preexport hook
+ if options.preexport:
+ RunAtCommand(options.preexport, shell=True,
+ extra_env={'GBP_GIT_DIR': repo.git_dir,
+ 'GBP_TMP_DIR': export_dir}
+ )()
+
+ # Move packaging files to final export dir
+ gbp.log.debug("Exporting packaging files from '%s' to '%s'" %
+ (dump_dir, export_dir))
+ for fname in os.listdir(dump_dir):
+ src = os.path.join(dump_dir, fname)
+ if fname == spec.specfile:
+ dst = os.path.join(spec_dir, fname)
+ else:
+ dst = os.path.join(source_dir, fname)
try:
- options.orig_prefix %= dict(spec.version,
- version=RpmPkgPolicy.compose_full_version(spec.version),
- name=spec.name, vendor=options.vendor)
- except KeyError as err:
- raise GbpError("Unknown key %s in orig prefix format "
- "string" % err)
- elif spec.orig_src:
- options.orig_prefix = spec.orig_src['prefix']
+ shutil.copy2(src, dst)
+ except IOError as err:
+ raise GbpError("Error exporting packaging files: %s" % err)
+ spec.specdir = os.path.abspath(spec_dir)
# Get/build the orig tarball
if is_native(repo, options):
- if spec.orig_src:
+ if spec.orig_src and not options.no_create_orig:
# Just build source archive from the exported tree
- gbp.log.info("Creating (native) source archive %s from '%s'" % (spec.orig_src['filename'], tree))
+ gbp.log.info("Creating (native) source archive %s from '%s'"
+ % (spec.orig_src['filename'], tree))
+ comp = None
if spec.orig_src['compression']:
- gbp.log.debug("Building source archive with compression '%s -%s'" % (spec.orig_src['compression'], options.comp_level))
- if not git_archive(repo, spec, source_dir, options.tmp_dir,
- tree, options.orig_prefix,
- options.comp_level,
+ comp = Compressor(spec.orig_src['compression'],
+ options.comp_level)
+ gbp.log.debug("Building source archive with "
+ "compression '%s" % comp)
+ orig_prefix = spec.orig_src['prefix']
+ if not git_archive(repo, spec, source_dir, tree,
+ orig_prefix, comp,
options.with_submodules):
raise GbpError("Cannot create source tarball at '%s'" %
- source_dir)
+ source_dir)
# Non-native packages: create orig tarball from upstream
elif spec.orig_src:
- prepare_upstream_tarball(repo, spec, options, source_dir)
+ prepare_upstream_tarball(repo, spec, options, source_dir)
# Run postexport hook
if options.postexport:
RunAtCommand(options.postexport, shell=True,
extra_env={'GBP_GIT_DIR': repo.git_dir,
- 'GBP_TMP_DIR': export_dir})(dir=export_dir)
+ 'GBP_TMP_DIR': export_dir}
+ )(dir=export_dir)
# Do actual build
if not options.no_build and not options.tag_only:
if options.prebuild:
RunAtCommand(options.prebuild, shell=True,
extra_env={'GBP_GIT_DIR': repo.git_dir,
- 'GBP_BUILD_DIR': export_dir})(dir=export_dir)
+ 'GBP_BUILD_DIR': export_dir}
+ )(dir=export_dir)
# Finally build the package:
if options.builder.startswith("rpmbuild"):
spec.specfile))
else:
builder_args.append(spec.specfile)
- RunAtCommand(options.builder, builder_args, shell=True,
- extra_env={'GBP_BUILD_DIR': export_dir})(dir=export_dir)
+ RunAtCommand(options.builder,
+ [pipes.quote(arg) for arg in builder_args],
+ shell=True,
+ extra_env={'GBP_BUILD_DIR': export_dir}
+ )(dir=export_dir)
if options.postbuild:
- changes = os.path.abspath("%s/%s.changes" % (source_dir, spec.name))
+ changes = os.path.abspath("%s/%s.changes" % (source_dir,
+ spec.name))
gbp.log.debug("Looking for changes file %s" % changes)
Command(options.postbuild, shell=True,
extra_env={'GBP_CHANGES_FILE': changes,
# Tag (note: tags the exported version)
if options.tag or options.tag_only:
- gbp.log.info("Tagging %s" % RpmPkgPolicy.compose_full_version(spec.version))
- commit_info = repo.get_commit_info(tree)
- tag = packaging_tag_name(repo, spec, commit_info, options)
- if options.retag and repo.has_tag(tag):
- repo.delete_tag(tag)
- create_packaging_tag(repo, tag, commit=tree, version=spec.version,
- options=options)
+ gbp.log.info("Tagging %s" % rpm.compose_version_str(spec.version))
+ tag = create_packaging_tag(repo, tree, spec.name, spec.version,
+ options)
vcs_info = get_vcs_info(repo, tag)
if options.posttag:
sha = repo.rev_parse("%s^{}" % tag)
'GBP_SHA1': sha})()
else:
vcs_info = get_vcs_info(repo, tree)
+
# Put 'VCS:' tag to .spec
- try:
- spec.set_tag('VCS', None, options.spec_vcs_tag % vcs_info)
- except KeyError as err:
- raise GbpError("Unknown key %s in vcs tag format string" % err)
+ spec.set_tag('VCS', None, format_str(options.spec_vcs_tag, vcs_info))
spec.write_spec_file()
-
+ except KeyboardInterrupt:
+ retval = 1
+ gbp.log.err("Interrupted. Aborting.")
except CommandExecFailed:
retval = 1
except GitRepositoryError as err:
retval = 1
finally:
drop_index(repo)
- shutil.rmtree(options.tmp_dir)
+ del_tmpdir()
if not options.tag_only:
- if spec and options.notify:
+ if spec:
summary = "Gbp-rpm %s" % ["failed", "successful"][not retval]
- pkg_evr = {'upstreamversion': spec.version}
message = ("Build of %s %s %s" % (spec.name,
- RpmPkgPolicy.compose_full_version(spec.version),
- ["failed", "succeeded"][not retval]))
+ rpm.compose_version_str(spec.version),
+ ["failed", "succeeded"][not retval]))
if not gbp.notifications.notify(summary, message, options.notify):
gbp.log.err("Failed to send notification")
retval = 1
return retval
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
-
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
-# (C) 2009,2010 Guido Guenther <agx@sigxcpu.org>
+# (C) 2009, 2010, 2015, 2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
# inspired by dom-git-checkout
#
-"""Clone a GIT repository and set it up for gbp"""
+"""Clone a Git repository and set it up for gbp"""
-import configparser
+import re
import sys
-import os, os.path
+import os
+import yaml
from gbp.config import (GbpOptionParser, GbpOptionGroup)
-from gbp.git import GitRepositoryError
+from gbp.deb.git import DebianGitRepository
+from gbp.git import (GitRepository, GitRepositoryError)
from gbp.errors import GbpError
+from gbp.scripts.common import ExitCodes
+from gbp.scripts.common import repo_setup
+from gbp.scripts.common.hook import Hook
+from gbp.command_wrappers import Command, CommandExecFailed
+from gbp.deb import DpkgCompareVersions
import gbp.log
-try:
- from gbp.deb.git import DebianGitRepository as GitRepository
-except ImportError:
- from gbp.rpm.git import RpmGitRepository as GitRepository
+
+from functools import cmp_to_key
+
+
+def apt_showsrc(pkg):
+ try:
+ aptsrc = Command("apt-cache", ["showsrc", pkg], capture_stdout=True)
+ aptsrc(quiet=True)
+ return aptsrc.stdout
+ except CommandExecFailed:
+ return ''
+
+
+def vcs_git_url(pkg):
+ repos = {}
+
+ out = apt_showsrc(pkg)
+ vcs_re = re.compile(r'(x-)?vcs-git:\s*(?P<repo>[^ ]+)$', re.I)
+ version_re = re.compile(r'Version:\s*(?P<version>.*)$', re.I)
+ end_re = re.compile(r'\s*$')
+
+ version = repo = None
+ for line in out.split('\n'):
+ m = vcs_re.match(line)
+ if m:
+ repo = m.group('repo')
+ continue
+ m = version_re.match(line)
+ if m:
+ version = m.group('version')
+ continue
+ m = end_re.match(line)
+ if m:
+ if version and repo:
+ repos[version] = repo
+ version = repo = None
+
+ if not repos:
+ gbp.log.err("Can't find any vcs-git URL for '%s'" % pkg)
+ return None
+
+ s = sorted(repos, key=cmp_to_key(DpkgCompareVersions()))
+ return repos[s[-1]]
+
+
+def repo_to_url(repo):
+ """
+ >>> repo_to_url("https://foo.example.com")
+ 'https://foo.example.com'
+ >>> repo_to_url("salsa:agx/git-buildpackage")
+ 'https://salsa.debian.org/agx/git-buildpackage.git'
+ >>> repo_to_url("github:agx/git-buildpackage")
+ 'https://github.com/agx/git-buildpackage.git'
+ """
+ parts = repo.split(":", 1)
+ if len(parts) != 2:
+ return repo
+ else:
+ proto, path = parts
+
+ if proto == 'salsa':
+ return 'https://salsa.debian.org/%s.git' % path
+ if proto == 'github':
+ return 'https://github.com/%s.git' % path
+ elif proto in ['vcsgit', 'vcs-git']:
+ return vcs_git_url(path)
+ else:
+ return repo
+
+
+def add_upstream_vcs(repo):
+ upstream_info = os.path.join('debian', 'upstream', 'metadata')
+ if not os.path.exists(upstream_info):
+ gbp.log.warn("No upstream metadata, can't track upstream repo")
+ return
+
+ with open(upstream_info) as f:
+ metadata = yaml.safe_load(f)
+ url = metadata.get('Repository', None)
+
+ if url is None:
+ gbp.log.warn("No repository in metadata, can't track upstream repo")
+ return
+
+ gbp.log.info(f"Adding upstream vcs at {url} as additional remote")
+ repo.add_remote_repo('upstreamvcs', url, fetch=True)
def build_parser(name):
try:
parser = GbpOptionParser(command=os.path.basename(name), prefix='',
usage='%prog [options] repository - clone a remote repository')
- except configparser.ParsingError as err:
+ except GbpError as err:
gbp.log.err(err)
return None
branch_group = GbpOptionGroup(parser, "branch options", "branch tracking and layout options")
+ cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke hooks")
+ uvcs_group = GbpOptionGroup(parser, "upstream vcs options", "upstream vcs options")
parser.add_option_group(branch_group)
+ parser.add_option_group(cmd_group)
+ parser.add_option_group(uvcs_group)
branch_group.add_option("--all", action="store_true", dest="all", default=False,
help="track all branches, not only debian and upstream")
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
- branch_group.add_config_file_option(option_name="debian-branch", dest="packaging_branch")
- branch_group.add_config_file_option(option_name="packaging-branch", dest="packaging_branch")
+ branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
branch_group.add_option("--depth", action="store", dest="depth", default=0,
help="git history depth (for creating shallow clones)")
+ branch_group.add_option("--reference", action="store", dest="reference", default=None,
+ help="git reference repository (use local copies where possible)")
+ cmd_group.add_config_file_option(option_name="postclone", dest="postclone",
+ help="hook to run after cloning the source tree, "
+ "default is '%(postclone)s'")
+ cmd_group.add_boolean_config_file_option(option_name="hooks", dest="hooks")
+
+ uvcs_group.add_boolean_config_file_option(option_name="add-upstream-vcs", dest='add_upstream_vcs')
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
+ parser.add_config_file_option(option_name="repo-user", dest="repo_user",
+ choices=['DEBIAN', 'GIT'])
+ parser.add_config_file_option(option_name="repo-email", dest="repo_email",
+ choices=['DEBIAN', 'GIT'])
+ parser.add_config_file_option(option_name="defuse-gitattributes", dest="defuse_gitattributes",
+ type="tristate", help="disable harmful Git attributes")
+ parser.add_boolean_config_file_option(option_name="aliases", dest="aliases")
return parser
-def parse_args (argv):
+def parse_args(argv):
parser = build_parser(argv[0])
if not parser:
return None, None
(options, args) = parse_args(argv)
if not options:
- return 1
+ return ExitCodes.parse_error
if len(args) < 2:
gbp.log.err("Need a repository to clone.")
return 1
else:
- source = args[1]
+ remote_repo = args[1]
+ source = repo_to_url(remote_repo) if options.aliases else remote_repo
+ if not source:
+ return 1
clone_to, auto_name = (os.path.curdir, True) if len(args) < 3 else (args[2], False)
try:
pass
try:
- repo = GitRepository.clone(clone_to, source, options.depth,
- auto_name=auto_name)
+ gbp.log.info("Cloning from '%s'%s" % (source, " into '%s'" % clone_to if not auto_name else ''))
+ repo = DebianGitRepository.clone(clone_to, source, options.depth,
+ auto_name=auto_name, reference=options.reference)
os.chdir(repo.path)
# Reparse the config files of the cloned repository so we pick up the
- # branch information from there:
+ # branch information from there but don't overwrite hooks:
+ postclone = options.postclone
(options, args) = parse_args(argv)
# Track all branches:
remotes = repo.get_remote_branches()
for remote in remotes:
local = remote.replace("origin/", "", 1)
- if not repo.has_branch(local) and \
- local != "HEAD":
- repo.create_branch(local, remote)
- else: # only track gbp's default branches
- branches = [ options.packaging_branch, options.upstream_branch ]
+ if (not repo.has_branch(local) and
+ local != "HEAD"):
+ repo.create_branch(local, remote)
+ else: # only track gbp's default branches
+ branches = [options.debian_branch, options.upstream_branch]
if options.pristine_tar:
- branches += [ repo.pristine_tar_branch ]
+ branches += [repo.pristine_tar_branch]
gbp.log.debug('Will track branches: %s' % branches)
for branch in branches:
remote = 'origin/%s' % branch
- if repo.has_branch(remote, remote=True) and \
- not repo.has_branch(branch):
- repo.create_branch(branch, remote)
+ if (repo.has_branch(remote, remote=True) and
+ not repo.has_branch(branch)):
+ repo.create_branch(branch, remote)
+
+ if repo.has_branch(options.debian_branch, remote=True):
+ repo.set_branch(options.debian_branch)
+
+ repo_setup.set_user_name_and_email(options.repo_user, options.repo_email, repo)
+ if not options.defuse_gitattributes.is_off():
+ if options.defuse_gitattributes.is_on() or not repo_setup.check_gitattributes(repo, 'HEAD'):
+ repo_setup.setup_gitattributes(repo)
- repo.set_branch(options.packaging_branch)
+ if options.add_upstream_vcs:
+ add_upstream_vcs(repo)
+ if postclone:
+ Hook('Postclone', options.postclone,
+ extra_env={'GBP_GIT_DIR': repo.git_dir},
+ )()
+
+ except KeyboardInterrupt:
+ retval = 1
+ gbp.log.err("Interrupted. Aborting.")
except GitRepositoryError as err:
gbp.log.err("Git command failed: %s" % err)
retval = 1
except GbpError as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
retval = 1
return retval
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2009,2010 Guido Guenther <agx@sigxcpu.org>
-# (C) 2014 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# inspired by dom-git-checkout
-#
-"""Clone a package Git repository from a bitbake-based distro"""
-
-import configparser
-import re
-import sys
-import os, os.path
-
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
-from gbp.git import GitRepositoryError
-from gbp.errors import GbpError
-import gbp.log
-from gbp.rpm.git import RpmGitRepository as GitRepository
-from gbp.bb import bb, init_tinfoil, guess_pkg
-
-def guess_remote(tinfoil, source):
- """Guess the remote repository URL"""
- # Try to determine if a remote URL is referenced
- if re.match(r'[a-z]{3,5}://', source) or re.match(r'\S+@\S+', source):
- return source, None
-
- # Get remote repo from recipe
- recipe = guess_pkg(tinfoil, source)
- appends = tinfoil.cooker.collection.get_file_appends(recipe)
- gbp.log.info("Using %s with appends %s" % (recipe, appends))
- pkg_data = bb.cache.Cache.loadDataFull(recipe, appends, tinfoil.config_data)
- uri = pkg_data.getVar('GBP_PACKAGING_REPO', True)
- if not uri:
- raise GbpError("GBP_PACKAGING_REPO not defined in recipe. Unable to "
- "determine remote repo")
- rev = pkg_data.getVar('GBP_PACKAGING_REV', True)
- return uri, rev
-
-
-def build_parser(name):
- """Create command line argument parser"""
- try:
- parser = GbpOptionParser(command=os.path.basename(name), prefix='',
- usage='%prog [options] repository - clone a '
- 'remote per-package repository')
- except configparser.ParsingError as err:
- gbp.log.err(err)
- return None
-
- branch_group = GbpOptionGroup(parser, "branch options",
- "branch tracking and layout options")
- parser.add_option_group(branch_group)
-
- branch_group.add_option("--all", action="store_true", dest="all",
- help="track all branches, not only packaging and upstream")
- branch_group.add_config_file_option(option_name="upstream-branch",
- dest="upstream_branch")
- branch_group.add_config_file_option(option_name="packaging-branch",
- dest="packaging_branch")
- branch_group.add_option("--depth", action="store", dest="depth", default=0,
- help="git history depth (for creating shallow clones)")
-
- parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
- help="verbose command execution")
- parser.add_config_file_option(option_name="color", dest="color",
- type='tristate')
- parser.add_config_file_option(option_name="color-scheme",
- dest="color_scheme")
- return parser
-
-
-def parse_args (argv):
- """Parse command line arguments"""
- parser = build_parser(argv[0])
- if not parser:
- return None, None
-
- (options, args) = parser.parse_args(argv)
- gbp.log.setup(options.color, options.verbose, options.color_scheme)
- return (options, args)
-
-
-def main(argv):
- """Entry point for gbp-clone-bb"""
- retval = 0
-
- if not bb:
- return 1
-
- (options, args) = parse_args(argv)
- if not options:
- return 1
-
- if len(args) < 2:
- gbp.log.err("Need a package or repository to clone.")
- return 1
-
- # Determine target dir
- clone_to = os.path.curdir
- auto_name = False
- if len(args) < 3:
- if 'BUILDDIR' in os.environ:
- clone_to = os.path.join(os.environ['BUILDDIR'], 'devel')
- auto_name = True
- else:
- clone_to = args[2]
-
- try:
- tinfoil = init_tinfoil()
-
- source, revision = guess_remote(tinfoil, args[1])
-
- gbp.log.info("Cloning from %s..." % source)
- repo = GitRepository.clone(clone_to, source, options.depth,
- auto_name=auto_name)
- os.chdir(repo.path)
-
- # Reparse the config files of the cloned repository so we pick up the
- # branch information from there:
- (options, args) = parse_args(argv)
-
- # Track all branches:
- if options.all:
- remotes = repo.get_remote_branches()
- for remote in remotes:
- local = remote.replace("origin/", "", 1)
- if not repo.has_branch(local) and local != "HEAD":
- repo.create_branch(local, remote)
- else: # only track gbp's default branches
- branches = [ options.packaging_branch, options.upstream_branch ]
- gbp.log.debug('Will track branches: %s' % branches)
- for branch in branches:
- remote = 'origin/%s' % branch
- if repo.has_branch(remote, remote=True) and \
- not repo.has_branch(branch):
- repo.create_branch(branch, remote)
-
- gbp.log.info("Successfully cloned into %s" % clone_to)
- if (revision and repo.rev_parse('HEAD') !=
- repo.rev_parse('%s^0' % revision)):
- gbp.log.info("Checking out revision %s" % revision)
- repo.set_branch(revision)
-
- except GitRepositoryError as err:
- gbp.log.err("Git command failed: %s" % err)
- retval = 1
- except GbpError as err:
- if len(err.__str__()):
- gbp.log.err(err)
- retval = 1
-
- return retval
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
-
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Parts shared between the deb and rpm commands"""
+
+import re
+import os
+import traceback
+from gbp.errors import GbpError
+from gbp.deb import DebianPkgPolicy
+from gbp.pkg import Archive
+from gbp.deb.upstreamsource import DebianAdditionalTarball
+
+
+class ExitCodes(object):
+ ok = 0,
+ failed = 1 # All other errors
+ no_value = 2 # Value does not exist (gbp config only)
+ parse_error = 3 # Failed to parse configuration file
+ uscan_up_to_date = 4 # Uscan up to date (import-orig only)
+
+
+def maybe_debug_raise():
+ if 'raise' in os.getenv("GBP_DEBUG", '').split(','):
+ raise
+
+
+def is_download(args):
+ """
+ >>> is_download(["http://foo.example.com"])
+ True
+ >>> is_download([])
+ False
+ >>> is_download(["foo-1.1.orig.tar.gz"])
+ False
+ """
+ if args and re.match("https?://", args[0]):
+ return True
+ return False
+
+
+# FIXME: this could become a method of DebianUpstreamSource
+def get_component_tarballs(name, version, tarball, components):
+ """
+ Figure out the paths to the component tarballs based on the main
+ tarball.
+ """
+ tarballs = []
+ (_, _, comp_type) = Archive.parse_filename(tarball)
+ for component in components:
+ cname = DebianPkgPolicy.build_tarball_name(name,
+ version,
+ comp_type,
+ os.path.dirname(tarball),
+ component)
+ sig = cname + '.asc'
+ if not os.path.exists(sig):
+ sig = None
+ tarballs.append(DebianAdditionalTarball(cname, component, sig=sig))
+ if not os.path.exists(cname):
+ raise GbpError("Cannot find component tarball %s" % cname)
+ return tarballs
+
+
+def debug_exc(options):
+ if options.verbose:
+ traceback.print_exc()
# vim: set fileencoding=utf-8 :
#
-# (C) 2006-2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006-2011, 2016 Guido Günther <agx@sigxcpu.org>
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
"""Common functionality for Debian and RPM buildpackage scripts"""
-import os, os.path
-import subprocess
-import shutil
-
-import gbp.tmpfile as tempfile
-from gbp.command_wrappers import (CatenateTarArchive, CatenateZipArchive)
-from gbp.git.repository import GitRepository, GitRepositoryError
+import os
+import os.path
+import pipes
+from gbp.git import GitRepositoryError
+from gbp.pkg.git import PkgGitRepository
from gbp.errors import GbpError
import gbp.log
# when we want to reference the index in a treeish context we call it:
index_name = "INDEX"
# when we want to reference the working copy in treeish context we call it:
-wc_names = {'WC': {'force': True, 'untracked': True},
- 'WC.TRACKED': {'force': False, 'untracked': False},
- 'WC.UNTRACKED': {'force': False, 'untracked': True},
- 'WC.IGNORED': {'force': True, 'untracked': True}}
-
-
-def sanitize_prefix(prefix):
- """
- Sanitize the prefix used for generating source archives
-
- >>> sanitize_prefix('')
- '/'
- >>> sanitize_prefix('foo/')
- 'foo/'
- >>> sanitize_prefix('/foo/bar')
- 'foo/bar/'
- """
- if prefix:
- return prefix.strip('/') + '/'
- return '/'
-
-
-def compress(cmd, options, output, input_data=None):
- """
- Filter data through a compressor cmd.
-
- For better performance input_data should feed data in bigger chunks.
- """
- stdin = subprocess.PIPE if input_data else None
- try:
- with open(output, 'w') as fobj:
- popen = subprocess.Popen([cmd] + options, stdin=stdin, stdout=fobj)
- if stdin:
- for chunk in input_data:
- popen.stdin.write(chunk)
- popen.stdin.close()
- if popen.wait():
- raise GbpError("Error creating %s: running '%s' failed" %
- (output, ' '.join([cmd] + options)))
- except (OSError, IOError) as err:
- raise GbpError("Error creating %s: %s" % (output, err))
-
-def git_archive_submodules(repo, treeish, output, tmpdir_base, prefix,
- comp_type, comp_level, comp_opts, format='tar'):
- """
- Create a source tree archive with submodules.
-
- Since git-archive always writes an end of tarfile trailer we concatenate
- the generated archives using tar and compress the result.
-
- Exception handling is left to the caller.
- """
- prefix = sanitize_prefix(prefix)
- tempdir = tempfile.mkdtemp(dir=tmpdir_base, prefix='git-archive_')
- main_archive = os.path.join(tempdir, "main.%s" % format)
- submodule_archive = os.path.join(tempdir, "submodule.%s" % format)
- try:
- # generate main (tmp) archive
- repo.archive(format=format, prefix=prefix,
- output=main_archive, treeish=treeish)
-
- # generate each submodule's arhive and append it to the main archive
- for (subdir, commit) in repo.get_submodules(treeish):
- tarpath = [subdir, subdir[2:]][subdir.startswith("./")]
- subrepo = GitRepository(os.path.join(repo.path, subdir))
+wc_name = "WC"
- gbp.log.debug("Processing submodule %s (%s)" % (subdir, commit[0:8]))
- subrepo.archive(format=format, prefix='%s%s/' % (prefix, tarpath),
- output=submodule_archive, treeish=commit)
- if format == 'tar':
- CatenateTarArchive(main_archive)(submodule_archive)
- elif format == 'zip':
- CatenateZipArchive(main_archive)(submodule_archive)
- # compress the output
- if comp_type:
- compress(comp_type, ['--stdout', '-%s' % comp_level] + comp_opts +
- [main_archive], output)
- else:
- shutil.move(main_archive, output)
- finally:
- shutil.rmtree(tempdir)
-
-
-def git_archive_single(repo, treeish, output, prefix, comp_type, comp_level,
- comp_opts, format='tar'):
- """
- Create an archive without submodules
-
- Exception handling is left to the caller.
- """
- prefix = sanitize_prefix(prefix)
- if comp_type:
- cmd = comp_type
- opts = ['--stdout', '-%s' % comp_level] + comp_opts
- else:
- cmd= 'cat'
- opts = []
- input_data = repo.archive(format, prefix, None, treeish)
- compress(cmd, opts, output, input_data)
-
-def untar_data(outdir, data):
- """Extract tar provided as an iterable"""
- popen = subprocess.Popen(['tar', '-C', outdir, '-x'],
- stdin=subprocess.PIPE)
- for chunk in data:
- popen.stdin.write(chunk)
- popen.stdin.close()
- if popen.wait():
- raise GbpError("Error extracting tar to %s" % outdir)
-
-#{ Functions to handle export-dir
+# Functions to handle export-dir
def dump_tree(repo, export_dir, treeish, with_submodules, recursive=True):
- """Dump a git tree-ish to output_dir"""
- if not os.path.exists(export_dir):
- os.makedirs(export_dir)
+ "dump a tree to output_dir"
+ output_dir = os.path.dirname(export_dir)
+ prefix = PkgGitRepository.sanitize_prefix(os.path.basename(export_dir))
if recursive:
- paths = ''
+ paths = []
else:
- paths = ['%s' % nam.decode() for _mod, typ, _sha, nam in
+ paths = ["'%s'" % nam.decode() for _mod, typ, _sha, nam in
repo.list_tree(treeish) if typ == 'blob']
+ pipe = pipes.Template()
+ pipe.prepend('git archive --format=tar --prefix=%s %s -- %s' %
+ (prefix, treeish, ' '.join(paths)), '.-')
+ pipe.append('tar -C %s -xf -' % output_dir, '-.')
+ top = os.path.abspath(os.path.curdir)
try:
- data = repo.archive('tar', '', None, treeish, paths)
- untar_data(export_dir, data)
- if recursive and with_submodules and repo.has_submodules():
- repo.update_submodules()
+ ret = pipe.copy('', '')
+ if ret:
+ raise GbpError("Error in dump_tree archive pipe")
+
+ if recursive and with_submodules:
+ if repo.has_submodules():
+ repo.update_submodules()
for (subdir, commit) in repo.get_submodules(treeish):
- gbp.log.info("Processing submodule %s (%s)" % (subdir,
- commit[0:8]))
- subrepo = GitRepository(os.path.join(repo.path, subdir))
- prefix = [subdir, subdir[2:]][subdir.startswith("./")] + '/'
- data = subrepo.archive('tar', prefix, None, treeish=commit)
- untar_data(export_dir, data)
- except GitRepositoryError as err:
- gbp.log.err("Git error when dumping tree: %s" % err)
+ gbp.log.info("Processing submodule %s (%s)" % (subdir, commit[0:8]))
+ tarpath = [subdir, subdir[2:]][subdir.startswith("./")]
+ os.chdir(subdir)
+ pipe = pipes.Template()
+ pipe.prepend('git archive --format=tar --prefix=%s%s/ %s' %
+ (prefix, tarpath, commit), '.-')
+ pipe.append('tar -C %s -xf -' % output_dir, '-.')
+ ret = pipe.copy('', '')
+ os.chdir(top)
+ if ret:
+ raise GbpError("Error in dump_tree archive pipe in submodule %s" % subdir)
+ except OSError as err:
+ gbp.log.err("Error dumping tree to %s: %s" % (output_dir, err[0]))
+ return False
+ except (GitRepositoryError, GbpError) as err:
+ gbp.log.err(err)
+ return False
+ except Exception as e:
+ gbp.log.err("Error dumping tree to %s: %s" % (output_dir, e))
return False
+ finally:
+ os.chdir(top)
return True
"""Get path of the temporary index file used for exporting working copy"""
return os.path.join(repo.git_dir, "gbp_index")
-def write_wc(repo, force=True, untracked=True):
+
+def write_wc(repo, force=True):
"""write out the current working copy as a treeish object"""
- clone_index(repo)
- repo.add_files(repo.path, force=force, untracked=untracked, index_file=wc_index(repo))
- tree = repo.write_tree(index_file=wc_index(repo))
+ index_file = wc_index(repo)
+ repo.add_files(repo.path, force=force, index_file=index_file)
+ tree = repo.write_tree(index_file=index_file)
return tree
def drop_index(repo):
"""drop our custom index"""
- if os.path.exists(wc_index(repo)):
- os.unlink(wc_index(repo))
-
-def clone_index(repo):
- """Copy the current index file to our custom index file"""
- indexfn = os.path.join(repo.git_dir, "index")
- if os.path.exists(indexfn):
- shutil.copy2(indexfn, wc_index(repo))
+ index_file = wc_index(repo)
+ if os.path.exists(index_file):
+ os.unlink(index_file)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2016 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+"""Common code for runniing hooks"""
+
+from gbp.command_wrappers import RunAtCommand
+import gbp.log
+
+
+class Hook(RunAtCommand):
+ "A hook run by one of the scripts"
+ def __init__(self, name, cmd, extra_env):
+ RunAtCommand.__init__(self, cmd, shell=True, extra_env=extra_env)
+ self.name = name
+ self.run_error = '%s-hook %s' % (name, self.run_error)
+
+ def __call__(self, *args, **kwargs):
+ gbp.log.info("Running %s hook" % self.name)
+ return RunAtCommand.__call__(self, *args, **kwargs)
+
+ @staticmethod
+ def md(a, b):
+ "Merge two dictionaries a and b into a new one"
+ c = a.copy()
+ c.update(b)
+ return c
# vim: set fileencoding=utf-8 :
#
-# (C) 2006, 2007, 2009, 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006, 2007, 2009, 2011 Guido Günther <agx@sigxcpu.org>
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
"""Common functionality for import-orig scripts"""
+import contextlib
import os
import tempfile
-
import gbp.command_wrappers as gbpc
-from gbp.pkg import parse_archive_filename
import gbp.log
+from gbp.errors import GbpError
+from gbp.deb.upstreamsource import DebianUpstreamSource
+
# Try to import readline, since that will cause raw_input to get fancy
# line editing and history capabilities. However, if readline is not
# available, input() will still work.
try:
- import readline
+ import readline # noqa: F401
except ImportError:
pass
+def orig_needs_repack(upstream_source, options):
+ """
+ Determine if the upstream sources needs to be repacked
+
+ We repack if
+ 1. we want to filter out files via filters or post-unpack script and use
+ pristine tar since we want to make a filtered tarball available to
+ pristine-tar
+ 2. we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
+ and want to use filters
+ 3. we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
+ and want to use pristine-tar
+ 4. we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
+ and want to use a post-unpack script
+ """
+ if ((options.pristine_tar and options.filter_pristine_tar and
+ (options.filters or options.postunpack))):
+ return True
+ elif not upstream_source.is_orig():
+ if len(options.filters):
+ return True
+ elif options.pristine_tar:
+ return True
+ elif options.postunpack:
+ return True
+ return False
+
+
def cleanup_tmp_tree(tree):
"""remove a tree of temporary files"""
try:
gbp.log.err("Removal of tmptree %s failed." % tree)
+def is_link_target(target, link):
+ """does symlink link already point to target?"""
+ if os.path.exists(link):
+ if os.path.samefile(target, link):
+ return True
+ return False
+
+
def ask_package_name(default, name_validator_func, err_msg):
"""
Ask the user for the source package name.
# bit clearer.
gbp.log.warn("\nNot a valid upstream version: '%s'.\n%s" % (version, err_msg))
-def prepare_sources(source, pkg_name, pkg_version, pristine_commit_name,
- filters, filter_pristine, prefix, tmpdir):
- """
- Prepare upstream sources for importing
-
- Unpack, filter and repack sources for importing to git and to pristine-tar.
-
- @param source: original upstream sources
- @type source: C{UpstreamSource}
- @param pkg_name: package name
- @type pkg_name: C{str}
- @param pkg_version: upstream version of the package
- @type pkg_version: C{str}
- @param pristine_commit_name: archive filename to commit to pristine-tar
- @type pristine_commit_name: C{str} or C{None}
- @param filters: filter to exclude files
- @type filters: C{list} of C{str}
- @param filter_pristine: filter pristine-tar, too
- @type filter_pristine: C{bool}
- @param prefix: prefix (i.e. leading directory of files) to use in
- pristine-tar, set to C{None} to not mangle orig archive
- @type prefix: C{str} or C{None}
- @param tmpdir: temporary working dir (cleanup left to caller)
- @type tmpdir: C{str}
- @return: path to prepared source tree and tarball to commit to pristine-tar
- @rtype: C{tuple} of C{str}
- """
- pristine = None
- # Determine parameters for pristine tar
- pristine_filters = filters if filters and filter_pristine else None
- pristine_prefix = None
- if prefix is not None and prefix != 'auto':
- prefix_subst = {'name': pkg_name,
- 'version': pkg_version,
- 'upstreamversion': pkg_version}
- pristine_prefix = prefix % prefix_subst
- # Handle unpacked sources, i.e. importing a directory
- if source.is_dir():
- if pristine_commit_name:
- gbp.log.warn('Preparing unpacked sources for pristine-tar')
- pristine = prepare_pristine_tar(source, pkg_name, pkg_version,
- pristine_commit_name,
- pristine_filters, pristine_prefix,
- tmpdir)
- if filters:
- # Re-use sources packed for pristine-tar, if available
- if pristine:
- packed = pristine
- else:
- packed_fn = tempfile.mkstemp(prefix="packed_", dir=tmpdir,
- suffix='.tar')[1]
- gbp.log.debug("Packing '%s' to '%s'" % (source.path, packed_fn))
- packed = source.pack(packed_fn)
- unpack_dir = tempfile.mkdtemp(prefix='filtered_', dir=tmpdir)
- filtered = packed.unpack(unpack_dir, filters)
- else:
- filtered = source
- # Handle source archives
+
+def repacked_tarball_name(upstream, name, version):
+ if upstream.is_orig():
+ # Repacked orig tarball needs a different name since there's already
+ # one with that name
+ name = os.path.join(
+ os.path.dirname(upstream.path),
+ os.path.basename(upstream.path).replace(".tar", ".gbp.tar"))
else:
- unpack_dir = tempfile.mkdtemp(prefix='filtered_', dir=tmpdir)
- gbp.log.debug("Unpacking '%s' to '%s'" % (source.path, unpack_dir))
- filtered = source.unpack(unpack_dir, filters)
- if pristine_commit_name:
- pristine = prepare_pristine_tar(source, pkg_name, pkg_version,
- pristine_commit_name,
- pristine_filters, pristine_prefix,
- tmpdir)
- pristine_path = pristine.path if pristine else ''
- return (filtered.unpacked, pristine_path)
-
-def prepare_pristine_tar(source, pkg_name, pkg_version, pristine_commit_name,
- filters=None, prefix=None, tmpdir=None):
+ # non tarballs (zips, unpacked dirs) get the canonical name
+ name = os.path.join(
+ os.path.dirname(upstream.path),
+ "%s_%s.orig.tar.gz" % (name, version))
+ return name
+
+
+def repack_upstream(upstream, name, version, tmpdir, filters):
+ """Repack the upstream source tree"""
+ name = repacked_tarball_name(upstream, name, version)
+ repacked = upstream.pack(name, filters)
+ if upstream.is_orig(): # Orig already was a tarball so it was filtered on unpack
+ repacked.unpacked = upstream.unpacked
+ else: # otherwise unpack the generated tarball again to get a filtered tree
+ if tmpdir:
+ cleanup_tmp_tree(tmpdir)
+ tmpdir = tempfile.mkdtemp(dir='../')
+ repacked.unpack(tmpdir, filters)
+ return (repacked, tmpdir)
+
+
+def download_orig(url):
"""
- Prepare the upstream sources for pristine-tar import
-
- @param source: original upstream sources
- @type source: C{UpstreamSource}
- @param pkg_name: package name
- @type pkg_name: C{str}
- @param pkg_version: upstream version of the package
- @type pkg_version: C{str}
- @param pristine_commit_name: archive filename to commit to pristine-tar
- @type pristine_commit_name: C{str} or C{None}
- @param filters: filter to exclude files
- @type filters: C{list} of C{str} or C{None}
- @param prefix: prefix (i.e. leading directory of files) to use in
- pristine-tar, set to C{None} to not mangle orig archive
- @type prefix: C{str} or C{None}
- @param tmpdir: temporary working dir (cleanup left to caller)
- @type tmpdir: C{str}
- @return: prepared source archive
- @rtype: C{UpstreamSource}
+ Download orig tarball from given URL
+ @param url: the download URL
+ @type url: C{str}
+ @returns: The upstream source tarball
+ @rtype: DebianUpstreamSource
+ @raises GbpError: on all errors
"""
- need_repack = False
- if source.is_dir():
- if prefix is None:
- prefix = '%s-%s' % (pkg_name, pkg_version)
- gbp.log.info("Using guessed prefix '%s/' for pristine-tar" % prefix)
- need_repack = True
- else:
- if prefix is not None and prefix == source.prefix:
- prefix = None
- comp = parse_archive_filename(pristine_commit_name)[2]
- if filters or prefix is not None or source.compression != comp:
- if not source.unpacked:
- unpack_dir = tempfile.mkdtemp(prefix='pristine_unpack_',
- dir=tmpdir)
- source.unpack(unpack_dir)
- need_repack = True
- pristine_path = os.path.join(tmpdir, pristine_commit_name)
- if need_repack:
- gbp.log.debug("Packing '%s' from '%s' for pristine-tar" %
- (pristine_path, source.unpacked))
- pristine = source.pack(pristine_path, filters, prefix)
- else:
- # Just create symlink for mangling the pristine tarball name
- os.symlink(source.path, pristine_path)
- pristine = source.__class__(pristine_path)
+ CHUNK_SIZE = 4096
- return pristine
+ try:
+ import requests
+ except ImportError:
+ requests = None
+ if requests is None:
+ raise GbpError("python3-requests not installed")
+ tarball = os.path.basename(url)
+ target = os.path.join('..', tarball)
+
+ if os.path.exists(target):
+ raise GbpError("Failed to download %s: %s already exists" % (url, target))
+
+ try:
+ with contextlib.closing(requests.get(url, verify=True, stream=True)) as r:
+ r.raise_for_status()
+ with open(target, 'wb', CHUNK_SIZE) as target_fd:
+ for d in r.iter_content(CHUNK_SIZE):
+ target_fd.write(d)
+ except Exception as e:
+ if os.path.exists(target):
+ os.unlink(target)
+ raise GbpError("Failed to download %s: %s" % (url, e))
+
+ sig = '{}.asc'.format(target)
+ if os.path.exists(sig):
+ gbp.log.debug("Signature {} found for {}".format(target, sig))
+ else:
+ sig = None
+ return DebianUpstreamSource(target, sig=sig)
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Günther <agx@sigxcpu.org>
+# (C) 2011,2015,2017 Guido Günther <agx@sigxcpu.org>
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
"""Common functionality for Debian and RPM patchqueue management"""
import re
import os
-import subprocess
import datetime
-import pwd
-import socket
import time
from email.message import Message
from email.header import Header
from gbp.errors import GbpError
import gbp.log
-DEFAULT_PQ_BRANCH_NAME = "patch-queue/%(branch)s"
+PQ_BRANCH_PREFIX = "patch-queue/"
-def pq_branch_match(branch, pq_fmt_str):
- """
- Match branch name with pq branch name pattern
-
- >>> pq_branch_match('patch-queue/foo', 'patch-queue/%(br)s').groupdict()
- {'br': 'foo'}
- >>> pq_branch_match('pq/foo/bar', 'pq/%(br)s/baz')
- >>> pq_branch_match('pq/foo/bar', 'pq/%(br)s/bar').groupdict()
- {'br': 'foo'}
- >>> pq_branch_match('foo/bar/1.0/pq', 'foo/%(br)s/%(ver)s/pq').groupdict()
- {'ver': '1.0', 'br': 'bar'}
- """
- pq_re = '^%s$' % re.sub('%\(([a-z_\-]+)\)s', r'(?P<\1>\\S+)', pq_fmt_str)
- return re.match(pq_re, branch)
-
-
-def is_pq_branch(branch, options):
+def is_pq_branch(branch):
"""
is branch a patch-queue branch?
- >>> from optparse import OptionParser
- >>> (opts, args) = OptionParser().parse_args([])
- >>> is_pq_branch("foo", opts)
- False
- >>> is_pq_branch("patch-queue/foo", opts)
- True
- >>> opts.pq_branch = "%(branch)s/development"
- >>> is_pq_branch("foo/development/bar", opts)
- False
- >>> is_pq_branch("bar/foo/development", opts)
- True
- >>> opts.pq_branch = "development"
- >>> is_pq_branch("development", opts)
- True
- >>> opts.pq_branch = "my/%(branch)s/pq"
- >>> is_pq_branch("my/foo/pqb", opts)
+ >>> is_pq_branch("foo")
False
- >>> is_pq_branch("my/foo/pq", opts)
- True
- >>> opts.pq_branch = "my/%(branch)s/%(version)s"
- >>> is_pq_branch("my/foo", opts)
- False
- >>> is_pq_branch("my/foo/1.0", opts)
+ >>> is_pq_branch("patch-queue/foo")
True
"""
- pq_format_str = (options.pq_branch if hasattr(options, 'pq_branch')
- else DEFAULT_PQ_BRANCH_NAME)
- if pq_branch_match(branch, pq_format_str):
- return True
- return False
+ return [False, True][branch.startswith(PQ_BRANCH_PREFIX)]
-def pq_branch_name(branch, options, extra_keys=None):
+def pq_branch_name(branch):
"""
get the patch queue branch corresponding to branch
- >>> from optparse import OptionParser
- >>> (opts, args) = OptionParser().parse_args([])
- >>> pq_branch_name("patch-queue/master", opts)
- >>> pq_branch_name("foo", opts)
+ >>> pq_branch_name("patch-queue/master")
+ 'patch-queue/master'
+ >>> pq_branch_name("foo")
'patch-queue/foo'
- >>> opts.pq_branch = "%(branch)s/development"
- >>> pq_branch_name("foo", opts)
- 'foo/development'
- >>> opts.pq_branch = "development"
- >>> pq_branch_name("foo", opts)
- 'development'
- >>> opts.pq_branch = "pq/%(branch)s/%(ver)s"
- >>> pq_branch_name("foo", opts, {'ver': '1.0'})
- 'pq/foo/1.0'
"""
- pq_format_str = (options.pq_branch if hasattr(options, 'pq_branch')
- else DEFAULT_PQ_BRANCH_NAME)
- format_fields = {'branch': branch}
- if extra_keys:
- format_fields.update(extra_keys)
- if not is_pq_branch(branch, options):
- return pq_format_str % format_fields
+ if not is_pq_branch(branch):
+ return PQ_BRANCH_PREFIX + branch
+ else:
+ return branch
-def pq_branch_base(pq_branch, options):
+def pq_branch_base(branch):
"""
- Get the branch corresponding to the given patch queue branch.
- Returns the packaging/debian branch if pq format string doesn't contain
- '%(branch)s' key.
-
- >>> from optparse import OptionParser
- >>> (opts, args) = OptionParser().parse_args([])
- >>> opts.packaging_branch = "packaging"
- >>> pq_branch_base("patch-queue/master", opts)
+ get the branch corresponding to the given patch queue branch
+
+ >>> pq_branch_base("patch-queue/master")
'master'
- >>> pq_branch_base("foo", opts)
- >>> opts.pq_branch = "my/%(branch)s/development"
- >>> pq_branch_base("foo/development", opts)
- >>> pq_branch_base("my/foo/development/bar", opts)
- >>> pq_branch_base("my/foo/development", opts)
+ >>> pq_branch_base("foo")
'foo'
- >>> opts.pq_branch = "development"
- >>> pq_branch_base("foo/development", opts)
- >>> pq_branch_base("development", opts)
- 'packaging'
"""
- pq_format_str = (options.pq_branch if hasattr(options, 'pq_branch')
- else DEFAULT_PQ_BRANCH_NAME)
- m = pq_branch_match(pq_branch, pq_format_str)
- if m:
- if 'branch' in m.groupdict():
- return m.group('branch')
- return options.packaging_branch
+ if is_pq_branch(branch):
+ return branch[len(PQ_BRANCH_PREFIX):]
+ else:
+ return branch
-def parse_gbp_commands(info, cmd_tag, noarg_cmds, arg_cmds):
- """Parse gbp commands from commit message"""
+def parse_gbp_commands(info, cmd_tag, noarg_cmds, arg_cmds, filter_cmds=None):
+ """
+ Parses gbp commands from commit message. Args with and wthout
+ arguments are supported as is filtering out of commands from the
+ commit body.
+
+ @param info: the commit into to parse for commands
+ @param cmd_tag: the command tag
+ @param noarg_cmds: commands without an argument
+ @type noarg_cmds: C{list} of C{str}
+ @param arg_cmds: command with an argumnt
+ @type arg_cmds: C{list} of C{str}
+ @param filter_cmds: commands to filter out of the passed in info
+ @type filter_cmds: C{list} of C{str}
+ @returns: the parsed commands and the filtered commit body.
+ """
+ body = []
cmd_re = re.compile(r'^%s:\s*(?P<cmd>[a-z-]+)(\s+(?P<args>\S.*))?' %
cmd_tag, flags=re.I)
commands = {}
- other_lines = []
for line in info['body'].splitlines():
match = re.match(cmd_re, line)
if match:
else:
gbp.log.warn("Ignoring unknown gbp-command '%s' in commit %s"
% (line, info['id']))
+ if filter_cmds is None or cmd not in filter_cmds:
+ body.append(line)
else:
- other_lines.append(line)
- return commands, other_lines
+ body.append(line)
+ msg = '\n'.join(body)
+ return (commands, msg)
def patch_path_filter(file_status, exclude_regex=None):
"""
if exclude_regex:
include_paths = []
- for file_list in list(file_status.values()):
+ for file_list in file_status.values():
for fname in file_list:
if not re.match(exclude_regex, fname):
include_paths.append(fname)
name = commit_info['author']['name']
email = commit_info['author']['email']
# Git compat: put name in quotes if special characters found
- if re.search("[,.@()\[\]\\\:;]", name):
+ if re.search(r'[,.@()\[\]\\\:;]', name):
name = '"%s"' % name
from_header = Header(header_name='from')
try:
body = commit_info['body'].rstrip() + '\n'
try:
msg.set_payload(body.encode('us-ascii'))
- except UnicodeEncodeError:
+ except (UnicodeEncodeError):
msg.set_payload(body, charset)
policy = Compat32(max_line_length=77)
patch.write(msg.as_bytes(unixfrom=False, policy=policy))
+
# Write diff
patch.write(b'---\n')
patch.write(diff)
return filename
-def format_patch(outdir, repo, commit_info, series, numbered=True,
- path_exclude_regex=None, topic=''):
+DEFAULT_PATCH_NUM_PREFIX_FORMAT = "%04d-"
+
+
+def format_patch(outdir, repo, commit_info, series, abbrev, numbered=True,
+ path_exclude_regex=None, topic='', name=None, renumber=False,
+ patch_num_prefix_format=DEFAULT_PATCH_NUM_PREFIX_FORMAT):
"""Create patch of a single commit"""
# Determine filename and path
outdir = os.path.join(outdir, topic)
if not os.path.exists(outdir):
os.makedirs(outdir)
- num_prefix = '%04d-' % (len(series) + 1)
- suffix = '.patch'
- base_maxlen = 63 - len(num_prefix) - len(suffix)
- base = commit_info['patchname'][:base_maxlen]
- filename = (num_prefix if numbered else '') + base + suffix
+
+ try:
+ num_prefix = str(patch_num_prefix_format) % (len(series) + 1) \
+ if numbered else ''
+ except Exception:
+ gbp.log.warn("Bad format format string '%s', "
+ "falling back to default '%s'" %
+ (str(patch_num_prefix_format),
+ DEFAULT_PATCH_NUM_PREFIX_FORMAT))
+ num_prefix = DEFAULT_PATCH_NUM_PREFIX_FORMAT % (len(series) + 1)
+
+ if name is not None:
+ if renumber:
+ # Remove any existing numeric prefix if the patch
+ # should be renumbered
+ name = re.sub(r'^\d+[-_]*', '', name)
+ else:
+ # Otherwise, clear proposed prefix
+ num_prefix = ''
+ (base, suffix) = os.path.splitext(name)
+ else:
+ suffix = '.patch'
+ base_maxlen = 63 - len(num_prefix) - len(suffix)
+ base = commit_info['patchname'][:base_maxlen]
+
+ filename = num_prefix + base + suffix
filepath = os.path.join(outdir, filename)
# Make sure that we don't overwrite existing patches in the series
if filepath in series:
- presuffix = '-%d' % len(series)
- base = base[:base_maxlen-len(presuffix)] + presuffix
- filename = (num_prefix if numbered else '') + base + suffix
+ presuffix = '-%d' % len([p for p in series
+ if p.startswith(os.path.splitext(filepath)[0])])
+ filename = num_prefix + base + presuffix + suffix
filepath = os.path.join(outdir, filename)
# Determine files to include
patch = None
if paths:
diff = repo.diff('%s^!' % commit_info['id'], paths=paths, stat=80,
- summary=True, text=True)
+ summary=True, text=True, abbrev=abbrev, renames=False)
patch = write_patch_file(filepath, commit_info, diff)
if patch:
series.append(patch)
return patch
-def format_diff(outdir, filename, repo, start, end, path_exclude_regex=None):
+def format_diff(outdir, filename, repo, start, end, abbrev, path_exclude_regex=None):
"""Create a patch of diff between two repository objects"""
- info = {'author': get_author(repo)}
+ info = {'author': repo.get_author_info()}
now = datetime.datetime.now().replace(tzinfo=GitTz(-time.timezone))
info['author'].set_date(now)
info['subject'] = "Raw diff %s..%s" % (start, end)
paths = patch_path_filter(file_status, path_exclude_regex)
if paths:
diff = repo.diff(start, end, paths=paths, stat=80, summary=True,
- text=True)
+ text=True, abbrev=abbrev, renames=False)
return write_patch_file(filename, info, diff)
return None
-def get_author(repo):
- """Determine author name and email"""
- author = GitModifier()
- if repo:
- author = repo.get_author_info()
-
- passwd_data = pwd.getpwuid(os.getuid())
- if not author.name:
- # On some distros (Ubuntu, at least) the gecos field has it's own
- # internal structure of comma-separated fields
- author.name = passwd_data.pw_gecos.split(',')[0].strip()
- if not author.name:
- author.name = passwd_data.pw_name
- if not author.email:
- if 'EMAIL' in os.environ:
- author.email = os.environ['EMAIL']
- else:
- author.email = "%s@%s" % (passwd_data.pw_name, socket.getfqdn())
-
- return author
-
-
def get_maintainer_from_control(repo):
"""Get the maintainer from the control file"""
control = os.path.join(repo.path, 'debian', 'control')
- cmd = 'sed -n -e \"s/Maintainer: \\+\\(.*\\)/\\1/p\" %s' % control
- cmdout = subprocess.Popen(cmd, shell=True,
- stdout=subprocess.PIPE).stdout.readlines()
-
- if len(cmdout) > 0:
- maintainer = cmdout[0].decode().strip()
- m = re.match('(?P<name>.*[^ ]) *<(?P<email>.*)>', maintainer)
- if m:
- return GitModifier(m.group('name'), m.group('email'))
-
+ maint_re = re.compile('Maintainer: +(?P<name>.*[^ ]) *<(?P<email>.*)>')
+ try:
+ with open(control, encoding='utf-8') as f:
+ for line in f:
+ m = maint_re.match(line)
+ if m:
+ return GitModifier(m.group('name'), m.group('email'))
+ except FileNotFoundError:
+ raise GbpError("Debian control file {} not found".format(control))
return GitModifier()
-def switch_to_pq_branch(repo, branch, options, name_keys=None):
+def switch_to_pq_branch(repo, branch):
"""
- Switch to patch-queue branch if not already there, create it if it
+ Switch to patch-queue branch if not already on it.
doesn't exist yet
"""
- if is_pq_branch(branch, options):
+ if is_pq_branch(branch):
return
- pq_branch = pq_branch_name(branch, options, name_keys)
+ pq_branch = pq_branch_name(branch)
if not repo.has_branch(pq_branch):
- try:
- repo.create_branch(pq_branch)
- except GitRepositoryError:
- raise GbpError("Cannot create patch-queue branch '%s'. "
- "Try 'rebase' instead." % pq_branch)
+ raise GbpError("Branch '%s' does not exist, try "
+ "'import' instead" % pq_branch)
gbp.log.info("Switching to '%s'" % pq_branch)
repo.set_branch(pq_branch)
-def apply_single_patch(repo, branch, patch, fallback_author, options):
- switch_to_pq_branch(repo, branch, options)
- topic = None if not hasattr(options, 'topic') else options.topic
+def apply_single_patch(repo, branch, patch, fallback_author, topic=None):
+ switch_to_pq_branch(repo, branch)
apply_and_commit_patch(repo, patch, fallback_author, topic)
+ gbp.log.info("Applied %s" % os.path.basename(patch.path))
-def apply_and_commit_patch(repo, patch, fallback_author, topic=None):
+def apply_and_commit_patch(repo, patch, fallback_author, topic=None, name=None):
"""apply a single patch 'patch', add topic 'topic' and commit it"""
author = {'name': patch.author,
'email': patch.email,
patch_fn = os.path.basename(patch.path)
if not (author['name'] and author['email']):
if fallback_author and fallback_author['name']:
- author = fallback_author
+ author = {}
+ for key in 'name', 'email', 'date':
+ author[key] = fallback_author.get(key)
gbp.log.warn("Patch '%s' has no authorship information, using "
"'%s <%s>'" % (patch_fn, author['name'],
author['email']))
else:
gbp.log.warn("Patch '%s' has no authorship information" % patch_fn)
- repo.apply_patch(patch.path, strip=patch.strip)
+ try:
+ repo.apply_patch(patch.path, strip=patch.strip)
+ except GitRepositoryError:
+ gbp.log.warn("Patch %s failed to apply, retrying with whitespace fixup" % patch_fn)
+ repo.apply_patch(patch.path, strip=patch.strip, fix_ws=True)
tree = repo.write_tree()
msg = "%s\n\n%s" % (patch.subject, patch.long_desc)
if topic:
- msg += "\nGbp-Pq-Topic: %s" % topic
+ msg += "\nGbp-Pq: Topic %s" % topic
+ if name:
+ msg += "\nGbp-Pq: Name %s" % name
+ if author['name']:
+ author['name'] = author['name'].encode('utf-8')
commit = repo.commit_tree(tree, msg, [repo.head], author=author)
repo.update_ref('HEAD', commit, msg="gbp-pq import %s" % patch.path)
-def drop_pq(repo, branch, options, name_keys=None):
- if is_pq_branch(branch, options):
- gbp.log.err("On a patch-queue branch, can't drop it.")
- raise GbpError
- else:
- pq_branch = pq_branch_name(branch, options, name_keys)
-
+def drop_pq(repo, branch):
+ repo.checkout(pq_branch_base(branch))
+ pq_branch = pq_branch_name(branch)
if repo.has_branch(pq_branch):
repo.delete_branch(pq_branch)
gbp.log.info("Dropped branch '%s'." % pq_branch)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2006-2011, 2016 Guido Günther <agx@sigxcpu.org>
+# (C) 2021 Andrej Shadura <andrew@shadura.me>
+# (C) 2021 Collabora Limited
+# 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, please see
+# <http://www.gnu.org/licenses/>
+#
+"""Common repository setup functionality."""
+
+import os
+import re
+import gbp.log
+
+from pathlib import Path
+
+
+def set_user_name_and_email(repo_user, repo_email, repo):
+ if repo_user == 'DEBIAN':
+ if os.getenv('DEBFULLNAME'):
+ repo.set_user_name(os.getenv('DEBFULLNAME'))
+
+ if repo_email == 'DEBIAN':
+ if os.getenv('DEBEMAIL'):
+ repo.set_user_email(os.getenv('DEBEMAIL'))
+
+
+def check_gitattributes(repo, treeish) -> bool:
+ """
+ Verify the treeish doesn’t contain non-empty .gitattributes files.
+ """
+ for mode, _type, sha1, size, path in repo.list_tree(treeish, recurse=True, sizes=True):
+ if size == 0:
+ continue
+ if path == b'.gitattributes' or path.endswith(b'/.gitattributes'):
+ gbp.log.debug("Found non-empty .gitattributes: %s" % path)
+ return False
+ return True
+
+
+dgit_attr_macro_re = re.compile(r'^\[attr\]dgit-defuse-attrs\s')
+dgit_attr_macro_defn = '-text -eol -crlf -ident -filter -working-tree-encoding'
+attr_glob_defns = {
+ 'dgit-defuse-attrs',
+ '-export-subst',
+ '-export-ignore',
+}
+
+
+def is_gitattributes_set_up(repo) -> bool:
+ """
+ Return True if git attributes have been set up correctly:
+ - dgit-defuse-attrs macro exists
+ - dgit-defuse-attrs includes attributes we’re interested in
+ - dgit-defuse-attrs is enabled for *
+ - export-subst and export-ignore are unset for *
+ """
+ gitattrs = Path(repo.git_dir) / 'info' / 'attributes'
+ if not gitattrs.exists():
+ return False
+ dgit_macro_present = False
+ attrs = set()
+ for line in gitattrs.read_text().splitlines():
+ if dgit_attr_macro_re.match(line):
+ gbp.log.debug("Found Git attribute macro: %s" % line)
+ dgit_macro_present = line.endswith(dgit_attr_macro_defn)
+ continue
+ attr = line.split()
+ if attr[0] == '*' and len(attr) == 2:
+ attrs.add(attr[1])
+ gbp.log.debug("Found global Git attributes: %s" % ', '.join(attrs))
+ return dgit_macro_present and attrs >= attr_glob_defns
+
+
+def setup_gitattributes(repo, treeish='HEAD'):
+ """
+ Setup .git/info/attributes in a way to prevent transformations from interfering
+ with packaging, because the working tree files can differ from the Git revision
+ history (and from the source packages).
+
+ Similar functionality has been implemented by dgit and git-deborig, so we try
+ to stay compatible and re-use the name of the attribute macro. Since dgit doesn’t
+ disable export-subst and export-ignore, which may interfere with export-orig, we
+ add this on top the same way git-deborig does.
+ """
+ if is_gitattributes_set_up(repo):
+ return
+ gbp.log.debug("Configuring Git attributes")
+ gitattrs = Path(repo.git_dir) / 'info' / 'attributes'
+ new_attributes = []
+ if not gitattrs.exists():
+ gitattrs.parent.mkdir(exist_ok=True)
+ else:
+ for line in gitattrs.read_text().splitlines():
+ attr = line.split()
+ if attr[0] == '*' and len(attr) == 2:
+ if attr[1] in attr_glob_defns:
+ continue
+ if dgit_attr_macro_re.match(line):
+ new_attributes += [
+ "# Old dgit macro disabled:",
+ "# %s" % line,
+ ]
+ gbp.log.debug("Disabling old dgit macro: '%s'" % line)
+ else:
+ new_attributes.append(line)
+ new_attributes += [
+ "# Added by git-buildpackage to disable .gitattributes found in the upstream tree",
+ "[attr]dgit-defuse-attrs %s" % dgit_attr_macro_defn,
+ ] + ['* %s' % attr for attr in attr_glob_defns]
+ with gitattrs.with_suffix('.new') as newattrs:
+ newattrs.write_text('\n'.join(new_attributes))
+ newattrs.rename(gitattrs)
# vim: set fileencoding=utf-8 :
#
-# (C) 2014 Guido Guenther <agx@sigxcpu.org>
+# (C) 2014 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
"""Query and display config file values"""
-import configparser
import sys
-import os, os.path
-from gbp.config import (GbpOptionParser, GbpOptionGroup)
+import os
+from gbp.config import GbpOptionParser
from gbp.errors import GbpError
from gbp.scripts.supercommand import import_command
+from gbp.scripts.common import ExitCodes
import gbp.log
def build_parser(name):
try:
parser = GbpOptionParser(command=os.path.basename(name), prefix='',
- usage='%prog [options] command[.optionname] - display configuration settings')
- except configparser.ParsingError as err:
+ usage='%prog [options] command[.optionname] - display configuration settings')
+ except GbpError as err:
gbp.log.err(err)
return None
return parser.parse_args(argv)
-def parse_cmd_config(command):
- """Make a command parse it's config files"""
- parser = GbpOptionParser(command)
- parser.parse_config_files()
+def build_cmd_parser(section):
+ """
+ Populate the parser to get a list of valid options
+ """
+ try:
+ # Populate the parser to get a list of
+ # valid options
+ module = import_command(section)
+ parser = module.build_parser(section)
+ except (AttributeError, ImportError):
+ # Use the default parser for section that don't
+ # map to a command
+ parser = GbpOptionParser(section)
+ parser.parse_config_files()
return parser
-def print_cmd_single_value(query, printer):
- """Print a single configuration value of a command
-
- @param query: the cmd to print the value for
- @param printer: the printer to output the value
- """
- try:
- cmd, option = query.split('.')
- except ValueError:
+def print_single_option(parser, option, printer):
+ value = parser.get_config_file_value(option)
+ if value is not None:
+ printer("%s" % value)
+ else:
return 2
+ return 0
- parser = parse_cmd_config(cmd)
- value = parser.get_config_file_value(option)
- printer("%s=%s" % (query, value))
- return 0 if value else 1
+
+def print_all_options(parser, printer):
+ if not parser.valid_options:
+ return 2
+ for opt in parser.valid_options:
+ value = parser.get_config_file_value(opt)
+ printer("%s.%s=%s" % (parser.command, opt, value))
+ return 0
-def print_cmd_all_values(cmd, printer):
+def print_cmd_values(query, printer):
"""
- Print all configuration values of a command
+ Print configuration values of a command
- @param cmd: the cmd to print the values for
+ @param query: the section to print the values for or section.option to
+ print
@param printer: the printer to output the values
"""
- if not cmd:
+ if not query:
return 2
+
try:
- # Populae the parset to get a list of
- # valid options
- module = import_command(cmd)
- parser = module.build_parser(cmd)
- except (AttributeError, ImportError):
- return 2
+ section, option = query.split('.')
+ except ValueError:
+ section = query
+ option = None
- for option in parser.valid_options:
- value = parser.get_config_file_value(option)
- if value != '':
- printer("%s.%s=%s" % (cmd, option, value))
- return 0
+ parser = build_cmd_parser(section)
+
+ if option: # Single option query
+ return print_single_option(parser, option, printer)
+ else: # all options
+ return print_all_options(parser, printer)
-def value_printer(value):
- if (value):
- print(value)
+def value_printer(output):
+ print(output)
def main(argv):
retval = 1
(options, args) = parse_args(argv)
+
+ if options is None:
+ return ExitCodes.parse_error
+
gbp.log.setup(options.color, options.verbose, options.color_scheme)
if not args:
- gbp.log.error("No command given")
+ gbp.log.err("No command given")
return 2
elif len(args) != 2:
- gbp.log.error("Can only take a command or command.optionname, check --help")
+ gbp.log.err("Can only take a command or command.optionname, check --help")
return 2
else:
query = args[1]
- if '.' in query:
- retval = print_cmd_single_value(query, value_printer)
- else:
- retval = print_cmd_all_values(query, value_printer)
+ retval = print_cmd_values(query, value_printer)
return retval
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
# vim: set fileencoding=utf-8 :
#
-# (C) 2010,2012 Guido Günther <agx@sigxcpu.org>
+# (C) 2010,2012,2015,2016 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
# Based on the aa-create-git-repo and dom-new-git-repo shell scripts
-"""Create a remote GIT repository based on the current one"""
+"""Create a remote Git repository based on the current one"""
-import configparser
import sys
-import os, os.path
+import os
import urllib.parse
import subprocess
-import tty, termios
+import tty
+import termios
import re
+import configparser
+
from gbp.deb.changelog import ChangeLog, NoChangeLogError
from gbp.command_wrappers import (CommandExecFailed, GitCommand)
from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.errors import GbpError
from gbp.git import GitRepositoryError
from gbp.deb.git import DebianGitRepository
+from gbp.scripts.common import ExitCodes
+
import gbp.log
+
def print_config(remote, branches):
"""
Print out the git config to push to the newly created repo.
remote = %s
merge = refs/heads/%s""" % (branch, remote['name'], branch))
-def sort_dict(d):
- """Return a sorted list of (key, value) tuples"""
- s = []
- for key in sorted(d.keys()):
- s.append((key, d[key]))
- return s
-def parse_url(remote_url, name, pkg, template_dir=None):
+def parse_url(remote_url, name, pkg, template_dir=None, bare=True):
"""
Sanity check our remote URL
- >>> sort_dict(parse_url("ssh://host/path/%(pkg)s", "origin", "package"))
- [('base', ''), ('dir', '/path/package'), ('host', 'host'), ('name', 'origin'), ('pkg', 'package'), ('port', None), ('scheme', 'ssh'), ('template-dir', None), ('url', 'ssh://host/path/package')]
-
- >>> sort_dict(parse_url("ssh://host:22/path/repo.git", "origin", "package"))
- [('base', ''), ('dir', '/path/repo.git'), ('host', 'host'), ('name', 'origin'), ('pkg', 'package'), ('port', '22'), ('scheme', 'ssh'), ('template-dir', None), ('url', 'ssh://host:22/path/repo.git')]
-
- >>> sort_dict(parse_url("ssh://host:22/~/path/%(pkg)s.git", "origin", "package"))
- [('base', '~/'), ('dir', 'path/package.git'), ('host', 'host'), ('name', 'origin'), ('pkg', 'package'), ('port', '22'), ('scheme', 'ssh'), ('template-dir', None), ('url', 'ssh://host:22/~/path/package.git')]
-
- >>> sort_dict(parse_url("ssh://host:22/~user/path/%(pkg)s.git", "origin", "package", "/doesnot/exist"))
- [('base', '~user/'), ('dir', 'path/package.git'), ('host', 'host'), ('name', 'origin'), ('pkg', 'package'), ('port', '22'), ('scheme', 'ssh'), ('template-dir', '/doesnot/exist'), ('url', 'ssh://host:22/~user/path/package.git')]
-
- >>> parse_url("git://host/repo.git", "origin", "package")
- Traceback (most recent call last):
- ...
- GbpError: URL must use ssh protocol.
- >>> parse_url("ssh://host/path/repo", "origin", "package")
- Traceback (most recent call last):
- ...
- GbpError: URL needs to contain either a repository name or '%(pkg)s'
- >>> parse_url("ssh://host:asdf/path/%(pkg)s.git", "origin", "package")
- Traceback (most recent call last):
- ...
- GbpError: URL contains invalid port.
- >>> parse_url("ssh://host/~us er/path/%(pkg)s.git", "origin", "package")
- Traceback (most recent call last):
- ...
- GbpError: URL contains invalid ~username expansion.
"""
frags = urllib.parse.urlparse(remote_url)
if frags.scheme in ['ssh', 'git+ssh', '']:
else:
raise GbpError("URL must use ssh protocol.")
- if not '%(pkg)s' in remote_url and not remote_url.endswith(".git"):
+ if '%(pkg)s' not in remote_url and not remote_url.endswith(".git"):
raise GbpError("URL needs to contain either a repository name or '%(pkg)s'")
if ":" in frags.netloc:
base = ""
path = frags.path
- remote = { 'pkg' : pkg,
- 'url' : remote_url % { 'pkg': pkg },
- 'dir' : path % { 'pkg': pkg },
- 'base': base,
- 'host': host,
- 'port': port,
- 'name': name,
- 'scheme': scheme,
- 'template-dir': template_dir}
+ remote = {'pkg': pkg,
+ 'url': remote_url % {'pkg': pkg},
+ 'dir': path % {'pkg': pkg},
+ 'base': base,
+ 'host': host,
+ 'port': port,
+ 'name': name,
+ 'scheme': scheme,
+ 'template-dir': template_dir,
+ 'bare': bare}
return remote
def build_remote_script(remote, branch):
"""
Create the script that will be run on the remote side
- >>> build_remote_script({'base': 'base', 'dir': 'dir', 'pkg': 'pkg', 'template-dir': None}, 'branch')
- '\\nset -e\\numask 002\\nif [ -d base"dir" ]; then\\n echo "Repository at "basedir" already exists - giving up."\\n exit 1\\nfi\\nmkdir -p base"dir"\\ncd base"dir"\\ngit init --bare --shared\\necho "pkg packaging" > description\\necho "ref: refs/heads/branch" > HEAD\\n'
- >>> build_remote_script({'base': 'base', 'dir': 'dir', 'pkg': 'pkg', 'template-dir': '/doesnot/exist'}, 'branch')
- '\\nset -e\\numask 002\\nif [ -d base"dir" ]; then\\n echo "Repository at "basedir" already exists - giving up."\\n exit 1\\nfi\\nmkdir -p base"dir"\\ncd base"dir"\\ngit init --bare --shared --template=/doesnot/exist\\necho "pkg packaging" > description\\necho "ref: refs/heads/branch" > HEAD\\n'
"""
args = remote
args['branch'] = branch
- args['git-init-args'] = '--bare --shared'
+ args['git-init-args'] = '--shared'
+ if args['bare']:
+ args['git-init-args'] += ' --bare'
+ args['checkout_cmd'] = ''
+ args['git_dir'] = '.'
+ else:
+ args['checkout_cmd'] = 'git checkout -f'
+ args['git_dir'] = '.git'
if args['template-dir']:
args['git-init-args'] += (' --template=%s'
- % args['template-dir'])
- remote_script_pattern = ['',
- 'set -e',
- 'umask 002',
- 'if [ -d %(base)s"%(dir)s" ]; then',
- ' echo "Repository at \"%(base)s%(dir)s\" already exists - giving up."',
- ' exit 1',
- 'fi',
- 'mkdir -p %(base)s"%(dir)s"',
- 'cd %(base)s"%(dir)s"',
- 'git init %(git-init-args)s',
- 'echo "%(pkg)s packaging" > description',
- 'echo "ref: refs/heads/%(branch)s" > HEAD',
- '' ]
+ % args['template-dir'])
+ remote_script_pattern = \
+ ['',
+ 'set -e',
+ 'umask 002',
+ 'if [ -d %(base)s"%(dir)s" ]; then',
+ ' echo "Repository at \"%(base)s%(dir)s\" already exists - giving up."',
+ ' exit 1',
+ 'fi',
+ 'mkdir -p %(base)s"%(dir)s"',
+ 'cd %(base)s"%(dir)s"',
+ 'git init %(git-init-args)s',
+ 'echo "%(pkg)s packaging" > %(git_dir)s/description',
+ 'echo "ref: refs/heads/%(branch)s" > %(git_dir)s/HEAD',
+ '']
remote_script = '\n'.join(remote_script_pattern) % args
return remote_script
if old_settings:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
- if ch in ( 'y', 'Y' ):
+ if ch in ('y', 'Y'):
return True
else:
return False
def setup_branch_tracking(repo, remote, branches):
repo.add_remote_repo(name=remote['name'], url=remote['url'], fetch=True)
- gitTrackRemote = GitCommand('branch', ['--set-upstream'])
+ gitTrackRemote = GitCommand('branch', ['--set-upstream-to'])
for branch in branches:
- gitTrackRemote(['%s' % branch, '%s/%s' % (remote['name'], branch)])
+ gitTrackRemote(['%s/%s' % (remote['name'], branch), branch])
def push_branches(remote, branches):
gitPush([remote['url'], '--tags'])
+def usage_msg():
+ return """%prog [options] - create a remote git repository
+Actions:
+ create create the repository. This is the default when no action is
+ given.
+ list list available configuration templates for remote repositories"""
+
+
def build_parser(name, sections=[]):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
- usage='%prog [options] - '
- 'create a remote repository',
+ usage=usage_msg(),
sections=sections)
- except configparser.ParsingError as err:
+ except (GbpError, configparser.NoSectionError) as err:
gbp.log.err(err)
return None
branch_group.add_config_file_option(option_name="upstream-branch",
dest="upstream_branch")
branch_group.add_config_file_option(option_name="debian-branch",
- dest="packaging_branch")
+ dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name="pristine-tar",
dest="pristine_tar")
branch_group.add_boolean_config_file_option(option_name="track",
dest='track')
+ branch_group.add_boolean_config_file_option(option_name="bare",
+ dest='bare')
parser.add_option("-v", "--verbose",
action="store_true",
dest="verbose",
return parser
-def parse_args(argv, sections=[]):
+def parse_args(argv):
"""
Parse the command line arguments and config files.
@param argv: the command line arguments
@type argv: C{list} of C{str}
- @param sections: additional sections to add to the config file parser
- besides the command name
- @type sections: C{list} of C{str}
"""
-
- # We simpley handle the template section as an additional config file
+ sections = []
+ # We handle the template section as an additional config file
# section to parse, this makes e.g. --help work as expected:
for arg in argv:
if arg.startswith('--remote-config='):
- sections = ['remote-config %s' % arg.split('=',1)[1]]
+ sections = ['remote-config %s' % arg.split('=', 1)[1]]
break
- else:
- sections = []
parser = build_parser(argv[0], sections)
if not parser:
- return None, None
+ return None, None, None
- return parser.parse_args(argv)
+ return list(parser.parse_args(argv)) + [parser.config_file_sections]
-def main(argv):
+def do_create(options):
retval = 0
changelog = 'debian/changelog'
cmd = []
- try:
- options, args = parse_args(argv)
- except Exception as e:
- print("%s" % e, file=sys.stderr)
- return 1
-
- gbp.log.setup(options.color, options.verbose, options.color_scheme)
try:
repo = DebianGitRepository(os.path.curdir)
except GitRepositoryError:
try:
branches = []
- for branch in [ options.packaging_branch, options.upstream_branch ]:
+ for branch in [options.debian_branch, options.upstream_branch]:
if repo.has_branch(branch):
- branches += [ branch ]
+ branches += [branch]
if repo.has_pristine_tar_branch() and options.pristine_tar:
- branches += [ repo.pristine_tar_branch ]
+ branches += [repo.pristine_tar_branch]
try:
cp = ChangeLog(filename=changelog)
remote = parse_url(options.remote_url,
options.name,
pkg,
- options.template_dir)
+ options.template_dir,
+ options.bare)
if repo.has_remote_repo(options.name):
raise GbpError("You already have a remote name '%s' defined for this repository." % options.name)
if not read_yn():
raise GbpError("Aborted.")
- remote_script = build_remote_script(remote, branches[0])
+ remote_default = branches[0] if branches else options.debian_branch
+ remote_script = build_remote_script(remote, remote_default)
if options.verbose:
print(remote_script)
print(cmd)
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE)
- proc.communicate(remote_script)
+ proc.communicate(remote_script.encode())
if proc.returncode:
raise GbpError("Error creating remote repository")
- push_branches(remote, branches)
+ if branches:
+ push_branches(remote, branches)
if options.track:
setup_branch_tracking(repo, remote, branches)
else:
gbp.log.info("You can now add:")
print_config(remote, branches)
- gbp.log.info("to your .git/config to 'gbp-pull' and 'git push' in the future.")
-
+ gbp.log.info("to your .git/config to 'gbp pull' and 'git push' in the future.")
+ except KeyboardInterrupt:
+ retval = 1
+ gbp.log.err("Interrupted. Aborting.")
except CommandExecFailed:
retval = 1
except (GbpError, GitRepositoryError) as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
retval = 1
+ return retval
+
+
+def get_config_names(sections):
+ config_names = []
+ for section in sections:
+ if section.startswith("remote-config "):
+ config_names.append(section.split(' ', 1)[1])
+ return config_names
+
+
+def do_list(sections):
+ names = get_config_names(sections)
+ if names:
+ gbp.log.info("Available remote config templates:")
+ for n in names:
+ print(" %s" % n)
+ else:
+ gbp.log.info("No remote config templates found.")
+ return 0
+
+
+def main(argv):
+ retval = 1
+
+ options, args, sections = parse_args(argv)
+ if not options:
+ return ExitCodes.parse_error
+
+ gbp.log.setup(options.color, options.verbose, options.color_scheme)
+ if len(args) == 1:
+ args.append('create') # the default
+ elif len(args) > 2:
+ gbp.log.err("Only one action allowed")
+ return 1
+
+ action = args[1]
+ if action == 'create':
+ retval = do_create(options)
+ elif action == 'list':
+ retval = do_list(sections)
+ else:
+ gbp.log.err("Unknown action '%s'" % action)
return retval
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
# vim: set fileencoding=utf-8 :
#
-# (C) 2007, 2008, 2009, 2010, 2013 Guido Guenther <agx@sigxcpu.org>
+# (C) 2007,2008,2009,2010,2013,2015,2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
-"""Generate Debian changelog entries from GIT commit messages"""
+"""Generate Debian changelog entries from Git commit messages"""
-import configparser
import os.path
import re
+import typing
import sys
import shutil
import gbp.command_wrappers as gbpc
from gbp.deb.source import DebianSource, DebianSourceError
from gbp.deb.git import GitRepositoryError, DebianGitRepository
from gbp.deb.changelog import ChangeLog, NoChangeLogError
+from gbp.scripts.common import ExitCodes, maybe_debug_raise
+from gbp.scripts.common.hook import Hook
-user_customizations = {}
-snapshot_re = re.compile("\s*\*\* SNAPSHOT build @(?P<commit>[a-z0-9]+)\s+\*\*")
+user_customizations: typing.Dict[str, str] = {}
+snapshot_re = re.compile(r'\s*\*\* SNAPSHOT build @(?P<commit>[a-z0-9]+)\s+\*\*')
-def guess_version_from_upstream(repo, upstream_tag_format, cp):
+def guess_version_from_upstream(repo, upstream_tag_format, upstream_branch, cp=None):
"""
- Guess the version based on the latest version on the upstream branch
+ Guess the version based on the latest version on the upstream branch.
+ If the version in dch is already higher this function returns None.
"""
+ epoch = cp.epoch if cp else None
+ cmp_version = cp.version if cp else '0~'
try:
version = repo.debian_version_from_upstream(upstream_tag_format,
- epoch=cp.epoch)
+ upstream_branch,
+ epoch=epoch,
+ debian_release=False)
+ if version is None:
+ gbp.log.warn("Failed to find upstream version tag")
+ return None
gbp.log.debug("Found upstream version %s." % version)
- if compare_versions(version, cp.version) > 0:
- return version
- except GitRepositoryError:
- gbp.log.debug("No upstream tag found")
+ if compare_versions(version, cmp_version) > 0:
+ return "%s-1" % version
+ except GitRepositoryError as e:
+ gbp.log.debug("No upstream tag found: %s" % e)
return None
author = email = None
if use_git_config:
- try: author = repo.get_config('user.name')
- except KeyError: pass
+ try:
+ author = repo.get_config('user.name')
+ except KeyError:
+ pass
- try: email = repo.get_config('user.email')
- except KeyError: pass
+ try:
+ email = repo.get_config('user.email')
+ except KeyError:
+ pass
return author, email
author, email = get_author_email(repo, use_git_author)
used_options = ['distribution', 'urgency']
opts = []
- mainttrailer_opts = [ '--nomainttrailer', '--mainttrailer', '-t' ]
+ mainttrailer_opts = ['--nomainttrailer', '--mainttrailer', '-t']
# This must not be done for snapshots or snapshots changelog entries
# will not be concatenated
else:
gbp.log.debug("Snapshot enabled: do not fixup options in header")
- if use_git_author:
- for opt in mainttrailer_opts:
- if opt in dch_options:
- break
- else:
- opts.append(mainttrailer_opts[0])
- ChangeLog.spawn_dch(msg='', author=author, email=email, dch_options=dch_options+opts)
+ for opt in mainttrailer_opts:
+ if opt in dch_options:
+ break
+ else:
+ opts.append(mainttrailer_opts[0])
+ ChangeLog.spawn_dch(msg='', author=author, email=email, dch_options=dch_options + opts)
def snapshot_version(version):
"""
try:
(release, suffix) = version.rsplit('~', 1)
- (snapshot, commit) = suffix.split('.', 1)
+ (snapshot, commit) = suffix.split('.', 1)
if not commit.startswith('gbp'):
raise ValueError
else:
snapshot = int(snapshot)
- except ValueError: # not a snapshot release
+ except ValueError: # not a snapshot release
release = version
snapshot = 0
return release, snapshot
"""
try:
tmpfile = '%s.%s' % (changelog, snapshot)
- cw = open(tmpfile, 'w')
- cr = open(changelog, 'r')
+ cw = open(tmpfile, 'w', encoding='utf-8')
+ cr = open(changelog, 'r', encoding='utf-8')
- print(("%(Source)s (%(MangledVersion)s) "
- "%(Distribution)s; urgency=%(urgency)s\n" % cp), file=cw)
+ print("%(Source)s (%(MangledVersion)s) "
+ "%(Distribution)s; urgency=%(urgency)s\n" % cp, file=cw)
- cr.readline() # skip version and empty line
+ cr.readline() # skip version and empty line
cr.readline()
line = cr.readline()
if snapshot_re.match(line):
- cr.readline() # consume the empty line after the snapshot header
+ cr.readline() # consume the empty line after the snapshot header
line = ''
if snapshot:
cp['MangledVersion'] = "%s~%s" % (release, suffix)
mangle_changelog(changelog, cp, commit)
- return snapshot, commit
+ return snapshot, commit, cp['MangledVersion']
+
def parse_commit(repo, commitid, opts, last_commit=False):
"""Parse a commit and return message, author, and author email"""
def get_customizations(customization_file):
if customization_file:
- exec(compile(open(customization_file, "rb").read(), customization_file, 'exec'),
- user_customizations,
- user_customizations)
+ try:
+ with open(customization_file) as f:
+ exec(f.read(), user_customizations, user_customizations)
+ except Exception as err:
+ raise GbpError("Failed to load customization file: %s" % err)
def process_options(options, parser):
if options.since and options.auto:
parser.error("'--since' and '--auto' are incompatible options")
+ if not options.since and not options.auto:
+ options.auto = True
+
dch_options = []
if options.multimaint_merge:
dch_options.append("--multimaint-merge")
if options.force_distribution:
dch_options.append("--force-distribution")
- get_customizations(options.customization_file)
- return dch_options
+ return dch_options + options.dch_opts
def process_editor_option(options):
elif options.release:
states.append("release")
- if options.spawn_editor in states:
- return "sensible-editor"
- else:
+ if options.spawn_editor == 'never' or options.spawn_editor not in states:
return None
+ else:
+ return "sensible-editor"
def changelog_commit_msg(options, version):
return options.commit_msg % dict(version=version)
+def create_changelog(repo, source, options):
+ try:
+ name = source.control.name
+ except DebianSourceError:
+ raise GbpError("Did not find debian/changelog or debian/source. Is this a Debian package?")
+ version = guess_version_from_upstream(repo, options.upstream_tag,
+ options.upstream_branch, None)
+ return ChangeLog.create(name, version)
+
+
+def maybe_create_changelog(repo, source, options):
+ """
+ Get the changelog or create a new one if it does not exist yet
+ """
+ try:
+ return source.changelog
+ except DebianSourceError:
+ return create_changelog(repo, source, options)
+
+
def build_parser(name):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name),
usage='%prog [options] paths')
- except configparser.ParsingError as err:
+ except GbpError as err:
gbp.log.err(err)
return None
parser.add_option_group(naming_group)
parser.add_option_group(custom_group)
- parser.add_boolean_config_file_option(option_name = "ignore-branch", dest="ignore_branch")
- naming_group.add_config_file_option(option_name="debian-branch", dest="packaging_branch")
+ parser.add_boolean_config_file_option(option_name="ignore-branch", dest="ignore_branch")
+ naming_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
+ naming_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
naming_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
- naming_group.add_config_file_option(option_name="debian-tag", dest="packaging_tag")
+ naming_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
naming_group.add_config_file_option(option_name="snapshot-number", dest="snapshot_number",
- help="expression to determine the next snapshot number, default is '%(snapshot-number)s'")
+ help="expression to determine the next snapshot number, "
+ "default is '%(snapshot-number)s'")
parser.add_config_file_option(option_name="git-log", dest="git_log",
- help="options to pass to git-log, default is '%(git-log)s'")
+ help="options to pass to git-log, "
+ "default is '%(git-log)s'")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
dest="color_scheme")
range_group.add_option("-s", "--since", dest="since", help="commit to start from (e.g. HEAD^^^, debian/0.4.3)")
range_group.add_option("-a", "--auto", action="store_true", dest="auto", default=False,
- help="autocomplete changelog from last snapshot or tag")
+ help="autocomplete changelog from last snapshot or tag")
version_group.add_option("-R", "--release", action="store_true", dest="release", default=False,
- help="mark as release")
+ help="mark as release")
version_group.add_option("-S", "--snapshot", action="store_true", dest="snapshot", default=False,
- help="mark as snapshot build")
+ help="mark as snapshot build")
version_group.add_option("-D", "--distribution", dest="distribution", help="Set distribution")
version_group.add_option("--force-distribution", action="store_true", dest="force_distribution", default=False,
- help="Force the provided distribution to be used, even if it doesn't match the list of known distributions")
+ help="Force the provided distribution to be used, "
+ "even if it doesn't match the list of known distributions")
version_group.add_option("-N", "--new-version", dest="new_version",
- help="use this as base for the new version number")
- version_group.add_option("-U", "--urgency", dest="urgency", help="Set urgency level")
+ help="use this as base for the new version number")
+ version_group.add_config_file_option("urgency", dest="urgency")
version_group.add_option("--bpo", dest="bpo", action="store_true", default=False,
- help="Increment the Debian release number for an upload to backports, and add a backport upload changelog comment.")
+ help="Increment the Debian release number for an upload to backports, "
+ "and add a backport upload changelog comment.")
version_group.add_option("--nmu", dest="nmu", action="store_true", default=False,
- help="Increment the Debian release number for a non-maintainer upload")
+ help="Increment the Debian release number for a non-maintainer upload")
version_group.add_option("--qa", dest="qa", action="store_true", default=False,
- help="Increment the Debian release number for a Debian QA Team upload, and add a QA upload changelog comment.")
+ help="Increment the Debian release number for a Debian QA Team upload, "
+ "and add a QA upload changelog comment.")
version_group.add_option("--team", dest="team", action="store_true", default=False,
- help="Increment the Debian release number for a Debian Team upload, and add a Team upload changelog comment.")
+ help="Increment the Debian release number for a Debian Team upload, "
+ "and add a Team upload changelog comment.")
version_group.add_option("--security", dest="security", action="store_true", default=False,
- help="Increment the Debian release number for a security upload and add a security upload changelog comment.")
+ help="Increment the Debian release number for a security upload and "
+ "add a security upload changelog comment.")
+ version_group.add_option("-l", "--local", dest="local_suffix", metavar="SUFFIX",
+ help="Add a suffix to the Debian version number for a local build.")
version_group.add_boolean_config_file_option(option_name="git-author", dest="use_git_author")
commit_group.add_boolean_config_file_option(option_name="meta", dest="meta")
commit_group.add_config_file_option(option_name="meta-closes", dest="meta_closes")
+ commit_group.add_config_file_option(option_name="meta-closes-bugnum", dest="meta_closes_bugnum")
commit_group.add_boolean_config_file_option(option_name="full", dest="full")
commit_group.add_config_file_option(option_name="id-length", dest="idlen",
- help="include N digits of the commit id in the changelog entry, default is '%(id-length)s'",
- type="int", metavar="N")
+ help="include N digits of the commit id in the changelog entry, "
+ "default is '%(id-length)s'",
+ type="int", metavar="N")
commit_group.add_config_file_option(option_name="ignore-regex", dest="ignore_regex",
- help="Ignore commit lines matching regex, default is '%(ignore-regex)s'")
+ help="Ignore commit lines matching regex, "
+ "default is '%(ignore-regex)s'")
commit_group.add_boolean_config_file_option(option_name="multimaint", dest="multimaint")
commit_group.add_boolean_config_file_option(option_name="multimaint-merge", dest="multimaint_merge")
commit_group.add_config_file_option(option_name="spawn-editor", dest="spawn_editor")
parser.add_config_file_option(option_name="commit-msg",
- dest="commit_msg")
+ dest="commit_msg")
parser.add_option("-c", "--commit", action="store_true", dest="commit", default=False,
help="commit changelog file after generating")
+ parser.add_config_file_option(option_name="dch-opt",
+ dest="dch_opts", action="append",
+ help="option to pass to dch verbatim, "
+ "can be given multiple times",
+ metavar="DCH_OPT")
help_msg = ('Load Python code from CUSTOMIZATION_FILE. At the moment,'
' the only useful thing the code can do is define a custom'
custom_group.add_config_file_option(option_name="customizations",
dest="customization_file",
help=help_msg)
-
-
+ custom_group.add_config_file_option(option_name="postedit", dest="postedit",
+ help="Hook to run after changes to the changelog file"
+ "have been finalized default is '%(postedit)s'")
return parser
def parse_args(argv):
parser = build_parser(argv[0])
if not parser:
- return None, None
+ return [None] * 4
(options, args) = parser.parse_args(argv[1:])
gbp.log.setup(options.color, options.verbose, options.color_scheme)
editor_cmd = process_editor_option(options)
return options, args, dch_options, editor_cmd
+
def main(argv):
ret = 0
changelog = 'debian/changelog'
version_change = {}
branch = None
-
options, args, dch_options, editor_cmd = parse_args(argv)
+ if not options:
+ return ExitCodes.parse_error
+
try:
+ old_cwd = os.path.abspath(os.path.curdir)
+ for var in ['EMAIL', 'DEBEMAIL']:
+ if var in os.environ and os.environ[var]:
+ break
+ else:
+ raise GbpError("Either 'EMAIL' or 'DEBEMAIL' must be set in the environment for 'dch' to work")
+
try:
- repo = DebianGitRepository('.')
+ repo = DebianGitRepository('.', toplevel=False)
+ os.chdir(repo.path)
except GitRepositoryError:
raise GbpError("%s is not a git repository" % (os.path.abspath('.')))
+ get_customizations(options.customization_file)
try:
branch = repo.get_branch()
except GitRepositoryError:
if not options.ignore_branch:
raise
- if options.packaging_branch != branch and not options.ignore_branch:
- gbp.log.err("You are not on branch '%s' but on '%s'" %
- (options.packaging_branch, branch))
- raise GbpError("Use --ignore-branch to ignore or --debian-branch "
- "to set the branch name.")
+ if options.debian_branch != branch and not options.ignore_branch:
+ gbp.log.err("You are not on branch '%s' but on '%s'" % (options.debian_branch, branch))
+ raise GbpError("Use --ignore-branch to ignore or --debian-branch to set the branch name.")
source = DebianSource('.')
- cp = source.changelog
+ cp = maybe_create_changelog(repo, source, options)
if options.since:
since = options.since
else:
- since = ''
- if options.auto:
- since = guess_documented_commit(cp, repo, options.packaging_tag)
- if since:
- msg = "Continuing from commit '%s'" % since
- else:
- msg = "Starting from first commit"
- gbp.log.info(msg)
- found_snapshot_banner = has_snapshot_banner(cp)
- else: # Fallback: continue from last tag
- since = repo.find_version(options.packaging_tag, cp['Version'])
- if not since:
- raise GbpError("Version %s not found" % cp['Version'])
+ since = guess_documented_commit(cp, repo, options.debian_tag)
+ if since:
+ msg = "Continuing from commit '%s'" % since
+ else:
+ msg = "Starting from first commit"
+ gbp.log.info(msg)
+ found_snapshot_banner = has_snapshot_banner(cp)
if args:
gbp.log.info("Only looking for changes on '%s'" % " ".join(args))
options=options.git_log.split(" "))
commits.reverse()
+ add_section = False
# add a new changelog section if:
if (options.new_version or options.bpo or options.nmu or options.qa or
- options.team or options.security):
+ options.team or options.security or options.local_suffix):
if options.bpo:
version_change['increment'] = '--bpo'
elif options.nmu:
version_change['increment'] = '--team'
elif options.security:
version_change['increment'] = '--security'
+ elif options.local_suffix:
+ version_change['increment'] = '--local=%s' % options.local_suffix
else:
version_change['version'] = options.new_version
# the user wants to force a new version
add_section = True
- elif cp['Distribution'] != "UNRELEASED" and not found_snapshot_banner and commits:
- # the last version was a release and we have pending commits
- add_section = True
- elif options.snapshot and not found_snapshot_banner:
- # the user want to switch to snapshot mode
- add_section = True
- else:
- add_section = False
+ elif cp['Distribution'] != "UNRELEASED" and not found_snapshot_banner:
+ if commits:
+ # the last version was a release and we have pending commits
+ add_section = True
+ if options.snapshot:
+ # the user want to switch to snapshot mode
+ add_section = True
if add_section and not version_change and not source.is_native():
# Get version from upstream if none provided
- v = guess_version_from_upstream(repo, options.upstream_tag, cp)
+ v = guess_version_from_upstream(repo, options.upstream_tag,
+ options.upstream_branch, cp)
if v:
version_change['version'] = v
for c in commits:
i += 1
parsed = parse_commit(repo, c, options,
- last_commit = i == len(commits))
+ last_commit=(i == len(commits)))
commit_msg, (commit_author, commit_email) = parsed
if not commit_msg:
# Some commits can be ignored
else:
cp.add_entry(commit_msg, commit_author, commit_email, dch_options)
-
# Show a message if there were no commits (not even ignored
# commits).
if not commits:
do_release(changelog, repo, cp, use_git_author=options.use_git_author,
dch_options=dch_options)
elif options.snapshot:
- (snap, version) = do_snapshot(changelog, repo, options.snapshot_number)
- gbp.log.info("Changelog has been prepared for snapshot #%d at %s" % (snap, version))
+ (snap, commit, version) = do_snapshot(changelog, repo, options.snapshot_number)
+ gbp.log.info("Changelog %s (snapshot #%d) prepared up to %s" % (version, snap, commit[:7]))
if editor_cmd:
gbpc.Command(editor_cmd, ["debian/changelog"])()
+ if options.postedit:
+ cp = ChangeLog(filename=changelog)
+ Hook('Postimport', options.postedit,
+ extra_env={'GBP_DEBIAN_VERSION': cp.version})()
+
if options.commit:
# Get the version from the changelog file (since dch might
# have incremented it, there's no way we can already know
# Commit the changes to the changelog file
msg = changelog_commit_msg(options, version)
repo.commit_files([changelog], msg)
- gbp.log.info("Changelog has been committed for version %s" % version)
-
+ gbp.log.info("Changelog committed for version %s" % version)
+ except KeyboardInterrupt:
+ ret = 1
+ gbp.log.err("Interrupted. Aborting.")
except (gbpc.CommandExecFailed,
GbpError,
GitRepositoryError,
DebianSourceError,
NoChangeLogError) as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
ret = 1
+ maybe_debug_raise()
+ finally:
+ os.chdir(old_cwd)
return ret
+
if __name__ == "__main__":
sys.exit(main(sys.argv))
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+#
+"""Create orig tarballs from git"""
+
+import os
+import sys
+import gbp.deb as du
+from gbp.command_wrappers import CommandExecFailed
+from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
+from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
+from gbp.deb.source import DebianSource, DebianSourceError
+from gbp.errors import GbpError
+import gbp.log
+import gbp.notifications
+from gbp.scripts.common import ExitCodes
+from gbp.pkg import Compressor, Archive
+from gbp.pkg.pkgpolicy import PkgPolicy
+
+
+def prepare_upstream_tarballs(repo, source, options, tarball_dir, output_dir):
+ """
+ Make sure we have the needed upstream tarballs. The default order is:
+ - look in tarball_dir and if found symlink to it
+ - create tarball using pristine-tar
+ - create tarball using git-archive
+
+ Afterwards
+ - create pristine-tar commmits if pristine-tar-commit is in use
+ - verify tarball checksums if pristine-tar is in use
+ """
+ if hasattr(options, 'no_create_orig') and options.no_create_orig:
+ return
+
+ if not source.is_native() and not source.upstream_version:
+ raise GbpError("Non-native package '%s' "
+ "has invalid version '%s'" % (source.name, source.version))
+
+ options.comp_type = guess_comp_type(options.comp_type,
+ source,
+ repo,
+ options.tarball_dir)
+ orig_files = source.upstream_tarball_names(options.comp_type, options.components)
+
+ # look in tarball_dir first, if found force a symlink to it
+ if options.tarball_dir:
+ gbp.log.debug("Looking for orig tarballs '%s' at '%s'" % (", ".join(orig_files), tarball_dir))
+ missing = du.DebianPkgPolicy.symlink_origs(orig_files, tarball_dir, output_dir, force=True)
+ if missing:
+ msg = "Tarballs '%s' not found at '%s'" % (", ".join(missing), tarball_dir)
+ else:
+ msg = "All Orig tarballs '%s' found at '%s'" % (", ".join(orig_files), tarball_dir)
+ gbp.log.info(msg)
+
+ # Create tarball if missing or forced
+ if not du.DebianPkgPolicy.has_origs(orig_files, output_dir) or options.force_create:
+ if not pristine_tar_build_origs(repo, source, output_dir, options):
+ git_archive_build_origs(repo, source, output_dir, options)
+ maybe_pristine_tar_commit(repo, source, options, output_dir, orig_files)
+ pristine_tar_verify_origs(repo, source, options, output_dir, orig_files)
+
+
+def pristine_tar_prepare_orig_tree(repo, source, options):
+ """
+ Make sure the upstream tree exists
+
+ In case of component tarballs we need to recreate a tree for the
+ main tarball without the component subdirs.
+ """
+ if options.components:
+ try:
+ upstream_tag = repo.version_to_tag(options.upstream_tag,
+ source.upstream_version)
+ tree_name = "%s^{tree}" % upstream_tag
+ repo.tree_drop_dirs(tree_name, options.components)
+ except GitRepositoryError:
+ raise GbpError("Couldn't find upstream tree '%s' to create "
+ "orig tarball via pristine-tar" % tree_name)
+
+
+def pristine_tar_build_origs(repo, source, output_dir, options):
+ """
+ Build orig tarball using pristine-tar
+
+ @returns: C{True} if tarball was built, C{False} otherwise
+ """
+ if not options.pristine_tar:
+ return False
+
+ if not repo.has_branch(repo.pristine_tar_branch):
+ gbp.log.warn('Pristine-tar branch "%s" not found' %
+ repo.pristine_tar_branch)
+
+ comp = Compressor(options.comp_type)
+ pristine_tar_prepare_orig_tree(repo, source, options)
+ try:
+ gbp.log.info("Creating %s" %
+ os.path.abspath(os.path.join(output_dir,
+ source.upstream_tarball_name(comp.type))))
+ repo.create_upstream_tarball_via_pristine_tar(source,
+ output_dir,
+ comp,
+ options.upstream_signatures)
+ for component in options.components:
+ gbp.log.info("Creating %s" %
+ os.path.abspath(os.path.join(output_dir,
+ source.upstream_tarball_name(comp.type, component))))
+ repo.create_upstream_tarball_via_pristine_tar(source,
+ output_dir,
+ comp,
+ options.upstream_signatures,
+ component=component)
+ return True
+ except GitRepositoryError:
+ if hasattr(options, 'pristine_tar_commit') and options.pristine_tar_commit:
+ gbp.log.debug("pristine-tar checkout failed, will commit tarball "
+ "due to '--pristine-tar-commit'")
+ else:
+ raise
+ return False
+
+
+def pristine_tar_verify_origs(repo, source, options, output_dir, orig_files):
+ """
+ Verify orig tarballs using pristine-tar
+
+ @returns: C{True} if tarball was built, C{False} otherwise
+ """
+ if not options.pristine_tar:
+ return True
+
+ if not repo.pristine_tar.has_feature_verify():
+ gbp.log.warn("pristine-tar does not support verify. "
+ "Skipping verification.")
+ return True
+
+ pristine_tar_prepare_orig_tree(repo, source, options)
+ for f in orig_files:
+ repo.pristine_tar.verify(os.path.join(output_dir, f))
+ return True
+
+
+def maybe_pristine_tar_commit(repo, source, options, output_dir, orig_files):
+ if not (hasattr(options, 'pristine_tar_commit') and options.pristine_tar_commit):
+ return
+
+ if repo.pristine_tar.has_commit(source.name,
+ source.upstream_version,
+ options.comp_type):
+ gbp.log.debug("%s already on pristine tar branch" % orig_files[0])
+ else:
+ upstream_tree = git_archive_get_upstream_tree(repo, source, options)
+ archive = os.path.join(output_dir, orig_files[0])
+ gbp.log.info("Adding %s to pristine-tar branch" % archive)
+ repo.pristine_tar.commit(archive, upstream_tree)
+
+
+def git_archive_get_upstream_tree(repo, source, options):
+ """
+ Determine the upstream tree from the given options
+
+ for a git archive export
+ """
+ if options.upstream_tree.upper() == 'TAG':
+ if source.upstream_version is None:
+ raise GitRepositoryError("Can't determine upstream version from changelog")
+ upstream_tree = repo.version_to_tag(options.upstream_tag,
+ source.upstream_version)
+ elif options.upstream_tree.upper() == 'BRANCH':
+ if not repo.has_branch(options.upstream_branch):
+ raise GbpError("%s is not a valid branch" % options.upstream_branch)
+ upstream_tree = options.upstream_branch
+ elif options.upstream_tree.upper() == 'SLOPPY':
+ tree_name = "%s^{tree}" % options.debian_branch
+ upstream_tree = repo.tree_drop_dirs(tree_name, ["debian"])
+ else:
+ upstream_tree = options.upstream_tree
+ if not repo.has_treeish(upstream_tree):
+ raise GbpError("%s is not a valid treeish" % upstream_tree)
+ return upstream_tree
+
+
+def git_archive_build_origs(repo, source, output_dir, options):
+ """
+ Build orig tarball(s) using git-archive
+
+ @param source: the source of the package we're acting on
+ @type source: L{DebianSource}
+ @param output_dir: where to put the tarball
+ @type output_dir: C{Str}
+ @param options: the parsed options
+ @type options: C{dict} of options
+ """
+ comp = Compressor(options.comp_type, options.comp_level)
+ upstream_tree = git_archive_get_upstream_tree(repo, source, options)
+ gbp.log.info("Creating %s from '%s'" % (source.upstream_tarball_name(comp.type),
+ upstream_tree))
+ gbp.log.debug("Building upstream tarball with compression %s" % comp)
+ tree = repo.tree_drop_dirs(upstream_tree, options.components) if options.components else upstream_tree
+ repo.create_upstream_tarball_via_git_archive(source, output_dir, tree, comp, options.with_submodules)
+ for component in options.components:
+ subtree = repo.tree_get_dir(upstream_tree, component)
+ if not subtree:
+ raise GbpError("No tree for '%s' found in '%s' to create additional tarball from"
+ % (component, upstream_tree))
+ gbp.log.info("Creating additional tarball '%s' from '%s'"
+ % (source.upstream_tarball_name(options.comp_type, component=component),
+ subtree))
+ repo.create_upstream_tarball_via_git_archive(source, output_dir, subtree, comp,
+ options.with_submodules, component=component)
+
+
+def guess_comp_type(comp_type, source, repo, tarball_dir):
+ """Guess compression type to use for the to be built upstream tarball
+
+ We prefer pristine-tar over everything else since this is what's carried around with
+ the repo and might be more reliable than what a user has in tarball_dir.
+ """
+ if comp_type != 'auto':
+ comp_type = Compressor.Aliases.get(comp_type, comp_type)
+ if comp_type not in Compressor.Opts:
+ gbp.log.warn("Unknown compression type - guessing.")
+ comp_type = 'auto'
+
+ if comp_type == 'auto':
+ branch = None
+ if repo:
+ if repo.has_branch('pristine-tar'):
+ branch = 'pristine-tar'
+ elif repo.has_branch('origin/pristine-tar', remote=True):
+ branch = 'origin/pristine-tar'
+
+ if branch is not None:
+ regex = r'pristine-tar .* %s_%s\.orig.tar\.' % (source.name, source.upstream_version)
+ commits = repo.grep_log(regex, branch, merges=False)
+ if commits:
+ commit = commits[-1]
+ gbp.log.debug("Found pristine-tar commit at '%s'" % commit)
+ else:
+ commit = branch
+ tarball = repo.get_commit_info(commit)['subject']
+ (base_name, archive_fmt, comp_type) = Archive.parse_filename(tarball)
+ gbp.log.debug("Determined compression type '%s'" % comp_type)
+ if not comp_type:
+ comp_type = 'gzip'
+ gbp.log.warn("Unknown compression type of %s, assuming %s" % (tarball, comp_type))
+ else:
+ tarball_dir = tarball_dir or '..'
+ detected = None
+ for comp in Compressor.Opts.keys():
+ if du.DebianPkgPolicy.has_orig(source.upstream_tarball_name(comp), tarball_dir):
+ if detected is not None:
+ raise GbpError("Multiple orig tarballs found.")
+ detected = comp
+ comp_type = 'gzip' if detected is None else detected
+ return comp_type
+
+
+def build_parser(name):
+ try:
+ parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='')
+ except GbpError as err:
+ gbp.log.err(err)
+ return None
+
+ tag_group = GbpOptionGroup(parser,
+ "tag options",
+ "options related to git tag creation")
+ orig_group = GbpOptionGroup(parser,
+ "orig tarball options",
+ "options related to the creation of the orig tarball")
+ branch_group = GbpOptionGroup(parser,
+ "branch options",
+ "branch layout options")
+ for group in [tag_group, orig_group, branch_group]:
+ parser.add_option_group(group)
+
+ parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
+ help="verbose command execution")
+ parser.add_config_file_option(option_name="color", dest="color", type='tristate')
+ parser.add_config_file_option(option_name="color-scheme",
+ dest="color_scheme")
+ tag_group.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
+ orig_group.add_config_file_option(option_name="upstream-tree", dest="upstream_tree")
+ orig_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
+ orig_group.add_config_file_option(option_name="force-create", dest="force_create",
+ help="force creation of orig tarball", action="store_true")
+ orig_group.add_config_file_option(option_name="tarball-dir", dest="tarball_dir", type="path",
+ help="location to look for external tarballs")
+ orig_group.add_config_file_option(option_name="compression", dest="comp_type",
+ help="Compression type, default is '%(compression)s'")
+ orig_group.add_config_file_option(option_name="compression-level", dest="comp_level",
+ help="Compression level, default is '%(compression-level)s'")
+ orig_group.add_config_file_option(option_name="upstream-signatures", dest="upstream_signatures",
+ help="use upstream signature, default is auto", type='tristate')
+ orig_group.add_config_file_option("component", action="append", metavar='COMPONENT',
+ dest="components")
+ orig_group.add_boolean_config_file_option(option_name="pristine-tar-commit",
+ dest="pristine_tar_commit")
+ branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
+ branch_group.add_boolean_config_file_option(option_name="submodules", dest="with_submodules")
+ return parser
+
+
+def parse_args(argv, prefix):
+ parser = build_parser(argv[0])
+ if not parser:
+ return None, None
+ options, args = parser.parse_args(argv[1:])
+
+ gbp.log.setup(options.color, options.verbose, options.color_scheme)
+ return options, args
+
+
+def main(argv):
+ retval = 0
+ source = None
+
+ options, args = parse_args(argv, '')
+
+ if args or not options:
+ return ExitCodes.parse_error
+
+ try:
+ repo = DebianGitRepository(os.path.curdir, toplevel=False)
+ except GitRepositoryError:
+ gbp.log.err("%s is not inside a git repository" % (os.path.abspath('.')))
+ return 1
+
+ try:
+ try:
+ source = DebianSource(repo.path)
+ source.is_native()
+ except Exception as e:
+ raise GbpError("Can't determine package type: %s" % e)
+
+ if options.tarball_dir and source.upstream_version is not None:
+ options.tarball_dir = PkgPolicy.version_subst(options.tarball_dir,
+ source.upstream_version)
+
+ output_dir = options.tarball_dir or os.path.join(repo.path, '..')
+
+ if source.is_native():
+ gbp.log.info("Nothing to be done for native package")
+ return 0
+
+ prepare_upstream_tarballs(repo, source, options, output_dir,
+ output_dir)
+ except KeyboardInterrupt:
+ retval = 1
+ gbp.log.err("Interrupted. Aborting.")
+ except CommandExecFailed:
+ retval = 1
+ except (GbpError, GitRepositoryError) as err:
+ if str(err):
+ gbp.log.err(err)
+ retval = 1
+ except DebianSourceError as err:
+ gbp.log.err(err)
+ source = None
+ retval = 1
+
+ return retval
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2014 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Import an RPM package in Bitbake format"""
-
-import configparser
-import sys
-import os
-import shutil
-
-import gbp.tmpfile as tempfile
-import gbp.command_wrappers as gbpc
-import gbp.log
-from gbp.rpm import RpmUpstreamSource
-from gbp.rpm.policy import RpmPkgPolicy
-from gbp.rpm.git import RpmGitRepository, GitRepositoryError
-from gbp.config import (GbpOptionParserBB, GbpOptionGroup,
- no_upstream_branch_msg)
-from gbp.errors import GbpError
-from gbp.pkg import parse_archive_filename
-from gbp.scripts.import_srpm import move_tag_stamp, force_to_branch_head
-from gbp.bb import bb, init_tinfoil, pkg_version, guess_pkg
-
-NO_PACKAGING_BRANCH_MSG = """
-Repository does not have branch '%s' for meta/packaging files.
-You need to reate it or use --packaging-branch to specify it.
-"""
-
-class SkipImport(Exception):
- """Nothing imported"""
- pass
-
-def set_bare_repo_options(options):
- """Modify options for import into a bare repository"""
- if options.pristine_tar:
- gbp.log.info("Bare repository: setting %s option '--no-pristine-tar'")
- options.pristine_tar = False
-
-
-def build_parser(name):
- """Create command line parser"""
- try:
- parser = GbpOptionParserBB(command=os.path.basename(name),
- prefix='',
- usage='%prog [options] /path/to/package'
- '.src.rpm')
- except configparser.ParsingError as err:
- gbp.log.err(err)
- return None
-
- import_group = GbpOptionGroup(parser, "import options",
- "pristine-tar and filtering")
- tag_group = GbpOptionGroup(parser, "tag options",
- "options related to git tag creation")
- branch_group = GbpOptionGroup(parser, "version and branch naming options",
- "version number and branch layout options")
-
- for group in [import_group, branch_group, tag_group ]:
- parser.add_option_group(group)
-
- parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
- default=False, help="verbose command execution")
- parser.add_config_file_option(option_name="color", dest="color",
- type='tristate')
- parser.add_config_file_option(option_name="color-scheme",
- dest="color_scheme")
- parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
- parser.add_config_file_option(option_name="vendor", action="store",
- dest="vendor")
- branch_group.add_config_file_option(option_name="packaging-branch",
- dest="packaging_branch")
- branch_group.add_config_file_option(option_name="upstream-branch",
- dest="upstream_branch")
- branch_group.add_option("--upstream-vcs-tag", dest="vcs_tag",
- help="Upstream VCS tag on top of which to import "
- "the orig sources")
- branch_group.add_boolean_config_file_option(
- option_name="create-missing-branches",
- dest="create_missing_branches")
-
- tag_group.add_boolean_config_file_option(option_name="sign-tags",
- dest="sign_tags")
- tag_group.add_config_file_option(option_name="keyid",
- dest="keyid")
- tag_group.add_config_file_option(option_name="packaging-tag",
- dest="packaging_tag")
- tag_group.add_config_file_option(option_name="upstream-tag",
- dest="upstream_tag")
-
- import_group.add_config_file_option(option_name="filter",
- dest="filters", action="append")
- import_group.add_boolean_config_file_option(option_name="pristine-tar",
- dest="pristine_tar")
- import_group.add_option("--allow-same-version", action="store_true",
- dest="allow_same_version", default=False,
- help="allow to import already imported version")
- import_group.add_config_file_option(option_name="meta-dir",
- dest="meta_dir")
- return parser
-
-def parse_args(argv):
- """Parse commandline arguments"""
- parser = build_parser(argv[0])
- if not parser:
- return None, None
-
- (options, args) = parser.parse_args(argv[1:])
- gbp.log.setup(options.color, options.verbose, options.color_scheme)
- return options, args
-
-
-def init_repo(path):
- """Check and initialize Git repository"""
- try:
- repo = RpmGitRepository(path)
- clean, out = repo.is_clean()
- if not clean and not repo.is_empty():
- gbp.log.err("Repository has uncommitted changes, commit "
- "these first:")
- gbp.log.err(out)
- raise GbpError
- except GitRepositoryError:
- gbp.log.info("No git repository found, creating one in %s" % path)
- repo = RpmGitRepository.create(path)
- return repo
-
-def recursive_copy(src, dst):
- """Recursive copy, overwriting files and preserving symlinks"""
- # Remove existing destinations, if needed
- if os.path.isfile(dst) or os.path.islink(dst):
- os.unlink(dst)
- elif (os.path.isfile(src) or os.path.islink(src)) and os.path.isdir(dst):
- # Remove dst dir if src is a file
- shutil.rmtree(dst)
-
- try:
- if os.path.islink(src):
- os.symlink(os.readlink(src), dst)
- elif os.path.isdir(src):
- if not os.path.exists(dst):
- os.makedirs(dst)
- for fname in os.listdir(src):
- recursive_copy(os.path.join(src, fname),
- os.path.join(dst, fname))
- else:
- shutil.copy2(src, dst)
- except (IOError, OSError) as err:
- raise GbpError("Error while copying '%s' to '%s': %s" % (src, dst, err))
-
-def guess_upstream_source(pkg_data, remotes):
- """Guess the primary upstream source archive."""
- orig = None
- name = pkg_data.getVar('PN', True)
-
- for fetch_data in remotes:
- if fetch_data.type == 'git':
- orig = fetch_data
- else:
- path = fetch_data.localpath
- fname = os.path.basename(path)
- fn_base, archive_fmt, _ = parse_archive_filename(fname)
- if fn_base.startswith(name) and archive_fmt:
- # Take an archive that starts with pkg name
- orig = fetch_data
- # otherwise we take the first archive
- elif not orig and archive_fmt:
- orig = fetch_data
- # else don't accept
- return orig
-
-def bb_get_files(pkg_data, tgt_dir, whole_dir=False, download=True):
- """Get (local) packaging files"""
- uris = (pkg_data.getVar('SRC_URI', True) or "").split()
- try:
- fetch = bb.fetch2.Fetch(uris, pkg_data)
- if download:
- gbp.log.info("Fetching sources...")
- fetch.download()
- except bb.fetch2.BBFetchException as err:
- raise GbpError("Failed to fetch packaging files: %s" % err)
-
- # Copy local files to target directory
- bb_dir = os.path.dirname(pkg_data.getVar('FILE', True))
- remote = []
- local = [path for path in pkg_data.getVar('BBINCLUDED', True).split() if
- path.startswith(bb_dir) and os.path.exists(path)]
- for url in fetch.urls:
- path = fetch.localpath(url)
- if path.startswith(bb_dir):
- if not whole_dir:
- gbp.log.debug("Found local meta file '%s'" % path)
- local.append(path)
- else:
- gbp.log.debug("Found remote file '%s'" % path)
- remote.append(fetch.ud[url])
-
- if whole_dir:
- # Simply copy whole meta dir, if requested
- recursive_copy(bb_dir, tgt_dir)
- else:
- for path in local:
- relpath = os.path.relpath(path, bb_dir)
- subdir = os.path.join(tgt_dir, os.path.dirname(relpath))
- if not os.path.exists(subdir):
- os.makedirs(subdir)
- shutil.copy2(path, os.path.join(tgt_dir, relpath))
-
- return remote
-
-def import_upstream_archive(repo, pkg_data, fetch_data, dirs, options):
- """Import upstream sources from archive"""
- # Unpack orig source archive
- path = fetch_data.localpath
- sources = RpmUpstreamSource(path)
- sources = sources.unpack(dirs['origsrc'], options.filters)
-
- tag_str_fields = dict(pkg_version(pkg_data), vendor=options.vendor.lower())
- tag = repo.version_to_tag(options.upstream_tag, tag_str_fields)
- if not repo.has_tag(tag):
- gbp.log.info("Tag %s not found, importing upstream sources" % tag)
- branch = options.upstream_branch
-
- msg = "Upstream version %s" % tag_str_fields['upstreamversion']
- if options.vcs_tag:
- parents = [repo.rev_parse("%s^{}" % options.vcs_tag)]
- else:
- parents = None
- commit = repo.commit_dir(sources.unpacked, "Imported %s" % msg,
- branch, other_parents=parents,
- create_missing_branch=options.create_missing_branches)
- repo.create_tag(name=tag, msg=msg, commit=commit,
- sign=options.sign_tags, keyid=options.keyid)
-
- if options.pristine_tar:
- archive_fmt = parse_archive_filename(path)[1]
- if archive_fmt == 'tar':
- repo.pristine_tar.commit(path, 'refs/heads/%s' % branch)
- else:
- gbp.log.warn('Ignoring pristine-tar, %s archives '
- 'not supported' % archive_fmt)
- return repo.rev_parse('%s^0' % tag)
-
-def import_upstream_git(repo, fetch_data, options):
- """Import upstream sources from Git"""
- # Fetch from local cached repo
- for branch in list(fetch_data.branches.values()):
- repo.fetch(repo=fetch_data.localpath, refspec=branch)
-
- commit = fetch_data.revision
- repo.update_ref('refs/heads/' + options.upstream_branch, commit)
- return commit
-
-def import_upstream_sources(repo, pkg_data, remotes, dirs, options):
- """Import upstream sources to Git"""
- fetch_data = guess_upstream_source(pkg_data, remotes)
- if fetch_data:
- gbp.log.debug("Using upstream source '%s'" % fetch_data.url)
- else:
- gbp.log.info("No orig source archive imported")
- return
-
- if not repo.has_branch(options.upstream_branch):
- if options.create_missing_branches:
- gbp.log.info("Will create missing branch '%s'" %
- options.upstream_branch)
- else:
- gbp.log.err(no_upstream_branch_msg % options.upstream_branch + "\n"
- "Also check the --create-missing-branches option.")
- raise GbpError
-
- if fetch_data.type == 'git':
- return import_upstream_git(repo, fetch_data, options)
- else:
- return import_upstream_archive(repo, pkg_data, fetch_data, dirs,
- options)
-
-
-def main(argv):
- """Main function of the gbp import-bb script"""
- dirs = dict(top=os.path.abspath(os.curdir))
- ret = 0
- skipped = False
-
- if not bb:
- return 1
-
- options, args = parse_args(argv)
-
- if len(args) == 0 or len(args) > 2:
- gbp.log.err("Need to give exactly one package to import. Try --help.")
- return 1
-
- try:
- dirs['tmp_base'] = tempfile.mkdtemp(dir=options.tmp_dir,
- prefix='import-bb')
- tinfoil = init_tinfoil()
- pkg_bb = guess_pkg(tinfoil, args[0])
- dirs['src'] = os.path.abspath(os.path.dirname(pkg_bb))
- gbp.log.info("Importing '%s' from '%s'" %
- (os.path.basename(pkg_bb), dirs['src']))
-
- pkg_data = bb.cache.Cache.loadDataFull(pkg_bb, [], tinfoil.config_data)
-
- # Determine target repo dir
- target_dir = ''
- if len(args) == 2:
- target_dir = args[1]
- else:
- if 'BUILDDIR' in os.environ:
- target_dir = os.path.join(os.environ['BUILDDIR'], 'devel')
- target_dir = os.path.join(target_dir, pkg_data.getVar('PN', True))
-
- # Check the Git repository state
- repo = init_repo(target_dir)
- if repo.bare:
- set_bare_repo_options(options)
- if repo.is_empty():
- options.create_missing_branches = True
- os.chdir(repo.path)
-
- # Create more tempdirs
- dirs['origsrc'] = tempfile.mkdtemp(dir=dirs['tmp_base'],
- prefix='origsrc_')
- dirs['packaging_base'] = tempfile.mkdtemp(dir=dirs['tmp_base'],
- prefix='packaging_')
- dirs['packaging'] = os.path.join(dirs['packaging_base'],
- options.meta_dir)
-
- # Copy (local) packaging files to tmp dir
- remote_srcs = bb_get_files(pkg_data, dirs['packaging'])
-
- version_dict = pkg_version(pkg_data)
- tag_str_fields = dict(version_dict, vendor=options.vendor.lower())
- ver_str = RpmPkgPolicy.compose_full_version(version_dict)
-
- # Check if the same version of the package is already imported
- if repo.find_version(options.packaging_tag, tag_str_fields):
- gbp.log.warn("Version %s already imported." % ver_str)
- if options.allow_same_version:
- gbp.log.info("Moving tag of version '%s' since import forced" %
- ver_str)
- move_tag_stamp(repo, options.packaging_tag, tag_str_fields)
- else:
- raise SkipImport
-
- # Import upstream sources
- import_upstream_sources(repo, pkg_data, remote_srcs, dirs, options)
-
- # Import packaging files
- gbp.log.info("Importing local meta/packaging files")
- branch = options.packaging_branch
- if not repo.has_branch(branch):
- if options.create_missing_branches:
- gbp.log.info("Will create missing branch '%s'" % branch)
- else:
- gbp.log.err(NO_PACKAGING_BRANCH_MSG % branch + "\n"
- "Also check the --create-missing-branches "
- "option.")
- raise GbpError
-
- tag = repo.version_to_tag(options.packaging_tag, tag_str_fields)
- msg = "%s release %s" % (options.vendor, ver_str)
-
- commit = repo.commit_dir(dirs['packaging_base'],
- "Imported %s" % msg,
- branch,
- create_missing_branch=options.create_missing_branches)
-
- # Create packaging tag
- repo.create_tag(name=tag,
- msg=msg,
- commit=commit,
- sign=options.sign_tags,
- keyid=options.keyid)
-
- force_to_branch_head(repo, options.packaging_branch)
-
- except KeyboardInterrupt:
- ret = 1
- gbp.log.err("Interrupted. Aborting.")
- except gbpc.CommandExecFailed:
- ret = 1
- except GitRepositoryError as err:
- gbp.log.err("Git command failed: %s" % err)
- ret = 1
- except GbpError as err:
- if len(err.__str__()):
- gbp.log.err(err)
- ret = 1
- except SkipImport:
- skipped = True
- finally:
- os.chdir(dirs['top'])
- gbpc.RemoveTree(dirs['tmp_base'])()
-
- if not ret and not skipped:
- gbp.log.info("Version '%s' imported under '%s'" %
- (ver_str, repo.path))
- return ret
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
-
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
-# (C) 2006,2007,2011,2012 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006, 2007, 2011, 2012, 2015-2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Import a Debian source package into a GIT repository"""
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
+"""Import a Debian source package into a Git repository"""
-import configparser
import sys
import re
import os
import shutil
+import tempfile
import glob
import pipes
import time
-import gbp.tmpfile as tempfile
import gbp.command_wrappers as gbpc
from gbp.deb.dscfile import DscFile
-from gbp.deb.upstreamsource import DebianUpstreamSource
+from gbp.deb.upstreamsource import (DebianUpstreamSource,
+ DebianAdditionalTarball)
from gbp.deb.git import (DebianGitRepository, GitRepositoryError)
from gbp.deb.changelog import ChangeLog
from gbp.git import rfc822_date_to_git
from gbp.git.modifier import GitModifier
+from gbp.git.vfs import GitVfs
from gbp.config import (GbpOptionParserDebian, GbpOptionGroup,
- no_upstream_branch_msg)
+ no_debian_branch_msg, no_upstream_branch_msg)
from gbp.errors import GbpError
+from gbp.scripts.common import ExitCodes, debug_exc
+from gbp.scripts.common import repo_setup
import gbp.log
+
class SkipImport(Exception):
pass
-def download_source(pkg, dirs, unauth, tmpdir_base):
- opts = [ '--download-only' ]
+def download_source(pkg, dirs, unauth):
+ opts = ['--download-only']
if unauth:
opts.append('--allow-unauthenticated')
cmd = 'apt-get'
opts += ['-qq', 'source', pkg]
- dirs['download'] = tempfile.mkdtemp(dir=tmpdir_base,
- prefix='import-dsc_download_')
+ dirs['download'] = os.path.abspath(tempfile.mkdtemp())
gbp.log.info("Downloading '%s' using '%s'..." % (pkg, cmd))
gbpc.RunAtCommand(cmd, opts, shell=False)(dir=dirs['download'])
- dsc = glob.glob(os.path.join(dirs['download'], '*.dsc'))[0]
+ try:
+ dsc = glob.glob(os.path.join(dirs['download'], '*.dsc'))[0]
+ except IndexError:
+ raise GbpError("Did not find a dsc file at %s/" % dirs['download'])
return dsc
def apply_patch(diff):
"Apply patch to a source tree"
+ patch_opts = ['-N', '-p1', '-F0', '-u', '-t',
+ '-Vnever', '-g0', '-z.gbp.orig',
+ '--quiet']
+
pipe = pipes.Template()
- pipe.prepend('gunzip -c %s' % diff, '.-')
- pipe.append('patch -p1 --quiet', '-.')
+ pipe.prepend('gunzip -c %s' % diff, '.-')
+ pipe.append('patch %s' % ' '.join(patch_opts), '-.')
+
try:
ret = pipe.copy('', '')
if ret:
- gbp.log.err("Error import %s: %d" % (diff, ret))
- return False
+ raise GbpError("Error import %s: %d" % (diff, ret))
except OSError as err:
- gbp.log.err("Error importing %s: %s" % (diff, err[0]))
- return False
- return True
+ raise GbpError("Error importing %s: %s" % (diff, err[0]))
-def apply_deb_tgz(deb_tgz):
+def apply_deb_tgz(deb_tgz, filters):
"""Apply .debian.tar.gz (V3 source format)"""
# Remove any existing data in debian/ as dpkg-source -x does
if os.path.isdir('debian'):
shutil.rmtree('debian')
- gbpc.UnpackTarArchive(deb_tgz, ".")()
- return True
+ gbpc.UnpackTarArchive(deb_tgz, ".", filters)()
+
+
+def get_changes(dir, repo, debian_branch):
+ if repo.empty:
+ version = "0~"
+ else:
+ vfs = GitVfs(repo, debian_branch)
+ try:
+ with vfs.open('debian/changelog') as f:
+ version = ChangeLog(contents=f.read()).version
+ except IOError:
+ version = "0~" # Use full history if debian branch has no changelog
+ cl = ChangeLog(filename=os.path.join(dir, 'debian/changelog'))
+ return cl.get_changes(version)
def get_author_from_changelog(dir):
Get author from debian/changelog
"""
dch = ChangeLog(filename=os.path.join(dir, 'debian/changelog'))
- date = rfc822_date_to_git(dch.date)
+ date = rfc822_date_to_git(dch.date, fuzzy=True)
if not (dch.author or dch.email):
gbp.log.warn("Failed to parse maintainer")
return parents
-def apply_debian_patch(repo, unpack_dir, src, options, tag):
+
+def apply_debian_patch(repo, source, dsc, upstream_commit, options):
"""apply the debian patch and tag appropriately"""
- try:
- os.chdir(unpack_dir)
- if src.diff and not apply_patch(src.diff):
- raise GbpError
+ try:
+ os.chdir(source.unpacked)
- if src.deb_tgz and not apply_deb_tgz(src.deb_tgz):
- raise GbpError
+ if dsc.diff:
+ apply_patch(dsc.diff)
+ elif dsc.deb_tgz:
+ apply_deb_tgz(dsc.deb_tgz, options.filters)
+ else:
+ raise GbpError("Neither a Debian diff nor tarball found")
if os.path.exists('debian/rules'):
os.chmod('debian/rules', 0o755)
os.chdir(repo.path)
- parents = check_parents(repo,
- options.packaging_branch,
- tag)
-
- author = get_author_from_changelog(unpack_dir)
+ parents = check_parents(repo, options.debian_branch, upstream_commit)
+ author = get_author_from_changelog(source.unpacked)
committer = get_committer_from_author(author, options)
- commit = repo.commit_dir(unpack_dir,
- "Imported Debian patch %s" % src.version,
- branch = options.packaging_branch,
- other_parents = parents,
+
+ changes = get_changes(source.unpacked,
+ repo,
+ options.debian_branch)
+ commit_msg = "Import Debian changes %s\n%s" % (dsc.version, changes)
+ commit = repo.commit_dir(source.unpacked,
+ commit_msg,
+ branch=options.debian_branch,
+ other_parents=parents,
author=author,
committer=committer)
- if not options.skip_packaging_tag:
- repo.create_tag(repo.version_to_tag(options.packaging_tag, src.version),
- msg="Debian release %s" % src.version,
+ if not options.skip_debian_tag:
+ repo.create_tag(repo.version_to_tag(options.debian_tag, dsc.version),
+ msg="Debian release %s" % dsc.version,
commit=commit,
sign=options.sign_tags,
keyid=options.keyid)
except (gbpc.CommandExecFailed, GitRepositoryError) as err:
- msg = err.__str__() if len(err.__str__()) else ''
- gbp.log.err("Failed to import Debian package: %s" % msg)
- raise GbpError
+ msg = str(err) or 'Unknown error, please report a bug'
+ raise GbpError("Failed to import Debian package: %s" % msg)
finally:
os.chdir(repo.path)
+def create_missing_branch(repo, branch, options, err_msg):
+ if not repo.has_branch(branch):
+ if options.create_missing_branches:
+ gbp.log.info("Creating missing branch '%s'" % branch)
+ repo.create_branch(branch)
+ else:
+ raise GbpError(err_msg + "\n"
+ "Also check the --create-missing-branches option.")
+
+
+def import_native(repo, source, dsc, options):
+ tag = repo.version_to_tag(options.debian_tag, dsc.upstream_version)
+ msg = "Debian version %s" % dsc.upstream_version
+
+ gbp.log.info("Tag %s not found, importing Debian tarball" % tag)
+ if repo.empty:
+ branch = None
+ else:
+ branch = options.debian_branch
+ create_missing_branch(repo, branch, options,
+ no_debian_branch_msg % branch)
+
+ author = get_author_from_changelog(source.unpacked)
+ committer = get_committer_from_author(author, options)
+ commit_msg = "Import %s\n%s" % (msg, get_changes(source.unpacked,
+ repo,
+ options.debian_branch))
+ commit = repo.commit_dir(source.unpacked,
+ commit_msg,
+ branch,
+ author=author,
+ committer=committer)
+ if not options.skip_debian_tag:
+ repo.create_tag(name=tag,
+ msg=msg,
+ commit=commit,
+ sign=options.sign_tags,
+ keyid=options.keyid)
+ if repo.empty and not repo.has_branch(options.debian_branch):
+ repo.create_branch(options.debian_branch, commit)
+ return commit
+
+
+def import_upstream(repo, source, dsc, options):
+ tag = repo.version_to_tag(options.upstream_tag, dsc.upstream_version)
+ msg = "Upstream version %s" % dsc.upstream_version
+
+ if repo.empty:
+ branch = None
+ else:
+ branch = options.upstream_branch
+ create_missing_branch(repo, branch, options,
+ no_upstream_branch_msg % branch)
+
+ author = committer = {}
+ commit_msg = "Import %s" % msg
+
+ upstream_parent = repo.vcs_tag_parent(options.vcs_tag,
+ dsc.upstream_version)
+ commit = repo.commit_dir(source.unpacked,
+ commit_msg,
+ branch,
+ other_parents=upstream_parent,
+ author=author,
+ committer=committer)
+
+ # if the repo was just created make sure debian branch is in .git/HEAD
+ # and upstream points to the first commit
+ if repo.empty:
+ if repo.branch != options.debian_branch:
+ repo.rename_branch(repo.branch, options.debian_branch)
+ repo.create_branch(options.upstream_branch, options.debian_branch)
+
+ repo.create_tag(name=tag,
+ msg=msg,
+ commit=commit,
+ sign=options.sign_tags,
+ keyid=options.keyid)
+ return commit
+
+
def print_dsc(dsc):
if dsc.native:
- gbp.log.debug("Debian Native Package %s")
+ gbp.log.debug("Debian Native Package")
gbp.log.debug("Version: %s" % dsc.upstream_version)
gbp.log.debug("Debian tarball: %s" % dsc.tgz)
else:
gbp.log.debug("Upstream version: %s" % dsc.upstream_version)
gbp.log.debug("Debian version: %s" % dsc.debian_version)
gbp.log.debug("Upstream tarball: %s" % dsc.tgz)
+ if dsc.additional_tarballs:
+ gbp.log.debug("Additional tarballs: %s" % ", ".join(dsc.additional_tarballs.values()))
if dsc.diff:
gbp.log.debug("Debian patch: %s" % dsc.diff)
if dsc.deb_tgz:
repo.move_tag(old, new)
-def set_bare_repo_options(options):
- """Modify options for import into a bare repository"""
+def disable_pristine_tar(options, reason):
+ """Disable pristine tar if enabled"""
if options.pristine_tar:
- gbp.log.info("Bare repository: setting %s option"
- % (["", " '--no-pristine-tar'"][options.pristine_tar], ))
+ gbp.log.info("%s: setting '--no-pristine-tar' option" % reason)
options.pristine_tar = False
+
def build_parser(name):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
- usage='%prog [options] /path/to/package.dsc')
- except configparser.ParsingError as err:
+ usage='%prog [options] /path/to/package.dsc [target]')
+ except GbpError as err:
gbp.log.err(err)
return None
import_group = GbpOptionGroup(parser, "import options",
- "pristine-tar and filtering")
+ "pristine-tar and filtering")
tag_group = GbpOptionGroup(parser, "tag options",
- "options related to git tag creation")
+ "options related to git tag creation")
branch_group = GbpOptionGroup(parser, "version and branch naming options",
- "version number and branch layout options")
-
- for group in [import_group, branch_group, tag_group ]:
+ "version number and branch layout options")
+ for group in [import_group, branch_group, tag_group]:
parser.add_option_group(group)
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
- parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
- parser.add_option("--download", action="store_true", dest="download", default=False,
- help="download source package")
branch_group.add_config_file_option(option_name="debian-branch",
- dest="packaging_branch")
+ dest="debian_branch")
branch_group.add_config_file_option(option_name="upstream-branch",
- dest="upstream_branch")
+ dest="upstream_branch")
branch_group.add_boolean_config_file_option(option_name="create-missing-branches",
- dest="create_missing_branches")
+ dest="create_missing_branches")
+ branch_group.add_config_file_option(option_name="upstream-vcs-tag", dest="vcs_tag")
tag_group.add_boolean_config_file_option(option_name="sign-tags",
- dest="sign_tags")
+ dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid",
- dest="keyid")
+ dest="keyid")
tag_group.add_config_file_option(option_name="debian-tag",
- dest="packaging_tag")
+ dest="debian_tag")
tag_group.add_config_file_option(option_name="upstream-tag",
- dest="upstream_tag")
- tag_group.add_option("--skip-debian-tag",dest="skip_packaging_tag",
+ dest="upstream_tag")
+ tag_group.add_option("--skip-debian-tag", dest="skip_debian_tag",
action="store_true", default=False,
help="Don't add a tag after importing the Debian patch")
-
import_group.add_config_file_option(option_name="filter",
- dest="filters", action="append")
+ dest="filters", action="append")
import_group.add_boolean_config_file_option(option_name="pristine-tar",
- dest="pristine_tar")
+ dest="pristine_tar")
import_group.add_option("--allow-same-version", action="store_true",
- dest="allow_same_version", default=False,
- help="allow to import already imported version")
+ dest="allow_same_version", default=False,
+ help="allow import of already imported version")
import_group.add_boolean_config_file_option(option_name="author-is-committer",
- dest="author_committer")
+ dest="author_committer")
import_group.add_boolean_config_file_option(option_name="author-date-is-committer-date",
- dest="author_committer_date")
+ dest="author_committer_date")
import_group.add_boolean_config_file_option(option_name="allow-unauthenticated",
- dest="allow_unauthenticated")
+ dest="allow_unauthenticated")
+
+ parser.add_config_file_option(option_name="repo-user", dest="repo_user",
+ choices=['DEBIAN', 'GIT'])
+ parser.add_config_file_option(option_name="repo-email", dest="repo_email",
+ choices=['DEBIAN', 'GIT'])
+ parser.add_option("--download", dest='download', action="store_true",
+ default=False, help="Ignored. Accepted for compatibility; see EXAMPLES in gbp-import-dsc(1).")
return parser
(options, args) = parser.parse_args(argv[1:])
gbp.log.setup(options.color, options.verbose, options.color_scheme)
+
+ if options.download:
+ gbp.log.warn("Passing --download explicitly is deprecated.")
+
return options, args
+def is_download(pkg):
+ """
+ >>> is_download("http://foo.example.com/apackage.dsc")
+ (True, 'http://foo.example.com/apackage.dsc')
+ >>> is_download("apt:///apackage/sid")
+ (True, 'apackage/sid')
+ >>> is_download("apt://apackage/sid")
+ (True, 'apackage/sid')
+ >>> is_download("apt:apackage/sid")
+ (True, 'apackage/sid')
+ >>> is_download("apt_1.0_amd64.dsc")
+ (False, 'apt_1.0_amd64.dsc')
+ >>> is_download("file:///foo/apackage.dsc")
+ (False, '/foo/apackage.dsc')
+ """
+ if pkg.startswith('file://'):
+ return (False, pkg[len('file://'):])
+ elif pkg.startswith('apt:'):
+ return (True, re.match(r'apt:([/]{2,3})?(?P<pkg>.*)', pkg).group('pkg'))
+ elif re.match("[a-z]{1,5}://", pkg):
+ return (True, pkg)
+ return (False, pkg)
+
+
+def parse_all(argv):
+ options, args = parse_args(argv)
+ if not options:
+ return None, None, None
+
+ if len(args) == 1:
+ pkg = args[0]
+ target = None
+ elif len(args) == 2:
+ pkg = args[0]
+ target = args[1]
+ else:
+ gbp.log.err("Need to give exactly one package to import. Try --help.")
+ return None, None, None
+
+ download, pkg = is_download(pkg)
+ # honor options.download until removed
+ options.download = download or options.download
+ return options, pkg, target
+
+
def main(argv):
dirs = dict(top=os.path.abspath(os.curdir))
needs_repo = False
- ret = 0
+ ret = 1
skipped = False
- parents = None
- options, args = parse_args(argv)
+ options, pkg, target = parse_all(argv)
if not options:
- return 1
+ return ExitCodes.parse_error
try:
- if len(args) != 1:
- gbp.log.err("Need to give exactly one package to import. Try --help.")
- raise GbpError
- else:
- pkg = args[0]
- if options.download:
- dsc = download_source(pkg,
+ try:
+ repo = DebianGitRepository('.')
+ # remember if the was repo initially empty
+ repo.empty = repo.is_empty()
+
+ (clean, out) = repo.is_clean()
+ if not clean and not repo.empty:
+ raise GbpError("Repository has uncommitted changes, commit these first: %s" % out)
+ except GitRepositoryError:
+ # no repo found, create one
+ needs_repo = True
+
+ if options.download:
+ dscfile = download_source(pkg,
dirs=dirs,
- unauth=options.allow_unauthenticated,
- tmpdir_base=options.tmp_dir)
+ unauth=options.allow_unauthenticated)
+ else:
+ dscfile = pkg
+
+ dsc = DscFile.parse(dscfile)
+ if dsc.pkgformat not in ['1.0', '3.0']:
+ raise GbpError("Importing %s source format not yet supported." % dsc.pkgformat)
+ if options.verbose:
+ print_dsc(dsc)
+
+ if needs_repo:
+ target = target or dsc.pkg
+ if os.path.exists(target):
+ raise GbpError("Directory '%s' already exists. If you want to import into it, "
+ "please change into this directory otherwise move it away first."
+ % target)
+ gbp.log.info("No git repository found, creating one.")
+ repo = DebianGitRepository.create(target)
+ repo.empty = True
+ os.chdir(repo.path)
+ repo_setup.set_user_name_and_email(options.repo_user, options.repo_email, repo)
+
+ if repo.bare:
+ disable_pristine_tar(options, "Bare repository")
+
+ # unpack
+ dirs['tmp'] = os.path.abspath(tempfile.mkdtemp(dir='..'))
+ sigfile = '{}.asc'.format(dsc.tgz)
+ sigfile = sigfile if sigfile in dsc.sigs else None
+ sources = [DebianUpstreamSource(dsc.tgz, sig=sigfile)]
+ for component, tarball in dsc.additional_tarballs.items():
+ sigfile = '{}.asc'.format(tarball)
+ sigfile = sigfile if sigfile in dsc.sigs else None
+ sources.append(DebianAdditionalTarball(tarball, component))
+ sources[0].unpack(dirs['tmp'], options.filters)
+ for tarball in sources[1:]:
+ gbp.log.info("Found component tarball '%s'" % os.path.basename(tarball.path))
+ tarball.unpack(sources[0].unpacked, options.filters)
+
+ if repo.find_version(options.debian_tag, dsc.version):
+ gbp.log.warn("Version %s already imported." % dsc.version)
+ if options.allow_same_version:
+ gbp.log.info("Moving tag of version '%s' since import forced" % dsc.version)
+ move_tag_stamp(repo, options.debian_tag, dsc.version)
else:
- dsc = pkg
-
- src = DscFile.parse(dsc)
- if src.pkgformat not in [ '1.0', '3.0' ]:
- raise GbpError("Importing %s source format not yet supported." % src.pkgformat)
- if options.verbose:
- print_dsc(src)
-
- try:
- repo = DebianGitRepository('.')
- is_empty = repo.is_empty()
-
- (clean, out) = repo.is_clean()
- if not clean and not is_empty:
- gbp.log.err("Repository has uncommitted changes, commit these first: ")
- raise GbpError(out)
-
- except GitRepositoryError:
- # no repo found, create one
- needs_repo = True
- is_empty = True
-
- if needs_repo:
- gbp.log.info("No git repository found, creating one.")
- repo = DebianGitRepository.create(src.pkg)
- os.chdir(repo.path)
-
- if repo.bare:
- set_bare_repo_options(options)
-
- dirs['tmp'] = tempfile.mkdtemp(dir=options.tmp_dir,
- prefix='import-dsc_')
- upstream = DebianUpstreamSource(src.tgz)
- upstream = upstream.unpack(dirs['tmp'], options.filters)
-
- format = [(options.upstream_tag, "Upstream"), (options.packaging_tag, "Debian")][src.native]
- tag = repo.version_to_tag(format[0], src.upstream_version)
- msg = "%s version %s" % (format[1], src.upstream_version)
-
- if repo.find_version(options.packaging_tag, src.version):
- gbp.log.warn("Version %s already imported." % src.version)
- if options.allow_same_version:
- gbp.log.info("Moving tag of version '%s' since import forced" % src.version)
- move_tag_stamp(repo, options.packaging_tag, src.version)
- else:
- raise SkipImport
-
- if not repo.find_version(format[0], src.upstream_version):
- gbp.log.info("Tag %s not found, importing %s tarball" % (tag, format[1]))
- if is_empty:
- branch = None
- else:
- branch = [options.upstream_branch,
- options.packaging_branch][src.native]
- if not repo.has_branch(branch):
- if options.create_missing_branches:
- gbp.log.info("Creating missing branch '%s'" % branch)
- repo.create_branch(branch)
- else:
- gbp.log.err(no_upstream_branch_msg % branch +
- "\nAlso check the --create-missing-branches option.")
- raise GbpError
-
- if src.native:
- author = get_author_from_changelog(upstream.unpacked)
- committer = get_committer_from_author(author, options)
- else:
- author = committer = {}
-
- commit = repo.commit_dir(upstream.unpacked,
- "Imported %s" % msg,
- branch,
- author=author,
- committer=committer)
-
- if not (src.native and options.skip_packaging_tag):
- repo.create_tag(name=tag,
- msg=msg,
- commit=commit,
- sign=options.sign_tags,
- keyid=options.keyid)
- if not src.native:
- if is_empty:
- repo.create_branch(options.upstream_branch, commit)
- if options.pristine_tar:
- repo.pristine_tar.commit(src.tgz, options.upstream_branch)
- if (not repo.has_branch(options.packaging_branch)
- and (is_empty or options.create_missing_branches)):
- repo.create_branch(options.packaging_branch, commit)
- if not src.native:
- if src.diff or src.deb_tgz:
- apply_debian_patch(repo, upstream.unpacked, src, options,
- tag)
+ raise SkipImport
+
+ # import
+ if dsc.native:
+ import_native(repo, sources[0], dsc, options)
+ else:
+ imported = False
+ commit = repo.find_version(options.upstream_tag, dsc.upstream_version)
+ if not repo.find_version(options.upstream_tag, dsc.upstream_version):
+ commit = import_upstream(repo, sources[0], dsc, options)
+ imported = True
+
+ if not repo.has_branch(options.debian_branch):
+ if options.create_missing_branches:
+ repo.create_branch(options.debian_branch, commit)
else:
- gbp.log.warn("Didn't find a diff to apply.")
- if repo.get_branch() == options.packaging_branch or is_empty:
- # Update HEAD if we modified the checked out branch
- repo.force_head(options.packaging_branch, hard=True)
+ raise GbpError("Branch %s does not exist, use --create-missing-branches" %
+ options.debian_branch)
+
+ if dsc.diff or dsc.deb_tgz:
+ apply_debian_patch(repo, sources[0], dsc, commit, options)
+ else:
+ gbp.log.warn("Didn't find a diff to apply.")
+
+ if imported and options.pristine_tar:
+ repo.create_pristine_tar_commits(commit, sources)
+ if repo.get_branch() == options.debian_branch or repo.empty:
+ # Update HEAD if we modified the checked out branch
+ repo.force_head(options.debian_branch, hard=True)
+ ret = 0
except KeyboardInterrupt:
- ret = 1
gbp.log.err("Interrupted. Aborting.")
except gbpc.CommandExecFailed:
- ret = 1
+ pass # command itself printed an error
except GitRepositoryError as msg:
gbp.log.err("Git command failed: %s" % msg)
- ret = 1
+ debug_exc(options)
except GbpError as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
- ret = 1
+ debug_exc(options)
except SkipImport:
skipped = True
+ ret = 0
finally:
os.chdir(dirs['top'])
-
- for d in [ 'tmp', 'download' ]:
- if d in dirs:
- gbpc.RemoveTree(dirs[d])()
+ for d in ['tmp', 'download']:
+ if d in dirs:
+ gbpc.RemoveTree(dirs[d])()
if not ret and not skipped:
- gbp.log.info("Version '%s' imported under '%s'" % (src.version, src.pkg))
+ gbp.log.info("Version '%s' imported under '%s'" % (dsc.version, repo.path))
return ret
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
from gbp.config import GbpOptionParser
import gbp.log
+
class DscCompareVersions(DpkgCompareVersions):
def __init__(self):
DpkgCompareVersions.__init__(self)
gbp.log.info("Downloading snapshots of '%s' to '%s'..." %
(pkg, downloaddir))
- debsnap = gbpc.Command("debsnap", [ '--force', '--destdir=%s' %
- (downloaddir), pkg])
+ debsnap = gbpc.Command("debsnap", ['--force', '--destdir=%s' %
+ (downloaddir), pkg])
try:
- debsnap()
- except gbpc.CommandExecFailed:
+ debsnap(quiet=True)
+ except gbpc.CommandExecFailed as e:
if debsnap.retcode == 2:
+ gbp.log.err(e)
gbp.log.warn("Some packages failed to download. Continuing.")
pass
else:
return [os.path.join(downloaddir, dsc) for dsc in dscs]
+
def set_gbp_conf_files():
"""
Filter out all gbp.conf files that are local to the git repository and set
os.environ['GBP_CONF_FILES'] = gbp_conf_files
gbp.log.debug("Setting GBP_CONF_FILES to '%s'" % gbp_conf_files)
+
def print_help():
print("""Usage: gbp import-dscs [options] [gbp-import-dsc options] /path/to/dsc1 [/path/to/dsc2] ...
gbp import-dscs --debsnap [options] [gbp-import-dsc options] package
Options:
- --ignore-repo-config: ignore gbp.conf in git repo
+ --debsnap: use debsnap command to download packages
+ --ignore-repo-config ignore gbp.conf in git repo
""")
for dsc in dscs[1:]:
if importer.importdsc(dsc):
raise GbpError("Failed to import '%s'" % dscs[0].dscfile)
-
+ except KeyboardInterrupt:
+ ret = 1
+ gbp.log.err("Interrupted. Aborting.")
except (GbpError, gbpc.CommandExecFailed, GitRepositoryError) as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
ret = 1
finally:
gbp.log.info('Everything imported under %s' % dirs['pkg'])
return ret
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
# vim: set fileencoding=utf-8 :
#
-# (C) 2006, 2007, 2009, 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006, 2007, 2009, 2011, 2015, 2016, 2019 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
-"""Import a new upstream version into a GIT repository"""
+"""Import a new upstream version into a Git repository"""
-import configparser
import os
+import shutil
import sys
-import gbp.tmpfile as tempfile
+import tempfile
+import time
import gbp.command_wrappers as gbpc
from gbp.deb import (DebianPkgPolicy, parse_changelog_repo)
+from gbp.deb.format import DebianSourceFormat
from gbp.deb.upstreamsource import DebianUpstreamSource
from gbp.deb.uscan import (Uscan, UscanError)
from gbp.deb.changelog import ChangeLog, NoChangeLogError
-from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
+from gbp.deb.git import GitRepositoryError
from gbp.config import GbpOptionParserDebian, GbpOptionGroup, no_upstream_branch_msg
from gbp.errors import GbpError
-from gbp.format import format_msg
+from gbp.format import format_str
+from gbp.git.vfs import GitVfs
import gbp.log
-from gbp.pkg import compressor_opts
-from gbp.scripts.common.import_orig import (cleanup_tmp_tree, ask_package_name,
- ask_package_version,
- prepare_sources)
+from gbp.scripts.common import ExitCodes, is_download, get_component_tarballs
+from gbp.scripts.common.import_orig import (orig_needs_repack, cleanup_tmp_tree,
+ ask_package_name, ask_package_version,
+ repack_upstream, is_link_target, download_orig)
+from gbp.scripts.common.hook import Hook
+from gbp.deb.rollbackgit import RollbackDebianGitRepository
+
+
+def maybe_link(orig, link):
+ """
+ Create a symlink named link pointing to orig if
+ that is not the case already.
+ """
+ if is_link_target(orig, link):
+ return False
+
+ if os.path.exists(link):
+ backup = "%s.%d" % (link, time.time())
+ gbp.log.info("%s already exists, moving to %s" % (link, backup))
+ shutil.move(link, backup)
+ os.symlink(os.path.abspath(orig), link)
+ return True
+
+
+def prepare_pristine_tar(archive, pkg, version):
+ """
+ Prepare the upstream source for pristine tar import.
+
+ This checks if the upstream source is actually a tarball
+ and creates a symlink from I{archive}
+ to I{<pkg>_<version>.orig.tar.<ext>} so pristine-tar will
+ see the correct basename. Same goes for an optional signature.
+
+ @param archive: the upstream source's name
+ @type archive: C{str}
+ @param pkg: the source package's name
+ @type pkg: C{str}
+ @param version: the upstream version number
+ @type version: C{str}
+ @rtype: C{str}
+ """
+ linked = False
+ if os.path.isdir(archive):
+ return None, False
+
+ ext = os.path.splitext(archive)[1]
+ if ext in ['.tgz', '.tbz2', '.tlz', '.txz']:
+ ext = ".%s" % ext[2:]
+
+ link = "../%s_%s.orig.tar%s" % (pkg, version, ext)
+ if os.path.basename(archive) != os.path.basename(link):
+ try:
+ linked = maybe_link(archive, link)
+ archive_sig = '{}.asc'.format(archive)
+ if os.path.exists(archive_sig):
+ maybe_link(archive_sig, '{}.asc'.format(link))
+ except OSError as err:
+ raise GbpError("Cannot symlink '%s' to '%s': %s" % (archive, link, err))
+ return (link, linked)
+ else:
+ return (archive, linked)
+
def upstream_import_commit_msg(options, version):
return options.import_msg % dict(version=version)
# Check the changelog file from the repository, in case
# we're not on the debian-branch (but upstream, for
# example).
- cp = parse_changelog_repo(repo, options.packaging_branch, 'debian/changelog')
+ cp = parse_changelog_repo(repo, options.debian_branch, 'debian/changelog')
sourcepackage = cp['Source']
except NoChangeLogError:
if options.interactive:
return (sourcepackage, version)
-def find_source(use_uscan, args):
- """Find the tarball to import - either via uscan or via command line argument
+def find_upstream(use_uscan, args, version=None):
+ """Find the main tarball to import - either via uscan or via command line argument
@return: upstream source filename or None if nothing to import
@rtype: string
@raise GbpError: raised on all detected errors
+
+ >>> find_upstream(False, ['too', 'many'])
+ Traceback (most recent call last):
+ ...
+ gbp.errors.GbpError: More than one archive specified. Try --help.
+ >>> find_upstream(False, [])
+ Traceback (most recent call last):
+ ...
+ gbp.errors.GbpError: No archive to import specified. Try --help.
+ >>> find_upstream(True, ['tarball'])
+ Traceback (most recent call last):
+ ...
+ gbp.errors.GbpError: you can't pass both --uscan and a filename.
+ >>> find_upstream(False, ['tarball']).path
+ 'tarball'
"""
if use_uscan:
if args:
uscan = Uscan()
gbp.log.info("Launching uscan...")
try:
- uscan.scan()
+ if not uscan.scan(download_version=version):
+ gbp.log.info("package is up to date, nothing to do.")
+ return None
except UscanError as e:
raise GbpError("%s" % e)
- if not uscan.uptodate:
- if uscan.tarball:
- gbp.log.info("using %s" % uscan.tarball)
- args.append(uscan.tarball)
- else:
- raise GbpError("uscan didn't download anything, and no source was found in ../")
+ if uscan.tarball:
+ gbp.log.info("Using uscan downloaded tarball %s" % uscan.tarball)
+ args.append(uscan.tarball)
else:
- gbp.log.info("package is up to date, nothing to do.")
- return None
- if len(args) > 1: # source specified
+ raise GbpError("uscan didn't download anything, and no source was found in ../")
+ if len(args) > 1: # source specified
raise GbpError("More than one archive specified. Try --help.")
elif len(args) == 0:
raise GbpError("No archive to import specified. Try --help.")
else:
- archive = DebianUpstreamSource(args[0])
- return archive
+ sig = '{}.asc'.format(args[0])
+ if os.path.exists(sig):
+ gbp.log.debug("Signature {} found for {}".format(args[0], sig))
+ else:
+ sig = None
+ return DebianUpstreamSource(args[0], sig=sig)
-def pristine_tarball_name(source, pkg_name, pkg_version):
- if source.is_tarball():
- if source.compression:
- comp_ext = '.' + compressor_opts[source.compression][1]
- else:
- comp_ext = ''
+def debian_branch_merge(repo, tag, version, options):
+ try:
+ func = globals()["debian_branch_merge_by_%s" % options.merge_mode]
+ except KeyError:
+ raise GbpError("%s is not a valid merge mode" % options.merge_mode)
+ func(repo, tag, version, options)
+
+
+def postimport_hook(repo, tag, version, options):
+ if options.postimport:
+ epoch = ''
+ if os.access('debian/changelog', os.R_OK):
+ # No need to check the changelog file from the
+ # repository, since we're certain that we're on
+ # the debian-branch
+ cp = ChangeLog(filename='debian/changelog')
+ if cp.has_epoch():
+ epoch = '%s:' % cp.epoch
+ debian_version = "%s%s-1" % (epoch, version)
+ info = {'version': debian_version}
+ env = {'GBP_BRANCH': options.debian_branch,
+ 'GBP_TAG': tag,
+ 'GBP_UPSTREAM_VERSION': version,
+ 'GBP_DEBIAN_VERSION': debian_version,
+ }
+ Hook('Postimport',
+ format_str(options.postimport, info),
+ extra_env=env)()
+
+
+def postunpack_hook(repo, tmp_dir, sources, options):
+ if options.postunpack:
+ Hook('Postunpack', options.postunpack,
+ extra_env={'GBP_GIT_DIR': repo.git_dir,
+ 'GBP_TMP_DIR': tmp_dir,
+ 'GBP_SOURCES_DIR': sources[0].unpacked}
+ )(dir=tmp_dir)
+
+
+def is_30_quilt(repo, options):
+ format_file = DebianSourceFormat.format_file
+ try:
+ content = GitVfs(repo, options.debian_branch).open(format_file).read()
+ except IOError:
+ return False
+ return str(DebianSourceFormat(content)) == "3.0 (quilt)"
+
+
+def debian_branch_merge_by_auto(repo, tag, version, options):
+ if is_30_quilt(repo, options):
+ gbp.log.debug("3.0 (quilt) package, replacing debian/ dir")
+ return debian_branch_merge_by_replace(repo, tag, version, options)
else:
- # Need to repack and/or mangle filename if the archive is not
- # pristine-tar-compatible -> we decide to create gz compressed tarball
- comp_ext = '.gz'
- return '%s_%s.orig.tar%s' % (pkg_name, pkg_version, comp_ext)
+ gbp.log.debug("not 3.0 (quilt) package, using git merge")
+ return debian_branch_merge_by_merge(repo, tag, version, options)
+
+
+def debian_branch_merge_by_replace(repo, tag, version, options):
+ gbp.log.info("Replacing upstream source on '%s'" % options.debian_branch)
+
+ tree = [x for x in repo.list_tree("%s^{tree}" % tag)
+ if x[-1] != b'debian']
+ msg = "Update upstream source from tag '%s'" % (tag)
+
+ # Get the current debian/ tree on the debian branch
+ try:
+ deb_sha = [x for x in repo.list_tree("%s^{tree}" % options.debian_branch)
+ if x[-1] == b'debian' and x[1] == 'tree'][0][2]
+ gbp.log.debug("Using %s as debian/ tree" % deb_sha)
+ tree.append(['040000', 'tree', deb_sha, 'debian'])
+ msg += "\n\nUpdate to upstream version '%s'\nwith Debian dir %s" % (version, deb_sha)
+ except IndexError:
+ pass # no debian/ dir is fine
+
+ sha = repo.make_tree(tree)
+ commit = repo.commit_tree(sha, msg, ["%s^{commit}" % options.debian_branch,
+ "%s^{commit}" % tag])
+ repo.update_ref("refs/heads/%s" % options.debian_branch, commit,
+ msg="gbp: Updating %s after import of %s" % (options.debian_branch,
+ tag))
+ current_branch = repo.get_branch()
+ if current_branch == options.debian_branch:
+ repo.force_head(commit, hard=True)
+
+
+def debian_branch_merge_by_merge(repo, tag, version, options):
+ gbp.log.info("Merging to '%s'" % options.debian_branch)
+ branch = repo.get_branch()
+ repo.set_branch(options.debian_branch)
+ try:
+ repo.merge(tag)
+ except GitRepositoryError:
+ raise GbpError("Automatic merge failed.")
+ repo.set_branch(branch)
+
+
+def unpack_tarballs(repo, name, sources, version, options):
+ tmpdir = tempfile.mkdtemp(dir='../')
+ if not sources[0].is_dir(): # Unpack main tarball
+ sources[0].unpack(tmpdir, options.filters)
+ gbp.log.debug("Unpacked '%s' to '%s'" % (sources[0].path, sources[0].unpacked))
+
+ try:
+ postunpack_hook(repo, tmpdir, sources, options)
+ except gbpc.CommandExecFailed:
+ raise GbpError() # The hook already printed an error message
+
+ if orig_needs_repack(sources[0], options):
+ gbp.log.debug("Filter pristine-tar: repacking '%s' from '%s'" % (sources[0].path,
+ sources[0].unpacked))
+ # FIXME: we should repack the other tarballs here too (See #860457)
+ # for that we better move around sources instead of source[0]
+ (source, tmpdir) = repack_upstream(sources[0], name, version, tmpdir, options.filters)
+ sources[0] = source
+
+ if not sources[0].is_dir(): # Unpack component tarballs
+ for s in sources[1:]:
+ s.unpack(sources[0].unpacked, options.filters)
+ return (sources, tmpdir)
def set_bare_repo_options(options):
"""Modify options for import into a bare repository"""
if options.pristine_tar or options.merge:
gbp.log.info("Bare repository: setting %s%s options"
- % (["", " '--no-pristine-tar'"][options.pristine_tar],
- ["", " '--no-merge'"][options.merge]))
+ % (["", " '--no-pristine-tar'"][options.pristine_tar],
+ ["", " '--no-merge'"][options.merge]))
options.pristine_tar = False
options.merge = False
+def rollback(repo, options):
+ if repo and repo.has_rollbacks() and options.rollback:
+ gbp.log.err("Error detected, Will roll back changes.")
+ try:
+ repo.rollback()
+ # Make sure the very last line as an error message
+ gbp.log.err("Rolled back changes after import error.")
+ except Exception as e:
+ gbp.log.err("%s" % e)
+ gbp.log.err("Clean up manually and please report a bug: %s" %
+ repo.rollback_errors)
+
+
def build_parser(name):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
usage='%prog [options] /path/to/upstream-version.tar.gz | --uscan')
- except configparser.ParsingError as err:
+ except GbpError as err:
gbp.log.err(err)
return None
import_group = GbpOptionGroup(parser, "import options",
- "pristine-tar and filtering")
+ "pristine-tar and filtering")
tag_group = GbpOptionGroup(parser, "tag options",
- "options related to git tag creation")
+ "options related to git tag creation")
branch_group = GbpOptionGroup(parser, "version and branch naming options",
- "version number and branch layout options")
- cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke external commands and hooks")
-
- for group in [import_group, branch_group, tag_group, cmd_group ]:
+ "version number and branch layout options")
+ cmd_group = GbpOptionGroup(parser, "external command options",
+ "how and when to invoke external commands and hooks")
+ for group in [import_group, branch_group, tag_group, cmd_group]:
parser.add_option_group(group)
branch_group.add_option("-u", "--upstream-version", dest="version",
- help="Upstream Version")
+ help="Upstream Version")
branch_group.add_config_file_option(option_name="debian-branch",
- dest="packaging_branch")
+ dest="debian_branch")
branch_group.add_config_file_option(option_name="upstream-branch",
- dest="upstream_branch")
- branch_group.add_option("--upstream-vcs-tag", dest="vcs_tag",
- help="Upstream VCS tag add to the merge commit")
+ dest="upstream_branch")
+ branch_group.add_config_file_option(option_name="upstream-vcs-tag", dest="vcs_tag")
branch_group.add_boolean_config_file_option(option_name="merge", dest="merge")
- branch_group.add_boolean_config_file_option(
- option_name="create-missing-branches",
- dest="create_missing_branches")
+ branch_group.add_config_file_option(option_name="merge-mode", dest="merge_mode")
tag_group.add_boolean_config_file_option(option_name="sign-tags",
- dest="sign_tags")
+ dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid",
- dest="keyid")
+ dest="keyid")
tag_group.add_config_file_option(option_name="upstream-tag",
- dest="upstream_tag")
+ dest="upstream_tag")
import_group.add_config_file_option(option_name="filter",
- dest="filters", action="append")
+ dest="filters", action="append")
import_group.add_boolean_config_file_option(option_name="pristine-tar",
- dest="pristine_tar")
+ dest="pristine_tar")
import_group.add_boolean_config_file_option(option_name="filter-pristine-tar",
- dest="filter_pristine_tar")
+ dest="filter_pristine_tar")
import_group.add_config_file_option(option_name="import-msg",
- dest="import_msg")
+ dest="import_msg")
import_group.add_boolean_config_file_option(option_name="symlink-orig",
dest="symlink_orig")
+ import_group.add_config_file_option("component", action="append", metavar='COMPONENT',
+ dest="components")
+ import_group.add_config_file_option(option_name="upstream-signatures",
+ dest="upstream_signatures",
+ type='tristate')
cmd_group.add_config_file_option(option_name="postimport", dest="postimport")
+ cmd_group.add_config_file_option(option_name="postunpack", dest="postunpack")
parser.add_boolean_config_file_option(option_name="interactive",
dest='interactive')
+ parser.add_boolean_config_file_option(option_name="rollback",
+ dest="rollback")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
- parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
-
- # Accepted for compatibility
- parser.add_option("--no-dch", dest='no_dch', action="store_true",
- default=False, help="deprecated - don't use.")
parser.add_option("--uscan", dest='uscan', action="store_true",
default=False, help="use uscan(1) to download the new tarball.")
+
+ # Accepted for compatibility
+ parser.add_option("--download", dest='download', action="store_true",
+ default=False, help="Ignored. Accepted for compatibility; see EXAMPLES in gbp-import-orig(1).")
return parser
def parse_args(argv):
+ """Parse the command line arguments
+ @return: options and arguments
+ """
+
parser = build_parser(argv[0])
if not parser:
return None, None
(options, args) = parser.parse_args(argv[1:])
gbp.log.setup(options.color, options.verbose, options.color_scheme)
- if options.no_dch:
- gbp.log.warn("'--no-dch' passed. This is now the default, please remove this option.")
+ if options.download:
+ gbp.log.warn("Passing --download explicitly is deprecated.")
+ options.download = is_download(args)
return options, args
def main(argv):
ret = 0
+ tmpdir = None
+ pristine_orig = None
+ linked = False
+ repo = None
(options, args) = parse_args(argv)
if not options:
- return 1
-
- tmpdir = tempfile.mkdtemp(dir=options.tmp_dir, prefix='import-orig_')
+ return ExitCodes.parse_error
try:
- source = find_source(options.uscan, args)
- if not source:
- return ret
-
try:
- repo = DebianGitRepository('.')
+ repo = RollbackDebianGitRepository('.')
except GitRepositoryError:
raise GbpError("%s is not a git repository" % (os.path.abspath('.')))
- # an empty repo has now branches:
- initial_branch = repo.get_branch()
- is_empty = False if initial_branch else True
+ is_empty = repo.is_empty()
if not repo.has_branch(options.upstream_branch) and not is_empty:
- if options.create_missing_branches:
- gbp.log.info("Will create missing branch '%s'" %
- options.upstream_branch)
- else:
- raise GbpError(no_upstream_branch_msg % options.upstream_branch)
-
- (pkg_name, version) = detect_name_and_version(repo, source, options)
+ raise GbpError(no_upstream_branch_msg % options.upstream_branch)
(clean, out) = repo.is_clean()
if not clean and not is_empty:
gbp.log.err("Repository has uncommitted changes, commit these first: ")
raise GbpError(out)
+ # Download the main tarball
+ if options.download:
+ sources = [download_orig(args[0])]
+ else:
+ sources = [find_upstream(options.uscan, args, options.version)]
+ if not sources[0]:
+ return ExitCodes.uscan_up_to_date
+
+ # The main tarball
+ (name, version) = detect_name_and_version(repo, sources[0], options)
+ # Additional tarballs we expect to exist
+ sources += get_component_tarballs(name, version, sources[0].path, options.components)
+
+ tag = repo.version_to_tag(options.upstream_tag, version)
+ if repo.has_tag(tag):
+ raise GbpError("Upstream tag '%s' already exists" % tag)
+
if repo.bare:
set_bare_repo_options(options)
- # Prepare sources for importing
- pristine_name = pristine_tarball_name(source, pkg_name, version)
- prepare_pristine = pristine_name if options.pristine_tar else None
- unpacked_orig, pristine_orig = prepare_sources(
- source, pkg_name, version, prepare_pristine, options.filters,
- options.filter_pristine_tar, None, tmpdir)
+ sources, tmpdir = unpack_tarballs(repo, name, sources, version, options)
+
+ if options.verbose:
+ for source in sources:
+ gbp.log.info(source)
+
+ (pristine_orig, linked) = prepare_pristine_tar(sources[0].path,
+ name,
+ version)
# Don't mess up our repo with git metadata from an upstream tarball
try:
- if os.path.isdir(os.path.join(unpacked_orig, '.git/')):
+ if os.path.isdir(os.path.join(sources[0].unpacked, '.git/')):
raise GbpError("The orig tarball contains .git metadata - giving up.")
except OSError:
pass
try:
- upstream_branch = [ options.upstream_branch, 'master' ][is_empty]
+ import_branch = options.upstream_branch
filter_msg = ["", " (filtering out %s)"
% options.filters][len(options.filters) > 0]
- gbp.log.info("Importing '%s' to branch '%s'%s..." % (source.path,
- upstream_branch,
+ gbp.log.info("Importing '%s' to branch '%s'%s..." % (sources[0].path,
+ import_branch,
filter_msg))
- gbp.log.info("Source package is %s" % pkg_name)
+ gbp.log.info("Source package is %s" % name)
gbp.log.info("Upstream version is %s" % version)
- import_branch = [ options.upstream_branch, None ][is_empty]
msg = upstream_import_commit_msg(options, version)
- if options.vcs_tag:
- parents = [repo.rev_parse("%s^{}" % options.vcs_tag)]
- else:
- parents = None
-
- commit = repo.commit_dir(unpacked_orig,
- msg=msg,
- branch=import_branch,
- other_parents=parents,
- create_missing_branch=options.create_missing_branches)
-
- if options.pristine_tar and pristine_orig:
- repo.pristine_tar.commit(pristine_orig, upstream_branch)
+ commit = repo.commit_dir(sources[0].unpacked,
+ msg=msg,
+ branch=import_branch,
+ other_parents=repo.vcs_tag_parent(options.vcs_tag, version),
+ create_missing_branch=is_empty,
+ )
+
+ if options.pristine_tar:
+ if pristine_orig:
+ repo.rrr_branch(repo.pristine_tar_branch)
+ for source in sources:
+ # Enforce signature file exists with --upstream-signatures=on
+ if options.upstream_signatures.is_on() and not source.signaturefile:
+ raise GbpError("%s does not have a signature file" % source.path)
+ elif options.upstream_signatures.is_off():
+ source.signaturefile = None
+ # For all practical purposes we're interested in pristine_orig's path
+ if pristine_orig != sources[0].path:
+ sources[0]._path = pristine_orig
+ repo.create_pristine_tar_commits(import_branch, sources)
+ else:
+ gbp.log.warn("'%s' not an archive, skipping pristine-tar" % sources[0].path)
- tag = repo.version_to_tag(options.upstream_tag, version)
repo.create_tag(name=tag,
msg="Upstream version %s" % version,
commit=commit,
sign=options.sign_tags,
keyid=options.keyid)
+
if is_empty:
- repo.create_branch(options.upstream_branch, rev=commit)
- repo.force_head(options.upstream_branch, hard=True)
+ repo.create_branch(branch=options.debian_branch, rev=commit)
+ repo.force_head(options.debian_branch, hard=True)
+ # In an empty repo avoid master branch defaulted to by
+ # git and check out debian branch instead.
+ if not repo.bare:
+ cur = repo.branch
+ if cur != options.debian_branch:
+ repo.set_branch(options.debian_branch)
+ repo.delete_branch(cur)
elif options.merge:
- gbp.log.info("Merging to '%s'" % options.packaging_branch)
- repo.set_branch(options.packaging_branch)
- try:
- repo.merge(tag)
- except GitRepositoryError:
- raise GbpError("Merge failed, please resolve.")
- if options.postimport:
- epoch = ''
- if os.access('debian/changelog', os.R_OK):
- # No need to check the changelog file from the
- # repository, since we're certain that we're on
- # the debian-branch
- cp = ChangeLog(filename='debian/changelog')
- if cp.has_epoch():
- epoch = '%s:' % cp.epoch
- info = { 'version': "%s%s-1" % (epoch, version) }
- env = { 'GBP_BRANCH': options.packaging_branch }
- gbpc.Command(format_msg(options.postimport, info), extra_env=env, shell=True)()
+ repo.rrr_branch(options.debian_branch)
+ debian_branch_merge(repo, tag, version, options)
+
# Update working copy and index if we've possibly updated the
# checked out branch
current_branch = repo.get_branch()
- if current_branch in [ options.upstream_branch,
- repo.pristine_tar_branch]:
+ if current_branch in [options.upstream_branch,
+ repo.pristine_tar_branch]:
repo.force_head(current_branch, hard=True)
- # Create symlink, if requested
- if options.symlink_orig:
- if source.is_tarball():
- link = os.path.join('..', pristine_name)
- if not (os.path.exists(link) and
- os.path.samefile(link, source.path)):
- gbp.log.info('Creating symlink to %s' % source.path)
- os.symlink(source.path, link)
- else:
- gbp.log.warn('Orig source not a tarball, not symlinked')
+ postimport_hook(repo, tag, version, options)
except (gbpc.CommandExecFailed, GitRepositoryError) as err:
- msg = err.__str__() if len(err.__str__()) else ''
- raise GbpError("Import of %s failed: %s" % (source.path, msg))
- except (GbpError, GitRepositoryError) as err:
- if len(err.__str__()):
+ msg = str(err) or 'Unknown error, please report a bug'
+ raise GbpError("Import of %s failed: %s" % (sources[0].path, msg))
+ except KeyboardInterrupt:
+ raise GbpError("Import of %s failed: aborted by user" % (sources[0].path))
+ except GbpError as err:
+ if str(err):
gbp.log.err(err)
ret = 1
+ rollback(repo, options)
+
+ if pristine_orig and linked and not options.symlink_orig:
+ os.unlink(pristine_orig)
if tmpdir:
cleanup_tmp_tree(tmpdir)
if not ret:
- gbp.log.info("Successfully imported version %s of %s" % (version, source.path))
+ gbp.log.info("Successfully imported version %s of %s" % (version, sources[0].path))
return ret
+
if __name__ == "__main__":
sys.exit(main(sys.argv))
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2006, 2007, 2009, 2011 Guido Guenther <agx@sigxcpu.org>
-# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-"""Import a new upstream version into a git repository"""
-
-import configparser
-import os
-import sys
-import gbp.tmpfile as tempfile
-import gbp.command_wrappers as gbpc
-import re
-import string
-from gbp.pkg import parse_archive_filename
-from gbp.rpm import (RpmUpstreamSource, SpecFile, NoSpecError, guess_spec,
- guess_spec_repo)
-from gbp.rpm.policy import RpmPkgPolicy
-from gbp.rpm.git import (GitRepositoryError, RpmGitRepository)
-from gbp.config import GbpOptionParserRpm, GbpOptionGroup, no_upstream_branch_msg
-from gbp.errors import GbpError
-import gbp.log
-from gbp.scripts.common.import_orig import (cleanup_tmp_tree, ask_package_name,
- ask_package_version,
- prepare_sources)
-from gbp.scripts.import_srpm import download_file
-
-
-def upstream_import_commit_msg(options, version):
- return options.import_msg % dict(version=version)
-
-def find_spec(repo, options):
- """Find spec in the working tree or repository"""
- try:
- preferred_fn = os.path.basename(repo.path) + '.spec'
- spec = guess_spec(os.path.join(repo.path, options.packaging_dir), True,
- preferred_fn)
- except NoSpecError:
- try:
- # Check the spec file from the repository, in case we're not on the
- # packaging-branch (but upstream, for example).
- spec = guess_spec_repo(repo, options.packaging_branch,
- options.packaging_dir, True, preferred_fn)
- except NoSpecError:
- spec = None
- return spec
-
-def detect_name_and_version(repo, source, spec, options):
- """Determine name and version of the upstream project"""
- # Guess defaults for the package name and version from the
- # original tarball.
- (guessed_package, guessed_version) = source.guess_version() or ('', '')
-
- # Try to find the source package name
- if spec:
- sourcepackage = spec.name
- else:
- if options.interactive:
- sourcepackage = ask_package_name(guessed_package,
- RpmPkgPolicy.is_valid_packagename,
- RpmPkgPolicy.packagename_msg)
- else:
- if guessed_package:
- sourcepackage = guessed_package
- else:
- raise GbpError("Couldn't determine upstream package name. Use --interactive.")
-
- # Try to find the version.
- if options.version:
- version = options.version
- else:
- if options.interactive:
- version = ask_package_version(guessed_version,
- RpmPkgPolicy.is_valid_upstreamversion,
- RpmPkgPolicy.upstreamversion_msg)
- else:
- if guessed_version:
- version = guessed_version
- else:
- raise GbpError ("Couldn't determine upstream version. Use '-u<version>' or --interactive.")
-
- return (sourcepackage, version)
-
-
-def find_source(spec, options, args):
- """Find the tarball to import
- @return: upstream source filename or None if nothing to import
- @rtype: string
- @raise GbpError: raised on all detected errors
- """
- if len(args) > 1: # source specified
- raise GbpError("More than one archive specified. Try --help.")
- elif len(args) == 0:
- if spec and spec.orig_src:
- path = spec.orig_src['uri']
- gbp.log.info("Archive file path from spec is used ('%s')" % path)
- elif spec:
- raise GbpError("No archive to import specified and unable to "
- "determine source from spec. Try --help.")
- else:
- raise GbpError("No archive to import specified and no spec file "
- "found. Try --help.")
- else:
- path = args[0]
- if re.match(r'[a-z]{1,5}://', path):
- path = download_file('..', path)
- return RpmUpstreamSource(path)
-
-
-def pristine_tarball_name(source, pkg_name, pkg_version, pristine_name):
- old_filename = os.path.basename(source.path)
- base_name, _fmt, _comp = parse_archive_filename(old_filename)
- if pristine_name != 'auto':
- ext = string.replace(old_filename, base_name, '', 1)
- return pristine_name % {'name': pkg_name,
- 'version': pkg_version,
- 'upstreamversion': pkg_version,
- 'filename_base': base_name,
- 'filename_ext': ext}
- # Need to repack and mangle filename if the archive is not
- # pristine-tar-compatible -> we decide to create gz compressed tarball
- elif not source.is_tarball():
- return "%s.tar.gz" % base_name
- return old_filename
-
-
-def set_bare_repo_options(options):
- """Modify options for import into a bare repository"""
- if options.pristine_tar or options.merge:
- gbp.log.info("Bare repository: setting %s%s options"
- % (["", " '--no-pristine-tar'"][options.pristine_tar],
- ["", " '--no-merge'"][options.merge]))
- options.pristine_tar = False
- options.merge = False
-
-
-def parse_args(argv):
- try:
- parser = GbpOptionParserRpm(command=os.path.basename(argv[0]),
- prefix='',
- usage='%prog [options] /path/to/upstream-version.tar.gz')
- except configparser.ParsingError as err:
- gbp.log.err(err)
- return None, None
-
- import_group = GbpOptionGroup(parser, "import options",
- "pristine-tar and filtering")
- tag_group = GbpOptionGroup(parser, "tag options",
- "options related to git tag creation")
- branch_group = GbpOptionGroup(parser, "version and branch naming options",
- "version number and branch layout options")
- cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke external commands and hooks")
-
- for group in [import_group, branch_group, tag_group, cmd_group ]:
- parser.add_option_group(group)
-
- branch_group.add_option("-u", "--upstream-version", dest="version",
- help="Upstream Version")
- branch_group.add_config_file_option(option_name="packaging-branch",
- dest="packaging_branch")
- branch_group.add_config_file_option(option_name="upstream-branch",
- dest="upstream_branch")
- branch_group.add_option("--upstream-vcs-tag", dest="vcs_tag",
- help="Upstream VCS tag add to the merge commit")
- branch_group.add_boolean_config_file_option(option_name="merge", dest="merge")
- branch_group.add_config_file_option(option_name="packaging-dir", dest="packaging_dir")
- branch_group.add_boolean_config_file_option(
- option_name="create-missing-branches",
- dest="create_missing_branches")
-
- tag_group.add_boolean_config_file_option(option_name="sign-tags",
- dest="sign_tags")
- tag_group.add_config_file_option(option_name="keyid",
- dest="keyid")
- tag_group.add_config_file_option(option_name="upstream-tag",
- dest="upstream_tag")
- import_group.add_config_file_option(option_name="filter",
- dest="filters", action="append")
- import_group.add_boolean_config_file_option(option_name="pristine-tar",
- dest="pristine_tar")
- import_group.add_boolean_config_file_option(option_name="filter-pristine-tar",
- dest="filter_pristine_tar")
- import_group.add_config_file_option(option_name="pristine-tarball-name",
- dest="pristine_tarball_name")
- import_group.add_config_file_option(option_name="orig-prefix",
- dest="orig_prefix")
- import_group.add_config_file_option(option_name="import-msg",
- dest="import_msg")
- cmd_group.add_config_file_option(option_name="postimport", dest="postimport")
-
- parser.add_boolean_config_file_option(option_name="interactive",
- dest='interactive')
- parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
- help="verbose command execution")
- parser.add_config_file_option(option_name="color", dest="color", type='tristate')
- parser.add_config_file_option(option_name="color-scheme",
- dest="color_scheme")
- parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
-
- (options, args) = parser.parse_args(argv[1:])
- gbp.log.setup(options.color, options.verbose, options.color_scheme)
-
- return options, args
-
-
-def main(argv):
- ret = 0
-
- (options, args) = parse_args(argv)
- if not options:
- return 1
-
- tmpdir = tempfile.mkdtemp(dir=options.tmp_dir, prefix='import-orig-rpm_')
- try:
- try:
- repo = RpmGitRepository('.')
- except GitRepositoryError:
- raise GbpError ("%s is not a git repository" % (os.path.abspath('.')))
-
- spec = find_spec(repo, options)
- source = find_source(spec, options, args)
-
- # an empty repo has now branches:
- initial_branch = repo.get_branch()
- is_empty = False if initial_branch else True
-
- if not repo.has_branch(options.upstream_branch):
- if options.create_missing_branches:
- gbp.log.info("Will create missing branch '%s'" %
- options.upstream_branch)
- elif is_empty:
- options.create_missing_branches = True
- else:
- raise GbpError(no_upstream_branch_msg % options.upstream_branch)
-
- sourcepackage, version = detect_name_and_version(repo, source, spec,
- options)
-
- (clean, out) = repo.is_clean()
- if not clean and not is_empty:
- gbp.log.err("Repository has uncommitted changes, commit these first: ")
- raise GbpError(out)
-
- if repo.bare:
- set_bare_repo_options(options)
-
- # Prepare sources for importing
- if options.pristine_tar:
- prepare_pristine = pristine_tarball_name(source, sourcepackage,
- version,
- options.pristine_tarball_name)
- else:
- prepare_pristine = None
- unpacked_orig, pristine_orig = \
- prepare_sources(source, sourcepackage, version,
- prepare_pristine, options.filters,
- options.filter_pristine_tar,
- options.orig_prefix, tmpdir)
-
- # Don't mess up our repo with git metadata from an upstream tarball
- if os.path.isdir(os.path.join(unpacked_orig, '.git/')):
- raise GbpError("The orig tarball contains .git metadata - "
- "giving up.")
- try:
- filter_msg = ["", " (filtering out %s)"
- % options.filters][len(options.filters) > 0]
- gbp.log.info("Importing '%s' to branch '%s'%s..." % (source.path,
- options.upstream_branch,
- filter_msg))
- gbp.log.info("Source package is %s" % sourcepackage)
- gbp.log.info("Upstream version is %s" % version)
-
- msg = upstream_import_commit_msg(options, version)
-
- if options.vcs_tag:
- parents = [repo.rev_parse("%s^{}" % options.vcs_tag)]
- else:
- parents = None
-
- commit = repo.commit_dir(unpacked_orig,
- msg=msg,
- branch=options.upstream_branch,
- other_parents=parents,
- create_missing_branch=options.create_missing_branches)
- if options.pristine_tar and pristine_orig:
- gbp.log.info("Pristine-tar: commiting %s" % pristine_orig)
- repo.pristine_tar.commit(pristine_orig, options.upstream_branch)
-
- tag_str_fields = dict(upstreamversion=version, vendor="Upstream")
- tag = repo.version_to_tag(options.upstream_tag, tag_str_fields)
- repo.create_tag(name=tag,
- msg="Upstream version %s" % version,
- commit=commit,
- sign=options.sign_tags,
- keyid=options.keyid)
- if options.merge:
- gbp.log.info("Merging to '%s'" % options.packaging_branch)
- if repo.has_branch(options.packaging_branch):
- repo.set_branch(options.packaging_branch)
- try:
- repo.merge(tag)
- except GitRepositoryError:
- raise GbpError("""Merge failed, please resolve.""")
- else:
- repo.create_branch(options.packaging_branch, rev=options.upstream_branch)
- if repo.get_branch() == options.packaging_branch:
- repo.force_head(options.packaging_branch, hard=True)
- if options.postimport:
- info = { 'upstreamversion': version }
- env = { 'GBP_BRANCH': options.packaging_branch }
- gbpc.Command(options.postimport % info, extra_env=env,
- shell=True)()
- # Update working copy and index if we've possibly updated the
- # checked out branch
- current_branch = repo.get_branch()
- if (current_branch == options.upstream_branch or
- current_branch == repo.pristine_tar_branch):
- repo.force_head(current_branch, hard=True)
- except (GitRepositoryError, gbpc.CommandExecFailed):
- raise GbpError("Import of %s failed" % source.path)
- except GbpError as err:
- if len(err.__str__()):
- gbp.log.err(err)
- ret = 1
-
- if tmpdir:
- cleanup_tmp_tree(tmpdir)
-
- if not ret:
- gbp.log.info("Successfully imported version %s of %s" % (version, source.path))
- return ret
-
-if __name__ == "__main__":
- sys.exit(main(sys.argv))
-
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2018 Michael Stapelberg <stapelberg@debian.org>
+# 2018 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+#
+"""Import a new upstream version from a git branch onto the Debian branch"""
+
+import os
+import sys
+import gbp.command_wrappers as gbpc
+from gbp.deb.git import GitRepositoryError
+from gbp.config import GbpOptionParserDebian, GbpOptionGroup
+from gbp.errors import GbpError
+import gbp.log
+from gbp.scripts.common import ExitCodes
+from gbp.deb.rollbackgit import RollbackDebianGitRepository
+
+from gbp.scripts.import_orig import (debian_branch_merge,
+ postimport_hook,
+ set_bare_repo_options,
+ rollback)
+
+
+def get_commit_and_version_to_merge(repo, options):
+ """
+ Get the commit and version we want to merge based on the
+ --upstream-tag setting
+ """
+ version = options.version
+ if options.upstream_tree.upper() == 'VERSION':
+ # Determine tag name from given version
+ if not options.version:
+ raise GbpError("No upstream version given, try -u<version>")
+ commit = repo.version_to_tag(options.upstream_tag, options.version)
+ elif options.upstream_tree.upper() == 'BRANCH':
+ # Use head of upstrem branch
+ if not repo.has_branch(options.upstream_branch):
+ raise GbpError("%s is not a valid branch" % options.upstream_branch)
+ commit = options.upstream_branch
+ else:
+ # Use whatever is passed in as commitish
+ commit = "%s^{commit}" % options.upstream_tree
+ return commit, version
+
+
+def build_parser(name):
+ try:
+ parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
+ usage='%prog [options] -u<upstream-version>')
+ except GbpError as err:
+ gbp.log.err(err)
+ return None
+
+ import_group = GbpOptionGroup(parser, "import options",
+ "import related options")
+ tag_group = GbpOptionGroup(parser, "tag options",
+ "tag related options ")
+ branch_group = GbpOptionGroup(parser, "version and branch naming options",
+ "version number and branch layout options")
+ cmd_group = GbpOptionGroup(parser, "external command options",
+ "how and when to invoke external commands and hooks")
+ for group in [import_group, branch_group, tag_group, cmd_group]:
+ parser.add_option_group(group)
+
+ branch_group.add_option("-u", "--upstream-version", dest="version",
+ help="The version number to use for the new version, "
+ "default is ''", default='')
+ branch_group.add_config_file_option(option_name="debian-branch",
+ dest="debian_branch")
+ branch_group.add_config_file_option(option_name="upstream-branch",
+ dest="upstream_branch")
+ branch_group.add_config_file_option(option_name="upstream-tree",
+ dest="upstream_tree",
+ help="Where to merge the upstream changes from.",
+ default="VERSION")
+ branch_group.add_config_file_option(option_name="merge-mode", dest="merge_mode")
+
+ tag_group.add_boolean_config_file_option(option_name="sign-tags",
+ dest="sign_tags")
+ tag_group.add_config_file_option(option_name="keyid",
+ dest="keyid")
+ tag_group.add_config_file_option(option_name="upstream-tag",
+ dest="upstream_tag")
+ import_group.add_config_file_option(option_name="import-msg",
+ dest="import_msg")
+ cmd_group.add_config_file_option(option_name="postimport", dest="postimport")
+
+ parser.add_boolean_config_file_option(option_name="rollback",
+ dest="rollback")
+ parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
+ help="verbose command execution")
+ parser.add_config_file_option(option_name="color", dest="color", type='tristate')
+ parser.add_config_file_option(option_name="color-scheme",
+ dest="color_scheme")
+ return parser
+
+
+def parse_args(argv):
+ """Parse the command line arguments
+ @return: options and arguments
+ """
+
+ parser = build_parser(argv[0])
+ if not parser:
+ return None, None
+
+ (options, args) = parser.parse_args(argv[1:])
+ gbp.log.setup(options.color, options.verbose, options.color_scheme)
+
+ return options, args
+
+
+def main(argv):
+ ret = 0
+ repo = None
+
+ (options, args) = parse_args(argv)
+ if not options:
+ return ExitCodes.parse_error
+
+ # TODO: honor --filter option
+ # TODO: add --filter-with-copyright which takes d/copyright into account
+ # TODO: handle automatic versions based on timestamp + sha1
+ # TODO: handle updating of upstream branch from remote
+ gbp.log.warn("This script is experimental, it might change incompatibly between versions.")
+ try:
+ try:
+ repo = RollbackDebianGitRepository('.')
+ except GitRepositoryError:
+ raise GbpError("%s is not a git repository" % (os.path.abspath('.')))
+
+ commit, version = get_commit_and_version_to_merge(repo, options)
+
+ is_empty = repo.is_empty()
+
+ (clean, out) = repo.is_clean()
+ if not clean and not is_empty:
+ gbp.log.err("Repository has uncommitted changes, commit these first: ")
+ raise GbpError(out)
+
+ if repo.bare:
+ set_bare_repo_options(options)
+
+ try:
+ tag = repo.version_to_tag(options.upstream_tag, version)
+ if not repo.has_tag(tag):
+ gbp.log.info("Upstream tag '%s' not found. Creating it for you." % tag)
+ repo.create_tag(name=tag,
+ msg="Upstream version %s" % version,
+ commit="%s^0" % commit,
+ sign=options.sign_tags,
+ keyid=options.keyid)
+
+ if is_empty:
+ repo.create_branch(branch=options.debian_branch, rev=commit)
+ repo.force_head(options.debian_branch, hard=True)
+ # In an empty repo avoid master branch defaulted to by
+ # git and check out debian branch instead.
+ if not repo.bare:
+ cur = repo.branch
+ if cur != options.debian_branch:
+ repo.set_branch(options.debian_branch)
+ repo.delete_branch(cur)
+ else:
+ repo.rrr_branch(options.debian_branch)
+ debian_branch_merge(repo, tag, version, options)
+
+ # Update working copy and index if we've possibly updated the
+ # checked out branch
+ current_branch = repo.get_branch()
+ if current_branch in [options.upstream_branch,
+ repo.pristine_tar_branch]:
+ repo.force_head(current_branch, hard=True)
+
+ postimport_hook(repo, tag, version, options)
+ except (gbpc.CommandExecFailed, GitRepositoryError) as err:
+ msg = str(err) or 'Unknown error, please report a bug'
+ raise GbpError("Import of %s failed: %s" % (commit, msg))
+ except KeyboardInterrupt:
+ raise GbpError("Import of %s failed: aborted by user" % (options.git_ref))
+ except GbpError as err:
+ if str(err):
+ gbp.log.err(err)
+ ret = 1
+ rollback(repo, options)
+
+ if not ret:
+ gbp.log.info("Successfully imported version %s" % (version))
+ return ret
+
+
+if __name__ == "__main__":
+ sys.exit(main(sys.argv))
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
-# (C) 2006,2007,2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006,2007,2011,2016 Guido Günther <agx@sigxcpu.org>
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Import an RPM source package into a GIT repository"""
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
+"""Import an RPM source package into a Git repository"""
-import configparser
import sys
import re
import os
import time
import shutil
import errno
-import urllib.request, urllib.error, urllib.parse
+from urllib.request import urlopen
+import urllib
-import gbp.tmpfile as tempfile
import gbp.command_wrappers as gbpc
+from gbp.tmpfile import init_tmpdir, del_tmpdir, tempfile
from gbp.rpm import (parse_srpm, guess_spec, SpecFile, NoSpecError,
- RpmUpstreamSource)
-from gbp.rpm.policy import RpmPkgPolicy
+ RpmUpstreamSource, compose_version_str, filter_version)
from gbp.rpm.git import (RpmGitRepository, GitRepositoryError)
from gbp.git.modifier import GitModifier
from gbp.config import (GbpOptionParserRpm, GbpOptionGroup,
- no_upstream_branch_msg)
+ no_upstream_branch_msg)
from gbp.errors import GbpError
+from gbp.scripts.common import ExitCodes, is_download
+from gbp.scripts.common import repo_setup
import gbp.log
-from gbp.scripts.pq_rpm import safe_patches, rm_patch_files, get_packager
-from gbp.scripts.common.pq import apply_and_commit_patch
-from gbp.pkg import parse_archive_filename
+from gbp.pkg import Archive
no_packaging_branch_msg = """
-Repository does not have branch '%s' for packaging/distribution sources. If there is none see
-file:///usr/share/doc/git-buildpackage/manual-html/gbp.import.html#GBP.IMPORT.CONVERT
-on howto create it otherwise use --packaging-branch to specify it.
+Repository does not have branch '%s' for packaging/distribution sources.
+You need to reate it or use --packaging-branch to specify it.
"""
-PATCH_AUTODELETE_COMMIT_MSG = """
-Autoremove imported patches from packaging
-
-Removed all imported patches from %s
-and patch files from the packaging dir.
-"""
class SkipImport(Exception):
"""Nothing imported"""
pass
-class PatchImportError(Exception):
- """Patch import failed"""
- pass
-
def download_file(target_dir, url):
"""Download a remote file"""
gbp.log.info("Downloading '%s'..." % url)
try:
- urlobj = urllib.request.urlopen(url)
+ urlobj = urlopen(url)
local_fn = os.path.join(target_dir, os.path.basename(url))
with open(local_fn, "wb") as local_file:
local_file.write(urlobj.read())
raise GbpError("Download failed: %s" % err.reason)
return local_fn
-def download_source(pkg, dirs):
+
+def download_source(pkg):
"""Download package from a remote location"""
if re.match(r'[a-z]{1,5}://', pkg):
mode = 'python urllib'
else:
mode = 'yumdownloader'
- tmpdir = tempfile.mkdtemp(dir=dirs['tmp_base'], prefix='download_')
+ tmpdir = tempfile.mkdtemp(prefix='download_')
gbp.log.info("Trying to download '%s' using '%s'..." % (pkg, mode))
if mode == 'yumdownloader':
gbpc.RunAtCommand('yumdownloader',
if options.pristine_tar:
gbp.log.info("Bare repository: setting %s option '--no-pristine-tar'")
options.pristine_tar = False
- if options.patch_import:
- gbp.log.info("Bare repository: setting %s option '--no-patch-import')")
- options.patch_import = False
-
-
-def import_spec_patches(repo, spec, dirs):
- """
- Import patches from a spec file to the current branch
- """
- queue = spec.patchseries()
- if len(queue) == 0:
- return
-
- gbp.log.info("Importing patches to '%s' branch" % repo.get_branch())
- tmpdir = tempfile.mkdtemp(dir=dirs['tmp_base'], prefix='import_')
- orig_head = repo.rev_parse("HEAD")
- packager = get_packager(spec)
-
- # Put patches in a safe place
- queue = safe_patches(queue, tmpdir)
- for patch in queue:
- gbp.log.debug("Applying %s" % patch.path)
- try:
- apply_and_commit_patch(repo, patch, packager)
- except (GbpError, GitRepositoryError):
- repo.force_head(orig_head, hard=True)
- raise PatchImportError("Patch(es) didn't apply, you need apply "
- "and commit manually")
-
- # Remove patches from spec and packaging directory
- gbp.log.info("Removing imported patch files from spec and packaging dir")
- rm_patch_files(spec)
- try:
- spec.update_patches([], {})
- spec.write_spec_file()
- except GbpError:
- repo.force_head('HEAD', hard=True)
- raise PatchImportError("Unable to update spec file, you need to edit"
- "and commit it manually")
- repo.commit_all(msg=PATCH_AUTODELETE_COMMIT_MSG % spec.specfile)
def force_to_branch_head(repo, branch):
+ """Checkout branch and reset --hard"""
if repo.get_branch() == branch:
# Update HEAD if we modified the checked out branch
repo.force_head(branch, hard=True)
repo.set_branch(branch)
-def parse_args(argv):
- """Parse commandline arguments"""
+def build_parser(name):
+ """Construct command line parser"""
try:
- parser = GbpOptionParserRpm(command=os.path.basename(argv[0]),
+ parser = GbpOptionParserRpm(command=os.path.basename(name),
prefix='',
usage='%prog [options] /path/to/package'
- '.src.rpm')
- except configparser.ParsingError as err:
+ '.src.rpm [target]')
+ except GbpError as err:
gbp.log.err(err)
- return None, None
+ return None
import_group = GbpOptionGroup(parser, "import options",
- "pristine-tar and filtering")
+ "pristine-tar and filtering")
tag_group = GbpOptionGroup(parser, "tag options",
- "options related to git tag creation")
+ "options related to git tag creation")
branch_group = GbpOptionGroup(parser, "version and branch naming options",
- "version number and branch layout options")
+ "version number and branch layout options")
- for group in [import_group, branch_group, tag_group ]:
+ for group in [import_group, branch_group, tag_group]:
parser.add_option_group(group)
parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
default=False, help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color",
- type='tristate')
+ type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
+ parser.add_config_file_option(option_name="vendor", action="store",
+ dest="vendor")
parser.add_option("--download", action="store_true", dest="download",
default=False, help="download source package")
- parser.add_config_file_option(option_name="vendor", action="store",
- dest="vendor")
branch_group.add_config_file_option(option_name="packaging-branch",
- dest="packaging_branch")
+ dest="packaging_branch")
branch_group.add_config_file_option(option_name="upstream-branch",
- dest="upstream_branch")
+ dest="upstream_branch")
branch_group.add_option("--upstream-vcs-tag", dest="vcs_tag",
help="Upstream VCS tag on top of which to import "
- "the orig sources")
+ "the orig sources")
branch_group.add_boolean_config_file_option(
- option_name="create-missing-branches",
- dest="create_missing_branches")
+ option_name="create-missing-branches",
+ dest="create_missing_branches")
branch_group.add_option("--orphan-packaging", action="store_true",
- dest="orphan_packaging", default=False,
- help="The packaging branch doesn't base on upstream")
+ dest="orphan_packaging", default=False,
+ help="The packaging branch doesn't base on upstream")
branch_group.add_option("--native", action="store_true",
- dest="native", default=False,
- help="This is a dist native package, no separate "
- "upstream branch")
+ dest="native", default=False,
+ help="This is a dist native package, no separate "
+ "upstream branch")
tag_group.add_boolean_config_file_option(option_name="sign-tags",
- dest="sign_tags")
+ dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid",
- dest="keyid")
+ dest="keyid")
tag_group.add_config_file_option(option_name="packaging-tag",
- dest="packaging_tag")
+ dest="packaging_tag")
tag_group.add_config_file_option(option_name="upstream-tag",
- dest="upstream_tag")
+ dest="upstream_tag")
+ tag_group.add_option("--skip-packaging-tag", dest="skip_packaging_tag",
+ action="store_true",
+ help="Don't add a tag after importing packaging files")
import_group.add_config_file_option(option_name="filter",
- dest="filters", action="append")
+ dest="filters", action="append")
import_group.add_boolean_config_file_option(option_name="pristine-tar",
- dest="pristine_tar")
+ dest="pristine_tar")
import_group.add_option("--allow-same-version", action="store_true",
- dest="allow_same_version", default=False,
- help="allow to import already imported version")
+ dest="allow_same_version", default=False,
+ help="allow import of already imported version")
import_group.add_boolean_config_file_option(
- option_name="author-is-committer",
- dest="author_is_committer")
+ option_name="author-is-committer",
+ dest="author_is_committer")
import_group.add_config_file_option(option_name="packaging-dir",
- dest="packaging_dir")
- import_group.add_boolean_config_file_option(option_name="patch-import",
- dest="patch_import")
+ dest="packaging_dir")
+
+ parser.add_config_file_option(option_name="repo-user", dest="repo_user",
+ choices=['DEBIAN', 'GIT'])
+ parser.add_config_file_option(option_name="repo-email", dest="repo_email",
+ choices=['DEBIAN', 'GIT'])
+ return parser
+
+
+def parse_args(argv):
+ """Parse commandline arguments"""
+ parser = build_parser(argv[0])
+ if not parser:
+ return None, None
+
(options, args) = parser.parse_args(argv[1:])
gbp.log.setup(options.color, options.verbose, options.color_scheme)
+
+ if options.download:
+ gbp.log.warn("Passing --download explicitly is deprecated.")
+
+ options.download = is_download(args)
return options, args
skipped = False
options, args = parse_args(argv)
+ if not options:
+ return ExitCodes.parse_error
- if len(args) != 1:
+ if len(args) == 1:
+ srpm = args[0]
+ target = None
+ elif len(args) == 2:
+ srpm = args[0]
+ target = args[1]
+ else:
gbp.log.err("Need to give exactly one package to import. Try --help.")
return 1
try:
- dirs['tmp_base'] = tempfile.mkdtemp(dir=options.tmp_dir,
- prefix='import-srpm')
+ dirs['tmp_base'] = init_tmpdir(options.tmp_dir, 'import-srpm_')
except GbpError as err:
gbp.log.err(err)
return 1
try:
- srpm = args[0]
if options.download:
- srpm = download_source(srpm, dirs)
+ srpm = download_source(srpm)
# Real srpm, we need to unpack, first
true_srcrpm = False
if not os.path.isdir(srpm) and not srpm.endswith(".spec"):
src = parse_srpm(srpm)
true_srcrpm = True
- dirs['pkgextract'] = tempfile.mkdtemp(dir=dirs['tmp_base'],
- prefix='pkgextract_')
+ dirs['pkgextract'] = tempfile.mkdtemp(prefix='pkgextract_')
gbp.log.info("Extracting src rpm to '%s'" % dirs['pkgextract'])
src.unpack(dirs['pkgextract'])
preferred_spec = src.name + '.spec'
dirs['src'] = os.path.abspath(srpm)
spec = guess_spec(srpm, True, preferred_spec)
else:
- gbp.log.debug("Trying to import an srpm from '%s' with spec "\
+ gbp.log.debug("Trying to import an srpm from '%s' with spec "
"file '%s'" % (os.path.dirname(srpm), srpm))
dirs['src'] = os.path.abspath(os.path.dirname(srpm))
spec = SpecFile(srpm)
except GitRepositoryError:
gbp.log.info("No git repository found, creating one.")
is_empty = True
- repo = RpmGitRepository.create(spec.name)
+ target = target or spec.name
+ repo = RpmGitRepository.create(target)
os.chdir(repo.path)
+ repo_setup.set_user_name_and_email(options.repo_user, options.repo_email, repo)
if repo.bare:
set_bare_repo_options(options)
# Create more tempdirs
- dirs['origsrc'] = tempfile.mkdtemp(dir=dirs['tmp_base'],
- prefix='origsrc_')
- dirs['packaging_base'] = tempfile.mkdtemp(dir=dirs['tmp_base'],
- prefix='packaging_')
+ dirs['origsrc'] = tempfile.mkdtemp(prefix='origsrc_')
+ dirs['packaging_base'] = tempfile.mkdtemp(prefix='packaging_')
dirs['packaging'] = os.path.join(dirs['packaging_base'],
options.packaging_dir)
try:
files = os.listdir(dirs['src'])
else:
# Need to copy files to the packaging directory given by caller
- files = [os.path.basename(patch.path) \
- for patch in spec.patchseries(unapplied=True, ignored=True)]
- for filename in list(spec.sources().values()):
+ files = [os.path.basename(patch.path)
+ for patch in spec.patchseries(unapplied=True, ignored=True)]
+ for filename in spec.sources().values():
files.append(os.path.basename(filename))
files.append(os.path.join(spec.specdir, spec.specfile))
# Don't copy orig source archive, though
# Unpack orig source archive
if spec.orig_src:
orig_tarball = os.path.join(dirs['src'], spec.orig_src['filename'])
- upstream = RpmUpstreamSource(orig_tarball)
- upstream = upstream.unpack(dirs['origsrc'], options.filters)
+ sources = RpmUpstreamSource(orig_tarball)
+ sources.unpack(dirs['origsrc'], options.filters)
else:
- upstream = None
+ sources = None
- tag_format = [(options.upstream_tag, "Upstream"),
- (options.packaging_tag, options.vendor)][options.native]
- tag_str_fields = dict(spec.version, vendor=options.vendor)
- tag = repo.version_to_tag(tag_format[0], tag_str_fields)
+ tag_str_fields = dict(spec.version, vendor=options.vendor.lower())
+ if options.native:
+ upstream_tag_format = options.packaging_tag
+ upstream_str_fields = tag_str_fields
+ else:
+ upstream_tag_format = options.upstream_tag
+ upstream_str_fields = filter_version(tag_str_fields, 'release', 'epoch')
+ upstream_tag = repo.version_to_tag(upstream_tag_format, upstream_str_fields)
+ full_version = compose_version_str(spec.version)
if repo.find_version(options.packaging_tag, tag_str_fields):
- gbp.log.warn("Version %s already imported." %
- RpmPkgPolicy.compose_full_version(spec.version))
+ gbp.log.warn("Version %s already imported." % full_version)
+
if options.allow_same_version:
gbp.log.info("Moving tag of version '%s' since import forced" %
- RpmPkgPolicy.compose_full_version(spec.version))
+ full_version)
move_tag_stamp(repo, options.packaging_tag, tag_str_fields)
else:
raise SkipImport
options.create_missing_branches = True
# Determine author and committer info, currently same info is used
- # for both upstream sources and packaging files
+ # for both sources and packaging files
author = None
if spec.packager:
- match = re.match('(?P<name>.*[^ ])\s*<(?P<email>\S*)>',
+ match = re.match(r'(?P<name>.*[^ ])\s*<(?P<email>\S*)>',
spec.packager.strip())
if match:
author = GitModifier(match.group('name'), match.group('email'))
gbp.log.debug("Couldn't determine packager info")
committer = committer_from_author(author, options)
- # Import upstream sources
- if upstream:
- upstream_commit = repo.find_version(tag_format[0], tag_str_fields)
+ # Import sources
+ if sources:
+ upstream_commit = repo.find_version(upstream_tag_format, upstream_str_fields)
if not upstream_commit:
- gbp.log.info("Tag %s not found, importing %s upstream sources"
- % (tag, tag_format[1]))
+ gbp.log.info("Tag %s not found, importing sources" % upstream_tag)
branch = [options.upstream_branch,
options.packaging_branch][options.native]
branch)
else:
gbp.log.err(no_upstream_branch_msg % branch + "\n"
- "Also check the --create-missing-branches option.")
+ "Also check the --create-missing-branches option.")
raise GbpError
-
- msg = "%s version %s" % (tag_format[1], spec.upstreamversion)
+ upstream_vendor = "Native" if options.native else "Upstream"
+ upstream_version = full_version if options.native else spec.upstreamversion
+ msg = "%s version %s" % (upstream_vendor, upstream_version)
if options.vcs_tag:
- parents = [repo.rev_parse("%s^{}" % options.vcs_tag)]
+ vcs_tag = repo.version_to_tag(options.vcs_tag, upstream_str_fields)
+ parents = [repo.rev_parse("%s^{}" % vcs_tag)]
else:
parents = None
- upstream_commit = repo.commit_dir(upstream.unpacked,
- "Imported %s" % msg,
+ upstream_commit = repo.commit_dir(sources.unpacked,
+ "Import %s" % msg,
branch,
other_parents=parents,
author=author,
committer=committer,
create_missing_branch=options.create_missing_branches)
- repo.create_tag(name=tag,
- msg=msg,
- commit=upstream_commit,
- sign=options.sign_tags,
- keyid=options.keyid)
+ if not (options.native and options.skip_packaging_tag):
+ repo.create_tag(name=upstream_tag,
+ msg=msg,
+ commit=upstream_commit,
+ sign=options.sign_tags,
+ keyid=options.keyid)
if not options.native:
if options.pristine_tar:
- archive_fmt = parse_archive_filename(orig_tarball)[1]
+ archive_fmt = Archive.parse_filename(orig_tarball)[1]
if archive_fmt == 'tar':
repo.pristine_tar.commit(orig_tarball,
- 'refs/heads/%s' %
+ 'refs/heads/%s' %
options.upstream_branch)
else:
gbp.log.warn('Ignoring pristine-tar, %s archives '
# Import packaging files. For native packages we assume that also
# packaging files are found in the source tarball
- if not options.native or not upstream:
+ if not options.native or not sources:
gbp.log.info("Importing packaging files")
branch = options.packaging_branch
if not repo.has_branch(branch):
"option.")
raise GbpError
- tag_str_fields = dict(spec.version, vendor=options.vendor)
- tag = repo.version_to_tag(options.packaging_tag, tag_str_fields)
- msg = "%s release %s" % (options.vendor,
- RpmPkgPolicy.compose_full_version(spec.version))
+ msg = "%s release %s" % (options.vendor, full_version)
- if options.orphan_packaging or not upstream:
+ if options.orphan_packaging or not sources:
commit = repo.commit_dir(dirs['packaging_base'],
- "Imported %s" % msg,
- branch,
- author=author,
- committer=committer,
- create_missing_branch=options.create_missing_branches)
+ "Import %s" % msg,
+ branch,
+ author=author,
+ committer=committer,
+ create_missing_branch=options.create_missing_branches)
else:
# Copy packaging files to the unpacked sources dir
try:
- pkgsubdir = os.path.join(upstream.unpacked,
+ pkgsubdir = os.path.join(sources.unpacked,
options.packaging_dir)
os.mkdir(pkgsubdir)
except OSError as err:
if err.errno != errno.EEXIST:
raise
- for fn in os.listdir(dirs['packaging']):
- shutil.copy2(os.path.join(dirs['packaging'], fn),
+ for fname in os.listdir(dirs['packaging']):
+ shutil.copy2(os.path.join(dirs['packaging'], fname),
pkgsubdir)
- commit = repo.commit_dir(upstream.unpacked,
- "Imported %s" % msg,
+ commit = repo.commit_dir(sources.unpacked,
+ "Import %s" % msg,
branch,
other_parents=[upstream_commit],
author=author,
# Import patches on top of the source tree
# (only for non-native packages with non-orphan packaging)
force_to_branch_head(repo, options.packaging_branch)
- if options.patch_import:
- spec = SpecFile(os.path.join(repo.path,
- options.packaging_dir, spec.specfile))
- import_spec_patches(repo, spec, dirs)
- commit = options.packaging_branch
# Create packaging tag
- repo.create_tag(name=tag,
- msg=msg,
- commit=commit,
- sign=options.sign_tags,
- keyid=options.keyid)
+ if not options.skip_packaging_tag:
+ tag = repo.version_to_tag(options.packaging_tag, tag_str_fields)
+ repo.create_tag(name=tag,
+ msg=msg,
+ commit=commit,
+ sign=options.sign_tags,
+ keyid=options.keyid)
force_to_branch_head(repo, options.packaging_branch)
gbp.log.err("Git command failed: %s" % err)
ret = 1
except GbpError as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
ret = 1
except NoSpecError as err:
gbp.log.err("Failed determine spec file: %s" % err)
ret = 1
- except PatchImportError as err:
- gbp.log.err(err)
- ret = 2
except SkipImport:
skipped = True
finally:
os.chdir(dirs['top'])
- gbpc.RemoveTree(dirs['tmp_base'])()
+ del_tmpdir()
if not ret and not skipped:
- gbp.log.info("Version '%s' imported under '%s'" %
- (RpmPkgPolicy.compose_full_version(spec.version),
- spec.name))
+ gbp.log.info("Version '%s' imported under '%s'" % (full_version, repo.path))
return ret
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
# vim: set fileencoding=utf-8 :
#
-# (C) 2011,2014 Guido Günther <agx@sigxcpu.org>
+# (C) 2011,2014,2017 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
"""Manage Debian patches on a patch queue branch"""
-import configparser
import errno
import os
import shutil
import sys
+import tempfile
import re
-import gbp.tmpfile as tempfile
from gbp.config import GbpOptionParserDebian
-from gbp.git import (GitRepositoryError, GitRepository)
+from gbp.deb.source import DebianSource
+from gbp.deb.git import DebianGitRepository
+from gbp.git import GitRepositoryError
from gbp.command_wrappers import (GitCommand, CommandExecFailed)
from gbp.errors import GbpError
import gbp.log
from gbp.patch_series import (PatchSeries, Patch)
from gbp.scripts.common.pq import (is_pq_branch, pq_branch_name, pq_branch_base,
- parse_gbp_commands, format_patch,
- switch_to_pq_branch, apply_single_patch,
- apply_and_commit_patch,
- drop_pq, get_maintainer_from_control)
+ parse_gbp_commands, format_patch,
+ apply_single_patch,
+ apply_and_commit_patch,
+ drop_pq, get_maintainer_from_control,
+ switch_to_pq_branch)
+from gbp.scripts.common import ExitCodes
from gbp.dch import extract_bts_cmds
PATCH_DIR = "debian/patches/"
-SERIES_FILE = os.path.join(PATCH_DIR,"series")
+SERIES_FILE = os.path.join(PATCH_DIR, "series")
def parse_old_style_topic(commit_info):
"""Parse 'gbp-pq-topic:' line(s) from commit info"""
commit = commit_info['id']
- topic_regex = 'gbp-pq-topic:\s*(?P<topic>\S.*)'
+ topic_regex = r'gbp-pq-topic:\s*(?P<topic>\S.*)'
mangled_body = ''
topic = ''
# Parse and filter commit message body
rev_list = reversed(repo.get_commits(start, end))
for commit in rev_list:
info = repo.get_commit_info(commit)
+ # Parse 'gbp-pq-topic:'
topic = parse_old_style_topic(info)
- cmds = parse_gbp_commands(info, 'gbp', ('ignore'), ('topic'))[0]
- cmds.update(parse_gbp_commands(info, 'gbp-pq', ('ignore'),
- ('topic'))[0])
- if not 'ignore' in cmds:
+ cmds = {'topic': topic} if topic else {}
+ # Parse 'Gbp: ' style commands
+ (cmds_gbp, info['body']) = parse_gbp_commands(info, 'gbp',
+ ('ignore'),
+ ('topic', 'name'),
+ ('topic', 'name'))
+ cmds.update(cmds)
+ # Parse 'Gbp-Pq: ' style commands
+ (cmds_gbp_pq, info['body']) = parse_gbp_commands(info,
+ 'gbp-pq',
+ ('ignore'),
+ ('topic', 'name'),
+ ('topic', 'name'))
+ cmds.update(cmds_gbp_pq)
+ if 'ignore' not in cmds:
if 'topic' in cmds:
topic = cmds['topic']
- format_patch(outdir, repo, info, patches, options.patch_numbers,
- topic=topic)
+ name = cmds.get('name', None)
+ format_patch(outdir, repo, info, patches, options.abbrev,
+ numbered=options.patch_numbers,
+ topic=topic, name=name,
+ renumber=options.renumber,
+ patch_num_prefix_format=options.patch_num_format)
else:
gbp.log.info('Ignoring commit %s' % info['id'])
"""
Compare new pathes to lists of patches already exported
- >>> compare_series(['a', 'b'], ['b', 'c'])
+ >>> compare_series(['# comment', 'a', 'b'], ['b', 'c'])
(['c'], ['a'])
>>> compare_series([], [])
([], [])
"""
added = set(new).difference(old)
- removed = set(old).difference(new)
- return (list(added), list(removed))
+ removed = [li for li in set(old).difference(new) if not li.startswith('#')]
+ return (list(added), removed)
def format_series_diff(added, removed, options):
Format the patch differences into a suitable commit message
>>> format_series_diff(['a'], ['b'], None)
- 'Rediff patches\\n\\nAdded a: <REASON>\\nDropped b: <REASON>\\n'
+ 'Rediff patches\\n\\nAdd a: <REASON>\\nDrop b: <REASON>\\n'
"""
if len(added) == 1 and not removed:
# Single patch added, create a more thorough commit message
bugs, dummy = extract_bts_cmds(patch.long_desc.split('\n'), options)
if bugs:
msg += '\n'
- for k, v in list(bugs.items()):
+ for k, v in bugs.items():
msg += '\n%s: %s' % (k, ', '.join(v))
else:
msg = "Rediff patches\n\n"
for p in added:
- msg += 'Added %s: <REASON>\n' % p
+ msg += 'Add %s: <REASON>\n' % p
for p in removed:
- msg += 'Dropped %s: <REASON>\n' % p
+ msg += 'Drop %s: <REASON>\n' % p
return msg
-def commit_patches(repo, branch, patches, options):
+def commit_patches(repo, branch, patches, options, patch_dir):
"""
Commit chanages exported from patch queue
"""
vfs = gbp.git.vfs.GitVfs(repo, branch)
try:
- oldseries = vfs.open('debian/patches/series')
- oldpatches = [ p.strip() for p in oldseries.readlines() ]
- oldseries.close()
+ with vfs.open('debian/patches/series') as oldseries:
+ oldpatches = [p.strip() for p in oldseries.readlines()]
except IOError:
# No series file yet
oldpatches = []
- newpatches = [ p[len(PATCH_DIR):] for p in patches ]
+ newpatches = [p[len(patch_dir):] for p in patches]
# FIXME: handle case were only the contents of the patches changed
added, removed = compare_series(oldpatches, newpatches)
msg = format_series_diff(added, removed, options)
- repo.add_files(PATCH_DIR)
- repo.commit_staged(msg=msg)
+
+ if not repo.is_clean(paths='debian/patches')[0]:
+ repo.add_files(PATCH_DIR, force=True)
+ repo.commit_staged(msg=msg)
return added, removed
+def find_upstream_commit(repo, branch, upstream_tag):
+ """
+ Find commit corresponding to upstream version based on changelog
+ """
+ vfs = gbp.git.vfs.GitVfs(repo, pq_branch_base(branch))
+ cl = DebianSource(vfs).changelog
+ upstream_commit = repo.find_version(upstream_tag, cl.upstream_version)
+ if not upstream_commit:
+ raise GbpError("Couldn't find upstream version %s" %
+ cl.upstream_version)
+ return upstream_commit
+
+
+def pq_on_upstream_tag(pq_from):
+ """Return True if the patch queue is based on the uptream tag,
+ False if its based on the debian packaging branch"""
+ return True if pq_from.upper() == 'TAG' else False
+
+
def export_patches(repo, branch, options):
"""Export patches from the pq branch into a patch series"""
- if is_pq_branch(branch, options):
- base = pq_branch_base(branch, options)
+ patch_dir = os.path.join(repo.path, PATCH_DIR)
+ series_file = os.path.join(repo.path, SERIES_FILE)
+ if is_pq_branch(branch):
+ base = pq_branch_base(branch)
gbp.log.info("On '%s', switching to '%s'" % (branch, base))
branch = base
repo.set_branch(branch)
- pq_branch = pq_branch_name(branch, options)
+ pq_branch = pq_branch_name(branch)
try:
- shutil.rmtree(PATCH_DIR)
+ shutil.rmtree(patch_dir)
except OSError as e:
if e.errno != errno.ENOENT:
raise GbpError("Failed to remove patch dir: %s" % e.strerror)
else:
- gbp.log.debug("%s does not exist." % PATCH_DIR)
+ gbp.log.debug("%s does not exist." % patch_dir)
- patches = generate_patches(repo, branch, pq_branch, PATCH_DIR, options)
+ if pq_on_upstream_tag(options.pq_from):
+ base = find_upstream_commit(repo, branch, options.upstream_tag)
+ else:
+ base = branch
+
+ patches = generate_patches(repo, base, pq_branch, patch_dir, options)
if patches:
- with open(SERIES_FILE, 'w') as seriesfd:
+ with open(series_file, 'w') as seriesfd:
for patch in patches:
- seriesfd.write(os.path.relpath(patch, PATCH_DIR) + '\n')
- if options.commit:
- added, removed = commit_patches(repo, branch, patches, options)
- if added:
- what = 'patches' if len(added) > 1 else 'patch'
- gbp.log.info("Added %s %s to patch series" % (what, ', '.join(added)))
- if removed:
- what = 'patches' if len(removed) > 1 else 'patch'
- gbp.log.info("Removed %s %s from patch series" % (what, ', '.join(removed)))
- else:
- GitCommand('status')(['--', PATCH_DIR])
+ seriesfd.write(os.path.relpath(patch, patch_dir) + '\n')
else:
- gbp.log.info("No patches on '%s' - nothing to do." % pq_branch)
+ gbp.log.info("No patches on '%s' - nothing to export." % pq_branch)
+
+ if options.commit:
+ added, removed = commit_patches(repo, branch, patches, options, patch_dir)
+ if added:
+ what = 'patches' if len(added) > 1 else 'patch'
+ gbp.log.info("Added %s %s to patch series" % (what, ', '.join(added)))
+ if removed:
+ what = 'patches' if len(removed) > 1 else 'patch'
+ gbp.log.info("Removed %s %s from patch series" % (what, ', '.join(removed)))
+ else:
+ gbp.log.info("Updated existing patches.")
if options.drop:
- drop_pq(repo, branch, options)
+ drop_pq(repo, branch)
-def safe_patches(series, tmpdir_base):
+def safe_patches(series, repo):
"""
Safe the current patches in a temporary directory
below .git/
src = os.path.dirname(series)
name = os.path.basename(series)
- tmpdir = tempfile.mkdtemp(dir=tmpdir_base, prefix='gbp-pq_')
+ tmpdir = tempfile.mkdtemp(dir=repo.git_dir, prefix='gbp-pq')
patches = os.path.join(tmpdir, 'patches')
series = os.path.join(patches, name)
- gbp.log.debug("Safeing patches '%s' in '%s'" % (src, tmpdir))
+ gbp.log.debug("Saving patches '%s' in '%s'" % (src, tmpdir))
shutil.copytree(src, patches)
return (tmpdir, series)
-def import_quilt_patches(repo, branch, series, tries, options):
+def import_quilt_patches(repo, branch, series, tries, force, pq_from,
+ upstream_tag):
"""
apply a series of quilt patches in the series file 'series' to branch
the patch-queue branch for 'branch'
@param repo: git repository to work on
- @param branch: branch to base pqtch queue on
- @param series; series file to read patches from
+ @param branch: branch to base patch queue on
+ @param series: series file to read patches from
@param tries: try that many times to apply the patches going back one
commit in the branches history after each failure.
- @param options: gbp-pq command options
+ @param force: import the patch series even if the branch already exists
+ @param pq_from: what to use as the starting point for the pq branch.
+ DEBIAN indicates the current branch, TAG indicates that
+ the corresponding upstream tag should be used.
+ @param upstream_tag: upstream tag template to use
"""
tmpdir = None
+ series = os.path.join(repo.path, series)
- if is_pq_branch(branch, options):
- if options.force:
- branch = pq_branch_base(branch, options)
- pq_branch = pq_branch_name(branch, options)
+ if is_pq_branch(branch):
+ if force:
+ branch = pq_branch_base(branch)
+ pq_branch = pq_branch_name(branch)
repo.checkout(branch)
else:
- gbp.log.err("Already on a patch-queue branch '%s' - doing nothing." % branch)
- raise GbpError
+ raise GbpError("Already on a patch-queue branch '%s' - doing nothing." % branch)
else:
- pq_branch = pq_branch_name(branch, options)
+ pq_branch = pq_branch_name(branch)
if repo.has_branch(pq_branch):
- if options.force:
- drop_pq(repo, branch, options)
+ if force:
+ drop_pq(repo, branch)
else:
- raise GbpError("Patch queue branch '%s'. already exists. Try 'rebase' instead."
+ raise GbpError("Patch queue branch '%s'. already exists. Try 'rebase' or 'switch' instead."
% pq_branch)
maintainer = get_maintainer_from_control(repo)
- commits = repo.get_commits(num=tries, first_parent=True)
+ if pq_on_upstream_tag(pq_from):
+ commits = [find_upstream_commit(repo, branch, upstream_tag)]
+ else: # pq_from == 'DEBIAN'
+ commits = repo.get_commits(num=tries, first_parent=True)
# If we go back in history we have to safe our pq so we always try to apply
# the latest one
- if len(commits) > 1:
- tmpdir, series = safe_patches(series, options.tmp_dir)
+ # If we are using the upstream_tag, we always need a copy of the patches
+ if len(commits) > 1 or pq_on_upstream_tag(pq_from):
+ if os.path.exists(series):
+ tmpdir, series = safe_patches(series, repo)
queue = PatchSeries.read_series_file(series)
for patch in queue:
gbp.log.debug("Applying %s" % patch.path)
try:
- apply_and_commit_patch(repo, patch, maintainer, patch.topic)
+ name = os.path.basename(patch.path)
+ apply_and_commit_patch(repo, patch, maintainer, patch.topic, name)
except (GbpError, GitRepositoryError) as e:
gbp.log.err("Failed to apply '%s': %s" % (patch.path, e))
repo.force_head('HEAD', hard=True)
else:
# All patches applied successfully
break
- i-=1
+ i -= 1
else:
raise GbpError("Couldn't apply patches")
gbp.log.debug("Remove temporary patch safe '%s'" % tmpdir)
shutil.rmtree(tmpdir)
+ return len(queue)
+
def rebase_pq(repo, branch, options):
- if is_pq_branch(branch, options):
- base = pq_branch_base(branch, options)
+ maybe_import_pq(repo, branch, options)
+ # Make sure we're on the pq branch
+ switch_to_pq_branch(repo, branch)
+ if pq_on_upstream_tag(options.pq_from):
+ base = find_upstream_commit(repo, branch, options.upstream_tag)
else:
- switch_to_pq_branch(repo, branch, options)
- base = branch
- GitCommand("rebase")([base])
+ base = pq_branch_base(repo.branch)
+
+ GitCommand("rebase", cwd=repo.path)([base])
+
+
+def import_pq(repo, branch, options):
+ """Import quilt patches onto pq branch"""
+ series = SERIES_FILE
+ tries = options.time_machine if (options.time_machine > 0) else 1
+ num = import_quilt_patches(repo, branch, series, tries,
+ options.force, options.pq_from,
+ options.upstream_tag)
+ gbp.log.info("%d patches listed in '%s' imported on '%s'" %
+ (num, series, repo.get_branch()))
-def switch_pq(repo, current, options):
+def maybe_import_pq(repo, branch, options):
+ """Import quilt patches onto pq branch if pq branch does not exist yet"""
+ if not repo.has_branch(pq_branch_name(branch)):
+ gbp.log.info("No pq branch found, importing patches")
+ import_pq(repo, branch, options)
+ return True
+ return False
+
+
+def switch_pq(repo, branch, options):
"""Switch to patch-queue branch if on base branch and vice versa"""
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
+ if is_pq_branch(branch):
+ base = pq_branch_base(branch)
gbp.log.info("Switching to %s" % base)
repo.checkout(base)
else:
- switch_to_pq_branch(repo, current, options)
+ maybe_import_pq(repo, branch, options)
+ switch_to_pq_branch(repo, branch)
+
+
+def check_clean(repo, options):
+ if not options.ignore_new:
+ (clean, out) = repo.is_clean()
+ if not clean:
+ gbp.log.err("You have uncommitted changes in your source tree:")
+ gbp.log.err(out)
+ raise GbpError("Use --ignore-new to ignore.")
+
+
+def usage_msg():
+ return """%prog [options] action - maintain patches on a patch queue branch
+Actions:
+ export export the patch queue associated to the current branch
+ into a quilt patch series in debian/patches/ and update the
+ series file.
+ import create a patch queue branch from quilt patches in debian/patches.
+ rebase switch to patch queue branch associated to the current
+ branch and rebase against current branch.
+ drop drop (delete) the patch queue associated to the current branch.
+ apply apply a patch
+ switch switch to patch-queue branch and vice versa"""
def build_parser(name):
try:
parser = GbpOptionParserDebian(command=os.path.basename(name),
- usage="%prog [options] action - maintain patches on a patch queue branch\n"
- "Actions:\n"
- " export export the patch queue associated to the current branch\n"
- " into a quilt patch series in debian/patches/ and update the\n"
- " series file.\n"
- " import create a patch queue branch from quilt patches in debian/patches.\n"
- " rebase switch to patch queue branch associated to the current\n"
- " branch and rebase against current branch.\n"
- " drop drop (delete) the patch queue associated to the current branch.\n"
- " apply apply a patch\n"
- " switch switch to patch-queue branch and vice versa")
- except configparser.ParsingError as err:
+ usage=usage_msg())
+ except GbpError as err:
gbp.log.err(err)
return None
parser.add_boolean_config_file_option(option_name="patch-numbers", dest="patch_numbers")
+ parser.add_config_file_option(option_name="patch-num-format", dest="patch_num_format")
+ parser.add_boolean_config_file_option(option_name="renumber", dest="renumber")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
parser.add_option("--topic", dest="topic", help="in case of 'apply' topic (subdir) to put patch into")
parser.add_config_file_option(option_name="time-machine", dest="time_machine", type="int")
parser.add_boolean_config_file_option("drop", dest='drop')
parser.add_boolean_config_file_option(option_name="commit", dest="commit")
+ parser.add_config_file_option(option_name="abbrev", dest="abbrev", type="int")
parser.add_option("--force", dest="force", action="store_true", default=False,
help="in case of import even import if the branch already exists")
parser.add_config_file_option(option_name="color", dest="color", type='tristate')
parser.add_config_file_option(option_name="color-scheme",
dest="color_scheme")
parser.add_config_file_option(option_name="meta-closes", dest="meta_closes")
- parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
+ parser.add_config_file_option(option_name="meta-closes-bugnum", dest="meta_closes_bugnum")
+ parser.add_config_file_option(option_name="pq-from", dest="pq_from", choices=['DEBIAN', 'TAG'])
+ parser.add_config_file_option(option_name="upstream-tag", dest="upstream_tag")
+ parser.add_boolean_config_file_option(option_name="ignore-new", dest="ignore_new")
return parser
(options, args) = parse_args(argv)
if not options:
- return 1
+ return ExitCodes.parse_error
gbp.log.setup(options.color, options.verbose, options.color_scheme)
return 1
try:
- repo = GitRepository(os.path.curdir)
+ repo = DebianGitRepository(os.path.curdir)
except GitRepositoryError:
gbp.log.err("%s is not a git repository" % (os.path.abspath('.')))
return 1
if action == "export":
export_patches(repo, current, options)
elif action == "import":
- series = SERIES_FILE
- tries = options.time_machine if (options.time_machine > 0) else 1
- import_quilt_patches(repo, current, series, tries, options)
- current = repo.get_branch()
- gbp.log.info("Patches listed in '%s' imported on '%s'" %
- (series, current))
+ check_clean(repo, options)
+ import_pq(repo, current, options)
elif action == "drop":
- drop_pq(repo, current, options)
+ drop_pq(repo, current)
elif action == "rebase":
rebase_pq(repo, current, options)
elif action == "apply":
patch = Patch(patchfile)
maintainer = get_maintainer_from_control(repo)
- apply_single_patch(repo, current, patch, maintainer, options)
+ apply_single_patch(repo, current, patch, maintainer, options.topic)
elif action == "switch":
switch_pq(repo, current, options)
+ except KeyboardInterrupt:
+ retval = 1
+ gbp.log.err("Interrupted. Aborting.")
except CommandExecFailed:
retval = 1
except (GbpError, GitRepositoryError) as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
retval = 1
return retval
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2011 Guido Günther <agx@sigxcpu.org>
-# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-"""manage patches in a patch queue"""
-
-import configparser
-import errno
-import os
-import shutil
-import sys
-
-import gbp.tmpfile as tempfile
-from gbp.config import GbpOptionParserBB
-from gbp.rpm.git import GitRepositoryError, RpmGitRepository
-from gbp.command_wrappers import GitCommand, CommandExecFailed
-from gbp.errors import GbpError
-import gbp.log
-from gbp.patch_series import PatchSeries, Patch
-from gbp.rpm import string_to_int
-from gbp.scripts.common.pq import (is_pq_branch, pq_branch_name, pq_branch_base,
- apply_and_commit_patch, drop_pq)
-from gbp.scripts.pq_rpm import (generate_patches, safe_patches,
- import_extra_files)
-from gbp.bb import bb, init_tinfoil, parse_bb, pkg_version
-
-USAGE_STRING = \
-"""%prog [options] action - maintain patches on a patch queue branch
-tions:
-export Export the patch queue / devel branch associated to the
- current branch into a patch series in and update the recipe file
-import Create a patch queue / devel branch from recipe file
- and patches in current dir.
-rebase Switch to patch queue / devel branch associated to the current
- branch and rebase against upstream.
-drop Drop (delete) the patch queue /devel branch associated to
- the current branch.
-apply Apply a patch
-switch Switch to patch-queue branch and vice versa."""
-
-
-def rm_patch_files(bbfile):
- """Delete the patch files listed in the pkg meta data."""
- unlinked = set()
-
- # Go through local files
- for path in bbfile.localfiles:
- if path.endswith('.patch'):
- gbp.log.debug("Removing patch '%s'" % path)
- unlinked.add(os.path.basename(path))
- try:
- os.unlink(path)
- except OSError as err:
- if err.errno != errno.ENOENT:
- raise GbpError("Failed to remove patch: %s" % err)
- else:
- gbp.log.debug("Patch %s does not exist." % path)
- else:
- gbp.log.debug("Unlink skipping non-local/non-patch file %s" % path)
- uris = (bbfile.getVar('SRC_URI', False) or "").split()
- return [uri for uri in uris if os.path.basename(uri) not in unlinked]
-
-
-def update_patch_series(repo, bbfile, start, end, options):
- """Export patches to packaging directory and update recipe file"""
- squash = options.patch_export_squash_until.split(':', 1)
- if len(squash) == 1:
- squash.append(None)
- else:
- squash[1] += '.diff'
-
- # Unlink old (local) patch files and generate new patches
- rm_patch_files(bbfile)
-
- # Guess patch subdir
- bb_dir = os.path.dirname(bbfile.getVar('FILE', True))
- pkg_name = bbfile.getVar('PN', True)
- pkg_ver = bbfile.getVar('PV', True)
- subdir = pkg_name + '-' + pkg_ver
- if not os.path.isdir(os.path.join(bb_dir, subdir)):
- if os.path.isdir(os.path.join(bb_dir, pkg_name)):
- subdir = pkg_name
- elif os.path.isdir(os.path.join(bb_dir, 'files')):
- subdir = 'files'
- tgt_dir = os.path.join(bb_dir, subdir)
-
- patches, _commands = generate_patches(repo, start, squash, end,
- tgt_dir, options)
- # TODO: implement commands processing (e.g. topic)
- new_uris = ['file://' + patch for patch in patches]
- bbfile.substitute_var_val(bbfile.bb_path, 'SRC_URI', r'file://\S+.\.patch',
- '')
- bbfile.append_var_val(bbfile.bb_path, 'SRC_URI', new_uris)
- return patches
-
-def var_to_str(var, value):
- """Create a well formatted string buffer for a variable assignment"""
- indent = ' ' * (len(var) + 3)
- linebuf = ['%s = "%s \\\n' % (var, value[0])]
- for val in value[1:]:
- linebuf.append(indent + ' ' + val + '\\\n')
- linebuf.append(indent + '"\n')
- return linebuf
-
-
-def find_upstream_commit(repo, bbfile, upstream_tag):
- """Find commit corresponding upstream version"""
- src_rev = bbfile.getVar('SRCREV', True)
- if src_rev and src_rev != 'INVALID':
- return bbfile.getVar('SRCREV', True)
-
- # Find tag
- upstreamversion = bbfile.getVar('PV', True)
- tag_str_fields = {'upstreamversion': upstreamversion,
- 'vendor': 'Upstream'}
- upstream_commit = repo.find_version(upstream_tag, tag_str_fields)
- if not upstream_commit:
- raise GbpError("Couldn't find upstream version %s" % upstreamversion)
- return upstream_commit
-
-
-def export_patches(cfg, repo, options):
- """Export patches from the pq branch into a packaging branch"""
- current = repo.get_branch()
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
- gbp.log.info("On branch '%s', switching to '%s'" % (current, base))
- repo.set_branch(base)
- bbfile = parse_bb(cfg, options, repo)
- pq_branch = current
- else:
- bbfile = parse_bb(cfg, options, repo)
- pq_branch = pq_branch_name(current, options, pkg_version(bbfile))
- upstream_commit = find_upstream_commit(repo, bbfile, options.upstream_tag)
-
- export_treeish = options.export_rev if options.export_rev else pq_branch
-
- update_patch_series(repo, bbfile, upstream_commit, export_treeish, options)
-
- bb_dir = os.path.dirname(bbfile.getVar('FILE', True))
- GitCommand('status')(['--', bb_dir])
-
-
-def bb_to_patch_series(bbfile):
- """Get all local patches as a series"""
- series = PatchSeries()
- for path in bbfile.localfiles:
- if path.endswith('.patch'):
- series.append(Patch(path))
- return series
-
-
-def import_bb_patches(cfg, repo, options):
- """Apply a series of patches in a recipe to branch onto a pq branch"""
- current = repo.get_branch()
-
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
- raise GbpError("Already on a patch-queue branch '%s' - doing "
- "nothing." % current)
- else:
- bbfile = parse_bb(cfg, options, repo)
- base = current
- upstream_commit = find_upstream_commit(repo, bbfile, options.upstream_tag)
- pq_branch = pq_branch_name(base, options, pkg_version(bbfile))
-
- # Create pq-branch
- if repo.has_branch(pq_branch) and not options.force:
- raise GbpError("Patch-queue branch '%s' already exists. "
- "Try 'rebase' instead." % pq_branch)
- try:
- if repo.get_branch() == pq_branch:
- repo.force_head(upstream_commit, hard=True)
- else:
- repo.create_branch(pq_branch, upstream_commit, force=True)
- except GitRepositoryError as err:
- raise GbpError("Cannot create patch-queue branch '%s': %s" %
- (pq_branch, err))
-
- # Put patches in a safe place
- in_queue = bb_to_patch_series(bbfile)
- queue = safe_patches(in_queue, options.tmp_dir)
- # Do import
- try:
- gbp.log.info("Switching to branch '%s'" % pq_branch)
- repo.set_branch(pq_branch)
- import_extra_files(repo, base, options.import_files)
-
- if not queue:
- return
- gbp.log.info("Trying to apply patches from branch '%s' onto '%s'" %
- (base, upstream_commit))
- for patch in queue:
- gbp.log.debug("Applying %s" % patch.path)
- apply_and_commit_patch(repo, patch, fallback_author=None)
- except (GbpError, GitRepositoryError) as err:
- gbp.log.err('Import failed: %s' % err)
- repo.force_head('HEAD', hard=True)
- repo.set_branch(base)
- repo.delete_branch(pq_branch)
- raise
-
- recipe_fn = os.path.basename(bbfile.getVar('FILE', True))
- gbp.log.info("Patches listed in '%s' imported on '%s'" % (recipe_fn,
- pq_branch))
-
-
-def rebase_pq(cfg, repo, options):
- """Rebase pq branch on the correct upstream version"""
- current = repo.get_branch()
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
- bbfile = parse_bb(cfg, options, repo, base)
- else:
- base = current
- bbfile = parse_bb(cfg, options, repo)
- upstream_commit = find_upstream_commit(repo, bbfile, options.upstream_tag)
-
- switch_to_pq_branch(cfg, repo, base, options)
- GitCommand("rebase")([upstream_commit])
-
-
-def switch_pq(cfg, repo, options):
- """Switch to patch-queue branch if on base branch and vice versa"""
- current = repo.get_branch()
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
- gbp.log.info("Switching to branch '%s'" % base)
- repo.checkout(base)
- else:
- switch_to_pq_branch(cfg, repo, current, options)
-
-
-def drop_pq_bb(cfg, repo, options):
- """Remove pq branch"""
- current = repo.get_branch()
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
- bbfile = parse_bb(cfg, options, repo, base)
- else:
- bbfile = parse_bb(cfg, options, repo)
- drop_pq(repo, current, options, pkg_version(bbfile))
-
-
-def switch_to_pq_branch(cfg, repo, branch, options):
- """
- Switch to patch-queue branch if not already there, create it if it
- doesn't exist yet
- """
- if is_pq_branch(branch, options):
- return
-
- bbfile = parse_bb(cfg, options, repo, branch)
- pq_branch = pq_branch_name(branch, options, pkg_version(bbfile))
- if not repo.has_branch(pq_branch):
- raise GbpError("Branch '%s' does not exist" % pq_branch)
-
- gbp.log.info("Switching to branch '%s'" % pq_branch)
- repo.set_branch(pq_branch)
-
-def apply_single_patch(cfg, repo, patchfile, options):
- """Apply a single patch onto the pq branch"""
- current = repo.get_branch()
- if not is_pq_branch(current, options):
- switch_to_pq_branch(cfg, repo, current, options)
- patch = Patch(patchfile)
- apply_and_commit_patch(repo, patch, fallback_author=None)
-
-def opt_split_cb(option, opt_str, value, parser):
- """Split option string into a list"""
- setattr(parser.values, option.dest, value.split(','))
-
-def build_parser(name):
- """Create command line argument parser"""
- try:
- parser = GbpOptionParserBB(command=os.path.basename(name),
- prefix='', usage=USAGE_STRING)
- except configparser.ParsingError as err:
- gbp.log.err(err)
- return None
-
- parser.add_boolean_config_file_option(option_name="patch-numbers",
- dest="patch_numbers")
- parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
- default=False, help="Verbose command execution")
- parser.add_option("--force", dest="force", action="store_true",
- default=False,
- help="In case of import even import if the branch already exists")
- parser.add_config_file_option(option_name="vendor", action="store",
- dest="vendor")
- parser.add_config_file_option(option_name="color", dest="color",
- type='tristate')
- parser.add_config_file_option(option_name="color-scheme",
- dest="color_scheme")
- parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
- parser.add_config_file_option(option_name="upstream-tag",
- dest="upstream_tag")
- parser.add_config_file_option(option_name="bb-file", dest="bb_file")
- parser.add_config_file_option(option_name="meta-dir",
- dest="meta_dir")
- parser.add_config_file_option(option_name="packaging-branch",
- dest="packaging_branch",
- help="Branch the packaging is being maintained on. Only relevant "
- "if a invariable/single pq-branch is defined, in which case "
- "this is used as the 'base' branch. Default is "
- "'%(packaging-branch)s'")
- parser.add_config_file_option(option_name="pq-branch", dest="pq_branch")
- parser.add_config_file_option(option_name="import-files",
- dest="import_files", type="string", action="callback",
- callback=opt_split_cb)
- parser.add_option("--export-rev", action="store", dest="export_rev",
- default="",
- help="Export patches from treeish object TREEISH instead of head "
- "of patch-queue branch", metavar="TREEISH")
- parser.add_config_file_option("patch-export-compress",
- dest="patch_export_compress")
- parser.add_config_file_option("patch-export-squash-until",
- dest="patch_export_squash_until")
- parser.add_config_file_option("patch-export-ignore-path",
- dest="patch_export_ignore_path")
- return parser
-
-def parse_args(argv):
- """Parse command line arguments"""
- parser = build_parser(argv[0])
- if not parser:
- return None, None
-
- options, args = parser.parse_args(argv)
- gbp.log.setup(options.color, options.verbose, options.color_scheme)
- options.patch_export_compress = string_to_int(options.patch_export_compress)
-
- return options, args
-
-
-def main(argv):
- """Main function for the gbp pq-rpm command"""
- retval = 0
-
- if not bb:
- return 1
-
- options, args = parse_args(argv)
- if not options:
- return 1
-
- if len(args) < 2:
- gbp.log.err("No action given.")
- return 1
- else:
- action = args[1]
-
- if args[1] in ["export", "import", "rebase", "drop", "switch"]:
- pass
- elif args[1] in ["apply"]:
- if len(args) != 3:
- gbp.log.err("No patch name given.")
- return 1
- else:
- patchfile = args[2]
- else:
- gbp.log.err("Unknown action '%s'." % args[1])
- return 1
-
- try:
- repo = RpmGitRepository(os.path.curdir)
- except GitRepositoryError:
- gbp.log.err("%s is not a git repository" % (os.path.abspath('.')))
- return 1
-
- if os.path.abspath('.') != repo.path:
- gbp.log.warn("Switching to topdir before running commands")
- os.chdir(repo.path)
-
- try:
- # Initialize BitBake
- tinfoil = init_tinfoil(config_only=True, tracking=True)
- bb_cfg_data = bb.data.createCopy(tinfoil.config_data)
-
- # Create base temporary directory for this run
- options.tmp_dir = tempfile.mkdtemp(dir=options.tmp_dir,
- prefix='gbp-pq-bb_')
- if action == "export":
- export_patches(bb_cfg_data, repo, options)
- elif action == "import":
- import_bb_patches(bb_cfg_data, repo, options)
- elif action == "drop":
- drop_pq_bb(bb_cfg_data, repo, options)
- elif action == "rebase":
- rebase_pq(bb_cfg_data, repo, options)
- elif action == "apply":
- apply_single_patch(bb_cfg_data, repo, patchfile, options)
- elif action == "switch":
- switch_pq(bb_cfg_data, repo, options)
- except CommandExecFailed:
- retval = 1
- except GitRepositoryError as err:
- gbp.log.err("Git command failed: %s" % err)
- retval = 1
- except GbpError as err:
- if len(err.__str__()):
- gbp.log.err(err)
- retval = 1
- finally:
- shutil.rmtree(options.tmp_dir, ignore_errors=True)
-
- return retval
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
-
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Günther <agx@sigxcpu.org>
-# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
+# (C) 2011,2016 Guido Günther <agx@sigxcpu.org>
+# (C) 2012-2014 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
-"""manage patches in a patch queue"""
+"""Manage RPM patches in a patch queue"""
-import configparser
+import bz2
import errno
+import gzip
import os
-import shutil
-import sys
import re
-import gzip
-import bz2
-import tarfile
-import subprocess
-import gbp.tmpfile as tempfile
+import sys
+
+import gbp.log
+from gbp.tmpfile import init_tmpdir, del_tmpdir, tempfile
from gbp.config import GbpOptionParserRpm
from gbp.rpm.git import GitRepositoryError, RpmGitRepository
-from gbp.git.modifier import GitModifier, GitTz
+from gbp.git.modifier import GitModifier
from gbp.command_wrappers import GitCommand, CommandExecFailed
from gbp.errors import GbpError
-import gbp.log
from gbp.patch_series import PatchSeries, Patch
-from gbp.pkg import parse_archive_filename
+from gbp.pkg import Archive
from gbp.rpm import (SpecFile, NoSpecError, guess_spec, guess_spec_repo,
- spec_from_repo, string_to_int)
+ spec_from_repo)
+from gbp.scripts.common import ExitCodes
from gbp.scripts.common.pq import (is_pq_branch, pq_branch_name, pq_branch_base,
- parse_gbp_commands, format_patch,
- format_diff, apply_and_commit_patch, drop_pq)
-from gbp.scripts.common.buildpackage import dump_tree
+ parse_gbp_commands, format_patch, format_diff,
+ switch_to_pq_branch, apply_single_patch,
+ apply_and_commit_patch,
+ drop_pq)
-USAGE_STRING = \
-"""%prog [options] action - maintain patches on a patch queue branch
-tions:
-export Export the patch queue / devel branch associated to the
- current branch into a patch series in and update the spec file
-import Create a patch queue / devel branch from spec file
- and patches in current dir.
-rebase Switch to patch queue / devel branch associated to the current
- branch and rebase against upstream.
-drop Drop (delete) the patch queue /devel branch associated to
- the current branch.
-apply Apply a patch
-switch Switch to patch-queue branch and vice versa.
-convert [experimental] Convert package from single-branch development
- model (packaging and source code changes in the same branch)
- into the orphan-packaging plus patch-queue / development branch
- development model."""
+from gbp.scripts.common.buildpackage import dump_tree
-def compress_patches(patches, compress_size=0):
- """
- Rename and/or compress patches
- """
- ret_patches = []
- for patch in patches:
- # Compress if patch file is larger than "threshold" value
- suffix = ''
- if compress_size and os.path.getsize(patch) > compress_size:
- gbp.log.debug("Compressing %s" % os.path.basename(patch))
- subprocess.Popen(['gzip', '-n', patch]).communicate()
- suffix = '.gz'
-
- ret_patches.append(os.path.basename(patch) + suffix)
- return ret_patches
def is_ancestor(repo, parent, child):
"""Check if commit is ancestor of another"""
merge_base = None
return merge_base == parent_sha1
-def generate_patches(repo, start, squash, end, outdir, options):
+
+def generate_patches(repo, start, end, outdir, options):
"""
Generate patch files from git
"""
start_sha1 = repo.rev_parse("%s^0" % start)
try:
end_commit = end
- end_commit_sha1 = repo.rev_parse("%s^0" % end_commit)
except GitRepositoryError:
# In case of plain tree-ish objects, assume current branch head is the
# last commit
end_commit = "HEAD"
- end_commit_sha1 = repo.rev_parse("%s^0" % end_commit)
+ end_commit_sha1 = repo.rev_parse("%s^0" % end_commit)
start_sha1 = repo.rev_parse("%s^0" % start)
if not is_ancestor(repo, start_sha1, end_commit_sha1):
raise GbpError("Start commit '%s' not an ancestor of end commit "
"'%s'" % (start, end_commit))
- # Squash commits, if requested
- if squash[0]:
- if squash[0] == 'HEAD':
- squash[0] = end_commit
- squash_sha1 = repo.rev_parse("%s^0" % squash[0])
- if start_sha1 != squash_sha1:
- if not squash_sha1 in repo.get_commits(start, end_commit):
- raise GbpError("Given squash point '%s' not in the history "
- "of end commit '%s'" % (squash[0], end_commit))
- # Shorten SHA1s
- squash_sha1 = repo.rev_parse(squash_sha1, short=7)
- start_sha1 = repo.rev_parse(start_sha1, short=7)
- gbp.log.info("Squashing commits %s..%s into one monolithic diff" %
- (start_sha1, squash_sha1))
- patch_fn = format_diff(outdir, squash[1], repo,
- start_sha1, squash_sha1,
- options.patch_export_ignore_path)
- if patch_fn:
- patches.append(patch_fn)
- start = squash_sha1
- # Check for merge commits, yet another squash if merges found
+ # Check for merge commits, squash if merges found
merges = repo.get_commits(start, end_commit, options=['--merges'])
if merges:
# Shorten SHA1s
- start_sha1 = repo.rev_parse(start, short=7)
- merge_sha1 = repo.rev_parse(merges[0], short=7)
+ start_sha1 = repo.rev_parse(start, short=options.abbrev)
+ merge_sha1 = repo.rev_parse(merges[0], short=options.abbrev)
patch_fn = format_diff(outdir, None, repo, start_sha1, merge_sha1,
- options.patch_export_ignore_path)
+ abbrev=options.abbrev)
if patch_fn:
gbp.log.info("Merge commits found! Diff between %s..%s written "
"into one monolithic diff" % (start_sha1, merge_sha1))
patches.append(patch_fn)
start = merge_sha1
- print(start)
# Generate patches
for commit in reversed(repo.get_commits(start, end_commit)):
info = repo.get_commit_info(commit)
- cmds = parse_gbp_commands(info, 'gbp-rpm', ('ignore'),
- ('if', 'ifarch'))[0]
- if not 'ignore' in cmds:
+ (cmds, info['body']) = parse_gbp_commands(info,
+ 'gbp-rpm',
+ ('ignore'),
+ ('if', 'ifarch'))
+ if 'ignore' not in cmds:
patch_fn = format_patch(outdir, repo, info, patches,
- options.patch_numbers,
- options.patch_export_ignore_path)
+ numbered=options.patch_numbers,
+ abbrev=options.abbrev)
if patch_fn:
commands[os.path.basename(patch_fn)] = cmds
else:
if end_commit != end:
gbp.log.info("Generating diff file %s..%s" % (end_commit, end))
patch_fn = format_diff(outdir, None, repo, end_commit, end,
- options.patch_export_ignore_path)
+ options.patch_export_ignore_path,
+ abbrev=options.abbrev)
if patch_fn:
patches.append(patch_fn)
- # Compress
- patches = compress_patches(patches, options.patch_export_compress)
-
- return patches, commands
+ return [os.path.relpath(p) for p in patches], commands
def rm_patch_files(spec):
"""
- Delete the patch files listed in the spec files. Doesn't delete patches
+ Delete the patch files listed in the spec file. Doesn't delete patches
marked as not maintained by gbp.
"""
# Remove all old patches from the spec dir
"""
Export patches to packaging directory and update spec file accordingly.
"""
- squash = options.patch_export_squash_until.split(':', 1)
- if len(squash) == 1:
- squash.append(None)
- else:
- squash[1] += '.diff'
-
# Unlink old patch files and generate new patches
rm_patch_files(spec)
- patches, commands = generate_patches(repo, start, squash, end,
+ patches, commands = generate_patches(repo, start, end,
spec.specdir, options)
spec.update_patches(patches, commands)
spec.write_spec_file()
for the spec file in the working copy.
"""
try:
- if options.spec_file != 'auto':
- options.packaging_dir = os.path.dirname(options.spec_file)
+ if options.spec_file:
if not treeish:
spec = SpecFile(options.spec_file)
else:
raise GbpError("Can't parse spec: %s" % err)
relpath = spec.specpath if treeish else os.path.relpath(spec.specpath,
repo.path)
+ options.packaging_dir = os.path.dirname(relpath)
gbp.log.debug("Using '%s' from '%s'" % (relpath, treeish or 'working copy'))
return spec
def find_upstream_commit(repo, spec, upstream_tag):
"""Find commit corresponding upstream version"""
tag_str_fields = {'upstreamversion': spec.upstreamversion,
- 'vendor': 'Upstream'}
+ 'version': spec.upstreamversion}
upstream_commit = repo.find_version(upstream_tag, tag_str_fields)
if not upstream_commit:
raise GbpError("Couldn't find upstream version %s" %
def export_patches(repo, options):
"""Export patches from the pq branch into a packaging branch"""
current = repo.get_branch()
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
+ if is_pq_branch(current):
+ base = pq_branch_base(current)
gbp.log.info("On branch '%s', switching to '%s'" % (current, base))
repo.set_branch(base)
- spec = parse_spec(options, repo)
pq_branch = current
else:
- spec = parse_spec(options, repo)
- pq_branch = pq_branch_name(current, options, spec.version)
+ base = current
+ pq_branch = pq_branch_name(current)
+ spec = parse_spec(options, repo)
upstream_commit = find_upstream_commit(repo, spec, options.upstream_tag)
-
- export_treeish = options.export_rev if options.export_rev else pq_branch
- if not repo.has_treeish(export_treeish):
- raise GbpError('Invalid treeish object %s' % export_treeish)
+ export_treeish = pq_branch
update_patch_series(repo, spec, upstream_commit, export_treeish, options)
GitCommand('status')(['--', spec.specdir])
+ if options.drop:
+ drop_pq(repo, base)
-def safe_patches(queue, tmpdir_base):
+
+def safe_patches(queue):
"""
Safe the current patches in a temporary directory
- below 'tmpdir_base'. Also, uncompress compressed patches here.
@param queue: an existing patch queue
- @param tmpdir_base: base under which to create tmpdir
- @return: tmpdir and a safed queue (with patches in tmpdir)
+ @return: safed queue (with patches in tmpdir)
@rtype: tuple
"""
- tmpdir = tempfile.mkdtemp(dir=tmpdir_base, prefix='patchimport_')
+ tmpdir = tempfile.mkdtemp(prefix='patchimport_')
safequeue = PatchSeries()
if len(queue) > 0:
gbp.log.debug("Saving patches '%s' in '%s'" %
(os.path.dirname(queue[0].path), tmpdir))
for patch in queue:
- base, _archive_fmt, comp = parse_archive_filename(patch.path)
+ base, _archive_fmt, comp = Archive.parse_filename(patch.path)
uncompressors = {'gzip': gzip.open, 'bzip2': bz2.BZ2File}
if comp in uncompressors:
gbp.log.debug("Uncompressing '%s'" % os.path.basename(patch.path))
src = uncompressors[comp](patch.path, 'r')
dst_name = os.path.join(tmpdir, os.path.basename(base))
- if _archive_fmt:
- tar_name = dst_name
- dst_name += '.tar'
elif comp:
raise GbpError("Unsupported patch compression '%s', giving up"
% comp)
dst.write(src.read())
src.close()
dst.close()
- if _archive_fmt:
- t = tarfile.open(dst_name, 'r:')
- t.extractall(path = tmpdir)
- t.close()
- dst_name = tar_name
safequeue.append(patch)
safequeue[-1].path = dst_name
return GitModifier(match.group('name'), match.group('email'))
return GitModifier()
-def import_extra_files(repo, commitish, files, patch_ignore=True):
- """Import branch-specific gbp.conf files to current branch"""
- found = {}
- for fname in files:
- if fname:
- try:
- found[fname] = repo.show('%s:%s' % (commitish, fname))
- except GitRepositoryError:
- pass
- if found:
- gbp.log.info("Importing additional file(s) from branch '%s' into '%s'" %
- (commitish, repo.get_branch()))
- for fname, content in found.items():
- dirname = os.path.dirname(fname)
- if dirname and not os.path.exists(dirname):
- os.makedirs(dirname)
- with open(fname, 'w') as fobj:
- fobj.write(content)
-
- files = list(found.keys())
- gbp.log.debug('Adding/commiting %s' % files)
- repo.add_files(files, force=True)
- commit_msg = ("Auto-import file(s) from branch '%s':\n %s\n" %
- (commitish, ' '.join(files)))
- if patch_ignore:
- commit_msg += "\nGbp: Ignore\nGbp-Rpm: Ignore"
- repo.commit_files(files, msg=commit_msg)
- return list(found.keys())
def import_spec_patches(repo, options):
"""
"""
current = repo.get_branch()
# Get spec and related information
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
+ if is_pq_branch(current):
+ base = pq_branch_base(current)
if options.force:
spec = parse_spec(options, repo, base)
spec_treeish = base
base = current
upstream_commit = find_upstream_commit(repo, spec, options.upstream_tag)
packager = get_packager(spec)
- pq_branch = pq_branch_name(base, options, spec.version)
+ pq_branch = pq_branch_name(base)
# Create pq-branch
if repo.has_branch(pq_branch) and not options.force:
repo.create_branch(pq_branch, upstream_commit, force=True)
except GitRepositoryError as err:
raise GbpError("Cannot create patch-queue branch '%s': %s" %
- (pq_branch, err))
+ (pq_branch, err))
# Put patches in a safe place
if spec_treeish:
- packaging_tmp = tempfile.mkdtemp(prefix='dump_', dir=options.tmp_dir)
+ packaging_tmp = tempfile.mkdtemp(prefix='dump_')
packaging_tree = '%s:%s' % (spec_treeish, options.packaging_dir)
dump_tree(repo, packaging_tmp, packaging_tree, with_submodules=False,
recursive=False)
spec.specdir = packaging_tmp
in_queue = spec.patchseries()
- queue = safe_patches(in_queue, options.tmp_dir)
+ queue = safe_patches(in_queue)
# Do import
try:
gbp.log.info("Switching to branch '%s'" % pq_branch)
repo.set_branch(pq_branch)
- import_extra_files(repo, base, options.import_files)
if not queue:
return
gbp.log.info("Trying to apply patches from branch '%s' onto '%s'" %
- (base, upstream_commit))
+ (base, upstream_commit))
for patch in queue:
gbp.log.debug("Applying %s" % patch.path)
apply_and_commit_patch(repo, patch, packager)
repo.delete_branch(pq_branch)
raise GbpError('Import failed: %s' % err)
- gbp.log.info("Patches listed in '%s' imported on '%s'" % (spec.specfile,
- pq_branch))
+ gbp.log.info("%d patches listed in '%s' imported on '%s'" % (len(queue), spec.specfile,
+ pq_branch))
def rebase_pq(repo, options):
"""Rebase pq branch on the correct upstream version (from spec file)."""
current = repo.get_branch()
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
+ if is_pq_branch(current):
+ base = pq_branch_base(current)
spec = parse_spec(options, repo, base)
else:
base = current
spec = parse_spec(options, repo)
upstream_commit = find_upstream_commit(repo, spec, options.upstream_tag)
- switch_to_pq_branch(repo, base, options)
+ switch_to_pq_branch(repo, base)
GitCommand("rebase")([upstream_commit])
-def switch_pq(repo, options):
+def switch_pq(repo, current):
"""Switch to patch-queue branch if on base branch and vice versa"""
- current = repo.get_branch()
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
- gbp.log.info("Switching to branch '%s'" % base)
+ if is_pq_branch(current):
+ base = pq_branch_base(current)
+ gbp.log.info("Switching to %s" % base)
repo.checkout(base)
else:
- switch_to_pq_branch(repo, current, options)
-
-
-def drop_pq_rpm(repo, options):
- """Remove pq branch"""
- current = repo.get_branch()
- if is_pq_branch(current, options):
- base = pq_branch_base(current, options)
- spec = parse_spec(options, repo, base)
- else:
- spec = parse_spec(options, repo)
- drop_pq(repo, current, options, spec.version)
-
-
-def switch_to_pq_branch(repo, branch, options):
- """
- Switch to patch-queue branch if not already there, create it if it
- doesn't exist yet
- """
- if is_pq_branch(branch, options):
- return
-
- spec = parse_spec(options, repo, branch)
- pq_branch = pq_branch_name(branch, options, spec.version)
- if not repo.has_branch(pq_branch):
- raise GbpError("Branch '%s' does not exist" % pq_branch)
-
- gbp.log.info("Switching to branch '%s'" % pq_branch)
- repo.set_branch(pq_branch)
-
-def apply_single_patch(repo, patchfile, options):
- """Apply a single patch onto the pq branch"""
- current = repo.get_branch()
- if not is_pq_branch(current, options):
- switch_to_pq_branch(repo, current, options)
- patch = Patch(patchfile)
- apply_and_commit_patch(repo, patch, fallback_author=None)
-
-def convert_package(repo, options):
- """Convert package to orphan-packaging model"""
- old_packaging = repo.get_branch()
- # Check if we're on pq branch, already
- err_msg_base = "Seems you're already using orphan-packaging model - "
- if is_pq_branch(old_packaging, options):
- raise GbpError(err_msg_base + "you're on patch-queue branch")
- # Check if a pq branch already exists
- spec = parse_spec(options, repo, treeish=old_packaging)
- pq_branch = pq_branch_name(old_packaging, options, spec.version)
- if repo.has_branch(pq_branch):
- pq_branch = pq_branch_name(old_packaging, options, spec.version)
- raise GbpError(err_msg_base + "pq branch %s already exists" % pq_branch)
- # Check that the current branch is based on upstream
- upstream_commit = find_upstream_commit(repo, spec, options.upstream_tag)
- if not is_ancestor(repo, upstream_commit, old_packaging):
- raise GbpError(err_msg_base + "%s is not based on upstream version %s" %
- (old_packaging, spec.upstreamversion))
- # Check new branch
- new_branch = old_packaging + "-orphan"
- if repo.has_branch(new_branch):
- if not options.force:
- raise GbpError("Branch '%s' already exists!" % new_branch)
- else:
- gbp.log.info("Dropping branch '%s'" % new_branch)
- repo.delete_branch(new_branch)
-
- # Determine "history"
- if options.retain_history:
- # Find first commit that has the spec file and list commits from there
- try:
- repo.show('%s:%s' % (upstream_commit, spec.specpath))
- history = repo.get_commits(upstream_commit, old_packaging)
- except GitRepositoryError:
- history_start = repo.get_commits(upstream_commit, old_packaging,
- spec.specpath)[-1]
- history = repo.get_commits('%s^' % history_start, old_packaging)
- else:
- history = [repo.rev_parse(old_packaging)]
- history.reverse()
-
- # Do import
- gbp.log.info("Importing packaging files from branch '%s' to '%s'" %
- (old_packaging, new_branch))
- convert_with_history(repo, upstream_commit, history, new_branch,
- spec.specfile, options)
- # Copy extra files
- import_extra_files(repo, old_packaging, options.import_files,
- patch_ignore=False)
-
- gbp.log.info("Package successfully converted to orphan-packaging.")
- gbp.log.info("You're now on the new '%s' packaging branch (the old "
- "packaging branch '%s' was left intact)." %
- (new_branch, old_packaging))
- gbp.log.info("Please check all files and test building the package!")
-
-
-def convert_with_history(repo, upstream, commits, new_branch, spec_fn, options):
- """Auto-import packaging files and (auto-generated) patches"""
-
- # Dump and commit packaging files
- packaging_tree = '%s:%s' % (commits[0], options.packaging_dir)
- packaging_tmp = tempfile.mkdtemp(prefix='pack_', dir=options.tmp_dir)
- dump_packaging_dir = os.path.join(packaging_tmp, options.new_packaging_dir)
- dump_tree(repo, dump_packaging_dir, packaging_tree, with_submodules=False,
- recursive=False)
-
- msg = "Auto-import packaging files\n\n" \
- "Imported initial packaging files from commit '%s'" % (commits[0])
- new_tree = repo.create_tree(packaging_tmp)
- tip_commit = repo.commit_tree(new_tree, msg, [])
-
- # Generate initial patches
- spec = SpecFile(os.path.join(dump_packaging_dir, spec_fn))
- update_patch_series(repo, spec, upstream, commits[0], options)
- # Commit updated packaging files only if something was changed
- new_tree = repo.create_tree(packaging_tmp)
- if new_tree != repo.rev_parse(tip_commit + ':'):
- msg = "Auto-generate patches\n\n" \
- "Generated patches from\n'%s..%s'\n\n" \
- "updating spec file and possibly removing old patches." \
- % (upstream, commits[0])
- tip_commit = repo.commit_tree(new_tree, msg, [tip_commit])
-
- # Import rest of the commits
- for commit in commits[1:]:
- shutil.rmtree(dump_packaging_dir)
- packaging_tree = '%s:%s' % (commit, options.packaging_dir)
- dump_tree(repo, dump_packaging_dir, packaging_tree,
- with_submodules=False, recursive=False)
- try:
- spec = SpecFile(os.path.join(dump_packaging_dir, spec_fn))
- update_patch_series(repo, spec, upstream, commit, options)
- except (NoSpecError, GbpError):
- gbp.log.warn("Failed to generate patches from '%s'" % commit)
-
- new_tree = repo.create_tree(packaging_tmp)
- if new_tree == repo.rev_parse(tip_commit + ':'):
- gbp.log.info("Skipping commit '%s' which generated no change" %
- commit)
- else:
- info = repo.get_commit_info(commit)
- msg = "%s\n\n%sAuto-imported by gbp from '%s'" % (info['subject'],
- info['body'], commit)
- tip_commit = repo.commit_tree(new_tree, msg, [tip_commit])
-
- repo.create_branch(new_branch, tip_commit)
- repo.set_branch(new_branch)
+ switch_to_pq_branch(repo, current)
-def opt_split_cb(option, opt_str, value, parser):
- """Split option string into a list"""
- setattr(parser.values, option.dest, value.split(','))
-
+def usage_msg():
+ return """%prog [options] action - maintain patches on a patch queue branch
+Ations:
+export Export the patch queue / devel branch associated to the
+ current branch into a patch series in and update the spec file
+import Create a patch queue / devel branch from spec file
+ and patches in current dir.
+rebase Switch to patch queue / devel branch associated to the current
+ branch and rebase against upstream.
+drop Drop (delete) the patch queue /devel branch associated to
+ the current branch.
+apply Apply a patch
+switch Switch to patch-queue branch and vice versa."""
-def main(argv):
- """Main function for the gbp pq-rpm command"""
- retval = 0
+def build_parser(name):
+ """Construct command line parser"""
try:
- parser = GbpOptionParserRpm(command=os.path.basename(argv[0]),
- prefix='', usage=USAGE_STRING)
- except configparser.ParsingError as err:
- gbp.log.err('Invalid config file: %s' % err)
- return 1
+ parser = GbpOptionParserRpm(command=os.path.basename(name),
+ prefix='', usage=usage_msg())
+
+ except GbpError as err:
+ gbp.log.err(err)
+ return None
parser.add_boolean_config_file_option(option_name="patch-numbers",
- dest="patch_numbers")
+ dest="patch_numbers")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
- default=False, help="Verbose command execution")
+ default=False, help="Verbose command execution")
parser.add_option("--force", dest="force", action="store_true",
- default=False,
- help="In case of import even import if the branch already exists")
- parser.add_config_file_option(option_name="vendor", action="store",
- dest="vendor")
+ default=False,
+ help="In case of import even import if the branch already exists")
+ parser.add_boolean_config_file_option("drop", dest='drop')
parser.add_config_file_option(option_name="color", dest="color",
- type='tristate')
+ type='tristate')
parser.add_config_file_option(option_name="color-scheme",
- dest="color_scheme")
+ dest="color_scheme")
parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
+ parser.add_config_file_option(option_name="abbrev", dest="abbrev", type="int")
parser.add_config_file_option(option_name="upstream-tag",
- dest="upstream_tag")
+ dest="upstream_tag")
parser.add_config_file_option(option_name="spec-file", dest="spec_file")
parser.add_config_file_option(option_name="packaging-dir",
- dest="packaging_dir")
- parser.add_option("--new-packaging-dir",
- help="Packaging directory in the new packaging branch. Only "
- "relevant for the 'convert' action. If not defined, defaults "
- "to '--packaging-dir'")
- parser.add_config_file_option(option_name="packaging-branch",
- dest="packaging_branch",
- help="Branch the packaging is being maintained on. Only relevant "
- "if a invariable/single pq-branch is defined, in which case "
- "this is used as the 'base' branch. Default is "
- "'%(packaging-branch)s'")
- parser.add_config_file_option(option_name="pq-branch", dest="pq_branch")
- parser.add_config_file_option(option_name="import-files",
- dest="import_files", type="string", action="callback",
- callback=opt_split_cb)
- parser.add_option("--retain-history", action="store_true",
- help="When doing convert, preserve as much of the git history as "
- "possible, i.e. create one commit per commit. Only "
- "relevant for the 'convert' action.")
- parser.add_option("--export-rev", action="store", dest="export_rev",
- default="",
- help="Export patches from treeish object TREEISH instead of head "
- "of patch-queue branch", metavar="TREEISH")
- parser.add_config_file_option("patch-export-compress",
- dest="patch_export_compress")
- parser.add_config_file_option("patch-export-squash-until",
- dest="patch_export_squash_until")
- parser.add_config_file_option("patch-export-ignore-path",
- dest="patch_export_ignore_path")
-
- (options, args) = parser.parse_args(argv)
+ dest="packaging_dir")
+ return parser
+
+
+def parse_args(argv):
+ """Parse command line arguments"""
+ parser = build_parser(argv[0])
+ if not parser:
+ return None, None
+ return parser.parse_args(argv)
+
+
+def main(argv):
+ """Main function for the gbp pq-rpm command"""
+ retval = 0
+
+ (options, args) = parse_args(argv)
+ if not options:
+ return ExitCodes.parse_error
+
gbp.log.setup(options.color, options.verbose, options.color_scheme)
- options.patch_export_compress = string_to_int(options.patch_export_compress)
- if options.new_packaging_dir is None:
- options.new_packaging_dir = options.packaging_dir
if len(args) < 2:
gbp.log.err("No action given.")
gbp.log.err("%s is not a git repository" % (os.path.abspath('.')))
return 1
- if os.path.abspath('.') != repo.path:
- gbp.log.warn("Switching to topdir before running commands")
- os.chdir(repo.path)
-
try:
# Create base temporary directory for this run
- options.tmp_dir = tempfile.mkdtemp(dir=options.tmp_dir,
- prefix='gbp-pq-rpm_')
+ init_tmpdir(options.tmp_dir, prefix='pq-rpm_')
+ current = repo.get_branch()
if action == "export":
export_patches(repo, options)
elif action == "import":
import_spec_patches(repo, options)
elif action == "drop":
- drop_pq_rpm(repo, options)
+ drop_pq(repo, current)
elif action == "rebase":
rebase_pq(repo, options)
elif action == "apply":
- apply_single_patch(repo, patchfile, options)
+ patch = Patch(patchfile)
+ apply_single_patch(repo, current, patch, fallback_author=None)
elif action == "switch":
- switch_pq(repo, options)
- elif action == "convert":
- convert_package(repo, options)
+ switch_pq(repo, current)
+ except KeyboardInterrupt:
+ retval = 1
+ gbp.log.err("Interrupted. Aborting.")
except CommandExecFailed:
retval = 1
except GitRepositoryError as err:
gbp.log.err("Git command failed: %s" % err)
retval = 1
except GbpError as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
retval = 1
finally:
- shutil.rmtree(options.tmp_dir, ignore_errors=True)
+ del_tmpdir()
return retval
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
-
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+#
+"""Perform pristine-tar import into a Git repository"""
+
+import os
+import sys
+import gbp.log
+from gbp.command_wrappers import CommandExecFailed
+from gbp.config import GbpOptionParserDebian
+from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
+from gbp.deb.source import DebianSource
+from gbp.deb.upstreamsource import DebianUpstreamSource
+from gbp.errors import GbpError
+from gbp.scripts.common import ExitCodes, get_component_tarballs
+
+
+def usage_msg():
+ return """%prog [action] [options] /path/to/upstream-version.tar.gz
+
+Actions:
+ commit recreate the pristine-tar commits on the pristine-tar branch
+"""
+
+
+def build_parser(name):
+ try:
+ parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
+ usage=usage_msg())
+ except GbpError as err:
+ gbp.log.err(err)
+ return None
+
+ parser.add_config_file_option(option_name="upstream-tag",
+ dest="upstream_tag")
+ parser.add_config_file_option("component", action="append", metavar='COMPONENT',
+ dest="components")
+ parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
+ help="verbose command execution")
+ parser.add_config_file_option(option_name="color", dest="color", type='tristate')
+ parser.add_config_file_option(option_name="color-scheme",
+ dest="color_scheme")
+ return parser
+
+
+def parse_args(argv):
+ """Parse the command line arguments
+ @return: options and arguments
+ """
+
+ parser = build_parser(argv[0])
+ if not parser:
+ return None, None
+
+ (options, args) = parser.parse_args(argv[1:])
+ gbp.log.setup(options.color, options.verbose, options.color_scheme)
+ return options, args
+
+
+def main(argv):
+ ret = 1
+ repo = None
+
+ (options, args) = parse_args(argv)
+ if not options:
+ return ExitCodes.parse_error
+
+ if len(args) != 2 or args[0] not in ['commit']:
+ gbp.log.err("No action given")
+ return 1
+ else:
+ tarball = args[1]
+
+ try:
+ try:
+ repo = DebianGitRepository('.')
+ except GitRepositoryError:
+ raise GbpError("%s is not a git repository" % (os.path.abspath('.')))
+
+ debsource = DebianSource('.')
+ # FIXME: this should be a single call
+ sources = [DebianUpstreamSource(tarball)]
+ sources += get_component_tarballs(debsource.sourcepkg,
+ debsource.upstream_version,
+ sources[0].path,
+ options.components)
+ upstream_tag = repo.version_to_tag(options.upstream_tag,
+ debsource.upstream_version)
+ repo.create_pristine_tar_commits(upstream_tag, sources)
+ ret = 0
+ except (GitRepositoryError, GbpError, CommandExecFailed) as err:
+ if str(err):
+ gbp.log.err(err)
+ except KeyboardInterrupt:
+ gbp.log.err("Interrupted. Aborting.")
+
+ if not ret:
+ comp_msg = (' with additional tarballs for %s'
+ % ", ".join([os.path.basename(t.path) for t in sources[1:]])) if sources[1:] else ''
+ gbp.log.info("Successfully committed pristine-tar data for version %s of %s%s" % (debsource.version,
+ tarball,
+ comp_msg))
+ return ret
+
+
+if __name__ == "__main__":
+ sys.exit(main(sys.argv))
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
-# (C) 2009,2013 Guido Guenther <agx@sigxcpu.org>
+# (C) 2009,2013,2017,2018 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
# heavily inspired by dom-safe-pull which is © 2009 Stéphane Glondu <steph@glondu.net>
#
"""Pull remote changes and fast forward debian, upstream and pristine-tar branch"""
-import configparser
import sys
-import os, os.path
+import os
+import os.path
from gbp.command_wrappers import (Command, CommandExecFailed)
from gbp.config import (GbpOptionParser, GbpOptionGroup)
from gbp.errors import GbpError
from gbp.git import GitRepositoryError
+from gbp.deb.git import DebianGitRepository
+from gbp.scripts.common import ExitCodes
import gbp.log
-try:
- from gbp.deb.git import DebianGitRepository as GitRepository
-except ImportError:
- from gbp.rpm.git import RpmGitRepository as GitRepository
-def update_branch(branch, repo, options):
+
+def fast_forward_branch(rem_repo, branch, repo, options):
"""
update branch to its remote branch, fail on non fast forward updates
unless --force is given
@return: branch updated or already up to date
@rtype: boolean
"""
- update = None
+ update = False
+
+ if rem_repo:
+ remote = 'refs/remotes/%s/%s' % (rem_repo, branch)
+ else:
+ remote = repo.get_merge_branch(branch)
- remote = repo.get_merge_branch(branch)
if not remote:
gbp.log.warn("No branch tracking '%s' found - skipping." % branch)
return False
- can_fast_forward, up_to_date = repo.is_fast_forward(branch, remote)
+ can_fast_forward, up_to_date = repo.is_fast_forward(repo.ensure_refs_heads(branch),
+ remote)
- if up_to_date: # Great, we're done
+ if up_to_date: # Great, we're done
gbp.log.info("Branch '%s' is already up to date." % branch)
return True
if can_fast_forward:
- update = 'merge'
+ update = True
else:
- if options.force == 'merge':
- gbp.log.info("Non-fast forwarding '%s' due to --force=merge" % branch)
- update = 'merge'
- elif options.force == 'clean':
- gbp.log.info("Checking out clean copy of '%s' due to --force=clean" % branch)
- update = 'clean'
+ if options.force:
+ gbp.log.info("Non-fast forwarding '%s' due to --force" % branch)
+ update = True
else:
gbp.log.warn("Skipping non-fast forward of '%s' - use --force or "
"update manually" % branch)
if update:
- gbp.log.info("Updating '%s'" % branch)
+ gbp.log.info("Updating '%s': %s..%s" % (branch,
+ repo.rev_parse(branch, short=12),
+ repo.rev_parse(remote, short=12)))
if repo.branch == branch:
- if update == 'merge':
- repo.merge(remote)
- elif update == 'clean':
- # Have to drop our current branch
- tmpbranch = "_gbptmp-"+branch
- gbp.log.debug("Checking out '%s' to '%s'" % (remote, tmpbranch))
- repo.create_branch(tmpbranch, remote)
- gbp.log.debug("Switching current branch to '%s'" % (tmpbranch))
- repo.set_branch(tmpbranch)
- gbp.log.debug("Dropping branch '%s'" % branch)
- repo.delete_branch(branch)
- gbp.log.info("Renaming branch '%s' to '%s'" % (tmpbranch, branch))
- repo.rename_branch(tmpbranch, branch)
+ repo.merge(remote)
else:
- if can_fast_forward or (update == 'clean'):
- sha1 = repo.rev_parse(remote)
- repo.update_ref("refs/heads/%s" % branch, sha1,
- msg="gbp: forward %s to %s" % (branch, remote))
- elif update == 'merge':
- # Merge other branch, if it cannot be fast-forwarded
- current_branch=repo.branch
- repo.set_branch(branch)
- repo.merge(remote)
- repo.set_branch(current_branch)
-
- return (update != None)
+ sha1 = repo.rev_parse(remote)
+ repo.update_ref("refs/heads/%s" % branch, sha1,
+ msg="gbp: forward %s to %s" % (branch, remote))
+ return update
def build_parser(name):
try:
parser = GbpOptionParser(command=os.path.basename(name), prefix='',
- usage='%prog [options] - safely update a repository from remote')
- except configparser.ParsingError as err:
+ usage='%prog [options] [repo] - safely update a repository from remote')
+ except GbpError as err:
gbp.log.err(err)
return None
branch_group = GbpOptionGroup(parser, "branch options", "branch update and layout options")
parser.add_option_group(branch_group)
- branch_group.add_boolean_config_file_option(option_name = "ignore-branch", dest="ignore_branch")
- branch_group.add_option("--force", action="store", dest="force",
- default=None,
- help="force a branch update even if it can't be fast "
- "forwarded (valid ACTIONs are 'merge', 'clean')",
- metavar='ACTION')
+ branch_group.add_boolean_config_file_option(option_name="ignore-branch", dest="ignore_branch")
+ branch_group.add_option("--force", action="store_true", dest="force", default=False,
+ help="force a branch update even if it can't be fast forwarded")
branch_group.add_option("--all", action="store_true", default=False,
help="update all remote-tracking branches that "
"have identical name in the remote")
branch_group.add_option("--redo-pq", action="store_true", dest="redo_pq", default=False,
- help="redo the patch queue branch after a pull. Warning: this drops the old patch-queue branch")
+ help="redo the patch queue branch after a pull. Warning: this drops the old patch-queue branch")
branch_group.add_config_file_option(option_name="upstream-branch", dest="upstream_branch")
- branch_group.add_config_file_option(option_name="debian-branch", dest="packaging_branch")
- branch_group.add_config_file_option(option_name="packaging-branch", dest="packaging_branch")
+ branch_group.add_config_file_option(option_name="debian-branch", dest="debian_branch")
branch_group.add_boolean_config_file_option(option_name="pristine-tar", dest="pristine_tar")
+ branch_group.add_boolean_config_file_option(option_name="track-missing", dest="track_missing")
branch_group.add_option("--depth", action="store", dest="depth", default=0,
help="git history depth (for deepening shallow clones)")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
parser = build_parser(argv[0])
if not parser:
return None, None
- return parser.parse_args(argv)
+ options, args = parser.parse_args(argv)
+ if len(args) > 2:
+ parser.print_help(file=sys.stderr)
+ return None, None
+ return options, args
+
+
+def get_remote(repo, current):
+ current_remote = repo.get_merge_branch(current)
+ if current_remote:
+ fetch_remote = current_remote.split('/')[0]
+ else:
+ fetch_remote = 'origin'
+ return fetch_remote
+
+
+def track_missing(repo, remote, branch, options):
+ upstream = "remotes/{}/{}".format(remote, branch)
+ if not repo.has_branch(branch):
+ try:
+ repo.fetch(remote, depth=options.depth, refspec=branch)
+ except GitRepositoryError:
+ pass # it's o.k. if the remote branch is missing
+ else:
+ repo.create_branch(branch, upstream)
def main(argv):
retval = 0
current = None
+ rem_repo = None
(options, args) = parse_args(argv)
if not options:
- return 1
+ return ExitCodes.parse_error
gbp.log.setup(options.color, options.verbose, options.color_scheme)
+ if len(args) == 2:
+ rem_repo = args[1]
+ gbp.log.info("Fetching from '%s'" % rem_repo)
+ else:
+ gbp.log.info("Fetching from default remote for each branch")
+
try:
- repo = GitRepository(os.path.curdir)
+ repo = DebianGitRepository(os.path.curdir)
except GitRepositoryError:
gbp.log.err("%s is not a git repository" % (os.path.abspath('.')))
return 1
try:
current = repo.get_branch()
except GitRepositoryError:
- # Not being on any branch is o.k. with --git-ignore-branch
- if options.ignore_branch:
+ # Not being on any branch is o.k. with --ignore-branch
+ if options.ignore_branch:
current = repo.head
gbp.log.info("Found detached head at '%s'" % current)
else:
raise
- for branch in [ options.packaging_branch, options.upstream_branch ]:
+ (ret, out) = repo.is_clean()
+ if not ret:
+ gbp.log.err("You have uncommitted changes in your source tree:")
+ gbp.log.err(out)
+ raise GbpError
+
+ repo.fetch(rem_repo, depth=options.depth)
+ repo.fetch(rem_repo, depth=options.depth, tags=True)
+
+ fetch_remote = get_remote(repo, current)
+ for branch in [options.debian_branch, options.upstream_branch]:
+ if not branch:
+ continue
+ if options.track_missing:
+ track_missing(repo, fetch_remote, branch, options)
+
if repo.has_branch(branch):
branches.add(branch)
- if repo.has_pristine_tar_branch() and options.pristine_tar:
- branches.add(repo.pristine_tar_branch)
+ if options.pristine_tar:
+ branch = repo.pristine_tar_branch
+ if options.track_missing:
+ track_missing(repo, fetch_remote, branch, options)
+
+ if repo.has_pristine_tar_branch():
+ branches.add(repo.pristine_tar_branch)
if options.all:
- current_remote = repo.get_merge_branch(current)
- if current_remote:
- fetch_remote = current_remote.split('/')[0]
- else:
- fetch_remote = 'origin'
for branch in repo.get_local_branches():
merge_branch = repo.get_merge_branch(branch)
if merge_branch:
if rem == fetch_remote and branch == rem_br:
branches.add(branch)
- (ret, out) = repo.is_clean()
- if not ret:
- gbp.log.err("You have uncommitted changes in your source tree:")
- gbp.log.err(out)
- raise GbpError
-
- repo.fetch(depth=options.depth)
- repo.fetch(depth=options.depth, tags=True)
for branch in branches:
- if not update_branch(branch, repo, options):
+ if not fast_forward_branch(rem_repo, branch, repo, options):
retval = 2
if options.redo_pq:
- repo.set_branch(options.packaging_branch)
- Command("gbp-pq")(["drop"])
- Command("gbp-pq")(["import"])
+ repo.set_branch(options.debian_branch)
+ Command("gbp")(["pq", "drop"])
+ Command("gbp")(["pq", "import"])
repo.set_branch(current)
+ except KeyboardInterrupt:
+ retval = 1
+ gbp.log.err("Interrupted. Aborting.")
except CommandExecFailed:
retval = 1
except (GbpError, GitRepositoryError) as err:
- if len(err.__str__()):
+ if str(err):
gbp.log.err(err)
retval = 1
return retval
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
--- /dev/null
+#!/usr/bin/python3
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+"""Push your changes to a remote"""
+
+import os
+import sys
+
+import gbp.log
+from gbp.config import GbpOptionParserDebian
+from gbp.deb.git import DebianGitRepository, GitRepositoryError
+from gbp.deb.source import DebianSourceError
+from gbp.deb.source import DebianSource
+from gbp.errors import GbpError
+from gbp.scripts.common import ExitCodes
+
+
+def build_parser(name):
+ try:
+ parser = GbpOptionParserDebian(command=os.path.basename(name),
+ usage='%prog [options]')
+ except GbpError as err:
+ gbp.log.err(err)
+ return None
+
+ parser.add_option("-d", "--dry-run", dest="dryrun", default=False,
+ action="store_true", help="dry run, don't push.")
+ parser.add_config_file_option(option_name="upstream-branch",
+ dest="upstream_branch")
+ parser.add_config_file_option(option_name="upstream-tag",
+ dest="upstream_tag")
+ parser.add_config_file_option(option_name="debian-branch",
+ dest="debian_branch")
+ parser.add_config_file_option(option_name="debian-tag",
+ dest="debian_tag")
+ parser.add_boolean_config_file_option(option_name="pristine-tar",
+ dest="pristine_tar")
+ parser.add_boolean_config_file_option(option_name="ignore-branch", dest="ignore_branch")
+ parser.add_config_file_option(option_name="color", dest="color", type='tristate')
+ parser.add_config_file_option(option_name="color-scheme",
+ dest="color_scheme")
+ parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
+ default=False, help="verbose command execution")
+ return parser
+
+
+def parse_args(argv):
+ parser = build_parser(argv[0])
+ if not parser:
+ return None, None
+ return parser.parse_args(argv)
+
+
+def do_push(repo, dests, to_push, dry_run):
+ verb = "Dry-run: Pushing" if dry_run else "Pushing"
+ success = True
+ for dest in dests:
+ for tag in to_push['tags']:
+ gbp.log.info("%s %s to %s" % (verb, tag, dest))
+ try:
+ repo.push_tag(dest, tag, dry_run=dry_run)
+ except GitRepositoryError as e:
+ gbp.log.err(e)
+ success = False
+ for k, v in to_push['refs']:
+ gbp.log.info("%s %s to %s:%s" % (verb, v, dest, k))
+ try:
+ repo.push(dest, v, k, dry_run=dry_run)
+ except GitRepositoryError as e:
+ gbp.log.err(e)
+ success = False
+ return success
+
+
+def get_push_src(repo, ref, tag):
+ """
+ Determine wether we can push the ref
+
+ If the ref is further ahead than the tag
+ we only want to push up to this tag.
+ """
+ commit = repo.rev_parse("%s^{commit}" % tag)
+ if repo.rev_parse(ref) == commit:
+ return ref
+ else:
+ return commit
+
+
+def get_remote(repo, branch):
+ remote_branch = repo.get_merge_branch(branch)
+ return remote_branch.split('/')[0] if remote_branch else 'origin'
+
+
+def main(argv):
+ retval = 1
+ branch = None
+ dest = None
+ to_push = {
+ 'refs': [],
+ 'tags': [],
+ }
+
+ (options, args) = parse_args(argv)
+ if not options:
+ return ExitCodes.parse_error
+
+ if len(args) > 2:
+ gbp.log.err("Only a single remote repository can be given")
+ elif len(args) == 2:
+ dest = args[1]
+
+ gbp.log.setup(options.color, options.verbose, options.color_scheme)
+ try:
+ repo = DebianGitRepository(os.path.curdir, toplevel=False)
+ except GitRepositoryError:
+ gbp.log.err("%s is not inside a git repository" % (os.path.abspath('.')))
+ return 1
+
+ try:
+ source = DebianSource(repo.path)
+ branch = repo.branch
+ dtag = None
+
+ if not options.ignore_branch:
+ if branch != options.debian_branch:
+ gbp.log.err("You are not on branch '%s' but %s" %
+ (options.debian_branch,
+ "on '%s'" % branch if branch else 'in detached HEAD state'))
+ raise GbpError("Use --ignore-branch to ignore or --debian-branch to set the branch name.")
+
+ if not dest:
+ dest = get_remote(repo, branch)
+
+ if options.debian_tag != '':
+ dtag = repo.version_to_tag(options.debian_tag, source.version)
+ if repo.has_tag(dtag):
+ to_push['tags'].append(dtag)
+
+ if branch:
+ ref = 'refs/heads/%s' % branch
+ if source.is_releasable() and dtag:
+ to_push['refs'].append((ref, get_push_src(repo, ref, dtag)))
+ elif not dtag:
+ # --debian-tag='': Push branch up to tip
+ to_push['refs'].append((ref, get_push_src(repo, ref, ref)))
+
+ if not source.is_native():
+ if options.upstream_tag != '':
+ utag = repo.version_to_tag(options.upstream_tag,
+ source.upstream_version)
+ if repo.has_tag(utag):
+ to_push['tags'].append(utag)
+
+ if options.upstream_branch != '':
+ ref = 'refs/heads/%s' % options.upstream_branch
+ to_push['refs'].append((ref, get_push_src(repo, ref, utag)))
+
+ if options.pristine_tar:
+ commit, _ = repo.get_pristine_tar_commit(source)
+ if commit:
+ ref = 'refs/heads/pristine-tar'
+ # If we push to the default we only push if our notion of the remote
+ # branch doesn't have the commit already (See #1001163)
+ if dest == get_remote(repo, repo.branch):
+ target = repo.get_merge_branch('pristine-tar')
+ if not repo.branch_contains(target, commit, remote=True):
+ to_push['refs'].append((ref, get_push_src(repo, ref, commit)))
+ else:
+ # TODO: Needs to check remote first, (See #1001163)
+ to_push['refs'].append((ref, get_push_src(repo, ref, commit)))
+ if do_push(repo, [dest], to_push, dry_run=options.dryrun):
+ retval = 0
+ else:
+ gbp.log.err("Failed to push some refs.")
+ retval = 1
+ except (GbpError, GitRepositoryError, DebianSourceError) as err:
+ if str(err):
+ gbp.log.err(err)
+ except KeyboardInterrupt:
+ gbp.log.err("Interrupted. Aborting.")
+
+ return retval
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
-# (C) 2007, 2008, 2009, 2010, 2013 Guido Guenther <agx@sigxcpu.org>
-# (C) 2014 Intel Corporation <markus.lehtonen@linux.intel.com>
+# (C) 2007, 2008, 2009, 2010, 2013 Guido Günther <agx@sigxcpu.org>
+# (C) 2014-2015 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
#
"""Generate RPM changelog entries from git commit messages"""
-import configparser
from datetime import datetime
import os.path
import pwd
import gbp.log
from gbp.config import GbpOptionParserRpm, GbpOptionGroup
from gbp.errors import GbpError
-from gbp.git.modifier import GitModifier
-from gbp.rpm import guess_spec, NoSpecError, SpecFile
+from gbp.rpm import (guess_spec, NoSpecError, SpecFile, split_version_str,
+ compose_version_str)
from gbp.rpm.changelog import Changelog, ChangelogParser, ChangelogError
from gbp.rpm.git import GitRepositoryError, RpmGitRepository
from gbp.rpm.policy import RpmPkgPolicy
-from gbp.scripts.buildpackage_rpm import packaging_tag_name
-from gbp.scripts.buildpackage_rpm import create_packaging_tag
+from gbp.scripts.common import ExitCodes
+from gbp.tmpfile import init_tmpdir, del_tmpdir
ChangelogEntryFormatter = RpmPkgPolicy.ChangelogEntryFormatter
# Parse topmost section and try to determine the start commit
if self.changelog.sections:
self.changelog.sections[0] = parser.parse_section(
- self.changelog.sections[0])
+ self.changelog.sections[0])
def write(self):
"""Write changelog file to disk"""
else:
return self._file
+
def load_customizations(customization_file):
"""Load user defined customizations file"""
# Load customization file
return 'vi'
-def check_repo_state(repo, options):
- """Check that the repository is in good state"""
- # Check branch
- branch = repo.get_branch()
+def check_branch(repo, options):
+ """Check the current git branch"""
+ try:
+ branch = repo.get_branch()
+ except GitRepositoryError:
+ branch = None
if options.packaging_branch != branch and not options.ignore_branch:
gbp.log.err("You are not on branch '%s' but on '%s'" %
(options.packaging_branch, branch))
raise GbpError("Use --ignore-branch to ignore or "
"--packaging-branch to set the branch name.")
- # Check unstaged changes
- if options.commit:
- unstaged = []
- status = repo.status()
- for group, files in status.items():
- if group != '??' and group[1] != ' ':
- unstaged.extend(files)
- if unstaged:
- gbp.log.error("Unstaged changes in:\n %s" %
- '\n '.join(unstaged))
- raise GbpError("Please commit or stage your changes before using "
- "the --commit or --tag option")
def parse_spec_file(repo, options):
"""Find and parse spec file"""
- if options.spec_file != 'auto':
+ if options.spec_file:
spec_path = os.path.join(repo.path, options.spec_file)
spec = SpecFile(spec_path)
else:
gbp.log.debug("Trying to find packaging tag for version '%s'" %
fields['version'])
full_version = fields['version']
- tag_str_fields.update(RpmPkgPolicy.split_full_version(full_version))
+ tag_str_fields.update(split_version_str(full_version))
elif 'upstreamversion' in fields:
gbp.log.debug("Trying to find packaging tag for version '%s'" %
fields['upstreamversion'])
if 'release' in fields:
tag_str_fields['release'] = fields['release']
commit = repo.find_version(options.packaging_tag,
- tag_str_fields)
+ tag_str_fields)
if commit:
return commit
else:
def get_start_commit(changelog, repo, options):
"""Get the start commit from which to generate new entries"""
- if options.all:
- since = None
- elif options.since:
+ if options.since:
since = options.since
else:
if changelog.sections:
since = None
if not since:
raise GbpError("Couldn't determine starting point from "
- "changelog, please use the '--since' or '--all'")
+ "changelog, please use the '--since' option")
gbp.log.info("Continuing from commit '%s'" % since)
return since
for commit in commits:
info = repo.get_commit_info(commit)
entry_text = ChangelogEntryFormatter.compose(info, full=options.full,
- ignore_re=options.ignore_regex, id_len=options.idlen,
- meta_bts=options.meta_bts)
+ ignore_re=options.ignore_regex,
+ id_len=options.idlen)
if entry_text:
entries.append(changelog.create_entry(author=info['author'].name,
text=entry_text))
return entries
-def entries_from_text(changelog, text, author):
- """Generate a list of changelog entries from a string"""
- entries = []
- # Use current user as the author for all entries
- for line in text.splitlines():
- if line.strip():
- entry_text = "- %s" % line.strip()
- entries.append(changelog.create_entry(author=author,
- text=entry_text))
- return entries
-
-
-def generate_new_entries(changelog, repo, options, args):
- """Generate new entries to be appended to changelog"""
- if options.message:
- author = get_author(repo, options.git_author)[0]
- entries = entries_from_text(changelog, options.message, author)
- else:
- # Get range of commits from where to generate changes
- since = get_start_commit(changelog, repo, options)
- if args:
- gbp.log.info("Only looking for changes in '%s'" % ", ".join(args))
- commits = repo.get_commits(since=since, until='HEAD', paths=args,
- options=options.git_log.split(" "))
- commits.reverse()
- if not commits:
- gbp.log.info("No changes detected from %s to %s." % (since, 'HEAD'))
- entries = entries_from_commits(changelog, repo, commits, options)
- return entries
-
-
def update_changelog(changelog, entries, repo, spec, options):
"""Update the changelog with a range of commits"""
# Get info for section header
now = datetime.now()
name, email = get_author(repo, options.git_author)
rev_str_fields = dict(spec.version,
- version=RpmPkgPolicy.compose_full_version(spec.version),
- vendor=options.vendor)
- if options.commit:
- # Get fake information for the to-be-created git commit
- commit_info = {'author': GitModifier(date=now),
- 'committer': GitModifier(date=now)}
- tag = packaging_tag_name(repo, spec, commit_info, options)
- else:
- commit_info = {'author': None, 'committer': None}
- tag = repo.describe('HEAD', longfmt=True, always=True)
- rev_str_fields['tagname'] = tag
-
+ version=compose_version_str(spec.version),
+ vendor=options.vendor,
+ tagname=repo.describe('HEAD', longfmt=True,
+ always=True))
try:
revision = options.changelog_revision % rev_str_fields
except KeyError as err:
raise GbpError("Unable to construct revision field: unknown key "
- "%s, only %s are accepted" % (err, list(rev_str_fields.keys())))
+ "%s, only %s are accepted" % (err, rev_str_fields.keys()))
# Add a new changelog section if new release or an empty changelog
if options.release or not changelog.sections:
# Add new entries to the topmost section
for entry in entries:
top_section.append_entry(entry)
- return (tag, commit_info['author'], commit_info['committer'])
-
-def create_commit_message(spec, options):
- """Generate commit message"""
- fields = spec.version
- fields['version'] = version=RpmPkgPolicy.compose_full_version(spec.version)
- fields['vendor'] = options.vendor
- try:
- return options.commit_msg % fields
- except KeyError as err:
- raise GbpError("Unknown key %s in commit-msg string, "
- "only %s are accepted" % (err, list(fields.keys())))
-
-def commit_changelog(repo, changelog, message, author, committer, edit):
- """Commit changelog and create a packaging/release tag"""
- repo.add_files(changelog.path)
- repo.commit_staged(message, author_info=author, committer_info=committer,
- edit=edit)
-def parse_args(argv):
- """Parse command line and config file options"""
+def build_parser(name):
+ """Construct command line parser"""
try:
- parser = GbpOptionParserRpm(command=os.path.basename(argv[0]),
+ parser = GbpOptionParserRpm(command=os.path.basename(name),
prefix='', usage='%prog [options] paths')
- except configparser.ParsingError as err:
- gbp.log.error('invalid config file: %s' % err)
- return None, None
+ except GbpError as err:
+ gbp.log.err(err)
+ return None
range_grp = GbpOptionGroup(parser, "commit range options",
- "which commits to add to the changelog")
+ "which commits to add to the changelog")
format_grp = GbpOptionGroup(parser, "changelog entry formatting",
- "how to format the changelog entries")
+ "how to format the changelog entries")
naming_grp = GbpOptionGroup(parser, "naming",
- "branch names, tag formats, directory and file naming")
- commit_grp = GbpOptionGroup(parser, "commit",
- "automatic committing and tagging")
+ "branch names, tag formats, directory and file naming")
parser.add_option_group(range_grp)
parser.add_option_group(format_grp)
parser.add_option_group(naming_grp)
- parser.add_option_group(commit_grp)
# Non-grouped options
parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
- help="verbose command execution")
+ help="verbose command execution")
parser.add_config_file_option(option_name="color", dest="color",
- type='tristate')
+ type='tristate')
parser.add_config_file_option(option_name="color-scheme",
- dest="color_scheme")
+ dest="color_scheme")
+ parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
parser.add_config_file_option(option_name="vendor", action="store",
- dest="vendor")
+ dest="vendor")
parser.add_config_file_option(option_name="git-log", dest="git_log",
- help="options to pass to git-log, default is '%(git-log)s'")
+ help="options to pass to git-log, default is '%(git-log)s'")
parser.add_boolean_config_file_option(option_name="ignore-branch",
- dest="ignore_branch")
+ dest="ignore_branch")
parser.add_config_file_option(option_name="customizations",
- dest="customization_file",
- help="Load Python code from CUSTOMIZATION_FILE. At the "
- "moment, the only useful thing the code can do is "
- "define a custom ChangelogEntryFormatter class.")
+ dest="customization_file",
+ help="Load Python code from CUSTOMIZATION_FILE. At the "
+ "moment, the only useful thing the code can do is define a "
+ "custom ChangelogEntryFormatter class.")
+
# Naming group options
naming_grp.add_config_file_option(option_name="packaging-branch",
- dest="packaging_branch")
+ dest="packaging_branch")
naming_grp.add_config_file_option(option_name="packaging-tag",
- dest="packaging_tag")
+ dest="packaging_tag")
naming_grp.add_config_file_option(option_name="packaging-dir",
- dest="packaging_dir")
+ dest="packaging_dir")
naming_grp.add_config_file_option(option_name="changelog-file",
- dest="changelog_file")
+ dest="changelog_file")
naming_grp.add_config_file_option(option_name="spec-file", dest="spec_file")
# Range group options
range_grp.add_option("-s", "--since", dest="since",
- help="commit to start from (e.g. HEAD^^^, release/0.1.2)")
- range_grp.add_option("--all", action="store_true",
- help="use all commits from the Git history, overrides "
- "--since")
+ help="commit to start from (e.g. HEAD^^^, release/0.1.2)")
# Formatting group options
- format_grp.add_config_file_option(option_name="meta-bts", dest="meta_bts")
format_grp.add_option("--no-release", action="store_false", default=True,
- dest="release",
- help="no release, just update the last changelog section")
+ dest="release",
+ help="no release, just update the last changelog section")
format_grp.add_boolean_config_file_option(option_name="git-author",
- dest="git_author")
+ dest="git_author")
format_grp.add_boolean_config_file_option(option_name="full", dest="full")
format_grp.add_config_file_option(option_name="id-length", dest="idlen",
- help="include N digits of the commit id in the changelog "
- "entry, default is '%(id-length)s'",
- type="int", metavar="N")
+ help="include N digits of the commit id in the changelog "
+ "entry, default is '%(id-length)s'",
+ type="int", metavar="N")
format_grp.add_config_file_option(option_name="ignore-regex",
- dest="ignore_regex",
- help="Ignore lines in commit message matching regex, "
- "default is '%(ignore-regex)s'")
+ dest="ignore_regex",
+ help="Ignore lines in commit message matching regex, "
+ "default is '%(ignore-regex)s'")
format_grp.add_config_file_option(option_name="changelog-revision",
- dest="changelog_revision")
+ dest="changelog_revision")
format_grp.add_config_file_option(option_name="spawn-editor",
- dest="spawn_editor")
+ dest="spawn_editor")
format_grp.add_config_file_option(option_name="editor-cmd",
- dest="editor_cmd")
- format_grp.add_option("-m", '--message',
- help="text to use as new changelog entries - git commit "
- "messages and the --since are ignored in this case")
- # Commit/tag group options
- commit_grp.add_option("-c", "--commit", action="store_true",
- help="commit changes")
- commit_grp.add_config_file_option(option_name="commit-msg",
- dest="commit_msg")
- commit_grp.add_option("--tag", action="store_true",
- help="commit the changes and create a packaging/release"
- "tag")
- commit_grp.add_option("--retag", action="store_true",
- help="Overwrite packaging tag if it already exists")
- commit_grp.add_boolean_config_file_option(option_name="sign-tags",
- dest="sign_tags")
- commit_grp.add_config_file_option(option_name="keyid", dest="keyid")
+ dest="editor_cmd")
+ return parser
+
+
+def parse_args(argv):
+ """Parse command line and config file options"""
+ parser = build_parser(argv[0])
+ if not parser:
+ return None, None
options, args = parser.parse_args(argv[1:])
- if options.tag:
- options.commit = True
+
if not options.changelog_revision:
options.changelog_revision = RpmPkgPolicy.Changelog.header_rev_format
return options, args
+
def main(argv):
"""Script main function"""
options, args = parse_args(argv)
if not options:
- return 1
+ return ExitCodes.parse_error
try:
+ init_tmpdir(options.tmp_dir, prefix='rpm-ch_')
+
load_customizations(options.customization_file)
editor_cmd = determine_editor(options)
repo = RpmGitRepository('.')
- check_repo_state(repo, options)
+ check_branch(repo, options)
# Find and parse spec file
spec = parse_spec_file(repo, options)
# Find and parse changelog file
ch_file = parse_changelog_file(repo, spec, options)
+ since = get_start_commit(ch_file.changelog, repo, options)
- # Get new entries
- entries = generate_new_entries(ch_file.changelog, repo, options, args)
+ # Get range of commits from where to generate changes
+ if args:
+ gbp.log.info("Only looking for changes in '%s'" % ", ".join(args))
+ commits = repo.get_commits(since=since, until='HEAD', paths=args,
+ options=options.git_log.split(" "))
+ commits.reverse()
+ if not commits:
+ gbp.log.info("No changes detected from %s to %s." % (since, 'HEAD'))
# Do the actual update
- tag, author, committer = update_changelog(ch_file.changelog, entries,
- repo, spec, options)
+ entries = entries_from_commits(ch_file.changelog, repo, commits,
+ options)
+ update_changelog(ch_file.changelog, entries, repo, spec, options)
+
# Write to file
ch_file.write()
- if editor_cmd and not options.message:
+ if editor_cmd:
gbpc.Command(editor_cmd, [ch_file.path])()
- if options.commit:
- edit = True if editor_cmd else False
- msg = create_commit_message(spec, options)
- commit_changelog(repo, ch_file, msg, author, committer, edit)
- if options.tag:
- if options.retag and repo.has_tag(tag):
- repo.delete_tag(tag)
- create_packaging_tag(repo, tag, 'HEAD', spec.version, options)
-
except (GbpError, GitRepositoryError, ChangelogError, NoSpecError) as err:
if len(err.__str__()):
gbp.log.err(err)
return 1
+ except KeyboardInterrupt:
+ gbp.log.err("Interrupted. Aborting.")
+ return 1
+ finally:
+ del_tmpdir()
+
return 0
+
if __name__ == "__main__":
sys.exit(main(sys.argv))
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2021 Andrej Shadura <andrew@shadura.me>
+# (C) 2021 Collabora Limited
+# 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, please see
+# <http://www.gnu.org/licenses/>
+#
+"""Setup Git attributes to incapacitate .gitattributes shipped by the upstream"""
+
+import os
+import sys
+import gbp.log
+from gbp.command_wrappers import CommandExecFailed
+from gbp.config import GbpOptionParserDebian
+from gbp.deb.git import GitRepositoryError, DebianGitRepository
+from gbp.errors import GbpError
+from gbp.scripts.common import ExitCodes
+from gbp.scripts.common.repo_setup import setup_gitattributes
+
+
+def build_parser(name):
+ setting_presets = {'dgit-defuse-attrs'}
+
+ def disable_preset(option, opt, value, parser):
+ setting = opt.replace('--no-', '')
+ if parser.values.attr_presets and setting in parser.values.attr_presets:
+ parser.values.attr_presets.remove(setting)
+
+ def enable_preset(option, opt, value, parser):
+ setting = opt.replace('--', '')
+ parser.values.attr_presets.add(setting)
+
+ try:
+ parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='',
+ usage='%prog - set up sane Git attributes')
+ except GbpError as err:
+ gbp.log.err(err)
+ return None
+
+ parser.add_option("--verbose", action="store_true", dest="verbose",
+ default=False, help="verbose command execution")
+ for preset in setting_presets:
+ parser.add_option("--%s" % preset, action="callback", callback=enable_preset,
+ help="Apply %s preset" % preset)
+ parser.add_option("--no-%s" % preset, action="callback", callback=disable_preset,
+ help="Do not apply %s preset" % preset)
+ parser.add_option("--all", action="store_const", dest="attr_presets",
+ const=setting_presets, default=setting_presets, help="apply all known settings")
+ parser.add_config_file_option(option_name="color", dest="color",
+ type='tristate')
+ parser.add_config_file_option(option_name="color-scheme",
+ dest="color_scheme")
+
+ return parser
+
+
+def parse_args(argv):
+ """Parse the command line arguments
+ @return: options and arguments
+ """
+
+ parser = build_parser(argv[0])
+ if not parser:
+ return None, None
+
+ (options, args) = parser.parse_args(argv[1:])
+ gbp.log.setup(options.color, options.verbose, options.color_scheme)
+ return options, args
+
+
+def main(argv):
+ repo = None
+
+ (options, args) = parse_args(argv)
+ if not options:
+ return ExitCodes.parse_error
+
+ try:
+ try:
+ repo = DebianGitRepository('.')
+ except GitRepositoryError:
+ raise GbpError("%s is not a git repository" % (os.path.abspath('.')))
+
+ if not options.attr_presets:
+ raise GbpError("Nothing to do, no settings to apply.")
+ setup_gitattributes(repo)
+ except (GitRepositoryError, GbpError, CommandExecFailed) as err:
+ if str(err):
+ gbp.log.err(err)
+ except KeyboardInterrupt:
+ gbp.log.err("Interrupted. Aborting.")
+
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main(sys.argv))
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2014 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-"""Create and push submit tag"""
-
-import configparser
-import os
-import sys
-from datetime import datetime
-
-import gbp.log
-from gbp.config import GbpOptionParserBB
-from gbp.errors import GbpError
-from gbp.format import format_msg
-from gbp.git import GitRepository, GitRepositoryError
-
-def guess_remote(repo, options):
- """Guess remote where to push"""
- if options.remote:
- return options.remote
-
- remotes = repo.get_remotes()
- if not remotes:
- raise GbpError("Local repo has no remotes configured. Please add one "
- "or use --remote to define the remote where to push.")
- elif len(remotes) == 1:
- return list(remotes.keys())[0]
- else:
- raise GbpError("Local repo has multiple remotes (%s). Don't know which "
- "one to choose. Use --remote to define where to push." %
- ', '.join(list(remotes.keys())))
-
-
-def build_parser(name):
- """Build command line parser"""
- usage_str = "%prog [options] - create and push submit tag"
- try:
- parser = GbpOptionParserBB(command=os.path.basename(name), prefix='',
- usage=usage_str)
- except configparser.ParsingError as err:
- gbp.log.err(err)
- return None
-
- parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
- help="verbose command execution")
- parser.add_config_file_option(option_name="color", dest="color",
- type='tristate')
- parser.add_config_file_option(option_name="color-scheme",
- dest="color_scheme")
- parser.add_option("-m", "--message", dest="message", help="tag message")
- parser.add_option("-c", "--commit", dest="commit", help="commit to submit",
- default='HEAD')
- parser.add_option("-r", "--remote", dest="remote",
- help="remote where to push")
- parser.add_config_file_option(option_name="submit-tag", dest="submit_tag")
- parser.add_config_file_option(option_name="target", dest="target")
- parser.add_boolean_config_file_option(option_name="sign-tags",
- dest="sign_tags")
- parser.add_config_file_option(option_name="keyid", dest="keyid")
-
- return parser
-
-
-def parse_args(argv):
- """Parse command line arguments"""
- parser = build_parser(argv[0])
- if not parser:
- return None, None
- options, args = parser.parse_args(argv)
-
- gbp.log.setup(options.color, options.verbose, options.color_scheme)
-
- return (options, args)
-
-
-def main(argv):
- """Entry point for gbp-submit-bb"""
- retval = 0
-
- options, _args = parse_args(argv)
- if not options:
- return 1
-
- try:
- repo = GitRepository(os.path.curdir)
- except GitRepositoryError:
- gbp.log.err("The command must be run under a Git repository")
- return 1
-
- try:
- remote = guess_remote(repo, options)
-
- tag_fields = {'nowtime': datetime.now().strftime('%Y%m%d.%H%M%S'),
- 'target': options.target}
- tag_name = format_msg(options.submit_tag, tag_fields)
-
- gbp.log.info("Tagging %s" % tag_name)
- repo.create_tag(tag_name, msg=options.message, commit=options.commit,
- sign=options.sign_tags, keyid=options.keyid,
- annotate=True)
-
- gbp.log.info("Pushing to remote %s" % remote)
- try:
- repo.push_tag(remote, tag_name)
- except GitRepositoryError as err:
- gbp.log.err(err)
- gbp.log.info("Removing tag %s" % tag_name)
- repo.delete_tag(tag_name)
- raise GbpError("Git push failed!")
-
- except (GbpError, GitRepositoryError) as err:
- if len(err.__str__()):
- gbp.log.err(err)
- retval = 1
-
- return retval
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
-
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Supercommand for all gbp commands"""
import glob
# Command is this module and common/ is shared code
# so we don't allow these to be imported:
-invalid_modules = [ 'common', 'supercommand' ]
+invalid_modules = ['common', 'supercommand']
+
def sanitize(cmd):
"""
"""
return cmd.replace('-', '_')
+
def usage():
print("""
Usage:
Use '--list-cmds' to list all available commands.
""")
+
def version(prog):
try:
from gbp.version import gbp_version
>>> pymod_to_cmd('/x/y/z/a_cmd.py')
'a-cmd'
"""
- return os.path.basename(mod.rsplit('.', 1)[0]).replace('_','-')
+ return os.path.basename(mod.rsplit('.', 1)[0]).replace('_', '-')
def get_available_commands(path):
usage()
return 1
- #prg, cmd = argv[0:2] prg is not used
- cmd = argv[1]
-
+ prg, cmd = argv[0:2]
args = argv[1:]
- if cmd in ['--help', '-h', 'help' ]:
+ if cmd in ['--help', '-h']:
usage()
return 0
- elif cmd in [ '--version', 'version' ]:
+ elif cmd == 'help' and len(args) > 1:
+ # Make the first argument after help the new commadn and
+ # request it's help output
+ cmd = args[1]
+ args = [cmd, '--help']
+ elif cmd == 'help':
+ usage()
+ return 0
+ elif cmd in ['--version', 'version']:
version(argv[0])
return 0
- elif cmd in [ '--list-cmds', 'list-cmds' ]:
+ elif cmd in ['--list-cmds', 'list-cmds']:
list_available_commands()
return 0
return module.main(args)
+
if __name__ == '__main__':
sys.exit(supercommand())
--- /dev/null
+#!/usr/bin/python3
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+"""Create a Debian tag"""
+
+import os
+import sys
+
+import gbp.log
+from gbp.format import format_str
+from gbp.config import GbpOptionParserDebian
+from gbp.deb.git import DebianGitRepository, GitRepositoryError
+from gbp.deb.source import DebianSourceError
+from gbp.deb.source import DebianSource
+from gbp.errors import GbpError
+
+from gbp.scripts.common import ExitCodes
+from gbp.scripts.common.hook import Hook
+
+from gbp.scripts.common.pq import is_pq_branch, pq_branch_base
+
+
+def create_debian_tag(repo, source, commit, options):
+ """
+ Create the debian tag
+
+ returns: the created tag
+ """
+ tag = repo.version_to_tag(options.debian_tag, source.version)
+ gbp.log.info("Tagging Debian package %s as %s in git" % (source.version, tag))
+ if options.retag and repo.has_tag(tag):
+ repo.delete_tag(tag)
+ tag_msg = format_str(options.debian_tag_msg,
+ dict(pkg=source.sourcepkg,
+ version=source.version))
+ repo.create_tag(name=tag,
+ msg=tag_msg,
+ sign=options.sign_tags,
+ commit=commit,
+ keyid=options.keyid)
+ return tag
+
+
+def perform_tagging(repo, source, options, hook_env=None):
+ """
+ Perform the tagging
+
+ Select brach to tag, create tag and run hooks
+ """
+ branch = repo.branch
+ if branch and is_pq_branch(branch):
+ commit = repo.get_merge_base(branch, pq_branch_base(branch))
+ else:
+ commit = repo.head
+
+ tag = create_debian_tag(repo, source, commit, options)
+ if options.posttag:
+ sha = repo.rev_parse("%s^{}" % tag)
+ Hook('Posttag', options.posttag,
+ extra_env=Hook.md(hook_env or {},
+ {'GBP_TAG': tag,
+ 'GBP_BRANCH': branch or '(no branch)',
+ 'GBP_SHA1': sha})
+ )()
+
+
+def build_parser(name):
+ try:
+ parser = GbpOptionParserDebian(command=os.path.basename(name),
+ usage='%prog [options]')
+ except GbpError as err:
+ gbp.log.err(err)
+ return None
+
+ parser.add_option("--retag", action="store_true", dest="retag", default=False,
+ help="don't fail if the tag already exists")
+ parser.add_config_file_option(option_name="debian-branch",
+ dest="debian_branch")
+ parser.add_config_file_option(option_name="debian-tag",
+ dest="debian_tag")
+ parser.add_config_file_option(option_name="debian-tag-msg", dest="debian_tag_msg")
+ parser.add_boolean_config_file_option(option_name="sign-tags", dest="sign_tags")
+ parser.add_config_file_option(option_name="keyid", dest="keyid")
+ parser.add_config_file_option(option_name="posttag", dest="posttag",
+ help="hook run after a successful tag operation, "
+ "default is '%(posttag)s'")
+ parser.add_boolean_config_file_option(option_name="ignore-branch", dest="ignore_branch")
+ parser.add_boolean_config_file_option(option_name="ignore-new", dest="ignore_new")
+ parser.add_config_file_option(option_name="color", dest="color", type='tristate')
+ parser.add_config_file_option(option_name="color-scheme",
+ dest="color_scheme")
+ parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
+ default=False, help="verbose command execution")
+ return parser
+
+
+def parse_args(argv):
+ parser = build_parser(argv[0])
+ if not parser:
+ return None, None
+ return parser.parse_args(argv)
+
+
+def main(argv):
+ retval = 1
+
+ (options, args) = parse_args(argv)
+ if not options:
+ return ExitCodes.parse_error
+
+ gbp.log.setup(options.color, options.verbose, options.color_scheme)
+ try:
+ repo = DebianGitRepository(os.path.curdir, toplevel=False)
+ except GitRepositoryError:
+ gbp.log.err("%s is not inside a git repository" % (os.path.abspath('.')))
+ return 1
+
+ try:
+ source = DebianSource(repo.path)
+ if not (options.ignore_branch or options.ignore_new):
+ if repo.branch != options.debian_branch:
+ gbp.log.err("You are not on branch '%s' but on '%s'"
+ % (options.debian_branch,
+ repo.branch or 'no branch'))
+ raise GbpError("Use --ignore-branch to ignore or "
+ "--debian-branch to set the branch name.")
+
+ if not options.ignore_new:
+ (ret, out) = repo.is_clean()
+ if not ret:
+ gbp.log.err("You have uncommitted changes in your source tree:")
+ gbp.log.err(out)
+ raise GbpError("Use --ignore-new to ignore.")
+
+ perform_tagging(repo, source, options)
+ retval = 0
+ except (GbpError, GitRepositoryError, DebianSourceError) as err:
+ if str(err):
+ gbp.log.err(err)
+ except KeyboardInterrupt:
+ gbp.log.err("Interrupted. Aborting.")
+
+ return retval
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
-# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
+# (C) 2012, 2015 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
+#
"""Temporary directory handling"""
import os
+import shutil
import tempfile
from gbp.errors import GbpError
-def mkdtemp(dir, **kwargs):
- """Create temporary directory"""
- try:
- if not os.path.exists(dir):
- os.makedirs(dir)
- except OSError as msg:
- raise GbpError("Unable to create dir %s (%s)" % (dir, msg))
+_old_tempdirs = []
+
+
+def init_tmpdir(path, prefix):
+ """Initialize a temporary directory structure"""
try:
- return os.path.abspath(tempfile.mkdtemp(dir=dir, **kwargs))
- except OSError as msg:
- raise GbpError("Unable to create tmpdir under %s (%s)" % (dir, msg))
+ if not os.path.exists(path):
+ os.makedirs(path)
+ except OSError as err:
+ raise GbpError("Unable to create tmpdir %s (%s)" % (path, err))
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
+ tmpdir = tempfile.mkdtemp(dir=path, prefix=prefix)
+ # Set newly created dir as the default value for all further tempfile
+ # calls
+ _old_tempdirs.append(tempfile.tempdir)
+ tempfile.tempdir = tmpdir
+ return tmpdir
+
+
+def del_tmpdir():
+ """Remove tempdir and restore tempfile module"""
+ if _old_tempdirs:
+ if os.path.exists(tempfile.tempdir) and \
+ not os.getenv('GBP_TMPFILE_NOCLEAN'):
+ shutil.rmtree(tempfile.tempdir)
+ tempfile.tempdir = _old_tempdirs.pop()
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
-# (C) 2011 Guido Guenther <agx@sigxcpu.org>
+# (C) 2011 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""
A switch with three states: on|off|auto
"""
+
class Tristate(object):
"""Tri-state value: on, off or auto """
- ON = True # state is on == do it
+ ON = True # state is on == do it
OFF = False # state is off == don't do it
AUTO = -1 # autodetect == do if possible
# We accept true as alias for on and false as alias for off
- _VALID_NAMES = [ 'on', 'off', 'true', 'false', 'auto' ]
+ _VALID_NAMES = ['on', 'off', 'true', 'false', 'auto']
def __init__(self, val):
- if type(val) in [ type(t) for t in (True, 1) ]:
+ if type(val) in [type(t) for t in (True, 1)]:
if val > 0:
self._state = self.ON
elif val < 0:
self._state = self.AUTO
else:
self._state = self.OFF
- elif type(val) in [ type(t) for t in ("", "") ]:
- if val.lower() in [ 'on', 'true' ]:
+ elif type(val) is str:
+ if val.lower() in ['on', 'true']:
self._state = self.ON
- elif val.lower() in [ 'auto' ]:
+ elif val.lower() in ['auto']:
self._state = self.AUTO
else:
self._state = self.OFF
else:
return 'off'
- def __bool__(self):
+ def __nonzero__(self):
"""
>>> Tristate('on').__nonzero__()
True
+++ /dev/null
-"The current gbp version number"
-gbp_version="0.0"
+++ /dev/null
-#!/bin/bash
-
-#generate apidocs
-which epydoc > /dev/null
-if [ $? -eq 0 ];then
- epydoc -v --config=setup.cfg
-else
- mkdir -p build
- pydoctor -v --config=.pydoctor.cfg
-fi
-
+++ /dev/null
-pkgbase='git-buildpackage'
-pkgname=('git-buildpackage-rpm' 'git-buildpackage-common' 'git-buildpackage-doc')
-pkgver=0.6.27
-pkgrel=0
-pkgdesc="Tools from Debian to integrate the package build system with Git"
-arch=(any)
-url="https://honk.sigxcpu.org/piki/projects/git-buildpackage/"
-license=('GPLv2')
-conflicts=('git-buildpackage')
-provides=('git-buildpackage')
-makedepends=('python3-distribute' 'gtk-doc' 'docbook-sgml' 'docbook-utils')
-source=(git-buildpackage_${pkgver}.tar.gz)
-sha256sums=(SKIP)
-
-prepare()
-{
- cd "$srcdir/$pkgbase-${pkgver}"
- for patch_file in $(find ../../ -maxdepth 1 -name '*.patch' |sort)
- do
- patch -p1 -i $patch_file
- done
-}
-
-build() {
- cd $srcdir/$pkgbase-$pkgver
- WITHOUT_NOSETESTS=1 \
- python3 setup.py build
-
-# Prepare apidocs
- epydoc -n git-buildpackage --no-sourcecode -o docs/apidocs/ \
- gbp*.py git*.py gbp/
-
-# HTML docs
- HAVE_SGML2X=0 make -C docs/
-}
-
-package_git-buildpackage-common() {
- depends=('man-db'
- 'python3'
- 'git')
- optdepends=('pristine-tar: regenerate pristine tarballs')
- cd $srcdir/$pkgbase-$pkgver
- WITHOUT_NOSETESTS=1 \
- python3 setup.py install \
- --root="$pkgdir" \
- --prefix=/usr \
- -O1
- rm $pkgdir/usr/lib/python*/site-packages/*info -rf
- rm $pkgdir/usr/bin/*rpm*
- rm $pkgdir/usr/lib/python*/site-packages/gbp/rpm -rf
- rm $pkgdir/usr/lib/python*/site-packages/gbp/scripts/*rpm*.py* -rf
-}
-
-package_git-buildpackage-rpm() {
- depends=("git-buildpackage-common=$pkgver-$pkgrel" "rpm")
- provides=("tizen-gbp-rpm=20160302")
- cd $srcdir/$pkgbase-$pkgver
- WITHOUT_NOSETESTS=1 \
- python3 setup.py install \
- --root="$pkgdir" \
- --prefix=/usr \
- -O1
- rm $pkgdir/usr/lib/python*/site-packages/*info -rf
- rm -rf $pkgdir/etc
- find $pkgdir/usr/bin -mindepth 1 -maxdepth 1 ! -name '*rpm*' -delete
- find $pkgdir/usr/lib/python*/site-packages/gbp -mindepth 1 -maxdepth 1 -type f -o -type d ! -name rpm -a ! -name scripts |xargs rm -rf
- find $pkgdir/usr/lib/python*/site-packages/gbp/scripts -mindepth 1 -maxdepth 1 ! -name '*rpm*.py*' |xargs rm -rf
-}
-
-package_git-buildpackage-doc() {
- cd $srcdir/$pkgbase-$pkgver
-# Install man pages
- mandir=/usr/share/man
- install -d ${pkgdir}/${mandir}/man1 ${pkgdir}/${mandir}/man5
- install docs/*.1 ${pkgdir}/${mandir}/man1
- install docs/*.5 ${pkgdir}/${mandir}/man5
-
-# Install html documentation
- mkdir -p ${pkgdir}/${docdir}/${pkgbase}
- cp -r docs/manual-html ${pkgdir}/${docdir}/${pkgbase}
- cp -r docs/apidocs ${pkgdir}/${docdir}/${pkgbase}
-}
-# vim:set ts=2 sw=2 et:
+++ /dev/null
-* Thu Nov 30 2023 Xu Huayong <huayong.xu@samsung.com> tizen/0.9.28-20231130
-- Fix git-buildpackage issue to adapt the librpm-tizen 4.14 version
-
-* Wed Nov 01 2023 Biao Wang <biao716.wang@samsung.com> tizen/0.9.27-20231101
-- Port code from python2.x to python3.x
-- Support openSUSE 15.2 build
-- Fix some defects during runtime
-
-* Fri May 14 2021 Biao Wang <biao716.wang@samsung.com> tizen/0.9.21-20210514
-- Fix export submodule source code error.
-
-* Fri May 22 2020 Yan Meng <yan11.meng@samsung.com> tizen/0.9.20-20200522
-- Adapt Ubuntu 20.04 to upgrade the version.
-
-* Wed Sep 12 2018 Biao Wang <biao716.wang@samsung.com> tizen/0.9.9-20180912
-- Adapt Ubuntu 18.04 to upgrade the version.
-
-* Sat Dec 31 2016 SoonKyu Park <sk7.park@samsung.com> tizen/0.7.5-20161231
-- Fix diff_status() for renames and copies
-- Adapt git-merge option when git version greater then 2.9
-- Disable test_pristine_tar unittest case
-
-* Sat May 14 2016 Jun Wang <junbill.wang@samsung.com> tizen/0.7.4-20160514
-- Upgrade version to 0.7.4
-
-* Wed Mar 02 2016 Jun Wang <junbill.wang@samsung.com> tizen/0.6.27-20160302
-- Upgrade version to 0.6.27
-
-* Fri Feb 06 2015 Markus Lehtonen <markus.lehtonen@linux.intel.com> tizen/0.6.22-20150206
-- Rebase on top of upstream version 0.6.22
-- Experimental support for BitBake
- * Introduce import-bb tool.
- This is the first tool in an effort of enabling gbp in the BitBake build
- environment. Gbp-import-bb is a tool for importing packages from a
- BitBake-based "combined" distro repository into individual per-package
- Git repositories.
- * Introduce pq-bb tool.
- This is a tool for managing patch-queues for packages maintained in the
- BitBake packaging format (.bb recipes).
- * Introduce buildpackage-bb tool.
- Initial version of the tool for building BitBake packages from Git.
- NOTE: The buildpackage-bb tool itself is able to operate even without an
- initialized BitBake build environment although the build likely fails in
- this case. However, this makes it possible to export the packaging meta
- data, for example.
- * Introcude clone-bb tool.
- This is a new tool for helping to clone remote per-package Git
- repositories when working in BitBake-based "full distro" build
- environment. This is useful in the case that individual packages are
- actually maintained in per-package Git repositories (like Tizen). That
- is, the full distro repository that the developer operates in is
- composed of the packaging meta data from the individual per-package
- repositories. When willing to contribute to a package the developer
- would use clone-bb to clone the correct per-package repository and make
- his changes there.
- NOTE: clone-bb uses GBP_PACKAGING_REPO variable to determine the remote
- repository URI. This variable should be defined in the package recipes
- in order to make clone-bb usable.
- * Introduce submit-bb tool.
- This is a Tizen-specific tool for creating and pushing special submit
- tags.
-- pq-rpm: better error message
-- buildpackage-rpm: look for remote upstream branches.
- Consider remote branches, too, while looking for the upstream branch
- when trying to guess if a package is native or not.
-- rpm packaging changes
- * enable CentOS 7.
- * include python egg-info in -common.
-- rpm: suppress stderr when unpacking src.rpm
-- UpstreamSource: suppress stderr from tar in _determine_prefix()
-- patchseries: strip numbering when guessing subject from filename
-- Changes in logging
- * don't propagate to ancestor loggers
- * don't initialize handlers in GbpLogger init.
- Better compatibility with 3rd party modules that have their own logging
- initializations.
-- Features/fixes in GitRepository
- * GitRepository/__git_inout: correctly handle input error
- * GitRepository.create_tag: add 'annotate' argument.
- For forcing the creation of annotated tags. Causes the an editor to be
- spawned if no message is given.
-
-* Thu Aug 28 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> tizen/0.6.15-20140828
-- Rebase on top of upstream version 0.6.15
-- Changes in buildpackage-rpm
- * new 'commitish' keyword for spec vcs tag
- * notify: catch RuntimeError when importing pynotify
- * fix exit code in case of GitRepositoryError
- * always create tarball for native packages
- * check submodules from the exported treeish
- * fix crash when running prebuild hook
- * always run cleaner hook
- * add --git-no-build option
- * don't crash on invalid vcs format strings
- * add '--git-native' option
- * remove some outdated/unnecessary exception handling
- * get rid of prepare_export_dir()
- * handle invalid keys in orig prefix
- * internal refactoring and fixes
-- Changes in rpm-ch
- * implement --commit option
- * implement --commit-msg option
- * rpm-ch: implement --meta-bts option
- * rpm.policy: don't allow leading whitespace in bts meta tags
-- docs: manpages for the rpm tools
-- Misc. fixes and features
- * buildpackage: refactor tarball compression
- * gbp-dch: fix handling of the '--meta' option
- * import-orig-rpm: download tarball into parent directory
- * GitRepository/has_submodules: add treeish argument
- * tristate: implement __nonzero__() method
-- Logging:
- * don't automatically setup gbp-specific logger
- * fix auto colorizing for custom streams
-- Tests
- * multiple fixes and additions in ComponentTestBase class
- * testutils: add directories arg to ls_* functions
- * add unit tests for buildpackage-rpm
-- Packaging
- * rpm-packaging: recommend/require unzip
- * recommend/require zipmerge
- * depend/recommend rpmbuild
- * [ Junchun Guan ] Add PKGBUILD to support arch linux
- * [ Li Jinjing ] rpm packaging: use macro for python binary
-
-* Wed May 21 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> tizen/0.6.12-20140521
-- Rebase on top of upstream version 0.6.12
-- Changes in rpm-ch
- * add --message cmdline option
- For giving the text for new changelog entry/entries, skipping git commit
- messages entirely.
- * implement '--all' option
- If defined, git-rpm-ch uses all commits in the Git history. Also,
- '--since' option is omitted.
- * implement --color-scheme option
- * use name (string) as the entry author
- * internal refactoring
- * fix crash in guessing the start commit
-- Changes in pq-rpm
- * implement --retain-history option
- With this option defined gbp tries to preserve the history when
- converting. That is, for each commit in the old branch create one
- corresponding commit in the new orphan packaging branch. This works by
- dumping packaging files and updating patches for each commit. However,
- empty commits are not generated - these are caused e.g. by changes in
- files that are ignored by patch-generation.
- NOTE! Only valid for the 'convert' action.
- * convert: don't try to commit empty set of patches
- * make sure we always get a sane author
- * slight unification of log messages
- * decrease (default) verbosity a bit
- * don't create pq branch when switching
-- Changes in buildpackage-rpm
- * buildpackage-rpm: fix desktop notifications
- * buildpackage-rpm: remove --purge option
- * guess/parse spec as early as possible
-- Documentation
- * Include man pages in RPM packages
- * Add -doc subpackage to RPM packaging
- * Build deb and rpm html docs in one docbook
- * A multitude of small cosmetic fixes
-- Other misc. internal changes
- * GitRepository: implement create_tree() method
- * rpm: suppress some verbosity when updating patches in spec file
- * [ Li Jinjing ] Fix missing return value in get_current_branch method
-
-* Thu Mar 06 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> tizen/0.6.8-20140306
-- Rebase on top of upstream version 0.6.8
-- Introduce git-rpm-ch tool.
- Initial version of the git-rpm-ch tool which is intended for maintaining
- RPM changelogs. Supports both spec files and separate "OBS style"
- changelog files.
- Implement '--tag' command line option (and other related options for
- signing) for creating and tagging a release. These correspond the
- tagging options in git-buildpackage-rpm.
- The git-buildpackage-rpm tool does not commit anything to git. However,
- in rpm-ch the '--tag' option causes the changelog modifications (and,
- all other staged changes) to be committed to git before creating the
- tag. This makes it possible to create a release and document the
- packaging/release tag name in the rpm changelog.
-- Changes to gbp-pq-rpm:
- * implement 'convert' subcommand.
- The new subcommand is intended to be a one-time-callable command for
- converting a package to use the "orphan-packaging" development model and
- git layout (where packaging files are maintained in a separate branch
- and code development in another branch).
- * implement '--import-files' command line option.
- For defining the packaging file(s) that will be imported into the
- development/patch-queue branch.
- By default, the local gbp conf files are imported (so that gbp sees the
- same settings on the development/pq branc as on the packaging branch).
- Files defined with this option will appear as one monolithic commit in
- the development/patch-queue branch.
- * implement --new-packaging-dir cmdline option.
- Used for setting the packaging directory to be used in the new orphan
- packaging branch. Defaults to --packaging-dir so that the gbp.conf files
- are more likely to work without modification.
- * fail gracefully on invalid config files
- * support '%(upstreamversion)s' as a replacable string in the pq branch
- name.
-- Changes to git-buildpackage-rpm
- * patch-export from development branch.
- Adds git-buildpackage-rpm --patch-export support for the 'orphan
- packaging' development model (where packaging files and development sources are kept in separate
- branches).
- New functionality:
- 1. If patch-export is enabled and gbp detects that the current branch
- has a development/patch-queue branch it exports the patches from there,
- instead of the tip of the packaging branch.
- 2. If gbp detects that the current (or exported) branch is a
- development/patch-queue branch it automatically enables patch-export
- and exports packaging files from the base branch (instead of the
- development/patch-queue branch.
- Also, add a new '--git-patch-export-rev' command line option with which
- the user can explicitly set the treeish from which patches are generated
- (i.e. HEAD..<patch-export-rev>)
- * fix spec file vcs update when doing git-tag-only
- * change default export directory.
- So that the git working directory is not dirtied, by default.
-- Changes ti git-import-orig-rpm:
- * disable --merge by default.
- Merging upstream to packaging does not usually make sense with rpm
- packages. Merely, it can create confusion cause unapplicable patches to
- be generated.
- * implement --create-missing-branches option.
- * implement automatic downloading.
- Automatically try to download the archive if the archive filename points
- to a remote location.
- * get archive from spec file.
- Try to get archive path/filename from spec file if no file name is given
- on the command line. This should make version bumps more
- straightforward: just update version number in the spec file and run
- 'git-import-orig-rpm'.
-- git-import-orig: implement --create-missing-branches option.
-- Fixes and new features in GitRepository class
- * GitRepository/get_commit_info: correctly handle file renames/copies.
- * GitRepository.create_branch: add 'force' option
- * GitRepository.archive: add 'paths' option
- * GitRepository/git_command: strip stderr output in case of error.
- * GitRepository/add_remote_repo: fix the 'tags' argument.
- * GitRepository: allow interactive commands.
- * GitRepository: fix the 'edit' mode in commit methods.
- * GitRepository.commit_files: add committer_info and edit arguments.
- * GitRepository.commit_all: add committer_info argument.
-- Fixes and new features in internal rpm/spec support
- * rpm.SpecFile: add 'specpath' attribute
- * rpm: correctly handle 'NoSource' and 'NoPatch' tags in spec.
- * rpm: Implement spec_from_repo() helper function
- * rpm: track all "section" directives in spec file.
- * rpm: add gbp.rpm.changelog module.
- This new module contains basic containers and functionality for parsing
- and updating rpm changelogs. It is coupled with the rpm packaging policy
- class which now has definitions for rpm changelog formatting.
- * rpm: support for getting/setting changelog in spec.
- SpecFile objects now support reading and writing of the %changelog
- section.
- * rpm: store full path of spec file sources
-- Fix detection of prefix directory in tarballs
- gbs import failed to import tarball properly if paths in the archive
- were prefixed with "./".
-
-* Tue Jan 07 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.6.8
-- Rebase on top of upstream version 0.6.8
-
-* Mon Dec 02 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.6.6
-- Rebase on top of upstream version 0.6.6
-- UpstreamSource: fix archive prefix guessing
-- pq-rpm: create diff up to the last merge commit
- Before, merge commits broke patch generation, or, (most probably) caused
- the generated patches to be unapplicable (similar to how
- git-format-patch behaves).
- Now, changes up to the last merge commit are squashed into one diff if
- merge commits are found in the revision list from which patches are to
- be generated. Individual patches (one per commit) are generated from the
- last merge commit up to the exported revision.
-- pq-rpm: magic word HEAD for patch-squashing
- When given as the squash-point, 'HEAD' translates to the end-commit.
- This allows one to configure gbp to always squash all commits into one
- monolithic diff.
-
-* Thu Oct 17 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.6.3
-- buildpackage: support 'commit' variable for VCS tags
-- Clone a repository to a specific directory
-- Fix gbs clone failure if repo url is like host:repo.git
-- SpecFile.set_tag: change the default place for new tags
-- remove 'repo' param to adapt to changes of write_patch_file
-- pq: pass commit_info to format_patch()
-- pq: pass commit_info to format_patch()
-- pq.write_patch_file: drop unused argument
-- pq: fix generation of series file
-- common/pq: fix length of patch filenames
-- buildpackage: refactor prefix handling
-- tests: remove unused import in submodule tests
-- tests: upper case global variables in submodule tests
-- tests: add some docstrings to git submodule tests
-- tests: use eq_ and ok_ from nose tools in submodule tests
-- tests: use sanitize some submodule tests
-- pq-rpm: don't overwrite patches in the same series
-- pq: don't overwrite patches in the same series
-- rpm: support guessing spec file from git treeish
-- rpm.SpecFile: support parsing spec as raw text data
-- rpm: minor docstring fixes
-- rpm: change guess_spec() to return SpecFile object
-- GitRepository.list_tree: add 'paths' option
-- common/pq: support more flexible pq-branch naming
-- pq-rpm: drop unused 'tries' option
-- GitRepository: deprecate the get_remote_repos method
-- GitRepository.has_remote_repo: use get_remotes method
-- git: new class and method for remote repositories
-- debian packaging: change to 1.0 source package format
-- Version bump, rebase on top of 0.6.3
- * Disable cover-min-percentage setting of nose
- * docs: minor sgml syntax fix
-- rpm tests: slight modificatin of import-srpm tests
-- ComponentTestBase: use eq_() ok_() from nose.tools
-- tests: add tests for git-import-orig-rpm
-- ComponentTestBase: keep tmpdir if GBP_TESTS_NOCLEAN is in env
-- ComponentTestBase: fix env restore in teardown
-- config: restore mangled env in doctests
-- import-orig-rpm: remove unneeded try-except
-- import-orig-rpm: don't crash on invalid gbp.conf
-- ComponentTestBase: more verbose output in case of branch mismatch
-- rpm tests: test --filter option of git-import-srpm
-- tests.testutils: add ls_zip() helper
-- import-orig: rework sourcecode preparation and filtering
-- import-orig: new function for filtering/re-packing sources
-- buildpackage: fix handling of empty tarball prefix
-- rpm: import orig: import readline in the common module
-- import orig: import readline in the common module
-- UpstreamSource.unpack: return UpstreamSource instance
-- UpstreamSource.pack: reuse unpacked dir if no filter is used
-- rpm: UpstreamSource: implement prefix guessing
-- UpstreamSource: implement prefix guessing
-- UpstreamSource: check that the sources exist
-- UpstreamSource: store the absolute path
-- rpm: UpstreamSource: move version guessing logic to PkgPolicy
-- UpstreamSource: move version guessing logic to PkgPolicy
-- UpstreamSource.guess_version: don't check for directories
-- Fix `fatal: fetch --all does not take a repository argument`
-
-* Thu Aug 22 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.6.0git20130530
-- rpm: Improve logging in case of rpmlib error
-- Add clean method to GitRepository class
-- Add all_remotes option in git fetch command
-- Add tags option in git push command
-- rpm: print a warning if importing gbp-specific librpm fails
-- rpm: implement a wrapper module for rpm lib
-- rpm: simplify SpecFile._parse_filtered_spec()
-- Fix pylint warnings, follow Markus' sugesstion
-- rpm: enhance spec parsing error messages
-- GitRepository/add_files: consistently update all tracked files
-- GitRepository: Add refspec option to fetch method
-- GitRepository: Add all option to pull method
-- GitRepository: Add force option to push method
+++ /dev/null
-%{!?python3_sitelib: %define python3_sitelib %(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')}
-# Add --without docs rpmbuild option, i.e. docs are enabled by default
-#current disable docs.
-%bcond_with docs
-
-Name: git-buildpackage
-Summary: Build packages from git
-Version: 0.9.28
-Release: 0
-Group: Development/Tools/Building
-License: GPLv2
-BuildArch: noarch
-URL: https://honk.sigxcpu.org/piki/projects/git-buildpackage/
-Source0: %{name}_%{version}.tar.gz
-
-
-# Conditional package names for requirements
-%if 0%{?fedora} || 0%{?centos_ver}
-%define dpkg_pkg_name dpkg-devel
-%else
-%define dpkg_pkg_name dpkg
-%endif
-
-%if 0%{?suse_version} && 0%{?suse_version} < 1230
-%define devscripts_pkg_name devscripts-fixes
-%else
-%define devscripts_pkg_name devscripts
-%endif
-
-%if 0%{?fedora}
-%define man_pkg_name man-db
-%else
-%define man_pkg_name man
-%endif
-
-%if 0%{?fedora} || 0%{?centos_ver} || 0%{?tizen_version:1}
-%define python_pkg_name python3
-%else
-%define python_pkg_name python3
-%endif
-
-%if 0%{?tizen_version:1}
-%define rpm_python_pkg_name python3-rpm
-%else
-%define rpm_python_pkg_name python3-rpm
-%endif
-
-Requires: %{name}-common = %{version}-%{release}
-Requires: %{dpkg_pkg_name}
-Requires: %{devscripts_pkg_name}
-BuildRequires: python3
-BuildRequires: python3-setuptools
-
-%if %{with docs}
-BuildRequires: docbook-utils
-BuildRequires: gtk-doc
-BuildRequires: epydoc
-%if 0%{?fedora}
-BuildRequires: perl-podlators
-%endif
-%endif
-
-%if 0%{?do_unittests}
-BuildRequires: python3-coverage
-BuildRequires: python3-nose
-BuildRequires: git-core
-BuildRequires: %{man_pkg_name}
-BuildRequires: %{dpkg_pkg_name}
-BuildRequires: rpm-build
-BuildRequires: %{rpm_python_pkg_name}
-BuildRequires: pristine-tar
-BuildRequires: unzip
-BuildRequires: libzip
-BuildRequires: gnupg
-# Missing dep of dpkg in openSUSE
-%if 0%{?suse_version}
-BuildRequires: perl-TimeDate
-%endif
-%endif
-
-%description
-Set of tools from Debian that integrate the package build system with Git.
-This package contains the original Debian tools.
-
-
-%package common
-Summary: Common files for git-buildpackage debian and rpm tools
-Group: Development/Tools/Building
-Requires: git-core
-Requires: %{man_pkg_name}
-Requires: %{python_pkg_name}
-Requires: python3-python-dateutil
-%if 0%{?suse_version} || 0%{?tizen_version:1}
-Recommends: pristine-tar
-Recommends: unzip
-Recommends: libzip
-%else
-Requires: pristine-tar
-Requires: unzip
-Requires: libzip
-%endif
-
-%description common
-Common files and documentation, used by both git-buildpackage debian and rpm tools
-
-
-%package rpm
-Summary: Build RPM packages from git
-Group: Development/Tools/Building
-Requires: %{name}-common = %{version}-%{release}
-Requires: rpm
-Requires: %{rpm_python_pkg_name}
-%if 0%{?suse_version} || 0%{?tizen_version:1}
-Recommends: rpm-build
-%else
-Requires: rpm-build
-%endif
-Provides: tizen-gbp-rpm = 20231130
-
-%description rpm
-Set of tools from Debian that integrate the package build system with Git.
-This package contains the tools for building RPM packages.
-
-
-%package bb
-Summary: Build with BitBake from git
-Group: Development/Tools/Building
-Requires: %{name}-common = %{version}-%{release}
-Requires: %{name}-rpm = %{version}-%{release}
-%if 0%{?suse_version} || 0%{?tizen_version:1}
-Recommends: bitbake
-%endif
-
-%description bb
-Set of tools from Debian that integrate the package build system with Git.
-This package contains the tools for building with the BitBake tool.
-
-
-%if %{with docs}
-%package doc
-Summary: Documentation for the git-buildpackage suite
-Group: Development/Tools/Building
-
-%description doc
-This package contains documentation for the git-buildpackage suite - both the
-Debian and the RPM tool set.
-%endif
-
-
-%prep
-%setup -q -n %{name}-%{version}
-
-
-
-%build
-WITHOUT_NOSETESTS=1 %{__python3} ./setup.py build
-
-%if %{with docs}
-# Prepare apidocs
-epydoc -n git-buildpackage --no-sourcecode -o docs/apidocs/ \
- gbp*.py git*.py gbp/
-
-# HTML docs
-HAVE_SGML2X=0 make -C docs/
-%endif
-
-
-%if 0%{?do_unittests}
-%check
-GIT_CEILING_DIRECTORIES=%{_builddir} \
- GIT_AUTHOR_EMAIL=rpmbuild@example.com GIT_AUTHOR_NAME=rpmbuild \
- GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL \
- %{__python3} setup.py nosetests
-%endif
-
-
-%install
-rm -rf %{buildroot}
-WITHOUT_NOSETESTS=1 %{__python3} ./setup.py install --root=%{buildroot} --prefix=/usr
-rm -rf %{buildroot}%{python3_sitelib}/*info
-
-#remove __pycache directory
-find %{buildroot}%{python3_sitelib} -name "__pycache__" | xargs rm -rfv
-
-%if %{with docs}
-# Install man pages
-install -d %{buildroot}%{_mandir}/man1 %{buildroot}%{_mandir}/man5
-install docs/*.1 %{buildroot}%{_mandir}/man1/
-install docs/*.5 %{buildroot}%{_mandir}/man5/
-
-# Install html documentation
-mkdir -p %{buildroot}%{_docdir}/%{name}
-cp -r docs/manual-html %{buildroot}%{_docdir}/%{name}
-cp -r docs/apidocs %{buildroot}%{_docdir}/%{name}
-%endif
-
-cat > files.list << EOF
-%{_bindir}/gbp-pq
-%{_bindir}/git-buildpackage
-%{_bindir}/git-dch
-%{_bindir}/git-import-dsc
-%{_bindir}/git-import-dscs
-%{_bindir}/git-import-orig
-%{_bindir}/git-pbuilder
-%{_bindir}/gbp-create-remote-repo
-%{python3_sitelib}/gbp/deb
-%{python3_sitelib}/gbp/scripts/pq.py*
-%{python3_sitelib}/gbp/scripts/buildpackage.py*
-%{python3_sitelib}/gbp/scripts/dch.py*
-%{python3_sitelib}/gbp/scripts/import_dsc.py*
-%{python3_sitelib}/gbp/scripts/import_dscs.py*
-%{python3_sitelib}/gbp/scripts/import_orig.py*
-%{python3_sitelib}/gbp/scripts/create_remote_repo.py*
-EOF
-
-%if %{with docs}
-cat >> files.list << EOF
-%{_mandir}/man1/gbp-buildpackage.1*
-%{_mandir}/man1/gbp-create-remote-repo.1*
-%{_mandir}/man1/gbp-dch.1*
-%{_mandir}/man1/gbp-import-dsc.1*
-%{_mandir}/man1/gbp-import-dscs.1*
-%{_mandir}/man1/gbp-import-orig.1*
-%{_mandir}/man1/gbp-pq.1*
-%{_mandir}/man1/git-pbuilder.1*
-EOF
-%endif
-
-# Disable the debian tools for CentOS
-%if 0%{?centos_version}
-for f in `cat files.list`; do
- rm -rfv %{buildroot}/$f
-done
-
-%else
-
-%files -f files.list
-%defattr(-,root,root,-)
-%endif
-
-%files common
-%defattr(-,root,root,-)
-%{_bindir}/gbp
-%{_bindir}/gbp-clone
-%{_bindir}/gbp-pull
-%dir %{python3_sitelib}/gbp
-%dir %{python3_sitelib}/gbp/git
-%dir %{python3_sitelib}/gbp/pkg
-%dir %{python3_sitelib}/gbp/scripts
-%dir %{python3_sitelib}/gbp/scripts/common
-%{python3_sitelib}/gbp/*.py*
-%{python3_sitelib}/gbp/scripts/__init__.py*
-%{python3_sitelib}/gbp/scripts/clone.py*
-%{python3_sitelib}/gbp/scripts/config.py*
-%{python3_sitelib}/gbp/scripts/pull.py*
-%{python3_sitelib}/gbp/scripts/supercommand.py*
-%{python3_sitelib}/gbp/scripts/common/*.py*
-%{python3_sitelib}/gbp/git/*.py*
-%{python3_sitelib}/gbp/pkg/*.py*
-%config %{_sysconfdir}/git-buildpackage
-%if %{with docs}
-%{_mandir}/man1/gbp.1*
-%{_mandir}/man1/gbp-clone.1*
-%{_mandir}/man1/gbp-config.1*
-%{_mandir}/man1/gbp-pull.1*
-%{_mandir}/man5/*.5*
-%endif
-
-
-%files rpm
-%defattr(-,root,root,-)
-%dir %{python3_sitelib}/gbp/rpm
-%{_bindir}/*rpm*
-%{python3_sitelib}/gbp/scripts/*rpm*.py*
-%{python3_sitelib}/gbp/rpm/*py*
-%if %{with docs}
-%{_mandir}/man1/gbp-buildpackage-rpm.1*
-%{_mandir}/man1/gbp-import-orig-rpm.1*
-%{_mandir}/man1/gbp-import-srpm.1*
-%{_mandir}/man1/gbp-pq-rpm.1*
-%{_mandir}/man1/gbp-rpm-ch.1*
-%endif
-
-
-%files bb
-%defattr(-,root,root,-)
-%dir %{python3_sitelib}/gbp/bb
-%{python3_sitelib}/gbp/scripts/*bb*.py*
-%{python3_sitelib}/gbp/bb/*py*
-
-
-%if %{with docs}
-%files doc
-%defattr(-,root,root,-)
-%{_docdir}/%{name}/
-%endif
--- /dev/null
+[pydoctor]
+project-name = git-buildpackage
+project-url = https://honk.sigxcpu.org/piki/projects/git-buildpackage/
+html-output = build/apidocs
--- /dev/null
+python-dateutil
[nosetests]
with-doctest=1
-#with-xcoverage=1
with-xunit=1
cover-package=gbp
cover-erase=1
exe=1
+verbosity=2
-[epydoc]
-name = git-buildpackage
-sourcecode = no
-url = https://honk.sigxcpu.org/piki/projects/git-buildpackage/
-target = build/apidocs/
-fail-on = docstring_warning
-modules = gbp, tests/test_*.py
+[flake8]
+# E501: ignore line length
+# E265: block comment should start with '# '
+ignore=E501,E265,W504
+builtins=unicode,execfile,raw_input
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
# END OF COPYRIGHT #
-import subprocess
-from setuptools import setup, find_packages
import os
+import re
+from setuptools import setup, find_packages
+VERSION_PY_PATH = 'gbp/version.py'
-def fetch_version():
+
+def _parse_changelog():
"""Get version from debian changelog and write it to gbp/version.py"""
- version = "0.0"
-
- try:
- popen = subprocess.Popen('dpkg-parsechangelog', stdout=subprocess.PIPE)
- out, ret = popen.communicate()
- for line in out.decode('utf-8').split('\n'):
- if line.startswith('Version:'):
- version = line.split(' ')[1].strip()
- break
- except OSError:
- pass # Failing is fine, we just can't print the version then
-
- with open('gbp/version.py', 'w') as f:
+ with open("debian/changelog", encoding="utf-8") as f:
+ line = f.readline()
+
+ # Parse version from changelog without external tooling so it can work
+ # on non Debian systems.
+ m = re.match(".* \\(([0-9a-zA-Z.~\\-:+]+)\\) ", line)
+ if m:
+ return m.group(1)
+
+ raise ValueError('Could not parse version from debian/changelog')
+
+
+def _save_version_py(version):
+ with open(VERSION_PY_PATH, 'w') as f:
f.write('"The current gbp version number"\n')
f.write('gbp_version = "%s"\n' % version)
+
+def _load_version():
+ with open(VERSION_PY_PATH, 'r') as f:
+ version_py = f.read()
+ version_py_globals = {}
+ exec(version_py, version_py_globals)
+ return version_py_globals['gbp_version']
+
+
+def parse_and_fetch_version():
+ if os.path.exists('debian/changelog'):
+ version = _parse_changelog()
+ _save_version_py(version)
+ # we could return with the version here, but instead we check that
+ # the file has been properly written and it can be loaded back
+
+ version = _load_version()
return version
def readme():
- with open('README') as file:
+ with open('README.md') as file:
return file.read()
-setup(name = "gbp",
- version = fetch_version(),
+
+def setup_requires():
+ if os.getenv('WITHOUT_NOSETESTS'):
+ return []
+ else:
+ return ['nose>=0.11.1', 'coverage>=2.85', 'nosexcover>=1.0.7']
+
+
+setup(name="gbp",
+ version=parse_and_fetch_version(),
author=u'Guido Günther',
- author_email = 'agx@sigxcpu.org',
- url = 'https://honk.sigxcpu.org/piki/projects/git-buildpackage/',
- description = 'Suite to help with Debian packages in Git repositories',
- license = 'GPLv2+',
- long_description = readme(),
- classifiers = [
+ author_email='agx@sigxcpu.org',
+ url='https://honk.sigxcpu.org/piki/projects/git-buildpackage/',
+ description='Suite to help with Debian packages in Git repositories',
+ license='GPLv2+',
+ long_description=readme(),
+ classifiers=[
'Environment :: Console',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Version Control',
'Operating System :: POSIX :: Linux',
],
- scripts = [ 'bin/git-buildpackage',
- 'bin/git-import-dsc',
- 'bin/git-import-orig',
- 'bin/git-dch',
- 'bin/git-import-dscs',
- 'bin/gbp-pq',
- 'bin/gbp-pull',
- 'bin/gbp-clone',
- 'bin/gbp-create-remote-repo',
- 'bin/git-pbuilder',
- 'bin/git-import-srpm',
- 'bin/gbp-pq-rpm',
- 'bin/git-buildpackage-rpm',
- 'bin/git-import-orig-rpm',
- 'bin/git-rpm-ch'],
- packages = find_packages(exclude=['tests', 'tests.*']),
- data_files = [("/etc/git-buildpackage/", ["gbp.conf"]),],
+ scripts=['bin/git-pbuilder',
+ 'bin/gbp-builder-mock'],
+ packages=find_packages(exclude=['tests', 'tests.*']),
+ data_files=[("share/git-buildpackage/", ["gbp.conf"]), ],
requires=['dateutil'],
install_requires=[
'python-dateutil',
],
+ setup_requires=setup_requires(),
python_requires='>=3.5',
- setup_requires=['nose>=0.11.1', 'coverage>=2.85'] if \
- os.getenv('WITHOUT_NOSETESTS') is None else [],
- entry_points = {
- 'console_scripts': [ 'gbp = gbp.scripts.supercommand:supercommand' ],
+ entry_points={
+ 'console_scripts': ['gbp=gbp.scripts.supercommand:supercommand'],
},
-)
+ )
"""Check if --help works"""
-from . import context
+from . import context # noqa: F401
-# Try unittest2 for CentOS
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+from .testutils.data import TestCaseWithData
-class TestHelp(unittest.TestCase):
+
+class TestHelp(TestCaseWithData):
"""Test help output of gbp commands"""
- def testHelp(self):
- for script in ['buildpackage',
- 'clone',
- 'config',
- 'create_remote_repo',
- 'dch',
- 'import_orig',
- 'import_dsc',
- 'pull',
- 'pq']:
- module = 'gbp.scripts.%s' % script
- m = __import__(module, globals(), locals(), ['main'], 0)
- self.assertRaises(SystemExit,
- m.main,
- ['doesnotmatter', '--help'])
-
- """Test help output of RPM-specific commands"""
- def testHelpRpm(self):
- for script in ['import_srpm',
- 'pq_rpm',
- 'buildpackage_rpm',
- 'import_orig_rpm']:
- module = 'gbp.scripts.%s' % script
- m = __import__(module, globals(), locals(), ['main'], 0)
- self.assertRaises(SystemExit,
- m.main,
- ['doesnotmatter', '--help'])
+ deb_cmds = ['buildpackage',
+ 'config',
+ 'create_remote_repo',
+ 'dch',
+ 'import_orig',
+ 'import_ref',
+ 'import_dsc',
+ 'pristine_tar',
+ 'pull',
+ 'push',
+ 'pq',
+ 'tag']
+
+ rpm_cmds = ['buildpackage_rpm',
+ 'import_srpm',
+ 'rpm_ch',
+ 'pq_rpm']
+
+ @TestCaseWithData.feed(deb_cmds + rpm_cmds)
+ def testHelp(self, script):
+ module = 'gbp.scripts.%s' % script
+ m = __import__(module, globals(), locals(), ['main'], 0)
+ with self.assertRaises(SystemExit):
+ m.main(['doesnotmatter', '--help'])
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
from . import context
import os
-import shutil
import tarfile
-import tempfile
-# Try unittest2 for CentOS
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import gbp.pkg
+
class TestUnpack(unittest.TestCase):
"""Make sure we unpack gzip and bzip2 archives correctly"""
archive_prefix = "archive"
assert os.path.exists(target), "%s does not exist" % target
def _create_archive(self, comp):
- filelist = [ 'README', 'setup.py' ]
+ filelist = ['README.md', 'setup.py']
name = "%s_0.1.tar.%s" % (self.archive_prefix, comp)
- t = tarfile.open(name= name, mode='w:%s' % comp)
+ t = tarfile.open(name=name, mode='w:%s' % comp)
for f in filelist:
t.add(os.path.join(self.top, f),
os.path.join(self._unpack_dir(comp), f))
self.top = context.projectdir
context.chdir(self.dir)
self.archives = {}
- for ext in [ "gz", "bz2" ]:
+ for ext in ["gz", "bz2"]:
self.archives[ext] = self._create_archive(ext)
def tearDown(self):
def test_upstream_source_type(self):
for (comp, archive) in self.archives.items():
source = gbp.pkg.UpstreamSource(archive[0])
- assert source.is_orig() == True
- assert source.is_dir() == False
- assert source.unpacked == None
+ assert source.is_orig() is True
+ assert source.is_dir() is False
+ assert source.unpacked is None
source.unpack(".")
- assert source.is_orig() == True
- assert source.is_dir() == False
+ assert source.is_orig() is True
+ assert source.is_dir() is False
assert type(source.unpacked) == str
def test_upstream_source_unpack(self):
self._check_files(archive[1], comp)
def test_upstream_source_unpack_filtered(self):
- exclude = "README"
+ exclude = "README.md"
for (comp, archive) in self.archives.items():
source = gbp.pkg.UpstreamSource(archive[0])
"""Test L{Changelog}'s guess_version_from_upstream"""
-from . import context
-
+from . import context # noqa: F401
from . import testutils
from gbp.scripts import dch
+
class TestGuessVersionFromUpstream(testutils.DebianGitTestRepo):
"""Test guess_version_from_upstream"""
cp = testutils.MockedChangeLog('1.0-1')
tagformat = 'upstream/%(version)s'
uversion = '1.1'
+ upstream_branch = 'upstream'
self.add_file('doesnot', 'matter')
+ self.repo.create_branch('upstream')
tag = self.repo.version_to_tag(tagformat, uversion)
self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion,
sign=False)
-
+ self.repo.set_branch("master")
guessed = dch.guess_version_from_upstream(self.repo,
tagformat,
+ upstream_branch,
cp)
self.assertEqual('1.1-1', guessed)
tagformat = 'upstream/%(version)s'
uversion = '1.1'
+ upstream_branch = 'upstream'
self.add_file('doesnot', 'matter')
+ self.repo.create_branch('upstream')
tag = self.repo.version_to_tag(tagformat, uversion)
self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion,
sign=False)
+ self.repo.set_branch("master")
guessed = dch.guess_version_from_upstream(self.repo,
tagformat,
+ upstream_branch,
cp)
self.assertEqual('1:1.1-1', guessed)
+
+ def test_guess_upstream_tag_clash_with_non_upstream_tag(self):
+ """Guess with clashing upstream- and non-upstream-tag"""
+ cp = testutils.MockedChangeLog('0.9-1')
+
+ tagformat = 'v%(version)s'
+ uversion = '1.0'
+ upstream_branch = 'upstream'
+
+ self.add_file('doesnot', 'matter')
+ self.repo.create_branch('upstream')
+ tag = self.repo.version_to_tag(tagformat, uversion)
+ self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion,
+ sign=False)
+ self.repo.set_branch("master")
+ self.add_file("clash", "bar")
+ self.repo.create_tag("vyatta/something", msg="some non-upstream tag but not package release tag either")
+ self.add_file("clash2", "bar")
+
+ guessed = dch.guess_version_from_upstream(self.repo,
+ tagformat,
+ upstream_branch,
+ cp)
+
+ self.assertEqual('1.0-1', guessed)
+
+ def test_guess_upstream_tag_zero_release(self):
+ """Guess with existing -0... releases"""
+ cp = testutils.MockedChangeLog('0.9-0vyatta2')
+
+ tagformat = 'upstream/%(version)s'
+ uversion = '0.9'
+ upstream_branch = 'upstream'
+
+ self.add_file('doesnot', 'matter')
+ self.repo.create_branch('upstream')
+ tag = self.repo.version_to_tag(tagformat, uversion)
+ self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion,
+ sign=False)
+ self.repo.set_branch('master')
+ self.add_file('doesnot2', 'matter')
+
+ guessed = dch.guess_version_from_upstream(self.repo,
+ tagformat,
+ upstream_branch,
+ cp)
+ self.assertEqual(None, guessed)
+
+ def test_guess_mangled_upstream_tag(self):
+ """Guess the new version from the upstream tag using a mangled tag format"""
+ cp = testutils.MockedChangeLog('1.0-1')
+ tagformat = 'upstream/%(version%~%-)s'
+ uversion = '1.1~rc1'
+ upstream_branch = 'upstream'
+
+ self.add_file('doesnot', 'matter')
+ self.repo.create_branch('upstream')
+ tag = self.repo.version_to_tag(tagformat, uversion)
+ self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion,
+ sign=False)
+ self.repo.set_branch("master")
+ guessed = dch.guess_version_from_upstream(self.repo,
+ tagformat,
+ upstream_branch,
+ cp)
+ self.assertEqual('1.1~rc1-1', guessed)
+
+ def test_no_changelog(self):
+ tagformat = 'upstream/%(version)s'
+ uversion = '1.1'
+ upstream_branch = 'upstream'
+
+ self.add_file('doesnot', 'matter')
+ self.repo.create_branch('upstream')
+ tag = self.repo.version_to_tag(tagformat, uversion)
+ self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion,
+ sign=False)
+ self.repo.set_branch("master")
+ guessed = dch.guess_version_from_upstream(self.repo,
+ tagformat,
+ upstream_branch,
+ None)
+ self.assertEqual('1.1-1', guessed)
import gbp.git
import gbp.command_wrappers
+from gbp.deb.policy import DebianPkgPolicy as Policy
+from gbp.deb.git import DebianGitRepository
+from gbp.pkg import Compressor
+
from gbp.scripts import buildpackage
+from tests.testutils import ls_zip
REPO = None
REPODIR = None
SUBMODULE_NAMES = ["test_submodule", "sub module"]
TMPDIR = None
TESTFILE_NAME = "testfile"
+TESTDIR_NAME = "testdir"
+
class Submodule(object):
"""Class representing remote repo for Git submodule"""
TMPDIR = context.new_tmpdir(__name__)
REPODIR = TMPDIR.join('test_repo')
- REPO = gbp.git.GitRepository.create(REPODIR)
- SUBMODULES = []
+ REPO = DebianGitRepository.create(REPODIR)
+
for name in SUBMODULE_NAMES:
SUBMODULES.append(Submodule(name, str(TMPDIR)))
"""Test module teardown"""
context.teardown()
+
def test_empty_has_submodules():
"""Test empty repo for submodules"""
ok_(not REPO.has_submodules())
def _add_dummy_data(repo, msg):
"""Commit dummy data to a Git repository"""
shutil.copy(".git/HEAD", TESTFILE_NAME)
+ os.mkdir(TESTDIR_NAME)
+ shutil.copy(TESTFILE_NAME, os.path.join(TESTDIR_NAME, TESTFILE_NAME))
repo.add_files('.', force=True)
repo.commit_all(msg)
REPO.add_submodule(SUBMODULES[0].dir)
REPO.commit_all(msg='Added submodule %s' % SUBMODULES[0].dir)
+
def test_has_submodules():
"""Check for submodules"""
ok_(REPO.has_submodules())
+ ok_(REPO.has_submodules('HEAD'))
+ ok_(not REPO.has_submodules('HEAD^'))
def test_get_submodules():
"""Check for submodules list of (name, hash)"""
modules = REPO.get_submodules("master")[0]
- eq_(modules[0] , 'test_submodule')
- eq_(len(modules[1]) , 40)
+ eq_(modules[0], 'test_submodule')
+ eq_(len(modules[1]), 40)
def test_dump_tree():
os.mkdir(dumpdir)
ok_(buildpackage.dump_tree(REPO, dumpdir, "master", True))
ok_(os.path.exists(os.path.join(dumpdir, TESTFILE_NAME)))
+ ok_(os.path.exists(os.path.join(dumpdir, TESTDIR_NAME, TESTFILE_NAME)))
ok_(os.path.exists(os.path.join(dumpdir, SUBMODULES[0].name,
TESTFILE_NAME)))
+ # No submodules or subdirs if recursive is False
+ dumpdir = TMPDIR.join("dump2")
+ os.mkdir(dumpdir)
+ ok_(buildpackage.dump_tree(REPO, dumpdir, "master", True, False))
+ ok_(os.path.exists(os.path.join(dumpdir, TESTFILE_NAME)))
+ ok_(not os.path.exists(os.path.join(dumpdir, TESTDIR_NAME)))
+ ok_(not os.path.exists(os.path.join(dumpdir, SUBMODULES[0].name)))
def test_create_tarballs():
"""Create an upstream tarball"""
+ class MockedSource:
+ def __init__(self, version):
+ self.name = 'test'
+ self.upstream_version = version
+
+ def upstream_tarball_name(self, compression, component=None):
+ return Policy.build_tarball_name(self.name,
+ self.upstream_version,
+ compression=compression)
+
+ comp = Compressor('bzip2')
# Tarball with submodules
- changelog = { "Source": "test", "Upstream-Version": "0.1" }
- ok_(buildpackage.git_archive(REPO, changelog, str(TMPDIR), str(TMPDIR),
- "HEAD", "bzip2", "9", True))
+ s = MockedSource('0.1')
+ ok_(REPO.create_upstream_tarball_via_git_archive(s, str(TMPDIR), "HEAD", comp,
+ with_submodules=True))
# Tarball without submodules
- changelog = { "Source": "test", "Upstream-Version": "0.2" }
- ok_(buildpackage.git_archive(REPO, changelog, str(TMPDIR), str(TMPDIR),
- "HEAD", "bzip2", "9", False))
+ s = MockedSource('0.2')
+ ok_(REPO.create_upstream_tarball_via_git_archive(s, str(TMPDIR), "HEAD", comp,
+ with_submodules=False))
+
+
+def test_create_zip_archives():
+ """Create an upstream zip archive"""
+ REPO.archive_comp('HEAD', 'with-submodules.zip', 'test',
+ None, format='zip', submodules=True)
+ # Check that submodules were included
+ contents = ls_zip('with-submodules.zip')
+ ok_('test/test_submodule/testfile' in contents)
+
+ REPO.archive_comp('HEAD', 'without-submodules.zip', 'test',
+ None, format='zip', submodules=False)
+ contents = ls_zip('without-submodules.zip')
+ ok_('test/test_submodule/testfile' not in contents)
+
def test_check_tarfiles():
"""Check the contents of the created tarfile"""
# Check tarball with submodules
tarobj = tarfile.open(TMPDIR.join("test_0.1.orig.tar.bz2"), 'r:*')
files = tarobj.getmembers()
- ok_("test-0.1/.gitmodules" in [ f.name for f in files ])
- eq_(len(files) , 6)
+ ok_("test-0.1/.gitmodules" in [f.name for f in files])
+ eq_(len(files), 10)
# Check tarball without submodules
tarobj = tarfile.open(TMPDIR.join("test_0.2.orig.tar.bz2"), 'r:*')
files = tarobj.getmembers()
- ok_(("test-0.2/%s" % TESTFILE_NAME) in [ f.name for f in files ])
- eq_(len(files) , 4)
+ ok_(("test-0.2/%s" % TESTFILE_NAME) in [f.name for f in files])
+ eq_(len(files), 6)
+
def test_add_whitespace_submodule():
"""Add a second submodule with name containing whitespace"""
REPO.add_submodule(SUBMODULES[1].dir)
REPO.commit_all(msg='Added submodule %s' % SUBMODULES[0].dir)
+
def test_get_more_submodules():
"""Check for submodules list of (name, hash)"""
- modules = REPO.get_submodules("master")
- eq_(len(modules), len(SUBMODULE_NAMES))
- module = REPO.get_submodules("master")[0]
- eq_(len(module[1]) , 40)
- ok_(os.path.basename(module[0]) in SUBMODULE_NAMES)
+ module = REPO.get_submodules("master")
+ eq_(len(module), len(SUBMODULE_NAMES))
+ for module in REPO.get_submodules("master"):
+ eq_(len(module[1]), 40)
+ ok_(os.path.basename(module[0]) in SUBMODULE_NAMES)
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
from . import context
-# Try unittest2 for CentOS
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
-
-from gbp.scripts import buildpackage
-from gbp.deb import (DebianPkgPolicy, orig_file)
+import unittest
+
+from gbp.deb.source import DebianSource
+
+from gbp.scripts import export_orig
+from gbp.deb import DebianPkgPolicy
from gbp.errors import GbpError
+
class MockGitRepository:
def __init__(self, with_branch=False, subject=None):
self.with_branch = with_branch
def has_pristine_tar_branch(self):
return self.with_branch
+ def has_branch(self, branch, remote=False):
+ return branch == 'pristine-tar' and self.with_branch
+
def pristine_tar_branch(self):
'pristine-tar'
- def grep_log(self, regex, branch):
+ def grep_log(self, regex, branch, merges=True):
return None
def get_commit_info(self, commit):
return {'subject': self.subject}
+
+class MockedSource(DebianSource):
+ def __init__(self):
+ pass
+
+ def is_native(self):
+ return False
+
+ @property
+ def name(self):
+ return 'source'
+
+ @property
+ def upstream_version(self):
+ return '1.2'
+
+
class TestDetection(unittest.TestCase):
def setUp(self):
+ self.source = MockedSource()
self.tmpdir = context.new_tmpdir(__name__)
- self.cp = {'Source': 'source', 'Upstream-Version': '1.2'}
def tearDown(self):
context.teardown()
def test_guess_comp_type_no_pristine_tar_no_orig(self):
repo = MockGitRepository(with_branch=False)
- guessed = buildpackage.guess_comp_type(
- repo, 'auto', self.cp, str(self.tmpdir))
+ guessed = export_orig.guess_comp_type(
+ 'auto', self.source, repo, str(self.tmpdir))
self.assertEqual('gzip', guessed)
def test_guess_comp_type_no_pristine_tar_with_orig(self):
open(self.tmpdir.join('source_1.2.orig.tar.bz2'), "w").close()
repo = MockGitRepository(with_branch=False)
- guessed = buildpackage.guess_comp_type(
- repo, 'auto', self.cp, str(self.tmpdir))
+ guessed = export_orig.guess_comp_type(
+ 'auto', self.source, repo, str(self.tmpdir))
self.assertEqual('bzip2', guessed)
def test_guess_comp_type_no_pristine_tar_with_multiple_origs(self):
open(self.tmpdir.join('source_1.2.orig.tar.gz'), "w").close()
open(self.tmpdir.join('source_1.2.orig.tar.xz'), "w").close()
repo = MockGitRepository(with_branch=False)
- self.assertRaises(
- GbpError,
- buildpackage.guess_comp_type,
- repo,
- 'auto',
- self.cp,
- str(self.tmpdir))
+ with self.assertRaises(GbpError):
+ export_orig.guess_comp_type('auto', self.source, repo, str(self.tmpdir))
def test_guess_comp_type_auto_bzip2(self):
subject = 'pristine-tar data for source_1.2-3.orig.tar.bz2'
repo = MockGitRepository(with_branch=True, subject=subject)
- guessed = buildpackage.guess_comp_type(
- repo, 'auto', self.cp, str(self.tmpdir))
+ guessed = export_orig.guess_comp_type(
+ 'auto', self.source, repo, str(self.tmpdir))
self.assertEqual("bzip2", guessed)
- def test_has_orig_false(self):
- self.assertFalse(DebianPkgPolicy.has_orig(orig_file(self.cp, 'gzip'), str(self.tmpdir)))
+ def test_has_orig_single_false(self):
+ self.assertFalse(DebianPkgPolicy.has_origs([self.source.upstream_tarball_name('gzip')], str(self.tmpdir)))
- def test_has_orig_true(self):
+ def test_has_orig_single_true(self):
open(self.tmpdir.join('source_1.2.orig.tar.gz'), "w").close()
- self.assertTrue(DebianPkgPolicy.has_orig(orig_file(self.cp, 'gzip'), str(self.tmpdir)))
+ self.assertTrue(DebianPkgPolicy.has_origs([self.source.upstream_tarball_name('gzip')], str(self.tmpdir)))
+
+ def test_has_orig_multiple_false(self):
+ orig_files = [self.source.upstream_tarball_name('gzip')] + \
+ [self.source.upstream_tarball_name('gzip', sub) for sub in ['foo', 'bar']]
+ self.assertFalse(DebianPkgPolicy.has_origs(orig_files, str(self.tmpdir)))
+
+ def test_has_orig_multiple_true(self):
+ for ext in ['', '-foo', '-bar']:
+ open(self.tmpdir.join('source_1.2.orig%s.tar.gz' % ext), "w").close()
+ orig_files = [self.source.upstream_tarball_name('gzip')] + \
+ [self.source.upstream_tarball_name('gzip', sub) for sub in ['foo', 'bar']]
+ self.assertTrue(DebianPkgPolicy.has_origs(orig_files, str(self.tmpdir)))
def test_guess_comp_type_bzip2(self):
repo = MockGitRepository(with_branch=False)
- guessed = buildpackage.guess_comp_type(
- repo, 'bzip2', self.cp, None)
+ guessed = export_orig.guess_comp_type(
+ 'bzip2', self.source, repo, None)
self.assertEqual("bzip2", guessed)
def test_guess_comp_type_gzip(self):
repo = MockGitRepository(with_branch=False)
- guessed = buildpackage.guess_comp_type(
- repo, 'gzip', self.cp, None)
+ guessed = export_orig.guess_comp_type(
+ 'gzip', self.source, repo, None)
self.assertEqual("gzip", guessed)
def test_guess_comp_type_bz(self):
repo = MockGitRepository(with_branch=False)
- guessed = buildpackage.guess_comp_type(
- repo, 'xz', self.cp, None)
+ guessed = export_orig.guess_comp_type(
+ 'xz', self.source, repo, None)
self.assertEqual("xz", guessed)
def test_guess_comp_type_lzma(self):
repo = MockGitRepository(with_branch=False)
- guessed = buildpackage.guess_comp_type(
- repo, 'lzma', self.cp, None)
+ guessed = export_orig.guess_comp_type(
+ 'lzma', self.source, repo, None)
self.assertEqual("lzma", guessed)
def test_guess_comp_type_bz2(self):
repo = MockGitRepository(with_branch=False)
- guessed = buildpackage.guess_comp_type(
- repo, 'bz2', self.cp, None)
+ guessed = export_orig.guess_comp_type(
+ 'bz2', self.source, repo, None)
self.assertEqual("bzip2", guessed)
def test_guess_comp_type_gz(self):
repo = MockGitRepository(with_branch=False)
- guessed = buildpackage.guess_comp_type(
- repo, 'gz', self.cp, None)
+ guessed = export_orig.guess_comp_type(
+ 'gz', self.source, repo, None)
self.assertEqual("gzip", guessed)
+
+ def test_guess_comp_type_no_repo(self):
+ guessed = export_orig.guess_comp_type(
+ 'auto', self.source, None, str(self.tmpdir))
+ self.assertEqual('gzip', guessed)
import glob
import os
-import shutil
import tarfile
-import tempfile
-# Try unittest2 for CentOS
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import zipfile
from gbp.pkg import UpstreamSource
+
class TestDir(unittest.TestCase):
def setUp(self):
self.tmpdir = context.new_tmpdir(__name__)
"""Upstream source is a directory"""
source = UpstreamSource(self.upstream_dir)
self.assertEqual(source.is_orig(), False)
- self.assertEqual(source.is_tarball(), False)
self.assertEqual(source.path, self.upstream_dir)
self.assertEqual(source.unpacked, self.upstream_dir)
self.assertEqual(source.guess_version(), ('test', '1.0'))
- self.assertEqual(source.prefix, 'test-1.0')
def tearDown(self):
context.teardown()
+
class TestTar(unittest.TestCase):
"""Test if packing tar archives works"""
def _check_tar(self, us, positive=[], negative=[]):
target = self.tmpdir.join("gbp_0.1.tar.bz2")
repacked = self.source.pack(target)
self.assertEqual(repacked.is_orig(), True)
- self.assertEqual(repacked.is_tarball(), True)
self.assertEqual(repacked.is_dir(), False)
self.assertEqual(repacked.guess_version(), ('gbp', '0.1'))
- self.assertEqual(repacked.archive_fmt, 'tar')
- self.assertEqual(repacked.compression, 'bzip2')
- self.assertEqual(repacked.prefix, 'gbp')
self._check_tar(repacked, ["gbp/errors.py", "gbp/__init__.py"])
def test_pack_filtered(self):
target = self.tmpdir.join("gbp_0.1.tar.bz2")
repacked = self.source.pack(target, ["__init__.py"])
self.assertEqual(repacked.is_orig(), True)
- self.assertEqual(repacked.is_tarball(), True)
self.assertEqual(repacked.is_dir(), False)
self._check_tar(repacked, ["gbp/errors.py"],
["gbp/__init__.py"])
- def test_pack_mangle_prefix(self):
- """Check if mangling prefix works"""
- source = UpstreamSource(os.path.abspath("gbp/"))
- target = self.tmpdir.join("gbp_0.1.tar.bz2")
- repacked = source.pack(target, newprefix="foobar")
- self._check_tar(repacked, ["foobar/errors.py", "foobar/__init__.py"])
- repacked2 = source.pack(target, newprefix="")
- self._check_tar(repacked2, ["./errors.py", "./__init__.py"])
-
class TestZip(unittest.TestCase):
"""Test if unpacking zip archives works"""
self.zipfile = self.tmpdir.join("gbp-0.1.zip")
z = zipfile.ZipFile(self.zipfile, "w")
for f in glob.glob(os.path.join(context.projectdir, "gbp/*.py")):
- arcname = os.path.relpath(f, context.projectdir)
- z.write(f, arcname, zipfile.ZIP_DEFLATED)
+ z.write(f, f, zipfile.ZIP_DEFLATED)
z.close()
def tearDown(self):
def test_unpack(self):
source = UpstreamSource(self.zipfile)
self.assertEqual(source.is_orig(), False)
- self.assertEqual(source.is_tarball(), False)
self.assertEqual(source.is_dir(), False)
self.assertEqual(source.unpacked, None)
self.assertEqual(source.guess_version(), ('gbp', '0.1'))
- self.assertEqual(source.archive_fmt, 'zip')
- self.assertEqual(source.compression, None)
- self.assertEqual(source.prefix, 'gbp')
source.unpack(str(self.tmpdir))
self.assertNotEqual(source.unpacked, None)
-
"""Test L{Patch} class"""
-from . import context
+from . import context # noqa: 401
import os
-# Try unittest2 for CentOS
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
-from gbp.patch_series import Patch
+from gbp.patch_series import Patch, Dep3Patch
class TestPatch(unittest.TestCase):
"It can span several lines.\n",
p.long_desc)
self.assertEqual('Sat, 24 Dec 2011 12:05:53 +0100', p.date)
+
+
+class TestDep3Patch(unittest.TestCase):
+ data_dir = os.path.splitext(__file__)[0] + '_data'
+
+ def test_encoding(self):
+ """Make sure broken encoding does no affect import"""
+ patchfile = os.path.join(self.data_dir, "dep3-iso8859-1.patch")
+ self.assertTrue(os.path.exists(patchfile))
+ p = Dep3Patch(patchfile)
+ self.assertEqual(r'Replace all -- in man page by \-\- to make lintian happy.', p.subject)
+ self.assertEqual("Roland Rosenfeld", p.author)
+ self.assertEqual("roland@debian.org", p.email)
+ self.assertEqual("", p.long_desc)
+
+ def test_pseudo_headers(self):
+ """Convert extra DEP-3 header into a git pseudo-header"""
+ patchfile = os.path.join(self.data_dir, "dep3-longdesc-bug.patch")
+ self.assertTrue(os.path.exists(patchfile))
+ p = Dep3Patch(patchfile)
+ self.assertEqual('Summary', p.subject)
+ self.assertEqual("Ben Hutchings", p.author)
+ self.assertEqual("ben@decadent.org.uk", p.email)
+ self.assertEqual("""\
+Bug: https://bugs.example.org/123456
+
+Long description
+""",
+ p.long_desc)
+
+
+class TestMixedHeaderPatch(unittest.TestCase):
+ data_dir = os.path.splitext(__file__)[0] + '_data'
+
+ def test_mixed(self):
+ """Get patch information from git mailimport and extra DEP-3 headers"""
+ patchfile = os.path.join(self.data_dir, "usbip-fix-misuse-of-strncpy.patch")
+ self.assertTrue(os.path.exists(patchfile))
+ p = Dep3Patch(patchfile)
+ self.assertEqual("usbip: Fix misuse of strncpy()", p.subject)
+ self.assertEqual("Ben Hutchings", p.author)
+ self.assertEqual("ben@decadent.org.uk", p.email)
+ self.assertEqual("""\
+Bug-Debian: https://bugs.debian.org/897802
+
+gcc 8 reports:
+
+usbip_device_driver.c: In function ‘read_usb_vudc_device’:
+usbip_device_driver.c:106:2: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
+ strncpy(dev->path, path, SYSFS_PATH_MAX);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+usbip_device_driver.c:125:2: error: ‘strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncation]
+ strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+I'm not convinced it makes sense to truncate the copied strings here,
+but since we're already doing so let's ensure they're still null-
+terminated. We can't easily use strlcpy() here, so use snprintf().
+
+usbip_common.c has the same problem.
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+""",
+ p.long_desc)
+
+
+class TestBase64Patch(unittest.TestCase):
+ data_dir = os.path.splitext(__file__)[0] + '_data'
+
+ def test_parse(self):
+ """Get patch information from git mailimport with base64 body but plain text patch"""
+ patchfile = os.path.join(self.data_dir, "base64.patch")
+ self.assertTrue(os.path.exists(patchfile))
+ p = Dep3Patch(patchfile)
+ self.assertEqual("Sort files in archive (reproducible builds)", p.subject)
+ self.assertEqual("Nick Leverton", p.author)
+ self.assertEqual("nick@leverton.org", p.email)
+ self.assertEqual("""\
+Sort files when using mergelib to create libnullmailer.a, to get
+reproducible build
+
+Author: Alexis Bienvenüe <pado@passoire.fr>
+""",
+ p.long_desc)
+
+
+class TestMarkerOnly(unittest.TestCase):
+ data_dir = os.path.splitext(__file__)[0] + '_data'
+
+ def test_parse(self):
+ """Don't fail on empty patch header"""
+ patchfile = os.path.join(self.data_dir, "916545.patch")
+ self.assertTrue(os.path.exists(patchfile))
+ p = Dep3Patch(patchfile)
+ self.assertEqual("916545", p.subject)
--- /dev/null
+---
+--- /dev/null
++++ b/foo
+@@ -0,0 +1,1 @@
++foo
--- /dev/null
+From: Nick Leverton <nick@leverton.org>
+Date: Tue, 11 Jul 2017 22:25:43 -0300
+Subject: Sort files in archive (reproducible builds)
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: base64
+
+U29ydCBmaWxlcyB3aGVuIHVzaW5nIG1lcmdlbGliIHRvIGNyZWF0ZSBsaWJudWxsbWFpbGVyLmEs
+IHRvIGdldApyZXByb2R1Y2libGUgYnVpbGQKCkF1dGhvcjogQWxleGlzIEJpZW52ZW7DvGUgPHBh
+ZG9AcGFzc29pcmUuZnI+Cg==
+---
+ lib/mergelib.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/mergelib.sh b/lib/mergelib.sh
+index f9b7a94..4e71079 100644
+--- a/lib/mergelib.sh
++++ b/lib/mergelib.sh
+@@ -12,5 +12,5 @@ for input in "$@"; do
+ "${AR:-ar}" x ../../"$input"
+ cd ..
+ done
+-"${AR:-ar}" rc ../"$archive" */*
++"${AR:-ar}" rc ../"$archive" `LC_ALL=C ls */*`
+ "${RANLIB:-ranlib}" ../"$archive"
--- /dev/null
+Author: Roland Rosenfeld <roland@debian.org>
+Description: Replace all -- in man page by \-\- to make lintian happy.
+
+--- a/GNUmakefile.in
++++ b/GNUmakefile.in
+@@ -484,8 +484,7 @@ man: dok-release
+ perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" $(MAN_PAGE); \
+ perl -pi.bak -e "s/ö/\\\\[:o]/g" $(MAN_PAGE); \
+ perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' $(MAN_PAGE); \
+- perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' $(MAN_PAGE); \
+- perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' $(MAN_PAGE); \
++ perl -pi.bak -e 's/--/\\-\\-/g' $(MAN_PAGE); \
+ $(DB) ../privoxy-man-page.sgml && $(MV) -f $(MAN_PAGE) ../../../$(MAN_PAGE)
+
+ # For those with man2html ala RH7s.
--- /dev/null
+Author: Ben Hutchings <ben@decadent.org.uk>
+Description: Summary
+ Long description
+Bug: https://bugs.example.org/123456
+
+--- /dev/null
++++ b/foo
+@@ -0,0 +1,1 @@
++foo
--- /dev/null
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Fri, 20 Jul 2018 01:30:24 +0100
+Subject: usbip: Fix misuse of strncpy()
+Bug-Debian: https://bugs.debian.org/897802
+
+gcc 8 reports:
+
+usbip_device_driver.c: In function ‘read_usb_vudc_device’:
+usbip_device_driver.c:106:2: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
+ strncpy(dev->path, path, SYSFS_PATH_MAX);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+usbip_device_driver.c:125:2: error: ‘strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncation]
+ strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+I'm not convinced it makes sense to truncate the copied strings here,
+but since we're already doing so let's ensure they're still null-
+terminated. We can't easily use strlcpy() here, so use snprintf().
+
+usbip_common.c has the same problem.
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+--- a/tools/usb/usbip/libsrc/usbip_common.c
++++ b/tools/usb/usbip/libsrc/usbip_common.c
+@@ -226,8 +226,8 @@ int read_usb_device(struct udev_device *
+ path = udev_device_get_syspath(sdev);
+ name = udev_device_get_sysname(sdev);
+
+- strncpy(udev->path, path, SYSFS_PATH_MAX);
+- strncpy(udev->busid, name, SYSFS_BUS_ID_SIZE);
++ snprintf(udev->path, SYSFS_PATH_MAX, "%s", path);
++ snprintf(udev->busid, SYSFS_BUS_ID_SIZE, "%s", name);
+
+ sscanf(name, "%u-%u", &busnum, &devnum);
+ udev->busnum = busnum;
+--- a/tools/usb/usbip/libsrc/usbip_device_driver.c
++++ b/tools/usb/usbip/libsrc/usbip_device_driver.c
+@@ -103,7 +103,7 @@ int read_usb_vudc_device(struct udev_dev
+ copy_descr_attr16(dev, &descr, idProduct);
+ copy_descr_attr16(dev, &descr, bcdDevice);
+
+- strncpy(dev->path, path, SYSFS_PATH_MAX);
++ snprintf(dev->path, SYSFS_PATH_MAX, "%s", path);
+
+ dev->speed = USB_SPEED_UNKNOWN;
+ speed = udev_device_get_sysattr_value(sdev, "current_speed");
+@@ -122,7 +122,7 @@ int read_usb_vudc_device(struct udev_dev
+ dev->busnum = 0;
+
+ name = udev_device_get_sysname(plat);
+- strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE);
++ snprintf(dev->busid, SYSFS_BUS_ID_SIZE, "%s", name);
+ return 0;
+ err:
+ fclose(fd);
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""
+Test L{GitRepository}
+
+Test things here that don't fit nicely into the doctests that
+also make up the API documentation.
+"""
+
+from . import context # noqa: 401
+from . import testutils
+
+import os
+
+import gbp.log
+import gbp.git
+import gbp.errors
+
+
+class TestWriteTree(testutils.DebianGitTestRepo):
+ def _write_testtree(self):
+ """Write a test tree"""
+ paths = []
+ for i in range(4):
+ path = os.path.join(self.repo.path, 'testfile%d' % i)
+ with open(path, 'w') as f:
+ print("testdata %d" % i, file=f)
+ paths.append(path)
+ return paths
+
+ def test_write_tree_index_nonexistent(self):
+ """Write out index file to non-existent dir"""
+ paths = self._write_testtree()
+ self.repo.add_files(paths)
+ with self.assertRaises(gbp.git.GitRepositoryError):
+ self.repo.write_tree('/does/not/exist')
+
+ def test_write_tree(self):
+ """Write out index file to alternate index file"""
+ index = os.path.join(self.repo.git_dir, 'gbp_index')
+ expected_sha1 = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'
+
+ paths = self._write_testtree()
+ self.repo.add_files(paths)
+ sha1 = self.repo.write_tree(index)
+ self.assertTrue(os.path.exists(index))
+ self.assertEqual(sha1, expected_sha1)
+ self.assertTrue(self.repo.has_treeish(expected_sha1))
+
+ def test_commit_tree(self):
+ """Commit a tree"""
+ expected_sha1 = 'ea63fcee40675a5f82ea6bedbf29ca86d89c5f63'
+ paths = self._write_testtree()
+ self.repo.add_files(paths)
+ sha1 = self.repo.write_tree()
+ self.assertEqual(sha1, expected_sha1)
+ self.assertTrue(self.repo.has_treeish(expected_sha1))
+ commit = self.repo.commit_tree(sha1, "first commit", parents=[],
+ committer=dict(name='foo',
+ email='foo@example.com'),
+ author=dict(name='bar',
+ email='bar@example.com'),
+ )
+ self.assertEqual(len(commit), 40)
+ # commit the same tree again using the previous commit as parent
+ self.repo.commit_tree(sha1, "second commit", parents=[commit])
+ # commit the same tree again using a non-existent parent
+ with self.assertRaises(gbp.errors.GbpError):
+ self.repo.commit_tree(sha1, "failed commit", ['doesnotexist'])
+
+
+class TestHasBranch(testutils.DebianGitTestRepo):
+ def test_has_branch(self):
+ self.add_file('whatever')
+ self.repo.create_branch("foo")
+ self.assertTrue(self.repo.has_branch("foo"))
+ # Don't be too sloppy on (#813298)
+ self.repo.create_branch("refs/heads/bar")
+ self.assertFalse(self.repo.has_branch("bar"))
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-
-"""Test L{GitRepository}'s write_tree method"""
-
-from . import context
-from . import testutils
-import os
-
-import gbp.log
-import gbp.git
-import gbp.errors
-
-
-class TestWriteTree(testutils.DebianGitTestRepo):
- def _write_testtree(self):
- """Write a test tree"""
- paths = []
- for i in range(4):
- path = os.path.join(self.repo.path, 'testfile%d' % i)
- with open(path, 'w') as f:
- print("testdata %d" % i, file=f)
- paths.append(path)
- return paths
-
- def test_write_tree_index_nonexistant(self):
- """Write out index file to nonexistant dir"""
- paths = self._write_testtree()
- self.repo.add_files(paths)
- self.assertRaises(gbp.git.GitRepositoryError,
- self.repo.write_tree,
- '/does/not/exist')
-
- def test_write_tree(self):
- """Write out index file to alternate index file"""
- index = os.path.join(self.repo.git_dir, 'gbp_index')
- expected_sha1 = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'
-
- paths = self._write_testtree()
- self.repo.add_files(paths)
- sha1 = self.repo.write_tree(index)
- self.assertTrue(os.path.exists(index))
- self.assertEqual(sha1, expected_sha1)
- self.assertTrue(self.repo.has_treeish(expected_sha1))
-
- def test_commit_tree(self):
- """Commit a tree"""
- expected_sha1 = 'ea63fcee40675a5f82ea6bedbf29ca86d89c5f63'
- paths = self._write_testtree()
- self.repo.add_files(paths)
- sha1 = self.repo.write_tree()
- self.assertEqual(sha1, expected_sha1)
- self.assertTrue(self.repo.has_treeish(expected_sha1))
- commit = self.repo.commit_tree(sha1, "first commit", parents=[],
- committer=dict(name='foo',
- email='foo@example.com'),
- author=dict(name='bar',
- email='bar@example.com'),
- )
- self.assertEqual(len(commit), 40)
- # commit the same tree again using the previous commit as parent
- self.repo.commit_tree(sha1, "second commit", parents=[commit])
- # commit the same tree again using a non existant parent
- self.assertRaises(gbp.git.GitRepositoryError,
- self.repo.commit_tree,
- sha1,
- "failed commit",
- ['doesnotexist'])
-
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
-"""Test L{buildpackage}'s get_upstream_tree method"""
-
-from . import context
+"""Test L{export_orig}'s git_archive_get_upstream_tree method"""
+from . import context # noqa: 401
from . import testutils
import gbp.errors
-import gbp.scripts.buildpackage as buildpackage
+import gbp.scripts.export_orig as export_orig
+
class MockOptions(object):
def __init__(self,
self.upstream_tree = upstream_tree
self.upstream_tag = upstream_tag
+
class TestGetUpstreamTree(testutils.DebianGitTestRepo):
+ class source:
+ upstream_version = '1.0~rc3'
+
def test_valid_upstream_branch(self):
"""Get upstream tree from a valid upstream branch"""
self.add_file('foo')
self.repo.create_branch('upstream')
options = MockOptions(upstream_tree='BRANCH',
upstream_branch='upstream')
- t = buildpackage.get_upstream_tree(self.repo, None, options)
+ t = export_orig.git_archive_get_upstream_tree(self.repo, None, options)
self.assertEqual(t, 'upstream')
def test_invalid_upstream_branch(self):
self.add_file('foo')
options = MockOptions(upstream_tree='BRANCH',
upstream_branch='upstream')
- self.assertRaises(gbp.errors.GbpError,
- buildpackage.get_upstream_tree,
- self.repo,
- None,
- options)
+ with self.assertRaises(gbp.errors.GbpError):
+ export_orig.git_archive_get_upstream_tree(self.repo, None, options)
def test_valid_tree(self):
"""Get upstream tree from a valid upstream tree"""
self.add_file('foo')
tree = self.repo.rev_parse('master')
options = MockOptions(upstream_tree=tree)
- t = buildpackage.get_upstream_tree(self.repo, None, options)
+ t = export_orig.git_archive_get_upstream_tree(self.repo, None, options)
self.assertEqual(t, tree)
def test_invalid_tree(self):
"""Getting upstream tree from an invalid tree must fail"""
self.add_file('foo')
options = MockOptions(upstream_tree='doesnotexist')
- self.assertRaises(gbp.errors.GbpError,
- buildpackage.get_upstream_tree,
- self.repo,
- None,
- options)
+ with self.assertRaises(gbp.errors.GbpError):
+ export_orig.git_archive_get_upstream_tree(self.repo, None, options)
def test_valid_tag(self):
"""Get upstream tree from a valid tag"""
self.add_file('foo')
self.repo.rev_parse('master')
- cp = { 'Upstream-Version': '1.0~rc3' }
self.repo.create_tag('upstream/1.0_rc3')
options = MockOptions(upstream_tree="TAG",
upstream_tag="upstream/%(version)s")
- tag = buildpackage.get_upstream_tree(self.repo, cp, options)
+ tag = export_orig.git_archive_get_upstream_tree(self.repo, self.source, options)
self.assertEqual(tag, "upstream/1.0_rc3")
def test_invalid_tag(self):
"""Getting upstream tree from an invalid tag must fail"""
self.add_file('foo')
- cp = { 'Upstream-Version': '1.0~rc3' }
options = MockOptions(upstream_tree="TAG",
upstream_tag="upstream/%(version)s")
- self.assertRaises(gbp.errors.GbpError,
- buildpackage.get_upstream_tree,
- self.repo,
- cp,
- options)
+ with self.assertRaises(gbp.errors.GbpError):
+ export_orig.git_archive_get_upstream_tree(self.repo, self.source, options)
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
"""Test L{gbp.scripts.dch} main"""
from . import context
+from .testutils import (DebianGitTestRepo, OsReleaseFile, skip_without_cmd,
+ get_dch_default_urgency, capture_stderr)
-from .testutils import (DebianGitTestRepo, OsReleaseFile,
- get_dch_default_urgency)
-import unittest
from gbp.scripts import dch
import os
default_urgency = get_dch_default_urgency()
# For Ubuntu compatibility
-os_release = OsReleaseFile('/etc/lsb-release')
+os_release = OsReleaseFile()
# OS release codename and snapshot of version 0.9-2~1
-if os_release['DISTRIB_ID'] == 'Ubuntu':
- os_codename = os_release['DISTRIB_CODENAME']
+if os_release['ID'] == 'ubuntu':
+ os_codename = os_release['UBUNTU_CODENAME']
snap_header_0_9 = r'^test-package\s\(0.9-1ubuntu1~1\.gbp([0-9a-f]{6})\)\sUNRELEASED;\surgency=%s' % default_urgency
new_version_0_9 = '0.9-1ubuntu1'
else:
""" % default_urgency
-@unittest.skipIf(not os.path.exists('/usr/bin/dch'), "Dch not found")
+@skip_without_cmd('debchange')
class TestScriptDch(DebianGitTestRepo):
"""Test git-dch"""
-
def setUp(self):
DebianGitTestRepo.setUp(self)
self.add_file("foo", "bar")
self.repo.create_tag("upstream/0.9", msg="upstream version 0.9")
self.add_file("bar", "foo")
self.repo.create_tag("upstream/1.0", msg="upstream version 1.0")
+ self.repo.create_branch("upstream")
self.repo.create_branch("debian")
self.repo.set_branch("debian")
self.upstream_tag = "upstream/%(version)s"
self.add_file("debian/changelog", cl_debian)
self.add_file("debian/control", """Source: test-package\nSection: test\n""")
self.options = ["--upstream-tag=%s" % self.upstream_tag, "--debian-branch=debian",
- "--id-length=0", "--spawn-editor=/bin/true"]
+ "--upstream-branch=upstream", "--id-length=0", "--spawn-editor=/bin/true"]
self.repo.create_tag(deb_tag, msg=deb_tag_msg, commit="HEAD~1")
-
+ self.repo.set_user_name("gbp test user")
+ self.repo.set_user_email("gbp@example.com")
def tearDown(self):
DebianGitTestRepo.tearDown(self)
-
def run_dch(self, dch_options=None):
# Take care to copy the list
options = self.options[:]
options.extend(dch_options)
ret = dch.main(options)
self.assertEqual(ret, 0)
- return open("debian/changelog").readlines()
-
+ cl = os.path.join(self.repo.path, 'debian/changelog')
+ return open(cl, encoding='utf-8').readlines()
def test_dch_main_new_upstream_version(self):
- """Test dch.py like git-dch script does: new upstream version"""
+ """Test dch.py like gbp dch script does: new upstream version"""
lines = self.run_dch()
self.assertEqual("test-package (1.0-1) UNRELEASED; urgency=%s\n" % default_urgency, lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_release(self):
- """Test dch.py like git-dch script does: new upstream version - release"""
+ """Test dch.py like gbp dch script does: new upstream version - release"""
options = ["--release"]
lines = self.run_dch(options)
self.assertEqual("test-package (1.0-1) %s; urgency=%s\n" % (os_codename, default_urgency), lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_auto(self):
- """Test dch.py like git-dch script does: new upstream version - guess last commit"""
+ """Test dch.py like gbp dch script does: new upstream version - guess last commit"""
options = ["--auto"]
lines = self.run_dch(options)
self.assertEqual("test-package (1.0-1) UNRELEASED; urgency=%s\n" % default_urgency, lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_snapshot(self):
- """Test dch.py like git-dch script does: new upstream version - snapshot mode"""
+ """Test dch.py like gbp dch script does: new upstream version - snapshot mode"""
options = ["--snapshot"]
lines = self.run_dch(options)
header = re.search(snap_header_1, lines[0])
self.assertIsNotNone(re.search(snap_mark + header.group(1), lines[2]))
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_2_snapshots_auto(self):
- """Test dch.py like git-dch script does: new upstream version - two snapshots - auto"""
+ """Test dch.py like gbp dch script does: new upstream version - two snapshots - auto"""
options = ["--snapshot"]
lines = self.run_dch(options)
header1 = re.search(snap_header_1, lines[0])
self.assertIn(""" * added debian/control\n""", lines)
self.assertIn(""" * added debian/compat\n""", lines)
-
def test_dch_main_new_upstream_version_with_2_snapshots_commit_auto(self):
- """Test dch.py like git-dch script does: new upstream version - two committed snapshots - auto"""
+ """Test dch.py like gbp dch script does: new upstream version - two committed snapshots - auto"""
options = ["--commit"]
options.append("--commit-msg=TEST-COMMITTED-SNAPSHOT")
options.append("--snapshot")
self.assertIsNotNone(re.search(snap_mark + header2.group(1), lines[2]))
self.assertIn(""" * added debian/control\n""", lines)
self.assertIn(""" * added debian/compat\n""", lines)
- # First snapshot entry must have disapear
+ # First snapshot entry must have disappeared
self.assertNotIn(header1.group(0) + "\n", lines)
# But its changelog must be included in the new one
self.assertIn(""" * TEST-COMMITTED-SNAPSHOT\n""", lines)
-
def test_dch_main_new_upstream_version_with_auto_release(self):
- """Test dch.py like git-dch script does: new upstream version - auto - release"""
+ """Test dch.py like gbp dch script does: new upstream version - auto - release"""
options = ["--auto", "--release"]
lines = self.run_dch(options)
self.assertEqual("test-package (1.0-1) %s; urgency=%s\n" % (os_codename, default_urgency), lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_auto_snapshot(self):
- """Test dch.py like git-dch script does: new upstream version - auto - snapshot mode"""
- options = [ "--auto", "--snapshot" ]
+ """Test dch.py like gbp dch script does: new upstream version - auto - snapshot mode"""
+ options = ["--auto", "--snapshot"]
options.append("--snapshot")
lines = self.run_dch(options)
header = re.search(snap_header_1, lines[0])
self.assertIsNotNone(re.search(snap_mark + header.group(1), lines[2]))
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_snapshot_release(self):
- """Test dch.py like git-dch script does: new upstream version - snapshot - release"""
+ """Test dch.py like gbp dch script does: new upstream version - snapshot - release"""
options = ["--snapshot", "--release"]
- self.assertRaises(SystemExit, self.run_dch, options)
-
+ with capture_stderr() as c:
+ with self.assertRaises(SystemExit):
+ self.run_dch(options)
+ self.assertTrue("'--snapshot' and '--release' are incompatible options" in c.output())
def test_dch_main_new_upstream_version_with_distribution(self):
- """Test dch.py like git-dch script does: new upstream version - set distribution"""
+ """Test dch.py like gbp dch script does: new upstream version - set distribution"""
options = ["--distribution=testing", "--force-distribution"]
lines = self.run_dch(options)
self.assertEqual("test-package (1.0-1) testing; urgency=%s\n" % default_urgency, lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_release_distribution(self):
- """Test dch.py like git-dch script does: new upstream version - release - set distribution"""
+ """Test dch.py like gbp dch script does: new upstream version - release - set distribution"""
options = ["--release", "--distribution=testing", "--force-distribution"]
lines = self.run_dch(options)
self.assertEqual("test-package (1.0-1) testing; urgency=%s\n" % default_urgency, lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_snapshot_distribution(self):
- """Test dch.py like git-dch script does: new upstream version - snapshot mode - do not set distribution"""
+ """Test dch.py like gbp dch script does: new upstream version - snapshot mode - do not set distribution"""
options = ["--snapshot", "--distribution=testing"]
lines = self.run_dch(options)
header = re.search(snap_header_1, lines[0])
self.assertIsNotNone(re.search(snap_mark + header.group(1), lines[2]))
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_2_snapshots_auto_distribution(self):
- """Test dch.py like git-dch script does: new upstream version - two snapshots - do not set distribution"""
+ """Test dch.py like gbp dch script does: new upstream version - two snapshots - do not set distribution"""
options = ["--snapshot", "--distribution=testing"]
lines = self.run_dch(options)
header1 = re.search(snap_header_1, lines[0])
# we do not commit
self.assertNotIn(""" * TEST-COMMITTED-SNAPSHOT\n""", lines)
-
def test_dch_main_new_upstream_version_with_2_snapshots_commit_auto_distribution(self):
- """Test dch.py like git-dch script does: new upstream version - two committed snapshots - do not set distribution"""
+ """Test dch.py like gbp dch script does: new upstream version - two committed snapshots - do not set distribution"""
options = ["--commit"]
options.append("--commit-msg=TEST-COMMITTED-SNAPSHOT")
options.append("--snapshot")
self.assertIsNotNone(re.search(snap_mark + header2.group(1), lines[2]))
self.assertIn(""" * added debian/control\n""", lines)
self.assertIn(""" * added debian/compat\n""", lines)
- # First snapshot entry must have disapear
+ # First snapshot entry must have disappeared
self.assertNotIn(header1.group(0) + "\n", lines)
# But its changelog must be included in the new one
self.assertIn(""" * TEST-COMMITTED-SNAPSHOT\n""", lines)
-
def test_dch_main_new_upstream_version_with_urgency(self):
- """Test dch.py like git-dch script does: new upstream version - set urgency"""
+ """Test dch.py like gbp dch script does: new upstream version - set urgency"""
options = ["--urgency=emergency"]
lines = self.run_dch(options)
self.assertEqual("test-package (1.0-1) UNRELEASED; urgency=emergency\n", lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_release_urgency(self):
- """Test dch.py like git-dch script does: new upstream version - release - set urgency"""
+ """Test dch.py like gbp dch script does: new upstream version - release - set urgency"""
options = ["--release", "--urgency=emergency"]
lines = self.run_dch(options)
self.assertEqual("test-package (1.0-1) %s; urgency=emergency\n" % os_codename, lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_new_upstream_version_with_snapshot_urgency(self):
- """Test dch.py like git-dch script does: new upstream version - snapshot mode - set urgency"""
- options = ["--snapshot", "--urgency=emergency"]
+ """Test dch.py like gbp dch script does: new upstream version - snapshot mode - set urgency"""
+ options = ["--snapshot", "--urgency=emergency"]
lines = self.run_dch(options)
header = re.search(snap_header_1, lines[0])
self.assertIsNotNone(header)
self.assertIsNotNone(re.search(snap_mark + header.group(1), lines[2]))
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_increment_debian_version(self):
- """Test dch.py like git-dch script does: increment debian version"""
+ """Test dch.py like gbp dch script does: increment debian version"""
self.repo.delete_tag("debian/0.9-1")
self.repo.create_tag("debian/0.9-1", msg="Pre stable release version 0.9-1", commit="HEAD~2")
self.repo.delete_tag("upstream/1.0")
self.assertEqual("test-package (%s) UNRELEASED; urgency=%s\n" % (new_version_0_9, default_urgency), lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_increment_debian_version_with_release(self):
- """Test dch.py like git-dch script does: increment debian version - release"""
+ """Test dch.py like gbp dch script does: increment debian version - release"""
self.repo.delete_tag("upstream/1.0")
options = ["--release"]
lines = self.run_dch(options)
self.assertEqual("test-package (%s) %s; urgency=%s\n" % (new_version_0_9, os_codename, default_urgency), lines[0])
self.assertIn(""" * added debian/control\n""", lines)
+ def test_dch_main_increment_debian_version_with_local(self):
+ """Test dch.py like gbp dch script does: increment debian version - local suffix"""
+ options = ["--local", "suffix"]
+ lines = self.run_dch(options)
+ self.assertEqual("test-package (0.9-1suffix1) UNRELEASED; urgency=%s\n" % (default_urgency,), lines[0])
+ self.assertIn(""" * added debian/control\n""", lines)
def test_dch_main_increment_debian_version_with_auto(self):
- """Test dch.py like git-dch script does: increment debian version - guess last commit"""
+ """Test dch.py like gbp dch script does: increment debian version - guess last commit"""
self.repo.delete_tag("upstream/1.0")
options = ["--auto"]
lines = self.run_dch(options)
self.assertEqual("test-package (%s) UNRELEASED; urgency=%s\n" % (new_version_0_9, default_urgency), lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_increment_debian_version_with_snapshot(self):
- """Test dch.py like git-dch script does: increment debian version - snapshot mode"""
+ """Test dch.py like gbp dch script does: increment debian version - snapshot mode"""
self.repo.delete_tag("upstream/1.0")
options = ["--snapshot"]
lines = self.run_dch(options)
self.assertIsNotNone(re.search(snap_mark + header.group(1), lines[2]))
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_increment_debian_version_with_auto_release(self):
- """Test dch.py like git-dch script does: increment debian version - auto - release"""
+ """Test dch.py like gbp dch script does: increment debian version - auto - release"""
self.repo.delete_tag("upstream/1.0")
- options = ["--auto", "--release"]
+ options = ["--auto", "--release"]
lines = self.run_dch(options)
self.assertEqual("test-package (%s) %s; urgency=%s\n" % (new_version_0_9, os_codename, default_urgency), lines[0])
self.assertIn(""" * added debian/control\n""", lines)
-
def test_dch_main_increment_debian_version_with_auto_snapshot(self):
- """Test dch.py like git-dch script does: increment debian version - auto - snapshot mode"""
+ """Test dch.py like gbp dch script does: increment debian version - auto - snapshot mode"""
self.repo.delete_tag("upstream/1.0")
- options = ["--auto", "--snapshot"]
+ options = ["--auto", "--snapshot"]
lines = self.run_dch(options)
header = re.search(snap_header_0_9, lines[0])
self.assertIsNotNone(header)
self.assertEqual(header.lastindex, 1)
self.assertIsNotNone(re.search(snap_mark + header.group(1), lines[2]))
self.assertIn(""" * added debian/control\n""", lines)
+
+ def test_dch_main_unreleased_debian_version_with_snapshot(self):
+ """Test dch.py like gbp dch script does: snapshot mode with unreleased debian version"""
+ new_version_1_0 = '1.0-1'
+ options = ["--commit"]
+ options.append("--commit-msg=UNRELEASED-version")
+ lines = self.run_dch()
+ header = re.search(r"\(%s\) UNRELEASED" % new_version_1_0, lines[0])
+ self.assertIsNotNone(header)
+ options = ["--snapshot", "--auto"]
+ lines = self.run_dch(options)
+ header = re.search(snap_header_1, lines[0])
+ self.assertIsNotNone(header)
+ self.assertEqual(header.lastindex, 1)
+ self.assertIsNotNone(re.search(snap_mark + header.group(1), lines[2]))
+ self.assertIn(""" * added debian/control\n""", lines)
+
+ def test_dch_main_closes_default(self):
+ options = ["--meta"]
+ self.add_file("closes", "test file",
+ msg="""test debian closes commit\n\nCloses: #123456""")
+ lines = self.run_dch(options)
+ self.assertIn(""" * test debian closes commit (Closes: #123456)\n""",
+ lines)
+
+ def test_dch_main_closes_non_debian_bug_numbers(self):
+ self.add_file("closes", "test file",
+ msg="""test non-debian closes 1\n\nCloses: EX-123""")
+ self.add_file("closes1", "test file",
+ msg="""test non-debian closes 2\n\nCloses: EX-5678""")
+ options = ["--meta", r'--meta-closes-bugnum=ex-\d+']
+ lines = self.run_dch(options)
+ self.assertIn(""" * test non-debian closes 1 (Closes: EX-123)\n""",
+ lines)
+ self.assertIn(""" * test non-debian closes 2 (Closes: EX-5678)\n""",
+ lines)
+
+ def test_dch_main_meta_closes_and_bug_numbers(self):
+ self.add_file("closes", "test file",
+ msg="""test non-debian closes 1\n\nExample: EX-123""")
+ self.add_file("closes1", "test file",
+ msg="""test non-debian closes 2\n\nExample: EX-5678""")
+ options = ["--meta", r'--meta-closes-bugnum=ex-\d+',
+ '--meta-closes=Example']
+ lines = self.run_dch(options)
+ self.assertIn(""" * test non-debian closes 1 (Example: EX-123)\n""",
+ lines)
+ self.assertIn(""" * test non-debian closes 2 (Example: EX-5678)\n""",
+ lines)
+
+ def test_dch_main_git_author(self):
+ options = ["--git-author", '-S', '-a']
+ lines = self.run_dch(options)
+ self.assertIn("-- gbp test user <gbp@example.com>", lines[7] + lines[9])
+
+ def test_dch_main_no_git_author(self):
+ options = ["--no-git-author", '-S', '-a']
+ lines = self.run_dch(options)
+ self.assertNotIn("-- gbp test user", "\n".join(lines))
+
+ def test_dch_subdir(self):
+ os.chdir('debian/')
+ lines = self.run_dch()
+ self.assertEqual("test-package (1.0-1) UNRELEASED; urgency=%s\n" % default_urgency, lines[0])
+ self.assertIn(""" * added debian/control\n""", lines)
+
+ def test_dch_create_changelog(self):
+ os.unlink('debian/changelog')
+ lines = self.run_dch()
+ self.assertEqual("test-package (1.0-1) UNRELEASED; urgency=%s\n" % default_urgency, lines[0])
"""Test L{gbp.deb}"""
-from . import context
+from . import context # noqa: 401
+from . import testutils
import os
import tempfile
from gbp.deb.dscfile import DscFile
from gbp.command_wrappers import CommandExecFailed
-class TestDscFile(unittest.TestCase):
+
+class Test30DscFile(unittest.TestCase):
"""Test L{gbp.deb.DscFile}"""
content = """Format: 3.0 (quilt)
Vcs-Git: git://git.debian.org/git/pkg-libvirt/libvirt.git
Build-Depends: cdbs (>= 0.4.90~), debhelper (>= 7), libxml2-dev, libncurses5-dev, libreadline-dev, zlib1g-dev, libgcrypt11-dev, libgnutls-dev, python-all-dev (>= 2.6.6-3~), libavahi-client-dev, libsasl2-dev, libxen-dev [i386 amd64], lvm2 [linux-any], open-iscsi [linux-any], libparted0-dev (>= 2.2), parted (>= 2.2), libdevmapper-dev [linux-any], uuid-dev, libudev-dev [linux-any], libhal-dev [!linux-any], libpciaccess-dev, module-init-tools [linux-any], policykit-1, libcap-ng-dev [linux-any], libnl-dev [linux-any], libyajl-dev, libpcap0.8-dev, libnuma-dev [amd64 i386 ia64 mips mipsel powerpc], radvd [linux-any], libnetcf-dev [linux-any], dwarves, libxml2-utils, dnsmasq-base, openssh-client, netcat-openbsd
Build-Conflicts: dpkg-dev (= 1.15.3)
-Package-List:
+Package-List:
libvirt-bin deb admin optional
libvirt-dev deb libdevel optional
libvirt-doc deb doc optional
libvirt0 deb libs optional
libvirt0-dbg deb debug extra
python-libvirt deb python optional
-Checksums-Sha1:
+Checksums-Sha1:
3743dc4f3e58d5912a98f568c3e854d97d81f216 20054618 libvirt_0.9.12.orig.tar.gz
+ 7dc0f3bfe8a63a0259affe4fe3d3cc5b3180a72b 240 libvirt_0.9.12.orig.tar.gz.asc
+ 3743dc4f3e58d5912a98f568c3e854d97d81f123 20054618 libvirt_0.9.12.orig-foo.tar.gz
+ 7dc0f3bfe8a63a0259affe4fe3d3cc5b3180a72b 240 libvirt_0.9.12.orig-foo.tar.gz.asc
+ 3743dc4f3e58d5912a98f568c3e854d97d81f123 20054618 libvirt_0.9.12.orig-bar.tar.gz
+ 7dc0f3bfe8a63a0259affe4fe3d3cc5b3180a72b 240 libvirt_0.9.12.orig-bar.tar.gz.asc
+ 3743dc4f3e58d5912a98f568c3e854d97d81f12c 20054618 libvirt_0.9.12.orig-upper-CASE.tar.gz
a7ffa64c18a5ee448c98b1dc894a0a27e1670357 35935 libvirt_0.9.12-4.debian.tar.gz
-Checksums-Sha256:
+Checksums-Sha256:
298ffc7f2a6d6e78aae46f11a0980f4bc17fa2928f5de6cd9e8abaf5990336e7 20054618 libvirt_0.9.12.orig.tar.gz
+ 2496f435c029673dd7cad49cdf27935d261ef1b3b245118a431556b7f40a7967 240 libvirt_0.9.12.orig.tar.gz.asc
+ 298ffc7f2a6d6e78aae46f11a0980f4bc17fa2928f5de6cd9e8abaf599033123 20054618 libvirt_0.9.12.orig-foo.tar.gz
+ 2496f435c029673dd7cad49cdf27935d261ef1b3b245118a431556b7f40a7967 240 libvirt_0.9.12.orig-foo.tar.gz.asc
+ 298ffc7f2a6d6e78aae46f11a0980f4bc17fa2928f5de6cd9e8abaf599033123 20054618 libvirt_0.9.12.orig-bar.tar.gz
+ 2496f435c029673dd7cad49cdf27935d261ef1b3b245118a431556b7f40a7967 240 libvirt_0.9.12.orig-bar.tar.gz.asc
+ 298ffc7f2a6d6e78aae46f11a0980f4bc17fa2928f5de6cd9e8abaf59903312c 20054618 libvirt_0.9.12.orig-upper-CASE.tar.gz
e75110c493995ba5366e751f20f3842f30674c3918357fa6eb83175d0afbec31 35935 libvirt_0.9.12-4.debian.tar.gz
-Files:
+Files:
5e842bc55733ceba60c64767580ff3e4 20054618 libvirt_0.9.12.orig.tar.gz
+ ddfefbf64ffa1b1d7e0819501d096544 240 libvirt_0.9.12.orig.tar.gz.asc
+ 5e842bc55733ceba60c64767580ff123 20054618 libvirt_0.9.12.orig-foo.tar.gz
+ ddfefbf64ffa1b1d7e0819501d096544 240 libvirt_0.9.12.orig-foo.tar.gz.asc
+ 5e842bc55733ceba60c64767580ff123 20054618 libvirt_0.9.12.orig-bar.tar.gz
+ ddfefbf64ffa1b1d7e0819501d096544 240 libvirt_0.9.12.orig-bar.tar.gz.asc
+ 5e842bc55733ceba60c64767580ff12c 20054618 libvirt_0.9.12.orig-upper-CASE.tar.gz
f328960d25e7c843f3ac5f9ba5064251 35935 libvirt_0.9.12-4.debian.tar.gz
"""
"""Test parsing a valid dsc file"""
dsc = DscFile.parse(self.dscfile.name)
self.assertEqual(dsc.version, '0.9.12-4')
+ self.assertEqual(dsc.native, False)
+ self.assertEqual(os.path.basename(dsc.tgz), 'libvirt_0.9.12.orig.tar.gz')
+ self.assertEqual(os.path.basename(dsc.diff), '')
+ self.assertEqual(os.path.basename(dsc.deb_tgz), 'libvirt_0.9.12-4.debian.tar.gz')
+ for s in ['foo', 'bar', 'upper-CASE']:
+ self.assertEqual(os.path.basename(dsc.additional_tarballs[s]),
+ 'libvirt_0.9.12.orig-%s.tar.gz' % s)
+ self.assertEquals(sorted(dsc.sigs), ['/tmp/libvirt_0.9.12.orig-bar.tar.gz.asc',
+ '/tmp/libvirt_0.9.12.orig-foo.tar.gz.asc',
+ '/tmp/libvirt_0.9.12.orig.tar.gz.asc'])
+
+
+class Test10DscNonNativeFile(unittest.TestCase):
+ """Test L{gbp.deb.DscFile}"""
+ content = """Format: 1.0
+Source: latencytop
+Binary: latencytop
+Architecture: any
+Version: 0.5
+Maintainer: Giacomo Catenazzi <cate@debian.org>
+Homepage: http://www.latencytop.org/
+Standards-Version: 3.8.2
+Build-Depends: cdbs, debhelper (>= 5), pkg-config, libncursesw5-dev, libglib2.0-dev, libgtk2.0-dev
+Package-List:
+ latencytop deb utils extra arch=any
+Checksums-Sha1:
+ cfd8a83fa40e630cf680d96a186ff4fdbf6f22c8 25374 latencytop_0.5.orig.tar.gz
+ 1fa907254c61c73679fd173c828327e9a2273c31 1978 latencytop_0.5.diff.gz
+Checksums-Sha256:
+ 9e7f72fbea7bd918e71212a1eabaad8488d2c602205d2e3c95d62cd57e9203ef 25374 latencytop_0.5.orig.tar.gz
+ 66342c4d55ae31e529bdcdf88d41a7d114b355f438b0d10efb107f3aef1a0db6 1978 latencytop_0.5.diff.gz
+Files:
+ 73bb3371c6ee0b0e68e25289027e865c 25374 latencytop_0.5.orig.tar.gz
+ bf7afb3e0d68b0e33e5abf4f1542af71 1978 latencytop_0.5.diff.gz
+"""
-@unittest.skipIf(not os.path.exists('/usr/bin/dpkg'), 'Dpkg not found')
+ def setUp(self):
+ with tempfile.NamedTemporaryFile(delete=False) as self.dscfile:
+ self.dscfile.write(self.content.encode())
+
+ def tearDown(self):
+ os.unlink(self.dscfile.name)
+
+ def test_dscfile_parse(self):
+ """Test parsing a a 1.0 non-native dsc file without debian revision"""
+ dsc = DscFile.parse(self.dscfile.name)
+ self.assertEqual(dsc.version, '0.5')
+ self.assertEqual(dsc.native, False)
+ self.assertEqual(os.path.basename(dsc.tgz), 'latencytop_0.5.orig.tar.gz')
+ self.assertEqual(os.path.basename(dsc.deb_tgz), '')
+ self.assertEqual(os.path.basename(dsc.diff), 'latencytop_0.5.diff.gz')
+ self.assertEqual(dsc.additional_tarballs, {}),
+ self.assertEquals(dsc.sigs, [])
+
+
+@testutils.skip_without_cmd('dpkg')
class TestDpkgCompareVersions(unittest.TestCase):
"""Test L{gbp.deb.DpkgCompareVersions}"""
self.assertEqual(ret, 0)
def testBadVersion(self):
- self.assertRaises(CommandExecFailed, self.cmp, '_', '_ _')
+ with self.assertRaises(CommandExecFailed):
+ self.cmp('_', '_ _')
+
+
+@testutils.skip_without_cmd('dpkg')
+class TestDeb(unittest.TestCase):
+ """Test L{gbp.deb.__init__} """
+
+ @unittest.skipUnless(platform.machine() == "x86_64" and platform.architecture()[0] == '64bit', "not on amd64")
+ def test_get_arch(self):
+ arch = gbp.deb.get_arch()
+ self.assertTrue(isinstance(arch, str))
+ self.assertEquals(arch, "amd64")
+ @unittest.skipUnless(testutils.OsReleaseFile()['ID'] == 'debian', "not on Debian")
+ def test_get_vendor(self):
+ vendor = gbp.deb.get_vendor()
+ self.assertTrue(isinstance(vendor, str))
+ self.assertEquals(vendor, "Debian")
# vim: set fileencoding=utf-8 :
-# (C) 2012 Guido Günther <agx@sigxcpu.org>
+# (C) 2012,2015 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Test L{gbp.pq}"""
from . import context
from . import testutils
import os
-import logging
import unittest
-from gbp.scripts.pq import generate_patches, switch_pq, export_patches
+from gbp.command_wrappers import GitCommand
+from gbp.scripts.pq import (generate_patches, export_patches,
+ import_quilt_patches, rebase_pq,
+ switch_pq,
+ SERIES_FILE)
import gbp.scripts.common.pq as pq
+import gbp.patch_series
+
+
+class TestPqOptions(object):
+ abbrev = 7
+ drop = False
+ patch_num_format = '%04d-'
+ patch_numbers = False
+ renumber = False
+
class TestApplyAndCommit(testutils.DebianGitTestRepo):
"""Test L{gbp.pq}'s apply_and_commit"""
pq.apply_and_commit_patch(self.repo, patch, None)
self.assertIn(b'foo', self.repo.list_files())
+ def test_apply_and_commit_patch_preserve_subject(self):
+ """Test applying a patch preserves the subject"""
+ patch = gbp.patch_series.Patch(_patch_path('brackets-in-subject.patch'))
+
+ pq.apply_and_commit_patch(self.repo, patch, None)
+ self.assertIn(b'foo', self.repo.list_files())
+ info = self.repo.get_commit_info('HEAD')
+ self.assertEquals('[text] foobar', info['subject'])
def test_topic(self):
"""Test if setting a topic works"""
pq.apply_and_commit_patch(self.repo, patch, None, topic='foobar')
info = self.repo.get_commit_info('HEAD')
- self.assertIn('Gbp-Pq-Topic: foobar', info['body'])
+ self.assertIn('Gbp-Pq: Topic foobar', info['body'])
+
+ def test_name(self):
+ """Test if setting a name works"""
+ patch = gbp.patch_series.Patch(_patch_path('foo.patch'))
- @unittest.skipIf(not os.path.exists('/usr/bin/dpkg'), 'Dpkg not found')
+ pq.apply_and_commit_patch(self.repo, patch, None, name='foobar')
+ info = self.repo.get_commit_info('HEAD')
+ self.assertIn('Gbp-Pq: Name foobar', info['body'])
+
+ @testutils.skip_without_cmd('dpkg')
def test_debian_missing_author(self):
"""
- Check if we parse the author from debian control
- if it's missing in the patch.
+ Check if we parse the author from debian control if it's missing in the patch.
"""
def _check_log(msg):
self.assertEqual(msg, "Patch 'foo.patch' has no authorship "
patch = gbp.patch_series.Patch(_patch_path('foo.patch'))
- dummy_opts = object()
- pq.apply_single_patch(self.repo, 'master', patch, None, dummy_opts)
+ self.repo.create_branch(pq.pq_branch_name('master'))
+ pq.apply_single_patch(self.repo, 'master', patch, None)
self.assertIn(b'foo', self.repo.list_files())
+
class TestWritePatch(testutils.DebianGitTestRepo):
"""Test L{gbp.pq}'s write_patch """
def tearDown(self):
context.teardown()
- def test_generate_patches(self):
- """Test generation of patches"""
-
- class opts: patch_numbers = False
+ def _test_generate_patches(self, changes, expected_patches, opts):
+ self.assertEqual(len(changes), len(expected_patches))
- # Add test file with topic:
- msg = ("added foo\n\n"
- "Gbp-Pq-Topic: gbptest")
- self.add_file('foo', 'foo', msg)
-
- # Write it out as patch and check it's existence
d = context.new_tmpdir(__name__)
- patchfile = generate_patches(self.repo, 'HEAD^', 'HEAD', str(d),
- opts)[0]
- expected = os.path.join(str(d), 'gbptest', 'added-foo.patch')
+ expected_paths = [os.path.join(str(d), n) for n in expected_patches]
+
+ # Commit changes
+ for c in changes:
+ self.add_file(c[0], c[1], c[2])
- self.assertTrue(os.path.exists(expected))
- logging.debug(open(expected).read())
+ # Write it out as patch and check its existence
+ origin = 'HEAD~%d' % len(changes)
+ patchfiles = generate_patches(self.repo, origin, 'HEAD', str(d), opts)
+ for expected in expected_paths:
+ self.assertIn(expected, patchfiles)
+ self.assertTrue(os.path.exists(expected))
# Reapply the patch to a new branch
- self.repo.create_branch('testapply', 'HEAD^')
+ self.repo.create_branch('testapply', origin)
self.repo.set_branch('testapply')
- self.repo.apply_patch(expected)
+ for expected in expected_paths:
+ self.repo.apply_patch(expected)
self.repo.commit_all("foo")
diff = self.repo.diff('master', 'testapply')
# Branches must be identical afterwards
- self.assertEqual('', diff)
+ self.assertEqual(b'', diff)
+
+ def test_generate_patches(self):
+ """Test generation of patches"""
+
+ expected_patches = ['gbptest/added-foo.patch',
+ 'gbptest/patchname.diff']
+
+ changes = [('foo', 'foo', ("added foo\n\n"
+ "Gbp-Pq: Topic gbptest")),
+ ('baz', 'baz', ("added bar\n\n"
+ "Gbp-Pq: Topic gbptest\n"
+ "Gbp-Pq: Name patchname.diff"))]
+
+ opts = TestPqOptions()
+ opts.patch_num_format = '%04d-'
+ self._test_generate_patches(changes, expected_patches, opts)
+
+ def test_generate_renumbered_patches(self):
+ """Test generation of renumbered patches"""
+
+ expected_patches = ['gbptest/01_added-foo.patch',
+ 'gbptest/02_patchname.diff']
+
+ changes = [('foo', 'foo', ("added foo\n\n"
+ "Gbp-Pq: Topic gbptest")),
+ ('baz', 'baz', ("added bar\n\n"
+ "Gbp-Pq: Topic gbptest\n"
+ "Gbp-Pq: Name 099-patchname.diff"))]
+
+ opts = TestPqOptions()
+ opts.patch_num_format = '%02d_'
+ opts.renumber = True
+ opts.patch_numbers = True
+ self._test_generate_patches(changes, expected_patches, opts)
+
+ def test_generate_patches_with_name_clashes(self):
+ """Test generation of patches which have name clashes"""
+
+ expected_patches = ['gbptest/added-foo.patch',
+ 'gbptest/patchname.diff',
+ 'gbptest/patchname-1.diff',
+ 'gbptest/patchname-2.diff']
+
+ changes = [('foo', 'foo', ("added foo\n\n"
+ "Gbp-Pq: Topic gbptest")),
+ ('baz', 'baz', ("added bar\n\n"
+ "Gbp-Pq: Topic gbptest\n"
+ "Gbp-Pq: Name 099-patchname.diff")),
+ ('qux', 'qux', ("added qux\n\n"
+ "Gbp-Pq: Topic gbptest\n"
+ "Gbp-Pq: Name 100-patchname.diff")),
+ ('norf', 'norf', ("added norf\n\n"
+ "Gbp-Pq: Topic gbptest\n"
+ "Gbp-Pq: Name 101-patchname.diff"))]
+
+ opts = TestPqOptions()
+ opts.renumber = True
+ opts.patch_num_format = '%02d_'
+ self._test_generate_patches(changes, expected_patches, opts)
+
class TestExport(testutils.DebianGitTestRepo):
- class Options(object):
- drop = True
- patch_numbers = False
+ class Options(TestPqOptions):
+ commit = False
+ meta_closes = False
+ meta_closes_bugnum = ''
+ pq_from = 'DEBIAN'
def setUp(self):
testutils.DebianGitTestRepo.setUp(self)
"""Test if we drop the patch-queue branch with --drop"""
repo = self.repo
start = repo.get_branch()
- pq = os.path.join('patch-queue', start)
- switch_pq(repo, start, TestExport.Options)
- self.assertEqual(repo.get_branch(), pq)
- export_patches(repo, pq, TestExport.Options)
+ pq_branch = os.path.join('patch-queue', start)
+ opts = TestExport.Options()
+ opts.drop = True
+
+ repo.create_branch(pq.pq_branch_name('master'))
+ switch_pq(repo, start, opts)
+ self.assertEqual(repo.get_branch(), pq_branch)
+ export_patches(repo, pq_branch, opts)
+ self.assertEqual(repo.get_branch(), start)
+ self.assertFalse(repo.has_branch(pq_branch))
+
+ def test_commit(self):
+ """Test if we commit the patch-queue branch with --commit"""
+ repo = self.repo
+ start = repo.get_branch()
+ pq_branch = os.path.join('patch-queue', start)
+ opts = TestExport.Options()
+ opts.commit = True
+ repo.create_branch(pq.pq_branch_name('master'))
+ switch_pq(repo, start, opts)
+ self.assertEqual(len(repo.get_commits()), 1)
+ self.assertEqual(repo.get_branch(), pq_branch)
+ self.add_file('foo', 'foo')
+ export_patches(repo, pq_branch, opts)
self.assertEqual(repo.get_branch(), start)
- self.assertFalse(repo.has_branch(pq))
+ self.assertTrue(repo.has_branch(pq_branch))
+ self.assertEqual(len(repo.get_commits()), 2,
+ "Export did not create commit")
+ export_patches(repo, pq_branch, opts)
+ self.assertEqual(repo.get_branch(), start)
+ self.assertEqual(len(repo.get_commits()), 2,
+ "Export must not create another commit")
+
+ def test_commit_dropped_patches(self):
+ """Test if we commit the patch-queue branch with all patches dropped"""
+ repo = self.repo
+ start = repo.get_branch()
+ pq_branch = os.path.join('patch-queue', start)
+ opts = TestExport.Options()
+ opts.commit = True
+ patch_dir = os.path.join(repo.path, 'debian/patches')
+ os.makedirs(patch_dir)
+ with open(os.path.join(patch_dir, 'series'), 'w') as f:
+ f.write("patch1.diff\n")
+ f.write("patch2.diff\n")
+ repo.add_files('debian/patches')
+ repo.commit_all('Add series file')
+ repo.create_branch(pq.pq_branch_name('master'))
+ switch_pq(repo, start, opts)
+ self.assertEqual(len(repo.get_commits()), 2)
+ self.assertEqual(repo.get_branch(), pq_branch)
+ export_patches(repo, pq_branch, opts)
+ self.assertEqual(repo.get_branch(), start)
+ self.assertTrue(repo.has_branch(pq_branch))
+ self.assertEqual(len(repo.get_commits()), 3,
+ "Export did not create commit")
+ self.assertIn(b"Drop patch1.diff:", repo.show('HEAD'))
+ self.assertIn(b"Drop patch2.diff:", repo.show('HEAD'))
+
+
+class TestParseGbpCommand(unittest.TestCase):
+ def test_empty_body(self):
+ """Test command filtering with an empty body"""
+ info = {'body': ''}
+ (cmds, body) = pq.parse_gbp_commands(info, ['tag'], ['cmd1'], ['cmd2'])
+ self.assertEquals(cmds, {})
+ self.assertEquals(body, '')
+
+ def test_noarg_cmd(self):
+ orig_body = '\n'.join(["Foo",
+ "tag: cmd1"])
+ info = {'body': orig_body}
+ (cmds, body) = pq.parse_gbp_commands(info, 'tag', ['cmd'], ['argcmd'])
+ self.assertEquals(cmds, {'cmd': None})
+ self.assertEquals(body, orig_body)
+
+ def test_filter_cmd(self):
+ orig_body = '\n'.join(["Foo",
+ "tag: cmd1"])
+ info = {'body': orig_body}
+ (cmds, body) = pq.parse_gbp_commands(info, 'tag', ['cmd'], ['argcmd'], ['cmd'])
+ self.assertEquals(cmds, {'cmd': None})
+ self.assertEquals(body, 'Foo')
+
+
+class TestFromTAG(testutils.DebianGitTestRepo):
+ """Test L{gbp.pq}'s pq-from=TAG"""
+
+ class Options(TestPqOptions):
+ commit = True
+ force = False
+ meta_closes = 'Closes|LP'
+ meta_closes_bugnum = r'(?:bug|issue)?\#?\s?\d+'
+ pq_from = 'TAG'
+ upstream_tag = 'upstream/%(version)s'
+
+ def git_create_empty_branch(self, branch):
+ GitCommand('checkout', cwd=self.repo.path)(['-q', '--orphan', branch])
+ GitCommand('rm', cwd=self.repo.path)(['-rf', '.'])
+
+ def setUp(self):
+ testutils.DebianGitTestRepo.setUp(self)
+ self.add_file('debian/control')
+ self.add_file(
+ 'debian/changelog',
+ 'foo (0.0.1-1) UNRELEASED; urgency=medium\n'
+ '\n'
+ ' * Initial foo\n'
+ '\n'
+ ' -- Mr. T. S. <t@example.com> '
+ 'Thu, 01 Jan 1970 00:00:00 +0000\n'
+ )
+ self.git_create_empty_branch('bar')
+ self.add_file('foo', 'foo')
+ self.repo.create_tag('upstream/0.0.1')
+ self.repo.set_branch('master')
+
+ def test_empty(self):
+
+ import_quilt_patches(self.repo,
+ branch=self.repo.get_branch(),
+ series=SERIES_FILE,
+ tries=1,
+ force=TestFromTAG.Options.force,
+ pq_from=TestFromTAG.Options.pq_from,
+ upstream_tag=TestFromTAG.Options.upstream_tag)
+ diff = self.repo.diff(self.repo.get_branch(), 'upstream/0.0.1')
+ self.assertEqual(b'', diff)
+ diff = self.repo.diff(self.repo.get_branch(), 'master')
+ self.assertNotEqual(b'', diff)
+
+ rebase_pq(self.repo,
+ branch=self.repo.get_branch(),
+ options=TestFromTAG.Options)
+ diff = self.repo.diff(self.repo.get_branch(), 'upstream/0.0.1')
+ self.assertEqual(b'', diff)
+ diff = self.repo.diff(self.repo.get_branch(), 'master')
+ self.assertNotEqual(b'', diff)
+
+ export_patches(self.repo,
+ branch=self.repo.get_branch(),
+ options=TestFromTAG.Options())
+ diff = self.repo.diff(self.repo.get_branch(), self.repo.head)
+ self.assertEqual(b'', diff)
+
+ def test_adding_patch(self):
+ import_quilt_patches(self.repo,
+ branch=self.repo.get_branch(),
+ series=SERIES_FILE,
+ tries=1,
+ force=TestFromTAG.Options.force,
+ pq_from=TestFromTAG.Options.pq_from,
+ upstream_tag=TestFromTAG.Options.upstream_tag)
+ self.add_file('bar', 'bar', 'added bar')
+ export_patches(self.repo,
+ branch=self.repo.get_branch(),
+ options=TestFromTAG.Options())
+ self.assertTrue(os.path.exists(os.path.join(self.repo.path,
+ os.path.dirname(SERIES_FILE),
+ 'added-bar.patch')))
+ switch_pq(self.repo, 'master', TestFromTAG.Options)
+ rebase_pq(self.repo,
+ branch=self.repo.get_branch(),
+ options=TestFromTAG.Options())
+ export_patches(self.repo,
+ branch=self.repo.get_branch(),
+ options=TestFromTAG.Options())
+ self.assertTrue(os.path.exists(os.path.join(self.repo.path,
+ os.path.dirname(SERIES_FILE),
+ 'added-bar.patch')))
+ # New upstream release
+ self.repo.set_branch('bar')
+ GitCommand('cherry-pick', cwd=self.repo.path)(['patch-queue/master'])
+ self.repo.create_tag('upstream/0.0.2')
+ self.repo.set_branch('master')
+ self.add_file(
+ 'debian/changelog',
+ 'foo (0.0.2-1) UNRELEASED; urgency=medium\n'
+ '\n'
+ ' * Initial foo\n'
+ '\n'
+ ' -- Mr. T. S. <t@example.com> '
+ 'Thu, 01 Jan 1970 00:00:00 +0000\n'
+ )
+ switch_pq(self.repo, 'master', TestFromTAG.Options())
+ rebase_pq(self.repo,
+ branch=self.repo.get_branch(),
+ options=TestFromTAG.Options())
+ export_patches(self.repo,
+ branch=self.repo.get_branch(),
+ options=TestFromTAG.Options())
+ self.assertFalse(os.path.exists(os.path.join(self.repo.path,
+ os.path.dirname(SERIES_FILE),
+ 'added-bar.patch')))
def _patch_path(name):
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Test L{gbp.pq}"""
from . import context
-
from . import testutils
+
import gbp.log
import gbp.scripts.import_dscs as import_dscs
from gbp.errors import GbpError
+
class StubGitImportDsc(object):
"""
A Stub for GitImportDsc.
"""
return 1 if dsc.filename == self.failfile else 0
+
class DscStub(object):
def __init__(self, filename, version):
self.filename = filename
version = filename[4]
return cls(filename, version)
-# hook up stubs
-import_dscs.GitImportDsc = StubGitImportDsc
-import_dscs.DscFile = DscStub
class TestImportDscs(testutils.DebianGitTestRepo):
"""Test L{gbp.scripts.import_dscs}'s """
self.orig_err = gbp.log.err
gbp.log.err = self._check_err_msg
+ self.safed_GitImportDsc = import_dscs.GitImportDsc
+ self.safed_DscFile = import_dscs.DscFile
+ import_dscs.GitImportDsc = StubGitImportDsc
+ import_dscs.DscFile = DscStub
+
def _check_err_msg(self, err):
self.assertIsInstance(err, GbpError)
self.assertIn("Failed to import", str(err))
testutils.DebianGitTestRepo.tearDown(self)
context.teardown()
+ import_dscs.GitImportDsc = self.safed_GitImportDsc
+ import_dscs.DscFile = self.safed_DscFile
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Test L{gbp.pq}"""
from . import context
from . import testutils
import os
+
from gbp.deb.source import DebianSource, DebianSourceError
from gbp.deb.format import DebianSourceFormat
from gbp.git.vfs import GitVfs
+
class TestDebianSource(testutils.DebianGitTestRepo):
"""Test L{gbp.deb.source}'s """
"""Test native package of format 3"""
source = DebianSource('.')
os.makedirs('debian/source')
- self.assertRaises(DebianSourceError,
- source.is_native)
+ with self.assertRaises(DebianSourceError):
+ source.is_native()
dsf = DebianSourceFormat.from_content("3.0", "native")
self.assertEqual(dsf.type, 'native')
"""Test native package without a debian/source/format file"""
source = DebianSource('.')
os.makedirs('debian/')
- self.assertRaises(DebianSourceError,
- source.is_native)
+ with self.assertRaises(DebianSourceError):
+ source.is_native()
with open('debian/changelog', 'w') as f:
f.write("""git-buildpackage (0.2.3) git-buildpackage; urgency=low
self._commit_format('3.0', 'quilt')
source = DebianSource(GitVfs(self.repo))
self.assertFalse(source.is_native())
+
+ def test_is_releasable(self):
+ os.makedirs('debian/')
+ with open('debian/changelog', 'w') as f:
+ f.write("""git-buildpackage (0.2.3) unstable; urgency=low
+
+ * git doesn't like '~' in tag names so replace this with a dot when tagging
+
+ -- Guido Guenther <agx@sigxcpu.org> Mon, 2 Oct 2006 18:30:20 +0200
+""")
+ source = DebianSource('.')
+ self.assertEquals(source.changelog.distribution, "unstable")
+ self.assertTrue(source.is_releasable())
+
+ def test_is_not_releasable(self):
+ os.makedirs('debian/')
+ with open('debian/changelog', 'w') as f:
+ f.write("""git-buildpackage (0.2.3) UNRELEASED; urgency=low
+
+ * git doesn't like '~' in tag names so replace this with a dot when tagging
+
+ -- Guido Guenther <agx@sigxcpu.org> Mon, 2 Oct 2006 18:30:20 +0200
+""")
+ source = DebianSource('.')
+ self.assertEquals(source.changelog.distribution, "UNRELEASED")
+ self.assertFalse(source.is_releasable())
+
+ def test_control(self):
+ os.makedirs('debian/')
+ with open('debian/control', 'w') as f:
+ f.write("Source: foo")
+ source = DebianSource('.')
+ self.assertIsNotNone(source.control)
+ self.assertEquals(source.control.name, "foo")
+
+ def test_cur_dir_not_toplevel(self):
+ """
+ Check if we can parse files if workdir != debian toplevel dir
+ """
+ os.makedirs('debian/')
+ with open('debian/changelog', 'w') as f:
+ f.write("""foo (0.2.3) unstable; urgency=low
+
+ * git doesn't like '~' in tag names so replace this with a dot when tagging
+
+ -- Guido Guenther <agx@sigxcpu.org> Mon, 2 Oct 2006 18:30:20 +0200
+""")
+ with open('debian/control', 'w') as f:
+ f.write("Source: foo")
+ os.chdir('debian/')
+ source = DebianSource('..')
+ self.assertEquals(source.changelog.name, "foo")
+ self.assertEquals(source.control.name, "foo")
+
+ source = DebianSource(os.path.abspath('..'))
+ self.assertEquals(source.changelog.name, "foo")
+ self.assertEquals(source.control.name, "foo")
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Test L{gbp} command wrapper"""
-import sys
-# Try unittest2 for CentOS
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import gbp.scripts.supercommand
+from tests.testutils import capture_stdout, capture_stderr
+
+
class TestSuperCommand(unittest.TestCase):
def test_import(self):
"""Test the importer itself"""
- self.assertRaises(ImportError,
- gbp.scripts.supercommand.import_command,
- 'not.allowed')
- self.assertRaises(ImportError,
- gbp.scripts.supercommand.import_command,
- 'not/allowed')
- self.assertRaises(ImportError,
- gbp.scripts.supercommand.import_command,
- '0notallowed')
+ with self.assertRaises(ImportError):
+ gbp.scripts.supercommand.import_command('not.allowed')
+ with self.assertRaises(ImportError):
+ gbp.scripts.supercommand.import_command('not/allowed')
+ with self.assertRaises(ImportError):
+ gbp.scripts.supercommand.import_command('0notallowed')
self.assertIsNotNone(gbp.scripts.supercommand.import_command('pq'))
def test_invalid_command(self):
"""Test if we fail correctly with an invalid command"""
- old_stderr = sys.stderr
- with open('/dev/null', 'w') as sys.stderr:
+ with capture_stderr():
self.assertEqual(gbp.scripts.supercommand.supercommand(
['argv0', 'asdf']), 2)
self.assertEqual(gbp.scripts.supercommand.supercommand(
['argv0', 'asdf', '--verbose']), 2)
- sys.stderr = old_stderr
+
+ def test_list_commands(self):
+ """Invoking with --list-cmds must not raise an error"""
+ with capture_stdout() as out:
+ self.assertEqual(gbp.scripts.supercommand.supercommand(['argv0',
+ '--list-cmds']), 0)
+ for cmd in ['import-orig', 'create-remote-repo', 'pq']:
+ self.assertIn("%s - " % cmd, out.output())
def test_help_command(self):
"""Invoking with --help must not raise an error"""
def test_missing_arg(self):
self.assertEqual(gbp.scripts.supercommand.supercommand(
['argv0']), 1)
-
"""Test L{Changelog}'s guess_version_from_upstream"""
-from . import context
-
+from . import context # noqa: 401
from . import testutils
from gbp.scripts import dch
+
class TestGuessDocumentedCommit(testutils.DebianGitTestRepo):
def setUp(self):
self.version = '1.0-1'
Guess the commit to start from from the snapshot banner
"""
cp = testutils.MockedChangeLog(self.version,
- "*** SNAPSHOT build @12345 ***")
+ "*** SNAPSHOT build @12345 ***")
guessed_commit = dch.guess_documented_commit(cp, None, None)
self.assertEqual(guessed_commit, '12345')
# vim: set fileencoding=utf-8 :
import os
-
import unittest
from gbp.config import GbpOptionParser, GbpOptionGroup
-from . import context
+from .testutils import GbpLogTester
+
+
+class TestConfigParser(unittest.TestCase, GbpLogTester):
+ def __init__(self, methodName='runTest'):
+ unittest.TestCase.__init__(self, methodName)
+ GbpLogTester.__init__(self)
-class TestConfigParser(unittest.TestCase):
def setUp(self):
self.conffiles_save = os.environ.get('GBP_CONF_FILES')
self.confname = 'tests/data/test1.conf'
self.assertTrue(os.stat(self.confname))
os.environ['GBP_CONF_FILES'] = self.confname
+ self._capture_log(True)
def tearDown(self):
if self.conffiles_save:
os.environ['GBP_CONF_FILES'] = self.conffiles_save
+ self._capture_log(False)
def test_default(self):
"""
A value only in the default section should be available in all commands
"""
- for n in range(1,5):
- for prefix in [ '', 'git-', 'gbp-' ]:
- parser = GbpOptionParser('cmd%d' % n)
+ for n in range(1, 5):
+ for prefix in ['', 'git-', 'gbp-']:
+ parser = GbpOptionParser('%scmd%d' % (prefix, n))
self.assertEqual(parser.config['default_option'], 'default_default1')
def test_single_override(self):
"""
A value in any command section should override the default
"""
- for prefix in [ '', 'git-', 'gbp-' ]:
+ for prefix in ['', 'git-', 'gbp-']:
parser = GbpOptionParser('%scmd1' % prefix)
self.assertEqual(parser.config['single_override_option1'], 'single_override_value1')
+ # No deprecation warning since the test1.conf section is [cmd1]
+ self._check_log_empty()
def test_single_git_override(self):
"""
A value in any git-command section should override the default
"""
- for prefix in [ '', 'git-' ]:
+ for prefix in ['', 'git-']:
parser = GbpOptionParser('%scmd2' % prefix)
self.assertEqual(parser.config['single_git_override_option1'], 'single_git_override_value1')
+ for line in range(0, 2):
+ self._check_log(line, r'.*Old style config section \[git-cmd2\] found please rename to \[cmd2\]')
def test_single_gbp_override(self):
"""
A value in any gbp-command section should override the default
"""
- for prefix in [ '', 'gbp-' ]:
+ for prefix in ['', 'gbp-']:
parser = GbpOptionParser('%scmd3' % prefix)
self.assertEqual(parser.config['single_gbp_override_option1'], 'single_gbp_override_value1')
- # FIXME: for all prefixes
+ for line in range(0, 2):
+ self._check_log(line, r'.*Old style config section \[gbp-cmd3\] found please rename to \[cmd3\]')
+
+ def test_single_git_override_disabled_deprecations(self):
+ """
+ With disabled deprecations we shouldn't see a log line
+ """
+ for prefix in ['', 'git-']:
+ os.environ['GBP_DISABLE_SECTION_DEPRECATION'] = 'true'
+ parser = GbpOptionParser('%scmd2' % prefix)
+ self.assertEqual(parser.config['single_git_override_option1'], 'single_git_override_value1')
+ for line in range(0, 2):
+ self._check_log_empty()
+ os.environ.pop('GBP_DISABLE_SECTION_DEPRECATION')
def test_new_overrides_git(self):
"""
how we're invoked
"""
for n in range(4, 6):
- for prefix in [ '', 'git-']:
+ for prefix in ['', 'git-']:
cmd = '%scmd%d' % (prefix, n)
parser = GbpOptionParser(cmd)
actual = parser.config['new_overrides_git_option1']
def test_get_config_file_value(self):
"""
- Read a single value from the parse config
+ Read a single value from the parsed config
"""
parser = GbpOptionParser('cmd4')
self.assertEqual(parser.get_config_file_value('new_overrides_git_option1'),
self.assertTrue('upstream-branch' in params)
self.assertTrue('debian-branch' in params)
self.assertTrue('color' in params)
+
+ def test_short_option_with_prefix(self):
+ """Options with short options can't have a prefix"""
+ class TestOptonParser(GbpOptionParser):
+ list_opts = []
+ defaults = {'withshort': 'foo'}
+ short_opts = {'withshort': '-S'}
+ parser = TestOptonParser('cmd', prefix='p')
+ with self.assertRaisesRegexp(ValueError, "Options with prefix cannot have a short option"):
+ parser.add_config_file_option(option_name="withshort", dest="with_short", help="foo")
+
+ def test_short_option(self):
+ class TestOptionParser(GbpOptionParser):
+ list_opts = []
+ defaults = {'withshort': 'foo'}
+ short_opts = {'withshort': '-S'}
+
+ parser = TestOptionParser('cmd')
+ parser.add_config_file_option(option_name="withshort", dest="with_short", help="foo")
+ self.assertEquals('withshort', parser.valid_options[0])
+ self.assertEquals(len(parser.valid_options), 1)
+ self.assertTrue(parser.has_option("--withshort"))
+ self.assertTrue(parser.has_option("-S"))
# vim: set fileencoding=utf-8 :
-# (C) 2014 Guido Günther <agx@sigxcpu.org>
+# (C) 2014,2016 Guido Günther <agx@sigxcpu.org>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Test L{gbp} config"""
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
+"""Test the L{gbp} config command"""
import os
-import sys
-# Try unittest2 for CentOS
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import gbp.scripts.config
+
class TestGbpConfigCommand(unittest.TestCase):
class SingleValuePrintStub(object):
def __init__(self):
def setUp(self):
self.conffiles_save = os.environ.get('GBP_CONF_FILES')
self.confname = 'tests/data/gbp_config.conf'
- self.assertTrue(os.stat(self.confname))
+ self.assertTrue(os.path.exists(self.confname))
os.environ['GBP_CONF_FILES'] = self.confname
+ def tearDown(self):
+ if self.conffiles_save:
+ os.environ['GBP_CONF_FILES'] = self.conffiles_save
+
def test_invocation_single_value(self):
"""Can invoke it for a sngle value without error"""
- ret = gbp.scripts.config.main(['doesnotmatter', 'coolcommand.branchname'])
+ ret = gbp.scripts.config.main(['argv0', 'config.color'])
self.assertEqual(ret, 0)
def test_invocation_missing_value(self):
"""Can we detect a missing value"""
- ret = gbp.scripts.config.main(['doesnotmatter', 'coolcommand.doesnotexist'])
- self.assertEqual(ret, 1)
+ ret = gbp.scripts.config.main(['argv0', 'config.doesnotexist'])
+ self.assertEqual(ret, 2)
+
+ def test_print_cmd_single_value_default(self):
+ """Can we fetch a single configuration value that is at it's default"""
+ printstub = self.SingleValuePrintStub()
+ query = 'config.color'
+ ret = gbp.scripts.config.print_cmd_values(query, printstub)
+ self.assertEqual(printstub.result, 'auto')
+ self.assertEqual(ret, 0)
- def test_print_cmd_single_value(self):
- """Can we fetch a single configuration value"""
+ def test_print_cmd_single_value_empty_default(self):
+ """Can we fetch a single configuration value that is at it's default which is empty"""
printstub = self.SingleValuePrintStub()
- query = 'coolcommand.branchname'
- ret = gbp.scripts.config.print_cmd_single_value(query, printstub)
- self.assertEqual(printstub.result, '%s=abranch' % query)
+ query = 'buildpackage.keyid'
+ ret = gbp.scripts.config.print_cmd_values(query, printstub)
+ self.assertEqual(printstub.result, '')
+ self.assertEqual(ret, 0)
+
+ def test_print_cmd_single_value_override(self):
+ """Can we fetch a single configuration value that is overridden by config"""
+ printstub = self.SingleValuePrintStub()
+ query = 'config.color-scheme'
+ ret = gbp.scripts.config.print_cmd_values(query, printstub)
+ self.assertEqual(printstub.result, 'checkcheck')
self.assertEqual(ret, 0)
def test_print_cmd_all_values(self):
"""Can we fetch the configuration for all commands"""
- for cmd in [ 'buildpackage',
- 'clone',
- 'config',
- 'create_remote_repo',
- 'dch',
- 'import_dsc',
- 'import_orig',
- 'pq',
- 'pull' ]:
+ for cmd in ['buildpackage',
+ 'buildpackage_rpm',
+ 'clone',
+ 'config',
+ 'create_remote_repo',
+ 'dch',
+ 'import_dsc',
+ 'import_orig',
+ 'import_srpm',
+ 'pq',
+ 'pq_rpm',
+ 'pull',
+ 'rpm_ch']:
printstub = self.AllValuesPrintStub(cmd)
- ret = gbp.scripts.config.print_cmd_all_values(cmd, printstub)
- self.assertTrue('%s.color' % cmd in list(printstub.result.keys()))
+ ret = gbp.scripts.config.print_cmd_values(cmd, printstub)
+ self.assertIn('%s.color' % cmd, printstub.result.keys())
+ self.assertEquals(printstub.result['%s.color' % cmd], 'auto')
self.assertEqual(ret, 0)
- def test_invalid_cms(self):
- """Invalid commands or those not using the config should rerturn an error code"""
- for cmd in [ "import_dscs", "supercommand" ]:
+ def test_nonexistent_cmds(self):
+ """Non-existing commands should print no values"""
+ for cmd in ["import_dscs", "supercommand", "nonexistent"]:
printstub = self.AllValuesPrintStub(cmd)
- ret = gbp.scripts.config.print_cmd_all_values(cmd, printstub)
+ ret = gbp.scripts.config.print_cmd_values(cmd, printstub)
+ self.assertEquals(printstub.result, dict())
self.assertEqual(ret, 2)
-
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+"""Test the classes under L{gbp.rpm}"""
+
+import filecmp
+import os
+import shutil
+import tempfile
+from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
+
+from gbp.errors import GbpError
+from gbp.rpm import (SpecFile, SrcRpmFile, NoSpecError, guess_spec,
+ guess_spec_repo, spec_from_repo)
+from gbp.git.repository import GitRepository
+
+# Disable "Method could be a function"
+# pylint: disable=R0201
+
+
+DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data',
+ 'rpm')
+SRPM_DIR = os.path.join(DATA_DIR, 'srpms')
+SPEC_DIR = os.path.join(DATA_DIR, 'specs')
+
+
+class SpecFileTester(SpecFile):
+ """Helper class for testing"""
+
+ def protected(self, name):
+ """Get a protected member"""
+ return super(SpecFileTester, self).__getattribute__(name)
+
+
+class RpmTestBase(object):
+ """Test base class"""
+ def __init__(self):
+ self.tmpdir = None
+
+ def setup(self):
+ """Test case setup"""
+ self.tmpdir = tempfile.mkdtemp(prefix='gbp_%s_' % __name__, dir='.')
+
+ def teardown(self):
+ """Test case teardown"""
+ if not os.getenv("GBP_TESTS_NOCLEAN"):
+ shutil.rmtree(self.tmpdir)
+
+
+class TestSrcRpmFile(RpmTestBase):
+ """Test L{gbp.rpm.SrcRpmFile}"""
+
+ def test_srpm(self):
+ """Test parsing of a source rpm"""
+ srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test-1.0-1.src.rpm'))
+ eq_(srpm.version, {'release': '1', 'upstreamversion': '1.0'})
+ eq_(srpm.name, 'gbp-test')
+ eq_(srpm.upstreamversion, '1.0')
+ eq_(srpm.packager, None)
+
+ def test_srpm_2(self):
+ """Test parsing of another source rpm"""
+ srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test2-3.0-0.src.rpm'))
+ eq_(srpm.version, {'release': '0', 'upstreamversion': '3.0',
+ 'epoch': '2'})
+ eq_(srpm.packager, 'Markus Lehtonen <markus.lehtonen@linux.intel.com>')
+
+ def test_unpack_srpm(self):
+ """Test unpacking of a source rpm"""
+ srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test-1.0-1.src.rpm'))
+ srpm.unpack(self.tmpdir)
+ for fn in ['gbp-test-1.0.tar.bz2', 'foo.txt', 'bar.tar.gz', 'my.patch',
+ 'my2.patch', 'my3.patch']:
+ ok_(os.path.exists(os.path.join(self.tmpdir, fn)),
+ "%s not found" % fn)
+
+
+class TestSpecFile(RpmTestBase):
+ """Test L{gbp.rpm.SpecFile}"""
+
+ def test_spec(self):
+ """Test parsing of a valid spec file"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test.spec')
+ spec = SpecFileTester(spec_filepath)
+
+ # Test basic properties
+ eq_(spec.specfile, os.path.basename(spec_filepath))
+ eq_(spec.specdir, os.path.dirname(spec_filepath))
+ eq_(spec.specpath, spec_filepath)
+
+ eq_(spec.name, 'gbp-test')
+ eq_(spec.packager, None)
+
+ eq_(spec.upstreamversion, '1.0')
+ eq_(spec.release, '1')
+ eq_(spec.epoch, None)
+ eq_(spec.version, {'release': '1', 'upstreamversion': '1.0'})
+
+ orig = spec.orig_src
+ eq_(orig['filename'], 'gbp-test-1.0.tar.bz2')
+ eq_(orig['uri'], 'gbp-test-1.0.tar.bz2')
+ eq_(orig['filename_base'], 'gbp-test-1.0')
+ eq_(orig['archive_fmt'], 'tar')
+ eq_(orig['compression'], 'bzip2')
+ eq_(orig['prefix'], 'gbp-test/')
+
+ def test_spec_2(self):
+ """Test parsing of another valid spec file"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test2.spec')
+ spec = SpecFile(spec_filepath)
+
+ # Test basic properties
+ eq_(spec.name, 'gbp-test2')
+ eq_(spec.packager, 'Markus Lehtonen <markus.lehtonen@linux.intel.com>')
+
+ eq_(spec.epoch, '2')
+ eq_(spec.version, {'release': '0', 'upstreamversion': '3.0',
+ 'epoch': '2'})
+
+ orig = spec.orig_src
+ eq_(orig['filename'], 'gbp-test2-3.0.tar.gz')
+ eq_(orig['uri'], 'ftp://ftp.host.com/gbp-test2-3.0.tar.gz')
+ eq_(orig['archive_fmt'], 'tar')
+ eq_(orig['compression'], 'gzip')
+ eq_(orig['prefix'], '')
+
+ def test_spec_3(self):
+ """Test parsing of yet another valid spec file"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-native.spec')
+ spec = SpecFile(spec_filepath)
+
+ # Test basic properties
+ eq_(spec.name, 'gbp-test-native')
+ orig = spec.orig_src
+ eq_(orig['filename'], 'gbp-test-native-1.0.zip')
+ eq_(orig['archive_fmt'], 'zip')
+ eq_(orig['compression'], None)
+ eq_(orig['prefix'], 'gbp-test-native-1.0/')
+
+ def test_spec_4(self):
+ """Test parsing of spec without orig tarball"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-native2.spec')
+ spec = SpecFile(spec_filepath)
+
+ # Test basic properties
+ eq_(spec.name, 'gbp-test-native2')
+ eq_(spec.orig_src, None)
+
+ def test_parse_raw(self):
+ """Test parsing of a valid spec file"""
+ with assert_raises(NoSpecError):
+ SpecFile(None, None)
+ with assert_raises(NoSpecError):
+ SpecFile('filename', 'filedata')
+
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test.spec')
+ with open(spec_filepath, 'r') as spec_fd:
+ spec_data = spec_fd.read()
+ spec = SpecFile(filedata=spec_data)
+
+ # Test basic properties
+ eq_(spec.specfile, None)
+ eq_(spec.specdir, None)
+ eq_(spec.name, 'gbp-test')
+
+ def test_update_spec(self):
+ """Test spec autoupdate functionality"""
+ # Create temporary spec file
+ tmp_spec = os.path.join(self.tmpdir, 'gbp-test.spec')
+ shutil.copy2(os.path.join(SPEC_DIR, 'gbp-test.spec'), tmp_spec)
+
+ reference_spec = os.path.join(SPEC_DIR, 'gbp-test-reference.spec')
+ spec = SpecFile(tmp_spec)
+ spec.update_patches(['new.patch'], {})
+ spec.write_spec_file()
+ eq_(filecmp.cmp(tmp_spec, reference_spec), True)
+
+ # Test adding the VCS tag and adding changelog
+ reference_spec = os.path.join(SPEC_DIR, 'gbp-test-reference2.spec')
+ spec.set_tag('VCS', None, 'myvcstag')
+ spec.set_changelog("* Wed Feb 05 2014 Name <email> 1\n- New entry\n")
+ spec.write_spec_file()
+ eq_(filecmp.cmp(tmp_spec, reference_spec), True)
+
+ def test_update_spec2(self):
+ """Another test for spec autoupdate functionality"""
+ tmp_spec = os.path.join(self.tmpdir, 'gbp-test2.spec')
+ shutil.copy2(os.path.join(SPEC_DIR, 'gbp-test2.spec'), tmp_spec)
+
+ reference_spec = os.path.join(SPEC_DIR, 'gbp-test2-reference2.spec')
+ spec = SpecFile(tmp_spec)
+ spec.update_patches(['1.patch', '2.patch'],
+ {'1.patch': {'if': 'true'},
+ '2.patch': {'ifarch': '%ix86'}})
+ spec.set_tag('VCS', None, 'myvcstag')
+ spec.write_spec_file()
+ eq_(filecmp.cmp(tmp_spec, reference_spec), True)
+
+ # Test updating patches again, removing the VCS tag and re-writing
+ # changelog
+ reference_spec = os.path.join(SPEC_DIR, 'gbp-test2-reference.spec')
+ spec.update_patches(['new.patch'], {'new.patch': {'if': '1'}})
+ spec.set_tag('VCS', None, '')
+ spec.set_changelog("* Wed Feb 05 2014 Name <email> 2\n- New entry\n\n")
+ spec.write_spec_file()
+ eq_(filecmp.cmp(tmp_spec, reference_spec), True)
+
+ def test_modifying(self):
+ """Test updating/deleting of tags and macros"""
+ tmp_spec = os.path.join(self.tmpdir, 'gbp-test.spec')
+ shutil.copy2(os.path.join(SPEC_DIR, 'gbp-test-updates.spec'), tmp_spec)
+ reference_spec = os.path.join(SPEC_DIR,
+ 'gbp-test-updates-reference.spec')
+ spec = SpecFileTester(tmp_spec)
+
+ # Mangle tags
+ prev = spec.protected('_delete_tag')('Vendor', None)
+ spec.protected('_set_tag')('License', None, 'new license', prev)
+ spec.protected('_delete_tag')('source', 0)
+ eq_(spec.sources(), {})
+ spec.protected('_delete_tag')('patch', 0)
+ spec.protected('_delete_tag')('patch', 1)
+ eq_(spec.protected('_patches')(), {})
+ prev = spec.protected('_delete_tag')('invalidtag', None)
+
+ with assert_raises(GbpError):
+ # Check that setting empty value fails
+ spec.protected('_set_tag')('Version', None, '', prev)
+ with assert_raises(GbpError):
+ # Check that setting invalid tag with public method fails
+ spec.set_tag('invalidtag', None, 'value')
+
+ # Mangle macros
+ prev = spec.protected('_delete_special_macro')('patch', -1)
+ spec.protected('_delete_special_macro')('patch', 123)
+ spec.protected('_set_special_macro')('patch', 0, 'my new args', prev)
+ with assert_raises(GbpError):
+ spec.protected('_delete_special_macro')('invalidmacro', 0)
+ with assert_raises(GbpError):
+ spec.protected('_set_special_macro')('invalidmacro', 0, 'args',
+ prev)
+
+ # Check resulting spec file
+ spec.write_spec_file()
+ eq_(filecmp.cmp(tmp_spec, reference_spec), True)
+
+ def test_modifying_err(self):
+ """Test error conditions of modification methods"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test2.spec')
+ spec = SpecFileTester(spec_filepath)
+
+ # Unknown/invalid section name
+ with assert_raises(GbpError):
+ spec.protected('_set_section')('patch', 'new content\n')
+
+ # Multiple sections with the same name
+ with assert_raises(GbpError):
+ spec.protected('_set_section')('files', '%{_sysconfdir}/foo\n')
+
+ def test_changelog(self):
+ """Test changelog methods"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test2.spec')
+ spec = SpecFile(spec_filepath)
+
+ # Read changelog
+ eq_(spec.get_changelog(),
+ "* Tue Feb 04 2014 Name <email> 1\n- My change\n\n\n")
+
+ # Set changelog and check again
+ new_text = "* Wed Feb 05 2014 Name <email> 2\n- New entry\n\n\n"
+ spec.set_changelog(new_text)
+ eq_(spec.get_changelog(), new_text)
+
+ def test_quirks(self):
+ """Test spec that is broken/has anomalities"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-quirks.spec')
+ spec = SpecFile(spec_filepath)
+
+ # Check that we quess orig source and prefix correctly
+ eq_(spec.orig_src['prefix'], 'foobar/')
+
+ def test_tags(self):
+ """Test parsing of all the different tags of spec file"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-tags.spec')
+ spec = SpecFileTester(spec_filepath)
+
+ # Check all the tags
+ for name, val in spec.protected('_tags').items():
+ rval = None
+ if name in ('version', 'release', 'epoch'):
+ rval = '0'
+ elif name in ('autoreq', 'autoprov', 'autoreqprov'):
+ rval = 'No'
+ elif name not in spec.protected('_listtags'):
+ rval = 'my_%s' % name
+ if rval:
+ eq_(val['value'], rval, ("'%s:' is '%s', expecting '%s'" %
+ (name, val['value'], rval)))
+ eq_(spec.ignorepatches, [])
+ # Check patch numbers and patch filenames
+ patches = {}
+ for patch in spec.protected('_tags')['patch']['lines']:
+ patches[patch['num']] = patch['linevalue']
+
+ eq_(patches, {0: 'my_patch0', 1: 'my_patch'})
+
+ def test_patch_series(self):
+ """Test the getting the patches as a patchseries"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-native.spec')
+ spec = SpecFileTester(spec_filepath)
+
+ eq_(len(spec.patchseries()), 0)
+ spec.update_patches(['1.patch', '2.patch', '3.patch'], {})
+ eq_(len(spec.patchseries()), 3)
+ spec.protected('_gbp_tags')['ignore-patches'].append({'args': "0"})
+ spec.update_patches(['4.patch'], {})
+ eq_(len(spec.patchseries()), 1)
+ eq_(len(spec.patchseries(ignored=True)), 2)
+ spec.protected('_delete_special_macro')('patch', 0)
+ eq_(len(spec.patchseries(ignored=True)), 1)
+ series = spec.patchseries(unapplied=True, ignored=True)
+ eq_(len(series), 2)
+ eq_(os.path.basename(series[-1].path), '1.patch')
+
+ def test_patch_series_autosetup(self):
+ """Check patch series functionalitu with %autostup"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test3.spec')
+ spec = SpecFileTester(spec_filepath)
+
+ eq_(len(spec.patchseries()), 2)
+ eq_(len(spec.patchseries(ignored=True)), 3)
+ spec.update_patches(['1.patch'], {})
+ eq_(len(spec.patchseries()), 1)
+ eq_(len(spec.patchseries(ignored=True)), 2)
+ eq_(spec.protected('_special_directives')['patch'], [])
+
+ def test_patch_series_quirks(self):
+ """Patches are applied in order different from the patch numbering"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-quirks.spec')
+ spec = SpecFileTester(spec_filepath)
+
+ # Check series is returned in the order the patches are applied
+ files = [os.path.basename(patch.path) for patch in spec.patchseries()]
+ eq_(files, ['05.patch', '01.patch'])
+ # Also ignored patches are returned in the correct order
+ files = [os.path.basename(patch.path) for patch in
+ spec.patchseries(ignored=True)]
+ eq_(files, ['05.patch', '02.patch', '01.patch'])
+ # Unapplied patches are added to the end of the series
+ files = [os.path.basename(patch.path) for patch in
+ spec.patchseries(unapplied=True)]
+ eq_(files, ['05.patch', '01.patch', '03.patch'])
+ # Return all patches (for which tag is found)
+ files = [os.path.basename(patch.path) for patch in
+ spec.patchseries(unapplied=True, ignored=True)]
+ eq_(files, ['05.patch', '02.patch', '01.patch', '03.patch', '04.patch'])
+
+
+class TestUtilityFunctions(RpmTestBase):
+ """Test utility functions of L{gbp.rpm}"""
+
+ def test_guess_spec(self):
+ """Test guess_spec() function"""
+ # Spec not found
+ with assert_raises(NoSpecError):
+ guess_spec(DATA_DIR, recursive=False)
+ # Multiple spec files
+ with assert_raises(NoSpecError):
+ guess_spec(DATA_DIR, recursive=True)
+ with assert_raises(NoSpecError):
+ guess_spec(SPEC_DIR, recursive=False)
+ # Spec found
+ spec = guess_spec(SPEC_DIR, recursive=False,
+ preferred_name='gbp-test2.spec')
+ eq_(spec.specfile, 'gbp-test2.spec')
+ eq_(spec.specdir, SPEC_DIR)
+
+ def test_guess_spec_repo(self):
+ """Test guess_spec_repo() and spec_from_repo() functions"""
+ # Create dummy repository with some commits
+ repo = GitRepository.create(self.tmpdir)
+ with open(os.path.join(repo.path, 'foo.txt'), 'w') as fobj:
+ fobj.write('bar\n')
+ repo.add_files('foo.txt')
+ repo.commit_all('Add dummy file')
+ os.mkdir(os.path.join(repo.path, 'packaging'))
+ shutil.copy(os.path.join(SPEC_DIR, 'gbp-test.spec'),
+ os.path.join(repo.path, 'packaging'))
+ repo.add_files('packaging/gbp-test.spec')
+ repo.commit_all('Add spec file')
+
+ # Spec not found
+ with assert_raises(NoSpecError):
+ guess_spec_repo(repo, 'HEAD~1', recursive=True)
+ with assert_raises(NoSpecError):
+ guess_spec_repo(repo, 'HEAD', recursive=False)
+ # Spec found
+ spec = guess_spec_repo(repo, 'HEAD', 'packaging', recursive=False)
+ spec = guess_spec_repo(repo, 'HEAD', recursive=True)
+ eq_(spec.specfile, 'gbp-test.spec')
+ eq_(spec.specdir, 'packaging')
+ eq_(spec.specpath, 'packaging/gbp-test.spec')
+
+ # Test spec_from_repo()
+ with assert_raises(NoSpecError):
+ spec_from_repo(repo, 'HEAD~1', 'packaging/gbp-test.spec')
+ spec = spec_from_repo(repo, 'HEAD', 'packaging/gbp-test.spec')
+ eq_(spec.specfile, 'gbp-test.spec')
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
--- /dev/null
+# vim: set fileencoding=utf-8 :
+"""Test L{gbp.command_wrappers.Command}'s tarball unpack"""
+
+import unittest
+
+from gbp.command_wrappers import Command, CommandExecFailed
+from . testutils import GbpLogTester, patch_popen
+
+
+class TestCommandWrapperFailures(unittest.TestCase, GbpLogTester):
+ def setUp(self):
+ self.false = Command('/does/not/matter')
+ self.log_tester = GbpLogTester()
+ self.log_tester._capture_log(True)
+
+ def tearDown(self):
+ self.log_tester._capture_log(False)
+
+ @patch_popen(stdout=b'', stderr=b'', returncode=1)
+ def test_log_default_error_msg(self, create_mock):
+ with self.assertRaises(CommandExecFailed):
+ self.false.__call__()
+ self.log_tester._check_log(0, "gbp:error: '/does/not/matter' failed: it exited with 1")
+ self.assertEqual(self.false.retcode, 1)
+ self.assertEqual(self.false.stderr, '')
+ self.assertEqual(self.false.stdout, '')
+
+ @patch_popen(stdout=b'', stderr=b'we have a problem', returncode=1)
+ def test_log_use_stderr_for_err_message(self, create_mock):
+ self.false.capture_stderr = True
+ self.false.run_error = "Erpel {stderr}"
+ with self.assertRaises(CommandExecFailed):
+ self.false.__call__()
+ self.log_tester._check_log(0, "gbp:error: Erpel we have a problem")
+ self.assertEqual(self.false.retcode, 1)
+ self.assertEqual(self.false.stderr, 'we have a problem')
+ self.assertEqual(self.false.stdout, '')
+
+ @patch_popen(stdout=b'', stderr=b'we have a problem', returncode=1)
+ def test_log_quote_format(self, create_mock):
+ self.false = Command('/does/{not}/matter')
+ self.false.capture_stderr = True
+ with self.assertRaises(CommandExecFailed):
+ self.false.__call__()
+ self.log_tester._check_log(0, "gbp:error: '/does/{not}/matter' failed: it exited with 1")
+ self.assertEqual(self.false.retcode, 1)
+ self.assertEqual(self.false.stderr, 'we have a problem')
+ self.assertEqual(self.false.stdout, '')
+
+ @patch_popen(stdout=b'we have a problem', stderr=b'', returncode=1)
+ def test_log_use_stdout_for_err_message(self, create_mock):
+ self.false.capture_stdout = True
+ self.false.run_error = "Erpel {stdout}"
+ with self.assertRaises(CommandExecFailed):
+ self.false.__call__()
+ self.log_tester._check_log(0, "gbp:error: Erpel we have a problem")
+ self.assertEqual(self.false.retcode, 1)
+ self.assertEqual(self.false.stderr, '')
+ self.assertEqual(self.false.stdout, 'we have a problem')
+
+ def test_log_use_err_or_reason_for_error_messge_reason(self):
+ self.false.run_error = "AFAIK {stderr_or_reason}"
+ with self.assertRaises(CommandExecFailed):
+ self.false.__call__()
+ self.log_tester._check_log(0, "gbp:error: AFAIK execution failed: .Errno 2. No such file or directory")
+ self.assertEqual(self.false.retcode, 1)
+
+ @patch_popen(stderr=b'we have a problem', returncode=1)
+ def test_log_use_err_or_reason_for_error_messge_error(self, create_mock):
+ self.false.run_error = "Erpel {stderr_or_reason}"
+ with self.assertRaises(CommandExecFailed):
+ self.false.__call__()
+ self.log_tester._check_log(0, "gbp:error: Erpel we have a problem")
+ self.assertEqual(self.false.retcode, 1)
+
+ @patch_popen(returncode=0)
+ def test_no_log_on_success(self, create_mock):
+ self.false.__call__()
+ self.log_tester._check_log_empty()
+ self.assertEqual(self.false.retcode, 0)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+"""Test L{gbp.command_wrappers.Command}'s tarball unpack"""
+
+from gbp.scripts.buildpackage import (get_pbuilder_dist,
+ setup_pbuilder,
+ GbpError)
+from . testutils import DebianGitTestRepo
+
+from mock import patch
+
+
+class TestGbpBuildpackageDep14(DebianGitTestRepo):
+ class Options(object):
+ pass
+
+ def setUp(self):
+ DebianGitTestRepo.setUp(self)
+ self.add_file('doesnotmatter')
+ self.options = self.Options()
+ self.options.pbuilder_dist = 'DEP14'
+
+ @patch('gbp.deb.get_vendor', return_value='Debian')
+ def test_get_pbuilder_dist_no_dep14(self, patch):
+ self.options.pbuilder_dist = 'notdep14'
+ self.assertEqual(get_pbuilder_dist(self.options, self.repo),
+ self.options.pbuilder_dist)
+
+ @patch('gbp.deb.get_vendor', return_value='Debian')
+ def test_get_pbuilder_dist_dep14_debian_sid(self, patch):
+ branch = 'debian/sid'
+ self.repo.create_branch(branch)
+ self.repo.set_branch(branch)
+ self.assertEqual(get_pbuilder_dist(self.options, self.repo), '')
+ patch.assert_called_once_with()
+
+ @patch('gbp.deb.get_vendor', return_value='Debian')
+ def test_get_pbuilder_dist_dep14_debian_master(self, patch):
+ branch = 'debian/master'
+ self.repo.create_branch(branch)
+ self.repo.set_branch(branch)
+ self.assertEqual(get_pbuilder_dist(self.options, self.repo), '')
+ patch.assert_called_once_with()
+
+ @patch('gbp.deb.get_vendor', return_value='Debian')
+ def test_get_pbuilder_dist_dep14_debian_suite(self, patch):
+ branch = 'debian/squeeze-lts'
+ self.repo.create_branch(branch)
+ self.repo.set_branch(branch)
+ self.assertEqual(get_pbuilder_dist(self.options, self.repo), 'squeeze-lts')
+ patch.assert_called_once_with()
+
+ @patch('gbp.deb.get_vendor', return_value='Debian')
+ def test_get_pbuilder_dist_dep14_debian_native(self, patch):
+ self.assertEqual(get_pbuilder_dist(self.options, self.repo, True), '')
+
+ @patch('gbp.deb.get_vendor', return_value='Debian')
+ def test_get_pbuilder_dist_dep14_vendor_sid(self, patch):
+ branch = 'downstream/sid'
+ self.repo.create_branch(branch)
+ self.repo.set_branch(branch)
+ self.assertEqual(get_pbuilder_dist(self.options, self.repo), 'downstream_sid')
+ patch.assert_called_once_with()
+
+ @patch('gbp.deb.get_vendor', return_value='Debian')
+ def test_get_pbuilder_dist_dep14_vendor_suite(self, patch):
+ branch = 'downstream/mies-lts'
+ self.repo.create_branch(branch)
+ self.repo.set_branch(branch)
+ self.assertEqual(get_pbuilder_dist(self.options, self.repo), 'downstream_mies-lts')
+
+ @patch('gbp.deb.get_vendor', return_value='Debian')
+ def test_get_pbuilder_dist_dep14_no_vendor_sid(self, patch):
+ branch = 'sid'
+ self.repo.create_branch(branch)
+ self.repo.set_branch(branch)
+ self.assertEqual(get_pbuilder_dist(self.options, self.repo), '')
+ patch.assert_called_once_with()
+
+ @patch('gbp.deb.get_vendor', return_value='Debian')
+ def test_get_pbuilder_dist_dep14_no_vendor(self, patch):
+ branch = 'wheezy'
+ self.repo.create_branch(branch)
+ self.repo.set_branch(branch)
+ self.assertEqual(get_pbuilder_dist(self.options, self.repo), 'wheezy')
+ patch.assert_called_once_with()
+
+ def test_get_pbuilder_dist_dep14_too_many_slashes(self):
+ branch = 'too/many/slashes'
+ self.repo.create_branch(branch)
+ self.repo.set_branch(branch)
+ with self.assertRaisesRegexp(GbpError,
+ "DEP14 DIST: Current branch 'too/many/slashes' does not match vendor/suite"):
+ get_pbuilder_dist(self.options, self.repo)
+
+
+class TestGbpBuildpackageSetupPbuilder(DebianGitTestRepo):
+ class Options(object):
+ use_pbuilder = True
+ pbuilder_dist = 'sid'
+ pbuilder_arch = ''
+ use_qemubuilder = False
+ pbuilder_autoconf = True
+ pbuilder_options = ''
+
+ def setUp(self):
+ DebianGitTestRepo.setUp(self)
+ self.options = self.Options()
+
+ def test_setup_pbuilder(self):
+ self.assertEqual(setup_pbuilder(self.options,
+ self.repo,
+ True),
+ ({'GBP_PBUILDER_DIST': 'sid', 'DIST': 'sid'},
+ {'GBP_PBUILDER_DIST': 'sid'}))
+
+ def test_setup_pbuilder_arch(self):
+ self.options.pbuilder_arch = 'arm64'
+ self.assertEqual(setup_pbuilder(self.options,
+ self.repo,
+ True),
+ ({'ARCH': 'arm64',
+ 'DIST': 'sid',
+ 'GBP_PBUILDER_ARCH': 'arm64',
+ 'GBP_PBUILDER_DIST': 'sid'},
+ {'GBP_PBUILDER_ARCH': 'arm64',
+ 'GBP_PBUILDER_DIST': 'sid'}))
--- /dev/null
+# (C) 2015 Jonathan Toppins <jtoppins@cumulusnetworks.com>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+"""Test gbp.dch.extract_bts_cmds()"""
+
+import unittest
+
+from gbp.dch import extract_bts_cmds
+
+
+class OptionsStub:
+ def __init__(self):
+ self.meta_closes = "Closes|LP"
+ self.meta_closes_bugnum = r'(?:bug|issue)?\#?\s?\d+'
+
+
+class TestExtractBTSCmds(unittest.TestCase):
+ def test_debian_commands(self):
+ """Test default BTS command extraction that is applicable to Debian"""
+ options = OptionsStub()
+ lines = """This is a test commit
+
+Closes: bug#12345
+Closes: 456
+"""
+ bugs, dummy = extract_bts_cmds(lines.split('\n'), options)
+ self.assertEquals(bugs, {'Closes': ['bug#12345', '456']})
+
+ def test_nondebian_commands(self):
+ """Test non-default BTS commands. We use the example given in the
+ documentation manpages."""
+ options = OptionsStub()
+ options.meta_closes_bugnum = r'(?:bug)?\s*ex-\d+'
+ lines = """This is a test commit
+some more lines...
+
+Closes: bug EX-12345
+Closes: ex-01273
+Closes: bug ex-1ab
+Closes: EX--12345
+"""
+ bugs, dummy = extract_bts_cmds(lines.split('\n'), options)
+ self.assertEquals(bugs, {'Closes': ['bug EX-12345', 'ex-01273',
+ 'bug ex-1']})
--- /dev/null
+# vim: set fileencoding=utf-8 :
+"""Test L{gbp.scripts.import_orig}"""
+
+import os
+import unittest
+
+from collections import namedtuple
+
+from gbp.scripts.import_orig import (debian_branch_merge_by_replace,
+ GbpError,
+ is_30_quilt,
+ prepare_pristine_tar)
+
+from gbp.scripts.common.import_orig import download_orig
+from . testutils import DebianGitTestRepo
+
+import shutil
+import tempfile
+
+
+@unittest.skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled")
+class TestImportOrigDownload(DebianGitTestRepo):
+ HOST = 'git.sigxcpu.org'
+
+ def setUp(self):
+ DebianGitTestRepo.setUp(self)
+ os.chdir(self.repo.path)
+
+ def test_404_download(self):
+ with self.assertRaisesRegexp(GbpError, "404 Client Error: Not Found for url"):
+ download_orig("https://{host}/does_not_exist".format(host=self.HOST))
+
+ def test_200_download(self):
+ pkg = 'hello-debhelper_2.6.orig.tar.gz'
+ url = "https://{host}/cgit/gbp/deb-testdata/tree/dsc-3.0/{pkg}".format(host=self.HOST,
+ pkg=pkg)
+ self.assertEqual(download_orig(url).path, '../%s' % pkg)
+
+
+class TestIs30Quilt(DebianGitTestRepo):
+ Options = namedtuple('Options', 'debian_branch')
+ format_file = 'debian/source/format'
+
+ def setUp(self):
+ DebianGitTestRepo.setUp(self)
+ os.chdir(self.repo.path)
+ os.makedirs('debian/source/')
+
+ def test_30_quilt(self):
+ options = self.Options(debian_branch='master')
+ with open(self.format_file, 'w') as f:
+ f.write('3.0 (quilt)\n')
+ self.repo.add_files([self.format_file])
+ self.repo.commit_all("Add %s" % self.format_file)
+ self.assertEquals(self.repo.branch, options.debian_branch)
+ self.assertTrue(is_30_quilt(self.repo, options))
+
+ def test_no_format(self):
+ options = self.Options(debian_branch='master')
+ self.assertFalse(os.path.exists(self.format_file))
+ self.assertFalse(is_30_quilt(self.repo, options))
+
+ def test_no_quilt(self):
+ options = self.Options(debian_branch='master')
+ with open(self.format_file, 'w') as f:
+ f.write('3.0 (nonexistent)')
+ self.assertFalse(is_30_quilt(self.repo, options))
+
+ def test_30_quilt_empty_repo(self):
+ options = self.Options(debian_branch='master')
+ self.assertFalse(is_30_quilt(self.repo, options))
+
+
+class TestMergeModeReplace(DebianGitTestRepo):
+ debian_branch = 'master'
+
+ def setUp(self):
+ DebianGitTestRepo.setUp(self)
+ os.chdir(self.repo.path)
+
+ def testDebianDir(self):
+ """Test that dropping upstream's debian/ workd (#881750)"""
+ self.add_file("debian/control")
+ self.repo.create_branch("upstream")
+ self.repo.set_branch("upstream")
+ self.add_file("upstream_file")
+ self.add_file("debian/changelog")
+ self.repo.set_branch("master")
+ self.repo.create_tag('upstream/1.0', "Upstream 1.0", "upstream")
+ debian_branch_merge_by_replace(self.repo, "upstream/1.0", "1.0", self)
+ self.assertTrue(os.path.exists("debian/control"))
+ # Upstream files must end up on debian branch…
+ self.assertTrue(os.path.exists("upstream_file"))
+ # … but upsream's debian dir must not
+ self.assertFalse(os.path.exists("debian/changelog"))
+
+
+class TestGbpBuildpackagePreparePristineTar(unittest.TestCase):
+ def setUp(self):
+ self._cwd = os.getcwd()
+ self._tmpdir = os.path.abspath(tempfile.mkdtemp(prefix='gbp_', dir='.'))
+ # we need to change into a temp subdir since the link is
+ # create in '..'
+ d = os.path.join(self._tmpdir, 'd')
+ os.mkdir(d)
+ os.chdir(d)
+
+ def tearDown(self):
+ if not os.getenv("GBP_TESTS_NOCLEAN"):
+ shutil.rmtree(self._tmpdir)
+ os.chdir(self._cwd)
+
+ def test_dir(self):
+ ret = prepare_pristine_tar(self._tmpdir, 'foo', '1.0')
+ self.assertEquals(ret, (None, False))
+
+ def test_tar(self):
+ archive = '{}/foo.tgz'.format(self._tmpdir)
+ ret = prepare_pristine_tar(archive, 'foo', '1.0')
+ self.assertEquals(ret, ('../foo_1.0.orig.tar.gz', True))
+ self.assertTrue(os.path.islink(
+ os.path.join(self._tmpdir, 'foo_1.0.orig.tar.gz')))
+
+ def test_signature(self):
+ archive = '{}/foo.tgz'.format(self._tmpdir)
+ signature = '{}.asc'.format(archive)
+ with open(signature, 'w') as f:
+ f.write('')
+ ret = prepare_pristine_tar(archive, 'foo', '1.0')
+ self.assertEquals(ret, ('../foo_1.0.orig.tar.gz', True))
+ self.assertTrue(os.path.islink(
+ os.path.join(self._tmpdir, 'foo_1.0.orig.tar.gz.asc')))
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""Check if we fail correcdtly on broken gbp.conf"""
+
+from . import context
+
+from . testutils.data import TestCaseWithData
+from . testutils.gbplogtester import GbpLogTester
+
+import os
+import unittest
+
+
+class TestBrokenConfig(TestCaseWithData, GbpLogTester):
+ """Test that broken config gives a sensible error for all commands"""
+
+ cmds = ['buildpackage',
+ 'clone',
+ 'config',
+ 'create_remote_repo',
+ 'dch',
+ 'import_orig',
+ 'import_dsc',
+ 'pull',
+ 'pq',
+ 'import_srpm',
+ 'buildpackage_rpm',
+ 'pq_rpm',
+ 'rpm_ch']
+
+ def __init__(self, methodName='runTest'):
+ unittest.TestCase.__init__(self, methodName)
+ GbpLogTester.__init__(self)
+
+ def setUp(self):
+ tmpdir = str(context.new_tmpdir('bar'))
+ confname = os.path.join(tmpdir, 'gbp.conf')
+ with open(confname, 'w') as f:
+ f.write("this is a broken config\n")
+ os.environ['GBP_CONF_FILES'] = confname
+ self._capture_log(True)
+
+ def tearDown(self):
+ del os.environ['GBP_CONF_FILES']
+
+ @TestCaseWithData.feed(cmds)
+ def testBrokenConf(self, cmd):
+ module = 'gbp.scripts.%s' % cmd
+ try:
+ m = __import__(module, globals(), locals(), ['main'], 0)
+ ret = m.main([cmd, '--help'])
+ self.assertEquals(ret, 3)
+ except Exception as e:
+ self.assertTrue(False, "Caught '%s'" % e)
+ self._check_log(-1, "See 'man gbp.conf' for the format.")
+ self._clear_log()
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2015 Jonathan Toppins <jtoppins@cumulusnetworks.com>
+# (C) 2016 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+"""Test gbp.dch.extract_thanks_info()"""
+
+import unittest
+
+from gbp.dch import extract_thanks_info
+
+
+class OptionsStub:
+ def __init__(self):
+ self.meta_closes = "Closes|LP"
+ self.meta_closes_bugnum = r'(?:bug|issue)?\#?\s?\d+'
+
+
+class TestExtractThanks(unittest.TestCase):
+ def test_debian_commands(self):
+ """Test default thanks extraction"""
+ lines = """
+thAnks: a lot
+Thanks: everyone"""
+
+ lines += " \n" # Add some trailing whitespace
+ bugs, dummy = extract_thanks_info(lines.split('\n'), None)
+ self.assertEquals(bugs, ['a lot', 'everyone'])
--- /dev/null
+# vim: set fileencoding=utf-8 :
+# (C) 2016 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+"""Test the L{gbp} create_remote_repo command"""
+
+import os
+import unittest
+import gbp.scripts.create_remote_repo as create_remote_repo
+
+
+class TestGbpCreateRemoteRepoCommand(unittest.TestCase):
+ def setUp(self):
+ self.conffiles_save = os.environ.get('GBP_CONF_FILES')
+
+ def tearDown(self):
+ if self.conffiles_save:
+ os.environ['GBP_CONF_FILES'] = self.conffiles_save
+
+ def test_no_config_templates(self):
+ self.confname = 'tests/data/gbp_nonexistent.conf'
+ self.assertFalse(os.path.exists(self.confname))
+ os.environ['GBP_CONF_FILES'] = self.confname
+
+ _, _, sections = create_remote_repo.parse_args(['create-remote-repo'])
+ self.assertEqual(create_remote_repo.get_config_names(sections),
+ [])
+
+ def test_list_config_templates(self):
+ self.confname = 'tests/data/gbp_create_remote_repo.conf'
+ self.assertTrue(os.path.exists(self.confname))
+ os.environ['GBP_CONF_FILES'] = self.confname
+
+ _, _, sections = create_remote_repo.parse_args(['create-remote-repo'])
+ self.assertEqual(create_remote_repo.get_config_names(sections),
+ ['config1', 'config2'])
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+import os
+
+from . testutils import DebianGitTestRepo
+from gbp.git.repository import GitRepositoryError
+
+
+class TestGitRepositoryCommitDir(DebianGitTestRepo):
+ def setUp(self):
+ DebianGitTestRepo.setUp(self)
+ self.content = os.path.join(str(self.tmpdir), 'new')
+ os.mkdir(self.content)
+ with open(os.path.join(self.content, 'file1'), 'w') as f:
+ f.write('content1')
+
+ def test_simple(self):
+ self.repo.commit_dir(self.content,
+ 'new content',
+ 'master',
+ create_missing_branch=True)
+ self.assertEquals(self.repo.show('master:file1'), b'content1')
+
+ def test_long_reflog(self):
+ """Make sure we fail on onverly long msg resulting in an
+ overly long reflog enry"""
+ with self.assertRaises(GitRepositoryError):
+ self.repo.commit_dir(self.content,
+ 'foo' * 100000,
+ 'master',
+ create_missing_branch=True)
+
+ def test_long_msg_854333(self):
+ """Make sure we shorten the reflog entry properly"""
+ self.repo.commit_dir(self.content,
+ 'foo\n' * 100000,
+ 'master',
+ create_missing_branch=True)
+ self.assertEquals(self.repo.show('master:file1'), b'content1')
+ out, dummy, ret = self.repo._git_inout('reflog', [])
+ self.assertEquals(ret, 0)
+ self.assertIn(b'HEAD@{0}: gbp: foo\n', out)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+from gbp.scripts.clone import vcs_git_url
+
+import unittest
+from mock import patch
+
+from . testutils import skip_without_cmd
+
+
+class TestGbpClone(unittest.TestCase):
+ show_src = """
+Version: 0.6.22
+Standards-Version: 3.9.4
+Vcs-Git: git://honk.sigxcpu.org/git/git-buildpackage.git
+
+Version: 0.8.14
+Standards-Version: 3.9.8
+Vcs-Git: https://git.sigxcpu.org/cgit/git-buildpackage/ -b foo
+
+Version: 0.8.12.2
+Standards-Version: 3.9.8
+Vcs-Git: https://git.sigxcpu.org/cgit/git-buildpackage/
+
+Version: 0.6.0~git20120601
+Standards-Version: 3.9.3
+Vcs-Git: git://honk.sigxcpu.org/git/git-buildpackage.git
+
+"""
+
+ @skip_without_cmd('dpkg')
+ @patch('gbp.scripts.clone.apt_showsrc', return_value=show_src)
+ def test_vcs_git_url(self, patch):
+ self.assertEqual(vcs_git_url('git-buildpackage'),
+ 'https://git.sigxcpu.org/cgit/git-buildpackage/')
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""
+Test L{gbp.deb.changelog.Changelog}
+
+Test things here that don't fit nicely into the doctests that
+also make up the API documentation.
+"""
+
+from . import context # noqa: 401
+from . testutils import skip_without_cmd
+import os
+import unittest
+
+from gbp.deb.changelog import ChangeLog
+from gbp.command_wrappers import CommandExecFailed
+
+
+class TestQuoting(unittest.TestCase):
+ def test_comma(self):
+ """Test we properly parse maitainers with comma #737623"""
+ changes = """git-buildpackage (0.9.2) unstable; urgency=low
+
+ * List of changes
+
+ -- Guido Günther, aftercomma <agx@sigxcpu.org> Sun, 12 Nov 2017 19:00:00 +0200
+"""
+ cl = ChangeLog(changes)
+ self.assertEquals(cl.author, 'Guido Günther, aftercomma')
+ self.assertEquals(cl.email, 'agx@sigxcpu.org')
+
+
+class TestEncoding(unittest.TestCase):
+ def test_nul(self):
+ """Test we remove NUL characters from strings when parsing (#981340)"""
+ changes = """git-buildpackage (0.9.2) unstable; urgency=low
+
+ * List of ch\0nges
+
+ -- User N\0me <agx@sigxcpu.org> Sun, 12 Nov 2017 19:00:00 +0200
+"""
+ cl = ChangeLog(changes)
+ self.assertEquals(cl.author, 'User Nme')
+ self.assertEquals(cl.email, 'agx@sigxcpu.org')
+ self.assertEquals('\0' in cl.get_changes(), False)
+
+
+@skip_without_cmd('debchange')
+class Test(unittest.TestCase):
+ def setUp(self):
+ self.tmpdir = context.new_tmpdir(__name__)
+ context.chdir(self.tmpdir)
+ os.mkdir('debian/')
+
+ def tearDown(self):
+ context.teardown()
+
+ def test_changelog_creation_full(self):
+ cp = ChangeLog.create('package', '1.0')
+ self.assertEquals(cp.name, 'package')
+ self.assertEquals(cp.version, '1.0')
+
+ def test_changelog_creation_version(self):
+ cp = ChangeLog.create(version='1.0')
+ self.assertEquals(cp.name, 'PACKAGE')
+ self.assertEquals(cp.version, '1.0')
+
+ def test_changelog_creation_package(self):
+ cp = ChangeLog.create(package='package')
+ self.assertEquals(cp.name, 'package')
+ self.assertEquals(cp.version, 'unknown')
+
+ def test_changelog_missing_dir(self):
+ os.rmdir('debian/')
+ with self.assertRaisesRegexp(CommandExecFailed, "Cannot find debian directory"):
+ ChangeLog.create('package', '1.0')
+
+ def test_changelog_exists(self):
+ with open('debian/changelog', 'w') as f:
+ f.write('')
+ with self.assertRaisesRegexp(CommandExecFailed, "File debian/changelog already exists"):
+ ChangeLog.create('package', '1.0')
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2014-2015 Intel Corporation <markus.lehtonen@linux.intel.com>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+"""Test RPM changelog classes and parsing"""
+
+from datetime import datetime
+from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
+from tempfile import NamedTemporaryFile
+
+from gbp.rpm.changelog import _ChangelogHeader, _ChangelogEntry
+from gbp.rpm.changelog import _ChangelogSection, Changelog
+from gbp.rpm.changelog import ChangelogParser, ChangelogError
+from gbp.rpm.policy import RpmPkgPolicy
+
+
+class TestChangelogHeader(object):
+ """Test the _ChangelogHeader class"""
+
+ def test_str_format(self):
+ """Basic test for header"""
+ time = datetime(2014, 1, 29, 12, 13, 14)
+ header = _ChangelogHeader(RpmPkgPolicy, time, name="John Doe",
+ email="user@host.com", revision="1")
+ eq_(str(header), "* Wed Jan 29 2014 John Doe <user@host.com> 1\n")
+
+ def test_str_format_err(self):
+ """Test missing properties"""
+ time = datetime(2014, 1, 29, 12, 13, 14)
+ header = _ChangelogHeader(RpmPkgPolicy, time, name="John", revision="1")
+ with assert_raises(ChangelogError):
+ str(header)
+
+ def test_container(self):
+ """Test the container methods of the class"""
+ header = _ChangelogHeader(RpmPkgPolicy, datetime(2014, 1, 1), name="N",
+ revision="1")
+ # Test __getitem__()
+ eq_(header['name'], "N")
+ eq_(header['email'], None)
+ # Test __contains__()
+ ok_('name' in header)
+ ok_('foo' not in header)
+
+
+class TestChangelogEntry(object):
+ """Test the _ChangelogEntry class"""
+
+ def test_str_format(self):
+ """Basic test"""
+ entry = _ChangelogEntry(RpmPkgPolicy, author="John Doe",
+ text="- foo\n bar")
+ eq_(str(entry), "- foo\n bar\n")
+
+
+class TestChangelogSection(object):
+ """Test the _ChangelogSection class"""
+
+ def setup(self):
+ """Initialize test"""
+ time = datetime(2014, 1, 29, 12, 13, 14)
+ self.default_sect = _ChangelogSection(RpmPkgPolicy, time, name="J. D.",
+ email="u@h", revision="1")
+ entry = _ChangelogEntry(RpmPkgPolicy, "J. D.", "- my change")
+ self.default_sect.entries = [entry]
+
+ def test_str_format(self):
+ """Basic test"""
+ section = self.default_sect
+ eq_(str(section), "* Wed Jan 29 2014 J. D. <u@h> 1\n- my change\n\n")
+
+ def test_append_entry(self):
+ """Test add_entry() method"""
+ section = self.default_sect
+ entry = _ChangelogEntry(RpmPkgPolicy, author="",
+ text="- another\n change")
+ new_entry = section.append_entry(entry)
+ eq_(str(section), "* Wed Jan 29 2014 J. D. <u@h> 1\n- my change\n"
+ "- another\n change\n\n")
+ eq_(new_entry, section.entries[-1])
+
+ def test_set_header(self):
+ """Test set_header() method"""
+ section = self.default_sect
+ time = datetime(2014, 1, 30)
+ section.set_header(time=time, name="Jane", email="u@h", revision="1.1")
+ eq_(str(section), "* Thu Jan 30 2014 Jane <u@h> 1.1\n- my change\n\n")
+
+
+class TestChangelogParser(object):
+ """Test the default changelog parser"""
+
+ cl_default_style = """\
+* Wed Jan 29 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
+- Version bump
+- Drop foo.patch
+
+* Tue Jan 28 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.2
+- Update to 0.2
+
+* Mon Jan 27 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.1
+- Initial version
+"""
+ cl_with_authors = """\
+* Wed Jan 29 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
+[Markus Lehtonen]
+- Version bump
+[John Doe]
+- Bug fix
+"""
+ # Invalid timestamp / name
+ cl_broken_header_1 = """\
+* Wed Jan 29 2014Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
+- Version bump
+"""
+ # Whitespace before the asterisk in the header
+ cl_broken_header_2 = """\
+ * Wed Jan 29 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
+- Version bump
+"""
+ # Invalid timestamp
+ cl_broken_header_3 = """\
+* Wed Jan 32 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
+- Version bump
+"""
+ # Missing email
+ cl_broken_header_4 = """\
+* Wed Jan 29 2014 Markus Lehtonen 0.3-1
+- Version bump
+"""
+ # Garbage before section header
+ cl_broken_header_5 = """\
+---garbage---
+* Wed Jan 29 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
+- Version bump
+"""
+
+ parser = ChangelogParser(RpmPkgPolicy)
+
+ def test_parse_changelog(self):
+ """Basic tests for successful parsing"""
+ # Raw parsing of changelog
+ changelog = self.parser.raw_parse_string(self.cl_default_style)
+ eq_(len(changelog.sections), 3)
+
+ # Check that re-creating the changelog doesn't mangle it
+ eq_(str(changelog), self.cl_default_style)
+
+ # Parse and check section
+ section = self.parser.parse_section(changelog.sections[0])
+
+ eq_(section.header['time'], datetime(2014, 1, 29))
+ eq_(section.header['name'], "Markus Lehtonen")
+ eq_(section.header['email'], "markus.lehtonen@linux.intel.com")
+ eq_(section.header['revision'], "0.3-1")
+
+ # Check that re-creating section doesn't mangle it
+ eq_(str(section), changelog.sections[0])
+
+ def test_parse_authors(self):
+ """Test parsing of authors from changelog entries"""
+ section = self.parser.parse_section(self.cl_with_authors)
+ eq_(section.entries[0].author, "Markus Lehtonen")
+ eq_(section.entries[1].author, "John Doe")
+
+ def test_parse_changelog_file(self):
+ """Basic tests for parsing a file"""
+ # Create file and parse it
+ tmpfile = NamedTemporaryFile(mode='w')
+ tmpfile.write(self.cl_default_style)
+ tmpfile.file.flush()
+ changelog = self.parser.raw_parse_file(tmpfile.name)
+ # Check parsing results
+ eq_(len(changelog.sections), 3)
+ eq_(str(changelog), self.cl_default_style)
+ # Cleanup
+ tmpfile.close()
+
+ def test_parse_section_fail(self):
+ """Basic tests for failures of changelog section parsing"""
+ with assert_raises(ChangelogError):
+ self.parser.parse_section(self.cl_broken_header_1)
+
+ with assert_raises(ChangelogError):
+ self.parser.parse_section(self.cl_broken_header_2)
+
+ with assert_raises(ChangelogError):
+ self.parser.parse_section(self.cl_broken_header_3)
+
+ with assert_raises(ChangelogError):
+ self.parser.parse_section(self.cl_broken_header_4)
+
+ def test_parse_changelog_fail(self):
+ """Basic tests for changelog parsing failures"""
+ with assert_raises(ChangelogError):
+ self.parser.raw_parse_string(self.cl_broken_header_5)
+
+
+class TestChangelog(object):
+ """Unit tests for the Changelog class"""
+
+ def basic_test(self):
+ """Test basic initialization"""
+ changelog = Changelog(RpmPkgPolicy)
+ eq_(str(changelog), "")
+
+ def test_add_section(self):
+ """Test the add_section() method"""
+ changelog = Changelog(RpmPkgPolicy)
+ time = datetime(2014, 1, 30)
+ new_section = changelog.add_section(time=time, name="Jane Doe",
+ email="j@doe.com", revision="1.2")
+ eq_(str(changelog), "* Thu Jan 30 2014 Jane Doe <j@doe.com> 1.2\n\n")
+ eq_(new_section, changelog.sections[0])
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""Test L{gbp.deb}"""
+
+from . import context # noqa: 401
+from . import testutils
+
+import unittest
+
+from gbp.deb.uscan import Uscan
+
+
+class TestUscan(unittest.TestCase):
+ """Test L{gbp.deb.uscan}"""
+
+ uscan_ok = b"""<dehs>
+uscan: Newest version of virt-what on remote site is 1.18, local version is 1.15
+uscan: => Newer package available from
+ https://people.redhat.com/~rjones/virt-what/files/virt-what-1.18.tar.gz
+gpgv: Signature made Mo 31 Jul 2017 11:36:08 ADT
+gpgv: using RSA key 91738F73E1B768A0
+gpgv: Good signature from "Richard W.M. Jones <rjones@redhat.com>"
+gpgv: aka "Richard W.M. Jones <rich@annexia.org>"
+<package>virt-what</package>
+<debian-uversion>1.15</debian-uversion>
+<debian-mangled-uversion>1.15</debian-mangled-uversion>
+<upstream-version>1.18</upstream-version>
+<upstream-url>https://people.redhat.com/~rjones/virt-what/files/virt-what-1.18.tar.gz</upstream-url>
+<status>newer package available</status>
+<target>virt-what_1.18.orig.tar.gz</target>
+<target-path>../virt-what_1.18.orig.tar.gz</target-path>
+<messages>Not downloading, using existing file: virt-what-1.18.tar.gz
+</messages>
+<messages>Leaving ../virt-what_1.18.orig.tar.gz where it is.
+</messages>
+</dehs>"""
+
+ @testutils.patch_popen(stdout=uscan_ok, stderr=b'', returncode=0)
+ def test_uscan(self, uscan_mock):
+ """Test parsing a valid uscan file"""
+ uscan = Uscan()
+ self.assertTrue(uscan.scan())
+ self.assertFalse(uscan.uptodate)
+ self.assertEquals(uscan.tarball, '../virt-what_1.18.orig.tar.gz')
# vim: set fileencoding=utf-8 :
#
-# (C) 2009, 2010,2011, 2012 Guido Guenther <agx@sigxcpu.org>
+# (C) 2009, 2010,2011, 2012 Guido Günther <agx@sigxcpu.org>
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Unit tests for git-buildpackage"""
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 2013 Guido Günther <agx@sigxcpu.org>
+# 2013,2017 Guido Günther <agx@sigxcpu.org>
#
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""
Module for testing individual command line tools of the git-buildpackage suite
"""
+import hashlib
import os
-import re
import shutil
import tempfile
-from io import StringIO
+import unittest
+from unittest import skipUnless
from nose import SkipTest
from nose.tools import eq_, ok_ # pylint: disable=E0611
+from .. testutils import GbpLogTester
+
+from gbp.git import GitRepository, GitRepositoryError
+
+
+__all__ = ['ComponentTestGitRepository', 'ComponentTestBase', 'GbpLogTester', 'skipUnless']
-import gbp.log
-from gbp.git import GitRepository, GitRepositoryError
class ComponentTestGitRepository(GitRepository):
"""Git repository class for component tests"""
raise SkipTest("Skipping '%s', testdata directory not initialized. "
"Consider doing 'git submodule update'" % __name__)
+ def ls_tree(self, treeish):
+ """List contents (blobs) in a git treeish"""
+ objs = self.list_tree(treeish, True)
+ blobs = [obj[3] for obj in objs if obj[1] == 'blob']
+ return set(blobs)
+
+ def get_head_author_subject(self):
+ out, err, ret = self._git_inout('format-patch', ['-1', '--stdout', '--subject-prefix='],
+ capture_stderr=True)
+ if ret:
+ raise GitRepositoryError("Cannot get head author/subject: %s" %
+ err.strip())
+
+ output = out.decode('utf-8')
+ for line in output.split('\n'):
+ line = line.strip()
+ if not line:
+ # end of headers
+ break
+ if line.startswith('From:'):
+ author = line.replace('From:', '').strip()
+ elif line.startswith('Subject:'):
+ subject = line.replace('Subject:', '').strip()
+ return author, subject
+
-class ComponentTestBase(object):
+class ComponentTestBase(unittest.TestCase, GbpLogTester):
"""Base class for testing cmdline tools of git-buildpackage"""
@classmethod
- def setup_class(cls):
+ def setUpClass(cls):
"""Test class case setup"""
# Don't let git see that we're (possibly) under a git directory
cls.orig_env = os.environ.copy()
# Create a top-level tmpdir for the test
cls._tmproot = tempfile.mkdtemp(prefix='gbp_%s_' % cls.__name__,
dir='.')
+ cls._tmproot = os.path.abspath(cls._tmproot)
# Prevent local config files from messing up the tests
- os.environ['GBP_CONF_FILES'] = '%(top_dir)s/.gbp.conf:' \
- '%(top_dir)s/debian/gbp.conf:%(git_dir)s/gbp.conf'
- # Initialize gbp logging module
- gbp.log.initialize()
+ os.environ['GBP_CONF_FILES'] = ':'.join(['%(top_dir)s/.gbp.conf',
+ '%(top_dir)s/debian/gbp.conf',
+ '%(git_dir)s/gbp.conf'])
@classmethod
- def teardown_class(cls):
+ def tearDownClass(cls):
"""Test class case teardown"""
# Return original environment
os.environ.clear()
if not os.getenv("GBP_TESTS_NOCLEAN"):
shutil.rmtree(cls._tmproot)
- def __init__(self):
+ def __init__(self, methodName='runTest'):
"""Object initialization"""
self._orig_dir = None
self._tmpdir = None
- self._log = None
- self._loghandler = None
+ unittest.TestCase.__init__(self, methodName)
+ GbpLogTester.__init__(self)
- def setup(self):
+ def setUp(self):
"""Test case setup"""
# Change to a temporary directory
self._orig_dir = os.getcwd()
- self._tmpdir = tempfile.mkdtemp(prefix='gbp_%s_' % __name__,
+ self._tmpdir = tempfile.mkdtemp(prefix='tmp_%s_' % self._testMethodName,
dir=self._tmproot)
os.chdir(self._tmpdir)
self._capture_log(True)
- def teardown(self):
+ def tearDown(self):
"""Test case teardown"""
# Restore original working dir
os.chdir(self._orig_dir)
extra = set(filelist) - set(reference)
missing = set(reference) - set(filelist)
assert_msg = "Unexpected files: %s, Missing files: %s" % \
- (list(extra), list(missing))
+ (list(extra), list(missing))
assert not extra and not missing, assert_msg
- @staticmethod
- def ls_tree(repo, treeish):
- """List contents (blobs) in a git treeish"""
- objs = repo.list_tree(treeish, True)
- blobs = [obj[3] for obj in objs if obj[1] == 'blob']
- return set(blobs)
+ @classmethod
+ def check_tags(cls, repo, tags):
+ local_tags = repo.tags
+ assert_msg = "Tags: expected %s, found %s" % (tags,
+ local_tags)
+ eq_(set(local_tags), set(tags), assert_msg)
@classmethod
def _check_repo_state(cls, repo, current_branch, branches, files=None,
- dirs=None):
- """Check that repository is clean and given branches exist"""
+ dirs=None, tags=None, clean=True):
+ """
+ Check that repository is clean and given branches, tags, files
+ and dirs exist
+ """
branch = repo.branch
eq_(branch, current_branch)
ok_(repo.is_clean())
assert_msg = "Branches: expected %s, found %s" % (branches,
local_branches)
eq_(set(local_branches), set(branches), assert_msg)
+
if files is not None or dirs is not None:
# Get files of the working copy recursively
local_f = set()
cls.check_files(files, local_f)
if dirs is not None:
cls.check_files(dirs, local_d)
+ if tags is not None:
+ cls.check_tags(repo, tags)
+ if clean:
+ clean, files = repo.is_clean()
+ ok_(clean, "Repo has uncommitted files %s" % files)
- def _capture_log(self, capture=True):
- """ Capture log"""
- if capture and self._log is None:
- self._log = StringIO()
- self._loghandler = gbp.log.GbpStreamHandler(self._log, False)
- self._loghandler.addFilter(gbp.log.GbpFilter([gbp.log.WARNING,
- gbp.log.ERROR]))
- for hdl in gbp.log.LOGGER.handlers:
- gbp.log.LOGGER.removeHandler(hdl)
- gbp.log.LOGGER.addHandler(self._loghandler)
- elif self._log is not None:
- gbp.log.LOGGER.removeHandler(self._loghandler)
- self._loghandler.close()
- self._loghandler = None
- self._log.close()
- self._log = None
-
- def _get_log(self):
- """Get the captured log output"""
- self._log.seek(0)
- return self._log.readlines()
-
- def _check_log(self, linenum, regex):
- """Check that the specified line on log matches expectations"""
- if self._log is None:
- raise Exception("BUG in unittests: no log captured!")
- output = self._get_log()[linenum].strip()
- ok_(re.match(regex, output),
- "Log entry '%s' doesn't match '%s'" % (output, regex))
-
- def _clear_log(self):
- """Clear the mock strerr"""
- if self._log is not None:
- self._log.seek(0)
- self._log.truncate()
+ @classmethod
+ def rem_refs(cls, repo, refs):
+ """Remember the SHA1 of the given refs"""
+ rem = []
+ for name in refs:
+ rem.append((name, repo.rev_parse(name)))
+ return rem
+
+ @classmethod
+ def check_refs(cls, repo, rem):
+ """
+ Check that the heads given n (head, sha1) tuples are
+ still pointing to the given sha1
+ """
+ for (h, s) in rem:
+ n = repo.rev_parse(h)
+ ok_(n == s, "Head '%s' points to %s' instead of '%s'" % (h, n, s))
+
+ @staticmethod
+ def hash_file(filename):
+ h = hashlib.md5()
+ with open(filename, 'rb') as f:
+ buf = f.read()
+ h.update(buf)
+ return h.hexdigest()
+
+ @staticmethod
+ def check_hook_vars(name, expected):
+ """
+ Check that a hook had the given vars in
+ it's environment.
+ This assumes the hook was set too
+ printenv > hookname.out
+ """
+ with open('%s.out' % name, encoding='utf-8') as f:
+ parsed = dict([line[:-1].split('=', 1) for line in f.readlines() if line.startswith("GBP_")])
+
+ for var in expected:
+ if len(var) == 2:
+ k, v = var
+ else:
+ k, v = var, None
+ ok_(k in parsed, "%s not found in %s" % (k, parsed))
+ if v is not None:
+ ok_(v == parsed[k],
+ "Got %s not expected value %s for %s" % (parsed[k], v, k))
+
+ @staticmethod
+ def add_file(repo, name, content=None):
+ with open(name, 'w') as f:
+ f.write(' ' or content)
+ repo.add_files(name)
+ repo.commit_files(name, 'New file %s' % name)
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
import os
DEB_TEST_SUBMODULE = os.path.join('tests', 'component', 'deb', 'data')
DEB_TEST_DATA_DIR = os.path.abspath(DEB_TEST_SUBMODULE)
+DEB_TEST_DOWNLOAD_URL = 'https://git.sigxcpu.org/cgit/gbp/deb-testdata/plain/'
+
def setup():
"""Test Module setup"""
ComponentTestGitRepository.check_testdata(DEB_TEST_SUBMODULE)
-
-
-
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from functools import wraps
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository)
+from tests.component.deb import DEB_TEST_DATA_DIR
+
+from nose.tools import eq_, ok_
+
+from gbp.command_wrappers import UnpackTarArchive
+from gbp.git import GitRepository
+from gbp.deb.dscfile import DscFile
+from gbp.scripts.import_dsc import main as import_dsc
+
+DEFAULT_NATIVE = os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-native',
+ 'git-buildpackage_%s.dsc' % '0.4.14')
+
+DEFAULT_QUILT30 = os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-3.0',
+ 'hello-debhelper_%s.dsc' % '2.8-1')
+
+DEFAULT_ADDITIONAL_TAR = os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-3.0-additional-tarballs',
+ 'hello-debhelper_%s.dsc' % '2.8-1')
+
+DEFAULT_OVERLAY = os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-3.0-additional-tarballs',
+ 'hello-debhelper_%s.debian.tar.gz' % '2.8-1')
+
+
+class RepoFixtures(object):
+ @classmethod
+ def native(cls, dsc=DEFAULT_NATIVE, opts=None):
+ """Decorator to be used as Debian native test fixture"""
+ def wrapper(fn):
+ @wraps(fn)
+ def _native_repo(*args):
+ repo = cls.import_native(dsc, opts)
+ return fn(*args, repo=repo)
+ return _native_repo
+ return wrapper
+
+ @classmethod
+ def quilt30(cls, dsc=DEFAULT_QUILT30, opts=None):
+ """Decorator to be used as 3.0 (quilt) test fixture"""
+ def wrapper(fn):
+ @wraps(fn)
+ def _quilt30_repo(*args):
+ repo = cls.import_quilt30(dsc, opts)
+ return fn(*args, repo=repo)
+ return _quilt30_repo
+ return wrapper
+
+ @classmethod
+ def quilt30_additional_tarball(cls, dsc=DEFAULT_ADDITIONAL_TAR, opts=None):
+ """Decorator to be used as 3.0 (quilt) with additional tarball test fixture"""
+ def wrapper(fn):
+ @wraps(fn)
+ def _quilt30_additional_tar_repo(*args):
+ repo = cls.import_quilt30_additional_tarball(dsc, opts)
+ return fn(*args, repo=repo)
+ return _quilt30_additional_tar_repo
+ return wrapper
+
+ @classmethod
+ def overlay(cls, debian=DEFAULT_OVERLAY, opts=None):
+ """Decorator to be used as overay mode test fixture"""
+ def wrapper(fn):
+ @wraps(fn)
+ def _overlay_mode_repo(*args):
+ repo = cls.import_debian_tarball(debian, opts)
+ return fn(*args, repo=repo)
+ return _overlay_mode_repo
+ return wrapper
+
+ @classmethod
+ def _import_one(cls, dsc, opts):
+ opts = opts or []
+ assert import_dsc(['arg0'] + opts + [dsc]) == 0
+ parsed = DscFile(dsc)
+ return ComponentTestGitRepository(parsed.pkg)
+
+ @classmethod
+ def import_native(cls, dsc=DEFAULT_NATIVE, opts=None):
+ """Import a Debian native package, verify and change into repo"""
+ repo = cls._import_one(dsc, opts)
+ ComponentTestBase._check_repo_state(repo, 'master', ['master'])
+ eq_(len(repo.get_commits()), 1)
+ os.chdir(repo.path)
+ return repo
+
+ @classmethod
+ def import_quilt30(cls, dsc=DEFAULT_QUILT30, opts=None):
+ """Import a 3.0 (quilt) package, verify and change into repo"""
+ repo = cls._import_one(dsc, opts)
+ expected_branches = ['master', 'upstream']
+ if opts and '--pristine-tar' in opts:
+ expected_branches.append('pristine-tar')
+ ComponentTestBase._check_repo_state(repo, 'master', expected_branches)
+ eq_(len(repo.get_commits()), 2)
+ os.chdir(repo.path)
+ return repo
+
+ @classmethod
+ def import_quilt30_additional_tarball(cls, dsc=DEFAULT_ADDITIONAL_TAR, opts=None):
+ """Import a 3.0 (quilt) package with additional tarball, verify and change into repo"""
+ repo = cls._import_one(dsc, opts)
+ expected_branches = ['master', 'upstream']
+ if opts and '--pristine-tar' in opts:
+ expected_branches.append('pristine-tar')
+ ComponentTestBase._check_repo_state(repo, 'master', expected_branches)
+ eq_(len(repo.get_commits()), 2)
+ os.chdir(repo.path)
+ ok_(os.path.exists('./foo'))
+ return repo
+
+ @classmethod
+ def import_debian_tarball(cls, debian=DEFAULT_OVERLAY, opts=None):
+ """Import a 3.0 (quilt) debian dir for overlay mode"""
+ repo = GitRepository.create(os.path.split('/')[-1].split('_')[0])
+ UnpackTarArchive(debian, repo.path)()
+ repo.add_files('.')
+ repo.commit_files('.', msg="debian dir")
+ expected_branches = ['master']
+ ComponentTestBase._check_repo_state(repo, 'master', expected_branches)
+ eq_(len(repo.get_commits()), 1)
+ os.chdir(repo.path)
+ return repo
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2015-2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import glob
+import hashlib
+import os
+import subprocess
+import tarfile
+
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository)
+from tests.component.deb import DEB_TEST_DATA_DIR
+from tests.component.deb.fixtures import (RepoFixtures,
+ DEFAULT_OVERLAY)
+from tests.testutils import skip_without_cmd
+
+from nose.tools import ok_, eq_, assert_false, assert_true
+
+from gbp.scripts.import_dsc import main as import_dsc
+from gbp.scripts.buildpackage import main as buildpackage
+from gbp.scripts.pq import main as pq
+
+from gbp.deb.changelog import ChangeLog
+
+
+class TestBuildpackage(ComponentTestBase):
+ """Test building a debian package"""
+
+ @staticmethod
+ def _dsc_name(pkg, version, dir):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ dir,
+ '%s_%s.dsc' % (pkg, version))
+
+ def _test_buildpackage(self, repo, opts=[]):
+ prebuild_out = os.path.join(repo.path, '..', 'prebuild.out')
+ postbuild_out = os.path.join(repo.path, '..', 'postbuild.out')
+ args = ['arg0',
+ '--git-prebuild=printenv > %s' % prebuild_out,
+ '--git-postbuild=printenv > %s' % postbuild_out,
+ '--git-builder=/bin/true',
+ '--git-cleaner=/bin/true'] + opts
+ os.chdir(repo.path)
+ ret = buildpackage(args)
+ ok_(ret == 0, "Building the package failed")
+ eq_(os.path.exists(prebuild_out), True)
+ eq_(os.path.exists(postbuild_out), True)
+
+ self.check_hook_vars('../prebuild', ["GBP_BUILD_DIR",
+ "GBP_GIT_DIR",
+ "GBP_BUILD_DIR"])
+
+ self.check_hook_vars('../postbuild', ["GBP_CHANGES_FILE",
+ "GBP_BUILD_DIR",
+ "GBP_CHANGES_FILE",
+ "GBP_BUILD_DIR"])
+
+ @RepoFixtures.native()
+ def test_debian_buildpackage(self, repo):
+ """Test that building a native debian package works"""
+ self._test_buildpackage(repo)
+
+ @RepoFixtures.quilt30()
+ def test_non_native_buildpackage(self, repo):
+ """Test that building a source 3.0 debian package works"""
+ self._test_buildpackage(repo)
+
+ @RepoFixtures.native()
+ def test_tag_only(self, repo):
+ """Test that only tagging a native debian package works"""
+ repo.delete_tag('debian/0.4.14') # make sure we can tag again
+ ret = buildpackage(['arg0',
+ '--git-tag-only',
+ '--git-posttag=printenv > ../posttag.out',
+ '--git-builder=touch ../builder-run.stamp',
+ '--git-cleaner=/bin/true'])
+ ok_(ret == 0, "Building the package failed")
+ eq_(os.path.exists('../posttag.out'), True)
+ eq_(os.path.exists('../builder-run.stamp'), False)
+ self.check_hook_vars('../posttag', [("GBP_TAG", "debian/0.4.14"),
+ ("GBP_BRANCH", "master"),
+ "GBP_SHA1"])
+
+ def test_component_generation(self):
+ """Test that generating tarball and additional tarball works without pristine-tar"""
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
+ tarballs = ["../%s_2.8.orig-foo.tar.gz" % pkg,
+ "../%s_2.8.orig.tar.gz" % pkg]
+
+ assert import_dsc(['arg0', '--no-pristine-tar', dsc]) == 0
+ repo = ComponentTestGitRepository(pkg)
+ os.chdir(pkg)
+ assert_false(repo.has_branch('pristine-tar'), "Pristine-tar branch must not exist")
+ for t in tarballs:
+ self.assertFalse(os.path.exists(t), "Tarball %s must not exist" % t)
+ ret = buildpackage(['arg0',
+ '--git-component=foo',
+ '--git-no-pristine-tar',
+ '--git-posttag=printenv > posttag.out',
+ '--git-builder=touch builder-run.stamp',
+ '--git-cleaner=/bin/true'])
+ ok_(ret == 0, "Building the package failed")
+ for t in tarballs:
+ self.assertTrue(os.path.exists(t), "Tarball %s not found" % t)
+
+ def test_pristinetar_component_generation(self):
+ """Test that generating tarball and additional tarball works with pristine-tar"""
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
+ tarballs = ["../%s_2.8.orig-foo.tar.gz" % pkg,
+ "../%s_2.8.orig.tar.gz" % pkg]
+
+ assert import_dsc(['arg0', '--pristine-tar', dsc]) == 0
+ repo = ComponentTestGitRepository(pkg)
+ os.chdir(pkg)
+ assert_true(repo.has_branch('pristine-tar'), "Pristine-tar branch must exist")
+ for t in tarballs:
+ self.assertFalse(os.path.exists(t), "Tarball %s must not exist" % t)
+ # Make sure the tree object for importing the main tarball is recreated
+ repo.collect_garbage(prune='all', aggressive=True)
+ ret = buildpackage(['arg0',
+ '--git-component=foo',
+ '--git-pristine-tar',
+ '--git-posttag=printenv > posttag.out',
+ '--git-builder=touch builder-run.stamp',
+ '--git-cleaner=/bin/true'])
+ ok_(ret == 0, "Building the package failed")
+ for t in tarballs:
+ self.assertTrue(os.path.exists(t), "Tarball %s not found" % t)
+
+ @RepoFixtures.quilt30()
+ def test_pristine_tar_commit(self, repo):
+ """Test that committing to pristine-tar branch after building tarballs works"""
+ assert_false(repo.has_branch('pristine-tar'), "Pristine-tar branch must not exist")
+ ret = buildpackage(['arg0',
+ '--git-builder=/bin/true',
+ '--git-pristine-tar-commit'])
+ ok_(ret == 0, "Building the package failed")
+ assert_true(repo.has_branch('pristine-tar'), "Pristine-tar branch must exist")
+ eq_(repo.ls_tree('pristine-tar'), {b'hello-debhelper_2.8.orig.tar.gz.id',
+ b'hello-debhelper_2.8.orig.tar.gz.delta'})
+
+ @RepoFixtures.quilt30()
+ def test_sloppy_tarball_generation(self, repo):
+ """Test that generating tarball from Debian branch works"""
+ tarball = '../hello-debhelper_2.8.orig.tar.gz'
+ self.add_file(repo, 'foo.txt')
+ self._test_buildpackage(repo, ['--git-force-create',
+ '--git-upstream-tree=SLOPPY'])
+ self.assertTrue(os.path.exists(tarball))
+ t = tarfile.open(name=tarball, mode="r:gz")
+ names = t.getnames()
+ for f in ['hello-debhelper-2.8/build-aux',
+ 'hello-debhelper-2.8/foo.txt']:
+ self.assertIn(f, names)
+ self.assertNotIn('hello-debhelper-2.8/debian', names)
+
+ @RepoFixtures.quilt30()
+ def test_export_dir_buildpackage(self, repo):
+ """Test that building with a export dir works"""
+ self._test_buildpackage(repo, ['--git-export-dir=../foo/bar'])
+ ok_(os.path.exists('../foo/bar'))
+
+ @RepoFixtures.quilt30_additional_tarball()
+ def test_export_dir_additional_tar(self, repo):
+ """Test that building with a export dir and additional tarball works"""
+ self._test_buildpackage(repo, ['--git-export-dir=../foo/bar',
+ '--git-no-purge',
+ '--git-component=foo'])
+ # Check that all needed tarballs end up in the build-area
+ eq_(sorted(glob.glob('../foo/bar/*')), ['../foo/bar/hello-debhelper-2.8',
+ '../foo/bar/hello-debhelper_2.8.orig-foo.tar.gz',
+ '../foo/bar/hello-debhelper_2.8.orig.tar.gz'])
+ # Check that directories from additional tarballs get exported too
+ ok_(os.path.exists('../foo/bar/hello-debhelper-2.8/foo'))
+
+ @RepoFixtures.overlay()
+ def test_export_dir_overlay(self, repo):
+ """Test that building in overlay mode with export dir works"""
+ tarball_dir = os.path.dirname(DEFAULT_OVERLAY)
+ self._test_buildpackage(repo, ['--git-overlay',
+ '--git-compression=auto',
+ '--git-tarball-dir=%s' % tarball_dir,
+ '--git-no-purge',
+ '--git-component=foo',
+ '--git-export-dir=../overlay'])
+ # Check if main tarball got unpacked
+ ok_(os.path.exists('../overlay/hello-debhelper-2.8/configure'))
+ # Check if debian dir is there
+ ok_(os.path.exists('../overlay/hello-debhelper-2.8/debian/changelog'))
+ # Check if additional tarball got unpacked
+ ok_(os.path.exists('../overlay/hello-debhelper-2.8/foo/test1'))
+ # Check if upstream tarballs is in export_dir
+ eq_(sorted(glob.glob('../overlay/*')), ['../overlay/hello-debhelper-2.8',
+ '../overlay/hello-debhelper_2.8.orig-foo.tar.gz',
+ '../overlay/hello-debhelper_2.8.orig.tar.gz'])
+
+ @RepoFixtures.quilt30()
+ def test_export_wc_buildpackage(self, repo):
+ """Test that exporting working copy works and it ignores
+ modifications the source tree """
+ with open(os.path.join(repo.path, 'foo.txt'), 'w') as f:
+ f.write("foo")
+ self._test_buildpackage(repo, ['--git-export=WC',
+ '--git-export-dir=../foo/bar'])
+ ok_(os.path.exists('../foo/bar'))
+
+ @RepoFixtures.native()
+ def test_argument_quoting(self, repo):
+ """Test that we quote arguments to builder (#850869)"""
+ with open('../arg with spaces', 'w'):
+ pass
+ # We use ls as builder to look for a file with spaces. This
+ # will fail if build arguments are not properly quoted and
+ # therefore split up
+ ret = buildpackage(['arg0',
+ '--git-builder=ls',
+ '--git-cleaner=/bin/true',
+ '../arg with spaces'])
+ ok_(ret == 0, "Building the package failed")
+
+ @RepoFixtures.quilt30()
+ def test_tarball_default_compression(self, repo):
+ """Test that we use defaults for compression if not given (#820846)"""
+ self._test_buildpackage(repo, ['--git-no-pristine-tar'])
+ tarball = "../hello-debhelper_2.8.orig.tar.gz"
+ out = subprocess.check_output(["file", tarball])
+ ok_(b"max compression" not in out)
+ m1 = hashlib.md5(open(tarball, 'rb').read()).hexdigest()
+ os.unlink(tarball)
+ eq_(buildpackage(['arg0',
+ '--git-ignore-new',
+ '--git-builder=/bin/true',
+ '--git-cleaner=/bin/true',
+ '../arg with spaces']), 0)
+ m2 = hashlib.md5(open(tarball, 'rb').read()).hexdigest()
+ eq_(m1, m2, "Regenerated tarball has different checksum")
+
+ @RepoFixtures.quilt30()
+ def test_tarball_max_compression(self, repo):
+ """Test that passing max compression works (#820846)"""
+ self._test_buildpackage(repo, ['--git-no-pristine-tar', '--git-compression-level=9'])
+ out = subprocess.check_output(["file", "../hello-debhelper_2.8.orig.tar.gz"])
+ ok_(b"max compression" in out)
+
+ @RepoFixtures.quilt30()
+ def test_tag_pq_branch(self, repo):
+ ret = pq(['argv0', 'import'])
+ eq_(repo.rev_parse('master'), repo.rev_parse('debian/2.8-1^{}'))
+ eq_(ret, 0)
+ eq_(repo.branch, 'patch-queue/master')
+ self.add_file(repo, 'foo.txt')
+ ret = buildpackage(['argv0',
+ '--git-tag-only',
+ '--git-retag',
+ '--git-ignore-branch'])
+ eq_(ret, 0)
+ eq_(repo.branch, 'patch-queue/master')
+ eq_(repo.rev_parse('patch-queue/master^{}^'), repo.rev_parse('debian/2.8-1^{}'))
+
+ @RepoFixtures.quilt30()
+ def test_tag_detached_head(self, repo):
+ """
+ Test that tagging works with an detached head (#863167)
+ """
+ eq_(repo.rev_parse('master^{}'), repo.rev_parse('debian/2.8-1^{}'))
+ self.add_file(repo, 'debian/foo.txt')
+ repo.checkout("HEAD~")
+ ret = buildpackage(['argv0',
+ '--git-tag-only',
+ '--git-retag',
+ '--git-ignore-branch'])
+ eq_(ret, 0)
+ repo.checkout("master")
+ eq_(repo.rev_parse('master~^{}'), repo.rev_parse('debian/2.8-1^{}'))
+
+ @skip_without_cmd('debchange')
+ @RepoFixtures.quilt30()
+ def test_broken_upstream_version(self, repo):
+ cl = ChangeLog(filename='debian/changelog')
+ cl.add_section(["broken versionnumber"],
+ "unstable",
+ version={'version': "3.0"})
+ ret = buildpackage(['argv0',
+ '--git-ignore-new',
+ '--git-builder=/bin/true',
+ '--git-tarball-dir=../tarballs'])
+ eq_(ret, 1)
+ self._check_log(-1, "gbp:error: Non-native package 'hello-debhelper' has invalid version '3.0'")
+
+ @RepoFixtures.quilt30()
+ def test_preexport(self, repo):
+ """Test the pre-export hook """
+ preexport_out = os.path.join(repo.path, '..', 'preexport.out')
+ self._test_buildpackage(repo, ['--git-export-dir=../export-dir',
+ '--git-preexport=printenv > %s' % preexport_out])
+ ok_(os.path.exists(preexport_out))
+ self.check_hook_vars('../preexport', ["GBP_BUILD_DIR", "GBP_GIT_DIR"])
+
+ @RepoFixtures.overlay()
+ def test_export_dir_version_replacement(self, repo):
+ """Test that building in overlay mode with export dir with versioned name works"""
+ tarball_dir = os.path.join(DEB_TEST_DATA_DIR, 'foo-%(version)s')
+ self._test_buildpackage(repo, ['--git-overlay',
+ '--git-compression=auto',
+ '--git-tarball-dir=%s' % tarball_dir,
+ '--git-no-purge',
+ '--git-component=foo',
+ '--git-export-dir=../foo'])
+ # Check if main tarball got unpacked
+ ok_(os.path.exists('../foo/hello-debhelper-2.8/configure'))
+ # Check if debian dir is there
+ ok_(os.path.exists('../foo/hello-debhelper-2.8/debian/changelog'))
+ # Check if additional tarball got unpacked
+ ok_(os.path.exists('../foo/hello-debhelper-2.8/foo/test1'))
+ # Check if upstream tarballs is in export_dir
+ eq_(sorted(glob.glob('../foo/*')), ['../foo/hello-debhelper-2.8',
+ '../foo/hello-debhelper_2.8.orig-foo.tar.gz',
+ '../foo/hello-debhelper_2.8.orig.tar.gz'])
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2016 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository,
+ skipUnless)
+from tests.component.deb.fixtures import RepoFixtures
+
+from nose.tools import ok_
+
+from gbp.scripts.clone import main as clone
+
+
+class TestClone(ComponentTestBase):
+ """Test cloning from a remote"""
+
+ @RepoFixtures.native()
+ def test_clone_nonempty(self, repo):
+ """Test that cloning into an existing dir fails"""
+ os.chdir('..')
+ ok_(clone(['arg0', repo.path]) == 1,
+ "Cloning did no fail as expected")
+ self._check_log(-2,
+ "gbp:error: Git command failed: Error "
+ "running git clone: fatal: destination path "
+ "'git-buildpackage' already exists and is not "
+ "an empty directory.")
+
+ @RepoFixtures.native()
+ def test_clone_native(self, repo):
+ """Test that cloning of debian native packages works"""
+ dest = os.path.join(self._tmpdir,
+ 'cloned_repo')
+ clone(['arg0',
+ '--postclone=printenv > ../postclone.out',
+ repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+ assert len(cloned.get_commits()) == 1
+ self.check_hook_vars('../postclone', ["GBP_GIT_DIR"])
+
+ @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled")
+ def test_clone_vcsgit_ok(self):
+ """Test that cloning from vcs-git urls works"""
+ dest = os.path.join(self._tmpdir,
+ 'cloned_repo')
+ ret = clone(['arg0', "--add-upstream-vcs", "vcsgit:libvirt-glib", dest])
+ self.assertEquals(ret, 0)
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'debian/sid', ['debian/sid', 'upstream/latest'])
+ assert cloned.has_remote_repo("upstreamvcs")
+ assert 'upstreamvcs/master' in cloned.get_remote_branches()
+
+ @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled")
+ def test_clone_vcsgit_fail(self):
+ """Test that cloning from vcs-git urls fails as expected"""
+ ret = clone(['arg0', "vcsgit:doesnotexist"])
+ self.assertEquals(ret, 1)
+ self._check_log(-1, "gbp:error: Can't find any vcs-git URL for 'doesnotexist'")
+
+ @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled")
+ def test_clone_github(self):
+ """Test that cloning from github urls works"""
+ dest = os.path.join(self._tmpdir,
+ 'cloned_repo')
+ ret = clone(['arg0', "github:agx/git-buildpackage", dest])
+ self.assertEquals(ret, 0)
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ @RepoFixtures.native()
+ def test_clone_without_attrs(self, repo):
+ """Test that cloning a repo without harmful attrs does nothing"""
+ dest = os.path.join(self._tmpdir,
+ 'cloned_repo')
+ clone(['arg0',
+ repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ attrs_file = os.path.join(dest, '.git', 'info', 'attributes')
+ # file may be empty or absent
+ self.assertFalse(os.path.exists(attrs_file) and os.path.getsize(attrs_file),
+ "%s is non-empty" % attrs_file)
+
+ @RepoFixtures.native()
+ def test_clone_with_attrs(self, repo):
+ """Test that cloning a repo with harmful attrs disarms them"""
+ with open('.gitattributes', 'w') as f:
+ f.write('# not empty')
+ repo.add_files('.gitattributes')
+ repo.commit_files('.gitattributes', msg="add .gitattributes")
+
+ dest = os.path.join(self._tmpdir,
+ 'cloned_repo')
+ clone(['arg0',
+ repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ attrs_file = os.path.join(dest, '.git', 'info', 'attributes')
+ ok_(os.path.exists(attrs_file), "%s is missing" % attrs_file)
+
+ with open(attrs_file) as f:
+ attrs = sorted(f.read().splitlines())
+
+ expected_gitattrs = [
+ '# Added by git-buildpackage to disable .gitattributes found in the upstream tree',
+ '* -export-ignore',
+ '* -export-subst',
+ '* dgit-defuse-attrs',
+ '[attr]dgit-defuse-attrs -text -eol -crlf -ident -filter -working-tree-encoding',
+ ]
+ self.assertEquals(attrs, expected_gitattrs)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import ComponentTestBase
+from tests.component.deb import DEB_TEST_DATA_DIR
+from tests.component.deb.fixtures import RepoFixtures
+from tests.testutils import skip_without_cmd
+
+import gbp.scripts.dch
+from gbp.scripts.dch import main as dch
+
+from nose.tools import eq_, ok_
+
+
+def _dsc_file(pkg, version, dir='dsc-3.0'):
+ return os.path.join(DEB_TEST_DATA_DIR, dir, '%s_%s.dsc' % (pkg, version))
+
+
+DEFAULT_DSC = _dsc_file('hello-debhelper', '2.6-2')
+
+
+@skip_without_cmd('debchange')
+class TestDch(ComponentTestBase):
+ """Test importing of new upstream versions"""
+ pkg = "hello-debhelper"
+ def_branches = ['master', 'upstream', 'pristine-tar']
+
+ @RepoFixtures.quilt30(DEFAULT_DSC)
+ def test_user_customizations(self, repo):
+ os.chdir(repo.path)
+ # Non-existent customization file
+ ok_(dch(['arg0', '--customizations=customizations.py']) == 1,
+ "dch did no fail as expected")
+
+ # Create user customizations file
+ with open('customizations.py', 'w') as fobj:
+ fobj.write("""def format_changelog_entry(commit_info, options, last_commit=False):
+ return ['testentry']
+""")
+ # Add the file so we have a change
+ repo.add_files(['customizations.py'])
+ repo.commit_all(msg="test customizations")
+ ok_(dch(['arg0', '-S', '-a', '--customizations=customizations.py']) == 0,
+ "dch did no succeed as expected")
+ with open("debian/changelog", encoding='utf-8') as f:
+ cl = f.read()
+ ok_('* testentry\n' in cl)
+ del gbp.scripts.dch.user_customizations['format_changelog_entry']
+
+ @RepoFixtures.native()
+ def test_postedit_hook(self, repo):
+ os.chdir(repo.path)
+ eq_(dch(['arg0', '-N', '1.2.3', '--postedit', 'echo $GBP_DEBIAN_VERSION > foo.txt']), 0)
+ with open('foo.txt') as f:
+ eq_(f.read(), '1.2.3\n')
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository)
+from tests.component.deb import DEB_TEST_DATA_DIR
+from tests.component.deb.fixtures import RepoFixtures
+
+from nose.tools import ok_, assert_false, assert_true
+
+from gbp.scripts.clone import main as clone
+from gbp.scripts.import_dsc import main as import_dsc
+from gbp.scripts.export_orig import main as export_orig
+
+
+class TestExportOrig(ComponentTestBase):
+ """Test exporting of orig tarballs"""
+
+ @staticmethod
+ def _dsc_name(pkg, version, dir):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ dir,
+ '%s_%s.dsc' % (pkg, version))
+
+ def test_component_generation(self):
+ """Test that generating tarball and additional tarball works without pristine-tar"""
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
+ tarballs = ["../%s_2.8.orig-foo.tar.gz" % pkg,
+ "../%s_2.8.orig.tar.gz" % pkg]
+
+ assert import_dsc(['arg0', '--no-pristine-tar', dsc]) == 0
+ repo = ComponentTestGitRepository(pkg)
+ os.chdir(pkg)
+ assert_false(repo.has_branch('pristine-tar'), "Pristine-tar branch must not exist")
+ for t in tarballs:
+ self.assertFalse(os.path.exists(t), "Tarball %s must not exist" % t)
+ ret = export_orig(['arg0',
+ '--component=foo',
+ '--no-pristine-tar'])
+ ok_(ret == 0, "Exporting tarballs failed")
+ for t in tarballs:
+ self.assertTrue(os.path.exists(t), "Tarball %s not found" % t)
+
+ def test_pristinetar_component_generation(self):
+ """Test that generating tarball and additional tarball works with pristine-tar"""
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
+ tarballs = ["../%s_2.8.orig-foo.tar.gz" % pkg,
+ "../%s_2.8.orig.tar.gz" % pkg]
+
+ assert import_dsc(['arg0', '--pristine-tar', dsc]) == 0
+ repo = ComponentTestGitRepository(pkg)
+ os.chdir(pkg)
+ assert_true(repo.has_branch('pristine-tar'), "Pristine-tar branch must exist")
+ for t in tarballs:
+ self.assertFalse(os.path.exists(t), "Tarball %s must not exist" % t)
+ # Make sure the tree object for importing the main tarball is recreated
+ repo.collect_garbage(prune='all', aggressive=True)
+ ret = export_orig(['arg0',
+ '--component=foo',
+ '--pristine-tar'])
+ ok_(ret == 0, "Exporting tarballs failed")
+ for t in tarballs:
+ self.assertTrue(os.path.exists(t), "Tarball %s not found" % t)
+
+ def test_git_archive_tree_non_existent(self):
+ """Test that we're failing tarball generation when commits are missing"""
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
+
+ assert import_dsc(['arg0', '--no-pristine-tar', dsc]) == 0
+ repo = ComponentTestGitRepository(pkg)
+ os.chdir(pkg)
+ assert_false(repo.has_branch('pristine-tar'), "Pristine-tar branch not must exist")
+ ret = export_orig(['arg0',
+ '--component=bar', # non-existing component
+ '--no-pristine-tar'])
+ ok_(ret == 1, "Exporting tarballs must fail")
+ self._check_log(-1, "gbp:error: No tree for 'bar' found in "
+ "'upstream/2.8' to create additional tarball from")
+
+ def test_pristine_tar_commit_non_existent(self):
+ """Test that we're failing if pristine-tar commit is missing"""
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
+
+ assert import_dsc(['arg0', '--pristine-tar', dsc]) == 0
+ repo = ComponentTestGitRepository(pkg)
+ os.chdir(pkg)
+ assert_true(repo.has_branch('pristine-tar'), "Pristine-tar branch must exist")
+ repo.delete_branch("pristine-tar")
+ repo.create_branch("pristine-tar") # create a nonsense pristine-tar branch
+ ret = export_orig(['arg0',
+ '--component=foo',
+ '--pristine-tar'])
+ ok_(ret == 1, "Exporting tarballs must fail")
+ self._check_log(-1, "gbp:error: Cannot find pristine tar commit for archive 'hello-debhelper_2.8.orig.tar.gz'")
+
+ def test_tarball_dir_version_replacement(self):
+ """Test that generating tarball from directory version substitution works"""
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
+ tarballs = ["%s_2.8.orig-foo.tar.gz" % pkg,
+ "%s_2.8.orig.tar.gz" % pkg]
+
+ assert import_dsc(['arg0', '--no-pristine-tar', dsc]) == 0
+ ComponentTestGitRepository(pkg)
+ os.chdir(pkg)
+ for t in tarballs:
+ self.assertFalse(os.path.exists(os.path.join('..', t)), "Tarball %s must not exist" % t)
+
+ tarball_dir = os.path.join(DEB_TEST_DATA_DIR, 'foo-%(version)s')
+ ret = export_orig(['arg0',
+ '--tarball-dir=%s' % tarball_dir,
+ '--component=foo',
+ '--no-pristine-tar'])
+ ok_(ret == 0, "Exporting tarballs failed")
+ # tarballs should be found in existing --tarball-dir directory and thus
+ # not get recreated by export-orig
+ for t in tarballs:
+ self.assertFalse(os.path.exists(os.path.join('..', t)), "Tarball %s found" % t)
+ self.assertTrue(os.path.exists(os.path.join(DEB_TEST_DATA_DIR, 'foo-2.8', t)), "Tarball %s not found" % t)
+
+ def test_pristine_tar_upstream_signatures_with(self):
+ """Test that exporting upstream signatures in pristine tar works with imported signature"""
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0')
+ files = ["%s_2.8.orig.tar.gz" % pkg,
+ "%s_2.8.orig.tar.gz.asc" % pkg]
+
+ assert import_dsc(['arg0', '--pristine-tar', dsc]) == 0
+ ComponentTestGitRepository(pkg)
+ os.chdir(pkg)
+ for f in files:
+ self.assertFalse(os.path.exists(os.path.join('..', f)), "File %s must not exist" % f)
+
+ ret = export_orig(['arg0',
+ '--pristine-tar',
+ '--upstream-signatures=no'])
+ ok_(ret == 0, "Exporting tarballs failed")
+ self.assertTrue(os.path.exists(os.path.join('..', files[0])), "Tarball %s not found" % files[0])
+ self.assertFalse(os.path.exists(os.path.join('..', files[1])), "Signature %s found" % files[1])
+
+ os.remove(os.path.join('..', files[0]))
+ for f in files:
+ self.assertFalse(os.path.exists(os.path.join('..', f)), "File %s must not exist" % f)
+
+ ret = export_orig(['arg0',
+ '--pristine-tar',
+ '--upstream-signatures=auto'])
+ ok_(ret == 0, "Exporting tarballs failed")
+ for f in files:
+ self.assertTrue(os.path.exists(os.path.join('..', f)), "File %s not found" % f)
+
+ for f in files:
+ os.remove(os.path.join('..', f))
+ self.assertFalse(os.path.exists(os.path.join('..', f)), "File %s must not exist" % f)
+
+ ret = export_orig(['arg0',
+ '--pristine-tar',
+ '--upstream-signatures=on'])
+ ok_(ret == 0, "Exporting tarballs failed")
+ for f in files:
+ self.assertTrue(os.path.exists(os.path.join('..', f)), "File %s not found" % f)
+
+ def test_pristine_tar_upstream_signatures_without(self):
+ """Test that exporting upstream signatures in pristine tar works without imported signature"""
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.6-1', 'dsc-3.0')
+ files = ["%s_2.6.orig.tar.gz" % pkg,
+ "%s_2.6.orig.tar.gz.asc" % pkg]
+
+ assert import_dsc(['arg0', '--pristine-tar', dsc]) == 0
+ ComponentTestGitRepository(pkg)
+ os.chdir(pkg)
+ for f in files:
+ self.assertFalse(os.path.exists(os.path.join('..', f)), "File %s must not exist" % f)
+
+ ret = export_orig(['arg0',
+ '--pristine-tar',
+ '--upstream-signatures=no'])
+ ok_(ret == 0, "Exporting tarballs failed")
+ self.assertTrue(os.path.exists(os.path.join('..', files[0])), "Tarball %s not found" % files[0])
+ self.assertFalse(os.path.exists(os.path.join('..', files[1])), "Signature %s found" % files[1])
+
+ os.remove(os.path.join('..', files[0]))
+ for f in files:
+ self.assertFalse(os.path.exists(os.path.join('..', f)), "File %s must not exist" % f)
+
+ ret = export_orig(['arg0',
+ '--pristine-tar',
+ '--upstream-signatures=auto'])
+ ok_(ret == 0, "Exporting tarballs failed")
+ self.assertTrue(os.path.exists(os.path.join('..', files[0])), "Tarball %s not found" % files[0])
+ self.assertFalse(os.path.exists(os.path.join('..', files[1])), "Signature %s found" % files[1])
+
+ os.remove(os.path.join('..', files[0]))
+ for f in files:
+ self.assertFalse(os.path.exists(os.path.join('..', f)), "File %s must not exist" % f)
+
+ ret = export_orig(['arg0',
+ '--pristine-tar',
+ '--upstream-signatures=on'])
+ ok_(ret == 1, "Exporting tarballs must fail")
+ self._check_log(-1, "gbp:error: Cannot find requested upstream signature for archive "
+ "'hello-debhelper_2.6.orig.tar.gz' in pristine tar commit.")
+
+ @RepoFixtures.quilt30(opts=['--pristine-tar'])
+ def test_pristine_tar_commit_on_origin(self, repo):
+ """Test that we can create tarball from 'origin/pristine-tar'"""
+
+ assert_true(repo.has_branch('pristine-tar'),
+ "Pristine-tar branch must exist in origin")
+ dest = os.path.join(self._tmpdir, 'cloned_repo')
+ clone(['arg0', repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+
+ os.chdir(cloned.path)
+ assert_false(cloned.has_branch('pristine-tar'),
+ "Pristine-tar branch must not exist in clone")
+ ret = export_orig(['arg0', '--pristine-tar'])
+ ok_(ret == 0, "Exporting tarballs must not fail")
# vim: set fileencoding=utf-8 :
#
-# (C) 2013,2014 Guido Günther <agx@sigxcpu.org>
+# (C) 2013,2014,2015,2017 Guido Günther <agx@sigxcpu.org>
#
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
import os
from tests.component import (ComponentTestBase,
- ComponentTestGitRepository)
-from tests.component.deb import DEB_TEST_DATA_DIR
+ ComponentTestGitRepository,
+ skipUnless)
+from tests.component.deb import DEB_TEST_DATA_DIR, DEB_TEST_DOWNLOAD_URL
+from tests.component.deb.fixtures import RepoFixtures
-from nose.tools import ok_
+from nose.tools import ok_, eq_
from gbp.scripts.import_dsc import main as import_dsc
+from gbp.deb.pristinetar import DebianPristineTar
+from gbp.deb.dscfile import DscFile
+from gbp.git.repository import GitRepository
+
class TestImportDsc(ComponentTestBase):
"""Test importing of debian source packages"""
- def test_debian_import(self):
+ def _dsc30(self, version):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-3.0',
+ 'hello-debhelper_%s.dsc' % version)
+
+ def _check_reflog(self, repo):
+ reflog, ret = repo._git_getoutput('reflog')
+ # Recent (>= 2.10) git versions create a reflog entry for "git
+ # update-ref HEAD HEAD" while older ones (2.9.4) don't so
+ # reflog[0] is either there or not.
+ if len(reflog) == 3:
+ ok_(b"gbp: Import Debian changes" in reflog[1])
+ ok_(b"gbp: Import Upstream version 2.6" in reflog[2])
+ elif len(reflog) == 2:
+ # Furthermore some older git versions (<2.10) fail to set
+ # the reflog correctly on the initial commit so only check
+ # the second
+ ok_(b"gbp: Import Debian changes" in reflog[0])
+ else:
+ ok_(len(reflog) > 3, "Reflog %s has too many lines" % reflog)
+ ok_(len(reflog) < 2, "Reflog %s has too few lines" % reflog)
+
+ def test_import_debian_native(self):
"""Test that importing of debian native packages works"""
def _dsc(version):
return os.path.join(DEB_TEST_DATA_DIR,
repo = ComponentTestGitRepository('git-buildpackage')
self._check_repo_state(repo, 'master', ['master'])
assert len(repo.get_commits()) == 1
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ ok_("git-buildpackage (0.01) unstable; urgency=low" in commitmsg)
+ ok_("git-buildpackage (0.4.14) unstable; urgency=low" in commitmsg)
os.chdir('git-buildpackage')
dsc = _dsc('0.4.15')
assert import_dsc(['arg0', dsc]) == 0
self._check_repo_state(repo, 'master', ['master'])
assert len(repo.get_commits()) == 2
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ ok_("git-buildpackage (0.4.14) unstable; urgency=low" not in commitmsg)
+ ok_("git-buildpackage (0.4.15) unstable; urgency=low" in commitmsg)
dsc = _dsc('0.4.16')
assert import_dsc(['arg0', dsc]) == 0
self._check_repo_state(repo, 'master', ['master'])
assert len(repo.get_commits()) == 3
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ ok_("git-buildpackage (0.4.14) unstable; urgency=low" not in commitmsg)
+ ok_("git-buildpackage (0.4.15) unstable; urgency=low" not in commitmsg)
+ ok_("git-buildpackage (0.4.16) unstable; urgency=low" in commitmsg)
-# def test_create_branches(self):
-# """Test if creating missing branches works"""
-# def _dsc(version):
-# return os.path.join(DEB_TEST_DATA_DIR,
-# 'dsc-3.0',
-# 'hello-debhelper_%s.dsc' % version)
-#
-# dsc = _dsc('2.6-2')
-# assert import_dsc(['arg0',
-# '--pristine-tar',
-# '--debian-branch=master',
-# '--upstream-branch=upstream',
-# dsc]) == 0
-# repo = ComponentTestGitRepository('hello-debhelper')
-# os.chdir('hello-debhelper')
-# assert len(repo.get_commits()) == 2
-# self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream'])
-# dsc = _dsc('2.8-1')
-# assert import_dsc(['arg0',
-# '--pristine-tar',
-# '--debian-branch=foo',
-# '--upstream-branch=bar',
-# '--create-missing-branches',
-# dsc]) == 0
-# self._check_repo_state(repo, 'master', ['bar', 'foo', 'master', 'pristine-tar', 'upstream'])
-# commits, expected = len(repo.get_commits()), 2
-# ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
+ @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled")
+ def test_download(self):
+ def _dsc(version):
+ return os.path.join(DEB_TEST_DOWNLOAD_URL,
+ 'dsc-native',
+ 'git-buildpackage_%s.dsc' % version)
+ dsc = _dsc('0.4.14')
+ assert import_dsc(['arg0',
+ '--allow-unauthenticated',
+ dsc]) == 0
+ repo = ComponentTestGitRepository('git-buildpackage')
+ self._check_repo_state(repo, 'master', ['master'])
+ assert len(repo.get_commits()) == 1
+
+ @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled")
+ def test_broken_download(self):
+ def _not_a_dsc(version):
+ return os.path.join(DEB_TEST_DOWNLOAD_URL,
+ 'dsc-3.0',
+ 'hello-debhelper_%s.orig.tar.gz' % version)
+
+ f = _not_a_dsc('2.6')
+ assert import_dsc(['arg0',
+ '--allow-unauthenticated',
+ f]) == 1
+ self._check_log(-1, "gbp:error: Did not find a dsc file at")
+
+ def test_create_branches(self):
+ """Test that creating missing branches works"""
+ dsc = self._dsc30('2.6-2')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dsc]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ os.chdir('hello-debhelper')
+ assert len(repo.get_commits()) == 2
+ self._check_reflog(repo)
+ self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream'])
+ dsc = self._dsc30('2.8-1')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=foo',
+ '--upstream-branch=bar',
+ '--create-missing-branches',
+ dsc]) == 0
+ self._check_repo_state(repo, 'master', ['bar', 'foo', 'master', 'pristine-tar', 'upstream'])
+ commits, expected = len(repo.get_commits()), 2
+ ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
+
+ def test_import_30_pristine_tar(self):
+ dscfile = self._dsc30('2.6-1')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dscfile]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream'])
+ commits, expected = len(repo.get_commits()), 2
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ eq_("hello-debhelper (2.6-1) unstable; urgency=low", commitmsg.split('\n')[0])
+ ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
+
+ os.chdir(repo.path)
+ dscfile = self._dsc30('2.6-2')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dscfile]) == 0
+ commits, expected = len(repo.get_commits()), 3
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ eq_("hello-debhelper (2.6-2) unstable; urgency=medium", commitmsg.split('\n')[0])
+ ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
+
+ commits, expected = len(repo.get_commits(until='pristine-tar')), 1
+ ok_(commits == expected, "Found %d pristine-tar commits instead of %d" % (commits, expected))
+
+ def test_import_30_additional_tarball_pristine_tar(self):
+ """Test that importing a package with additional tarballs works"""
+ def _dsc(version):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-3.0-additional-tarballs',
+ 'hello-debhelper_%s.dsc' % version)
+
+ dscfile = _dsc('2.8-1')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dscfile]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream'])
+ commits, expected = len(repo.get_commits()), 2
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ ok_("hello-debhelper (2.8-1) unstable; urgency=low" in commitmsg)
+ ok_("hello (1.3-7) experimental; urgency=LOW" in commitmsg)
+
+ for file in [b'foo/test1', b'foo/test2']:
+ ok_(file in repo.ls_tree('HEAD'),
+ "Could not find component tarball file %s in %s" % (file, repo.ls_tree('HEAD')))
+
+ ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
+
+ dsc = DscFile.parse(dscfile)
+ # Check if we can rebuild the tarball and component
+ ptars = [('hello-debhelper_2.8.orig.tar.gz', 'pristine-tar', '', dsc.tgz),
+ ('hello-debhelper_2.8.orig-foo.tar.gz', 'pristine-tar^', 'foo', dsc.additional_tarballs['foo'])]
+
+ p = DebianPristineTar(repo)
+ outdir = os.path.abspath('.')
+ for f, w, s, o in ptars:
+ eq_(repo.get_subject(w), 'pristine-tar data for %s' % f)
+ old = self.hash_file(o)
+ p.checkout('hello-debhelper', '2.8', 'gzip', outdir, component=s)
+ new = self.hash_file(os.path.join(outdir, f))
+ eq_(old, new, "Checksum %s of regenerated tarball %s does not match original %s" %
+ (f, old, new))
+
+ def test_existing_dir(self):
+ """
+ Importing outside of git repository with existing target
+ dir must fail
+ """
+
+ # Create directory we should stumble upon
+ os.makedirs('hello-debhelper')
+ dsc = self._dsc30('2.8-1')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dsc]) == 1
+ self._check_log(0, "gbp:error: Directory 'hello-debhelper' already exists. If you want to import into it, "
+ "please change into this directory otherwise move it away first")
+
+ def test_import_10(self):
+ """Test that importing a 1.0 source format package works"""
+ def _dsc(version):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-1.0',
+ 'hello-debhelper_%s.dsc' % version)
+
+ dsc = _dsc('2.6-2')
+ assert import_dsc(['arg0', dsc]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ self._check_repo_state(repo, 'master', ['master', 'upstream'],
+ tags=['upstream/2.6', 'debian/2.6-2'])
+ assert len(repo.get_commits()) == 2
+
+ def test_target_dir(self):
+ """Test that setting the target dir works"""
+ dsc = self._dsc30('2.6-2')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--no-pristine-tar',
+ dsc,
+ 'targetdir']) == 0
+ assert os.path.exists('targetdir')
+ repo = ComponentTestGitRepository('targetdir')
+ self._check_repo_state(repo, 'master', ['master', 'upstream'])
+
+ def test_bare(self):
+ """Test that importing into bare repository works"""
+ dsc = self._dsc30('2.6-2')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dsc]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ os.chdir('hello-debhelper')
+ assert len(repo.get_commits()) == 2
+ self._check_reflog(repo)
+ self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream'])
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ ok_("hello-debhelper (2.6-2) unstable; urgency=medium" in commitmsg)
+ ok_("hello (1.3-7) experimental; urgency=LOW" in commitmsg)
+
+ dsc = self._dsc30('2.8-1')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dsc]) == 0
+ commits, expected = len(repo.get_commits()), 4
+ ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ ok_("hello-debhelper (2.8-1) unstable; urgency=low" in commitmsg)
+ ok_("ello-debhelper (2.7-1) unstable; urgency=low" in commitmsg)
+ ok_("hello-debhelper (2.6-2) unstable; urgency=medium" not in commitmsg)
+
+ def test_import_environ(self):
+ """Test that environment variables influence git configuration"""
+ os.environ['DEBFULLNAME'] = 'testing tester'
+ os.environ['DEBEMAIL'] = 'gbp-tester@debian.invalid'
+ repo = RepoFixtures.import_native()
+ got = repo.get_config("user.email")
+ want = os.environ['DEBEMAIL']
+ ok_(got == want, "unexpected git config user.email: got %s, want %s" % (got, want))
+
+ got = repo.get_config("user.name")
+ want = os.environ['DEBFULLNAME']
+ ok_(got == want, "unexpected git config user.name: got %s, want %s" % (got, want))
+
+ def test_debian_branch_not_master(self):
+ """Make sure we only have debian-branch and upstream-branch after an initial import"""
+ dsc = self._dsc30('2.6-2')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--no-pristine-tar',
+ '--debian-branch=pk4',
+ '--upstream-branch=upstream',
+ dsc]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ self._check_repo_state(repo, 'pk4', ['pk4', 'upstream'])
+ commits, expected = len(repo.get_commits()), 2
+ ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
+
+ def test_empty_repo(self):
+ """Make sure we can import into an empty repository"""
+ dsc = self._dsc30('2.6-2')
+ repo = GitRepository.create("hello-debhelper")
+ self._check_repo_state(repo, None, [])
+ os.chdir('hello-debhelper')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--no-pristine-tar',
+ '--debian-branch=pk4',
+ '--upstream-branch=upstream',
+ dsc]) == 0
+ self._check_repo_state(repo, 'pk4', ['pk4', 'upstream'])
+ commits, expected = len(repo.get_commits()), 2
+ ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
+
+ def test_upstream_branch_is_master(self):
+ """Make sure we can import when upstream-branch == master (#750962)"""
+ dsc = self._dsc30('2.6-2')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--no-pristine-tar',
+ '--debian-branch=debian',
+ '--upstream-branch=master',
+ dsc]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ self._check_repo_state(repo, 'debian', ['debian', 'master'])
+ commits, expected = len(repo.get_commits()), 2
+ ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
+
+ def test_import_30_filters(self):
+ dscfile = self._dsc30('2.6-1')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--no-pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ '--filter=debian/patches/*',
+ '--filter=AUTHORS',
+ dscfile]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ self._check_repo_state(repo, 'master', ['master', 'upstream'])
+ os.chdir('hello-debhelper')
+ ok_(os.path.exists("./debian/changelog"))
+ ok_(os.path.exists("./configure.ac"))
+ ok_(not os.path.exists("./debian/patches/series"))
+ ok_(not os.path.exists("./debian/patches/AUTHORS"))
+
+ def test_import_signature(self):
+ dscfile = self._dsc30('2.8-1')
+ assert import_dsc(['arg0',
+ '--verbose',
+ '--pristine-tar',
+ '--debian-branch=master',
+ '--upstream-branch=upstream',
+ dscfile]) == 0
+ repo = ComponentTestGitRepository('hello-debhelper')
+ self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream'])
+ commits, expected = len(repo.get_commits()), 2
+ commits, expected = len(repo.get_commits(until='pristine-tar')), 1
+ ok_(commits == expected, "Found %d pristine-tar commits instead of %d" % (commits, expected))
+ eq_(repo.ls_tree('pristine-tar'), {b'hello-debhelper_2.8.orig.tar.gz.delta',
+ b'hello-debhelper_2.8.orig.tar.gz.id',
+ b'hello-debhelper_2.8.orig.tar.gz.asc'})
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository)
+from tests.component.deb import DEB_TEST_DATA_DIR
+from nose.tools import ok_
+
+from gbp.scripts.import_dscs import main as import_dscs
+
+
+class TestImportDscs(ComponentTestBase):
+ """Test importing of debian source packages"""
+
+ def test_import_debian_native(self):
+ """Test that importing of debian native packages works"""
+ def _dsc(version):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ 'dsc-native',
+ 'git-buildpackage_%s.dsc' % version)
+
+ dsc1 = _dsc('0.4.14')
+ dsc2 = _dsc('0.4.15')
+ assert import_dscs(['arg0', dsc1, dsc2]) == 0
+ repo = ComponentTestGitRepository('git-buildpackage')
+ self._check_repo_state(repo, 'master', ['master'])
+ assert len(repo.get_commits()) == 2
+ commitmsg = repo.get_commit_info('HEAD')['body']
+ ok_("git-buildpackage (0.4.15) unstable; urgency=low" in commitmsg)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2015,2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+import shutil
+import tarfile
+
+from mock import patch, DEFAULT
+
+from tests.component import (ComponentTestBase, ComponentTestGitRepository, skipUnless)
+from tests.component.deb import DEB_TEST_DATA_DIR, DEB_TEST_DOWNLOAD_URL
+from tests.component.deb.fixtures import RepoFixtures
+
+from gbp.scripts.import_orig import main as import_orig
+from gbp.deb.pristinetar import DebianPristineTar
+from gbp.deb.dscfile import DscFile
+from gbp.git.repository import GitRepository, GitRepositoryError
+from gbp.paths import to_bin
+from gbp.command_wrappers import UnpackTarArchive
+
+from nose.tools import ok_, eq_, assert_raises
+
+
+def raise_if_tag_match(match):
+ def wrapped(*args, **kwargs):
+ if len(args) > 0 and args[0].startswith(match) or kwargs.get('name', '').startswith(match):
+ raise GitRepositoryError('this is a create tag error mock for %s %s' % (match, kwargs))
+ return DEFAULT
+ return wrapped
+
+
+def _dsc_file(pkg, version, dir='dsc-3.0'):
+ return os.path.join(DEB_TEST_DATA_DIR, dir, '%s_%s.dsc' % (pkg, version))
+
+
+DEFAULT_DSC = _dsc_file('hello-debhelper', '2.6-2')
+
+
+class TestImportOrig(ComponentTestBase):
+ """Test importing of new upstream versions"""
+ pkg = "hello-debhelper"
+ def_branches = ['master', 'upstream', 'pristine-tar']
+
+ def _orig(self, version, dir='dsc-3.0'):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ dir,
+ '%s_%s.orig.tar.gz' % (self.pkg, version))
+
+ def _download_url(self, version, dir='dsc-3.0'):
+ return os.path.join(DEB_TEST_DOWNLOAD_URL,
+ dir,
+ '%s_%s.orig.tar.gz' % (self.pkg, version))
+
+ def test_initial_import(self):
+ """Test that importing into an empty repo works"""
+ repo = GitRepository.create(self.pkg)
+ os.chdir(self.pkg)
+ orig = self._orig('2.6')
+ ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 0)
+ self._check_repo_state(repo, 'master', self.def_branches,
+ tags=['upstream/2.6'])
+
+ @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled")
+ def test_download(self):
+ """Test that importing via download works"""
+ repo = GitRepository.create(self.pkg)
+ os.chdir(self.pkg)
+ orig = self._download_url('2.6')
+ ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 0)
+ self._check_repo_state(repo, 'master', self.def_branches,
+ tags=['upstream/2.6'])
+
+ def _check_component_tarballs(self, repo, files):
+ for file in files:
+ ok_(to_bin(file) in repo.ls_tree('HEAD'),
+ "Could not find component tarball file %s in %s" % (file, repo.ls_tree('HEAD')))
+ ok_(to_bin(file) in repo.ls_tree('upstream'),
+ "Could not find component tarball file %s in %s" % (file, repo.ls_tree('upstream')))
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_update(self, repo):
+ """
+ Test that importing a new version works
+ """
+ orig = self._orig('2.8')
+ ok_(import_orig(['arg0',
+ '--postimport=printenv > ../postimport.out',
+ '--postunpack=printenv > ../postunpack.out',
+ '--no-interactive', '--pristine-tar', orig]) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+ ok_(os.path.exists('debian/changelog'))
+ ok_(os.path.exists('../postimport.out'))
+ self.check_hook_vars('../postimport', [("GBP_BRANCH", "master"),
+ ("GBP_TAG", "upstream/2.8"),
+ ("GBP_UPSTREAM_VERSION", "2.8"),
+ ("GBP_DEBIAN_VERSION", "2.8-1")])
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_update_component_tarballs(self, repo):
+ """
+ Test importing new version with additional tarballs works
+ """
+ # Import 2.8
+ orig = self._orig('2.8', dir='dsc-3.0-additional-tarballs')
+ ok_(import_orig(['arg0', '--component=foo', '--no-interactive', '--pristine-tar', orig]) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+ self._check_component_tarballs(repo, [b'foo/test1', b'foo/test2'])
+ ok_(os.path.exists('debian/changelog'))
+
+ dsc = DscFile.parse(_dsc_file(self.pkg, '2.8-1', dir='dsc-3.0-additional-tarballs'))
+ # Check if we can rebuild the upstream tarball and additional tarball
+ ptars = [('hello-debhelper_2.8.orig.tar.gz', 'pristine-tar', '', dsc.tgz),
+ ('hello-debhelper_2.8.orig-foo.tar.gz', 'pristine-tar^', 'foo', dsc.additional_tarballs['foo'])]
+
+ p = DebianPristineTar(repo)
+ outdir = os.path.abspath('.')
+ for f, w, s, o in ptars:
+ eq_(repo.get_subject(w), 'pristine-tar data for %s' % f)
+ old = self.hash_file(o)
+ p.checkout('hello-debhelper', '2.8', 'gzip', outdir, component=s)
+ out = os.path.join(outdir, f)
+ new = self.hash_file(out)
+ eq_(old, new, "Checksum %s of regenerated tarball %s does not match original %s" %
+ (f, old, new))
+ os.unlink(out)
+
+ # Import 2.9
+ orig = self._orig('2.9', dir='dsc-3.0-additional-tarballs')
+ ok_(import_orig(['arg0', '--component=foo', '--no-interactive', '--pristine-tar', orig]) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8', 'upstream/2.9'])
+ self._check_component_tarballs(repo, ['foo/test1', 'foo/test2', 'foo/test3'])
+ ok_(os.path.exists('debian/changelog'))
+
+ dsc = DscFile.parse(_dsc_file(self.pkg, '2.9-1', dir='dsc-3.0-additional-tarballs'))
+ # Check if we can rebuild the upstream tarball and additional tarball
+ ptars = [('hello-debhelper_2.9.orig.tar.gz', 'pristine-tar', '', dsc.tgz),
+ ('hello-debhelper_2.9.orig-foo.tar.gz', 'pristine-tar^', 'foo', dsc.additional_tarballs['foo'])]
+
+ p = DebianPristineTar(repo)
+ outdir = os.path.abspath('.')
+ for f, w, s, o in ptars:
+ eq_(repo.get_subject(w), 'pristine-tar data for %s' % f)
+ old = self.hash_file(o)
+ p.checkout('hello-debhelper', '2.9', 'gzip', outdir, component=s)
+ new = self.hash_file(os.path.join(outdir, f))
+ eq_(old, new, "Checksum %s of regenerated tarball %s does not match original %s" %
+ (f, old, new))
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_update_from_upstream_branch(self, repo):
+ orig = self._orig('2.8')
+ repo.checkout('upstream')
+ ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 0)
+ self._check_repo_state(repo, 'upstream', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+
+ def test_tag_exists(self):
+ """Test that importing an already imported version fails"""
+ repo = GitRepository.create(self.pkg)
+ os.chdir(repo.path)
+ orig = self._orig('2.6')
+ # First import
+ ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 0)
+ heads = self.rem_refs(repo, self.def_branches)
+ # Second import must fail
+ ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 1)
+ self._check_log(0, "gbp:error: Upstream tag 'upstream/2.6' already exists")
+ # Check that the second import didn't change any refs
+ self.check_refs(repo, heads)
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_update_fail_create_upstream_tag(self, repo):
+ """
+ Test that we can rollback from a failure to create the upstream
+ tag
+ """
+ heads = self.rem_refs(repo, self.def_branches)
+ orig = self._orig('2.8')
+ with patch('gbp.git.repository.GitRepository.create_tag',
+ side_effect=GitRepositoryError('this is a create tag error mock')):
+ ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 1)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6'])
+ self.check_refs(repo, heads)
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_update_fail_merge(self, repo):
+ """
+ Test that we can rollback from a failed merge
+ """
+ heads = self.rem_refs(repo, self.def_branches)
+ orig = self._orig('2.8')
+ with patch('gbp.scripts.import_orig.debian_branch_merge',
+ side_effect=GitRepositoryError('this is a fail merge error mock')):
+ ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 1)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6'])
+ self.check_refs(repo, heads)
+
+ @patch('gbp.git.repository.GitRepository.create_tag',
+ side_effect=raise_if_tag_match('upstream/'))
+ def test_initial_import_fail_create_upstream_tag(self, RepoMock):
+ """
+ Test that we can rollback from a failure to create the upstream
+ tag on initial import
+ """
+ repo = GitRepository.create(self.pkg)
+ os.chdir(repo.path)
+ orig = self._orig('2.6')
+ ok_(import_orig(['arg0', '--no-interactive', orig]) == 1)
+
+ self._check_repo_state(repo, None, [], tags=[])
+
+ def test_initial_import_fail_create_debian_branch(self):
+ """
+ Test that we can rollback from creating the Debian branch on
+ initial import
+ """
+ repo = GitRepository.create(self.pkg)
+ os.chdir(self.pkg)
+ orig = self._orig('2.6')
+
+ with patch('gbp.git.repository.GitRepository.create_branch',
+ side_effect=GitRepositoryError('this is a create branch error mock')):
+ ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 1)
+
+ self._check_repo_state(repo, None, [], tags=[])
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_filter_with_component_tarballs(self, repo):
+ """
+ Test that using a filter works with component tarballs (#840602)
+ """
+ # copy data since we don't want the repacked tarball to end up in DEB_TEST_DATA_DIR
+ os.mkdir('../tarballs')
+ for f in ['hello-debhelper_2.8.orig-foo.tar.gz', 'hello-debhelper_2.8.orig.tar.gz']:
+ src = os.path.join(DEB_TEST_DATA_DIR, 'dsc-3.0-additional-tarballs', f)
+ shutil.copy(src, '../tarballs')
+
+ ok_(import_orig(['arg0',
+ '--component=foo',
+ '--no-interactive',
+ '--pristine-tar',
+ '--filter-pristine-tar',
+ '--filter=README*',
+ '../tarballs/hello-debhelper_2.8.orig.tar.gz']) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+ self._check_component_tarballs(repo, ['foo/test1', 'foo/test2'])
+
+ ok_(b'COPYING' in repo.ls_tree('HEAD'))
+ ok_(b'README' not in repo.ls_tree('HEAD'),
+ "README not filtered out of %s" % repo.ls_tree('HEAD'))
+ tar = '../hello-debhelper_2.8.orig.tar.gz'
+
+ # Check if tar got filtered properly
+ ok_(os.path.exists(tar))
+ t = tarfile.open(name=tar, mode="r:gz")
+ for f in ['hello-2.8/configure']:
+ i = t.getmember(f)
+ eq_(type(i), tarfile.TarInfo)
+ for f in ['hello-2.8/README']:
+ with assert_raises(KeyError):
+ t.getmember(f)
+ t.close()
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_filter_with_component_tarballs_and_postunpack_changes(self, repo):
+ """
+ Test that using a filter works with component tarballs (#840602) and
+ that the postunpack hook can be used to do more sophisticated changes
+ to the orig (#951534).
+ """
+ # copy data since we don't want the repacked tarball to end up in DEB_TEST_DATA_DIR
+ os.mkdir('../tarballs')
+ for f in ['hello-debhelper_2.8.orig-foo.tar.gz', 'hello-debhelper_2.8.orig.tar.gz']:
+ src = os.path.join(DEB_TEST_DATA_DIR, 'dsc-3.0-additional-tarballs', f)
+ shutil.copy(src, '../tarballs')
+
+ ok_(import_orig(['arg0',
+ '--component=foo',
+ '--no-interactive',
+ '--pristine-tar',
+ '--filter-pristine-tar',
+ '--filter=README*',
+ '--postunpack=printenv > $GBP_SOURCES_DIR/postunpack.out;' +
+ 'rm $GBP_SOURCES_DIR/TODO',
+ '../tarballs/hello-debhelper_2.8.orig.tar.gz']) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+ self._check_component_tarballs(repo, ['foo/test1', 'foo/test2'])
+
+ ok_(b'COPYING' in repo.ls_tree('HEAD'))
+ ok_(b'README' not in repo.ls_tree('HEAD'),
+ "README not filtered out of %s" % repo.ls_tree('HEAD'))
+ ok_(b'TODO' not in repo.ls_tree('HEAD'),
+ "TODO not filtered out of %s" % repo.ls_tree('HEAD'))
+ tar = '../hello-debhelper_2.8.orig.tar.gz'
+
+ # Check if tar got filtered properly
+ ok_(os.path.exists(tar))
+ t = tarfile.open(name=tar, mode="r:gz")
+ for f in ['hello-2.8/configure', 'hello-2.8/postunpack.out']:
+ i = t.getmember(f)
+ eq_(type(i), tarfile.TarInfo)
+ for f in ['hello-2.8/README', 'hello-2.8/TODO']:
+ with assert_raises(KeyError):
+ t.getmember(f)
+ t.close()
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_filter_with_orig_tarball(self, repo):
+ """
+ Test that using a filter works with an upstream tarball that has
+ already the correct name (#558777)
+ """
+ f = 'hello-debhelper_2.8.orig.tar.gz'
+ src = os.path.join(DEB_TEST_DATA_DIR, 'dsc-3.0', f)
+ shutil.copy(src, '..')
+
+ ok_(import_orig(['arg0',
+ '--no-interactive',
+ '--pristine-tar',
+ '--filter-pristine-tar',
+ '--filter=README*',
+ '../hello-debhelper_2.8.orig.tar.gz']) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+
+ filtered = os.path.join('..', f)
+ ok_(os.path.exists(filtered))
+ eq_(os.readlink(filtered).split('/')[-1],
+ 'hello-debhelper_2.8.orig.gbp.tar.gz')
+ # Check if tar got filtered properly
+ t = tarfile.open(name=filtered, mode="r:gz")
+ for f in ['hello-2.8/configure']:
+ i = t.getmember(f)
+ eq_(type(i), tarfile.TarInfo)
+ for f in ['hello-2.8/README']:
+ with assert_raises(KeyError):
+ t.getmember(f)
+ t.close()
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_filter_with_orig_tarball_and_postunpack_changes(self, repo):
+ """
+ Test that using a filter works with an upstream tarball that has
+ already the correct name (#558777) and that the postunpack hook can
+ be used to do more sophisticated changes to the orig (#951534).
+ """
+ f = 'hello-debhelper_2.8.orig.tar.gz'
+ src = os.path.join(DEB_TEST_DATA_DIR, 'dsc-3.0', f)
+ shutil.copy(src, '..')
+
+ ok_(import_orig(['arg0',
+ '--no-interactive',
+ '--pristine-tar',
+ '--filter-pristine-tar',
+ '--filter=README*',
+ '--postunpack=printenv > $GBP_SOURCES_DIR/postunpack.out;' +
+ 'rm $GBP_SOURCES_DIR/TODO',
+ '../hello-debhelper_2.8.orig.tar.gz']) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+
+ filtered = os.path.join('..', f)
+ ok_(os.path.exists(filtered))
+ eq_(os.readlink(filtered).split('/')[-1],
+ 'hello-debhelper_2.8.orig.gbp.tar.gz')
+ # Check if tar got filtered properly
+ t = tarfile.open(name=filtered, mode="r:gz")
+ for f in ['hello-2.8/configure', 'hello-2.8/postunpack.out']:
+ i = t.getmember(f)
+ eq_(type(i), tarfile.TarInfo)
+ for f in ['hello-2.8/README', 'hello-2.8/TODO']:
+ with assert_raises(KeyError):
+ t.getmember(f)
+ t.close()
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_postunpack_changes_with_orig_tarball(self, repo):
+ """
+ Test that using a postunpack script to apply changes works with an
+ upstream tarball that has already the correct name (#951534).
+ """
+ f = 'hello-debhelper_2.8.orig.tar.gz'
+ src = os.path.join(DEB_TEST_DATA_DIR, 'dsc-3.0', f)
+ shutil.copy(src, '..')
+
+ ok_(import_orig(['arg0',
+ '--no-interactive',
+ '--pristine-tar',
+ '--filter-pristine-tar',
+ '--postunpack=printenv > $GBP_SOURCES_DIR/postunpack.out;' +
+ 'rm $GBP_SOURCES_DIR/TODO; rm $GBP_SOURCES_DIR/README',
+ '../hello-debhelper_2.8.orig.tar.gz']) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+
+ filtered = os.path.join('..', f)
+ ok_(os.path.exists(filtered))
+ eq_(os.readlink(filtered).split('/')[-1],
+ 'hello-debhelper_2.8.orig.gbp.tar.gz')
+ # Check if tar got filtered properly
+ t = tarfile.open(name=filtered, mode="r:gz")
+ for f in ['hello-2.8/configure', 'hello-2.8/postunpack.out']:
+ i = t.getmember(f)
+ eq_(type(i), tarfile.TarInfo)
+ for f in ['hello-2.8/README', 'hello-2.8/TODO']:
+ with assert_raises(KeyError):
+ t.getmember(f)
+ t.close()
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_filter_unpacked_dir(self, repo):
+ """
+ Test that importing and filtering unpacked upstream source works.
+ """
+ f = 'hello-debhelper_2.8.orig.tar.gz'
+ src = os.path.join(DEB_TEST_DATA_DIR, 'dsc-3.0', f)
+
+ # Create an unpacked tarball we can import
+ UnpackTarArchive(src, '..')()
+ ok_(os.path.exists('../hello-2.8'))
+
+ ok_(import_orig(['arg0',
+ '--no-interactive',
+ '--pristine-tar',
+ '--filter-pristine-tar',
+ '--filter=README*',
+ '../hello-2.8']) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+
+ filtered = os.path.join('..', f)
+ ok_(os.path.exists(filtered))
+ # Check if tar got filtered properly
+ t = tarfile.open(name=filtered, mode="r:gz")
+ for f in ['hello-2.8/configure']:
+ i = t.getmember(f)
+ eq_(type(i), tarfile.TarInfo)
+ for f in ['hello-2.8/README']:
+ with assert_raises(KeyError):
+ t.getmember(f)
+ t.close()
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_filter_unpacked_dir_with_postunpack_changes(self, repo):
+ """
+ Test that importing and filtering unpacked upstream source works and
+ that the postunpack hook can be used to do more sophisticated changes
+ to the orig (#951534).
+ """
+ f = 'hello-debhelper_2.8.orig.tar.gz'
+ src = os.path.join(DEB_TEST_DATA_DIR, 'dsc-3.0', f)
+
+ # Create an unpacked tarball we can import
+ UnpackTarArchive(src, '..')()
+ ok_(os.path.exists('../hello-2.8'))
+
+ ok_(import_orig(['arg0',
+ '--no-interactive',
+ '--pristine-tar',
+ '--filter-pristine-tar',
+ '--filter=README*',
+ '--postunpack=printenv > $GBP_SOURCES_DIR/postunpack.out;' +
+ 'rm $GBP_SOURCES_DIR/TODO',
+ '../hello-2.8']) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
+
+ filtered = os.path.join('..', f)
+ ok_(os.path.exists(filtered))
+ # Check if tar got filtered properly
+ t = tarfile.open(name=filtered, mode="r:gz")
+ for f in ['hello-2.8/configure', 'hello-2.8/postunpack.out']:
+ i = t.getmember(f)
+ eq_(type(i), tarfile.TarInfo)
+ for f in ['hello-2.8/README', 'hello-2.8/TODO']:
+ with assert_raises(KeyError):
+ t.getmember(f)
+ t.close()
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_import_in_submodule(self, repo):
+ """
+ Test that importing works if repo is a git submodule (#674015)
+ """
+ parent_repo = GitRepository.create('../parent')
+ parent_repo.add_submodule(repo.path)
+ parent_repo.update_submodules(init=True, recursive=True)
+ submodule = GitRepository(os.path.join(parent_repo.path,
+ 'hello-debhelper'))
+ ok_(submodule.path.endswith, 'parent/hello-debhelper')
+ os.chdir(submodule.path)
+ orig = self._orig('2.8')
+ submodule.create_branch('upstream', 'origin/upstream')
+ ok_(import_orig(['arg0', '--no-interactive', orig]) == 0)
+
+ def test_with_signaturefile(self):
+ """
+ Test that importing a new version with a signature file works
+ """
+ repo = ComponentTestGitRepository.create(self.pkg)
+ os.chdir(self.pkg)
+ orig = self._orig('2.8')
+ ok_(import_orig(['arg0',
+ '--postimport=printenv > ../postimport.out',
+ '--postunpack=printenv > ../postunpack.out',
+ '--no-interactive', '--pristine-tar',
+ '--upstream-signatures=on', orig]) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['upstream/2.8'])
+ ok_(os.path.exists('../postimport.out'))
+ eq_(repo.ls_tree('pristine-tar'), {b'hello-debhelper_2.8.orig.tar.gz.id',
+ b'hello-debhelper_2.8.orig.tar.gz.delta',
+ b'hello-debhelper_2.8.orig.tar.gz.asc'})
+ self.check_hook_vars('../postimport', [("GBP_BRANCH", "master"),
+ ("GBP_TAG", "upstream/2.8"),
+ ("GBP_UPSTREAM_VERSION", "2.8"),
+ ("GBP_DEBIAN_VERSION", "2.8-1")])
+
+ def test_with_auto_signaturefile(self):
+ """
+ Test that importing a new version with a signature file works
+ when using auto mode.
+ """
+ repo = ComponentTestGitRepository.create(self.pkg)
+ os.chdir(self.pkg)
+ orig = self._orig('2.8')
+ ok_(import_orig(['arg0',
+ '--postimport=printenv > ../postimport.out',
+ '--postunpack=printenv > ../postunpack.out',
+ '--no-interactive', '--pristine-tar',
+ '--upstream-signatures=auto', orig]) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
+ tags=['upstream/2.8'])
+ ok_(os.path.exists('../postimport.out'))
+ eq_(repo.ls_tree('pristine-tar'), {b'hello-debhelper_2.8.orig.tar.gz.id',
+ b'hello-debhelper_2.8.orig.tar.gz.delta',
+ b'hello-debhelper_2.8.orig.tar.gz.asc'})
+ self.check_hook_vars('../postimport', [("GBP_BRANCH", "master"),
+ ("GBP_TAG", "upstream/2.8"),
+ ("GBP_UPSTREAM_VERSION", "2.8"),
+ ("GBP_DEBIAN_VERSION", "2.8-1")])
+
+ def test_postunpack_env_vars(self):
+ """
+ Test that the expected environment variables are set during
+ postunpack hook.
+ """
+ ComponentTestGitRepository.create(self.pkg)
+ os.chdir(self.pkg)
+ orig = self._orig('2.8')
+ ok_(import_orig(['arg0',
+ '--postunpack=printenv > ../postunpack.out',
+ '--no-interactive', '--pristine-tar', orig]) == 0)
+ self.check_hook_vars('../postunpack', ["GBP_GIT_DIR",
+ "GBP_TMP_DIR",
+ "GBP_SOURCES_DIR"])
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled")
+ def test_uscan(self, repo):
+ """Test that importing via uscan works"""
+ with open("debian/watch", 'w+', encoding='utf-8') as f:
+ f.write("""version=4
+https://git.sigxcpu.org/cgit/gbp/deb-testdata/plain/dsc-3.0/ \
+ @PACKAGE@_@ANY_VERSION@\\.orig\\.tar\\.gz
+""")
+ repo.add_files(["debian/watch"])
+ repo.commit_files("debian/watch", msg="Add watch file")
+ ok_(import_orig(['arg0', '--uscan', '--no-interactive', '--no-pristine-tar']) == 0)
+ self._check_repo_state(repo, 'master', self.def_branches,
+ tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2015,2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import ComponentTestBase
+from tests.component.deb import DEB_TEST_DATA_DIR
+from tests.component.deb.fixtures import RepoFixtures
+
+from gbp.scripts.import_ref import main as import_ref
+
+from nose.tools import ok_, eq_
+
+
+def _dsc_file(pkg, version, dir='dsc-3.0'):
+ return os.path.join(DEB_TEST_DATA_DIR, dir, '%s_%s.dsc' % (pkg, version))
+
+
+DEFAULT_DSC = _dsc_file('hello-debhelper', '2.6-2')
+
+
+class TestImportRef(ComponentTestBase):
+ """Test importing of new upstream versions"""
+ pkg = "hello-debhelper"
+ def_branches = ['master', 'upstream', 'pristine-tar']
+
+ def _orig(self, version, dir='dsc-3.0'):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ dir,
+ '%s_%s.orig.tar.gz' % (self.pkg, version))
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_from_branch(self, repo):
+ """
+ Test that importing a upstream git from a branch works
+ """
+ eq_(len(repo.get_commits()), 2)
+ ok_(import_ref(['arg0',
+ '--upstream-tree=BRANCH',
+ '--upstream-tag=theupstream/%(version)s',
+ '-uaversion']) == 0)
+ self._check_repo_state(repo, 'master', self.def_branches,
+ tags=['debian/2.6-2', 'theupstream/aversion', 'upstream/2.6'])
+ eq_(len(repo.get_commits()), 3)
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_from_version(self, repo):
+ """
+ Test that importing a upstream git from a given version works
+ """
+ eq_(len(repo.get_commits()), 2)
+ ok_(import_ref(['arg0',
+ '--upstream-tree=VERSION',
+ '--upstream-tag=upstream/%(version)s',
+ '-u2.6']) == 0)
+ self._check_repo_state(repo, 'master', self.def_branches,
+ tags=['debian/2.6-2', 'upstream/2.6'])
+ eq_(len(repo.get_commits()), 3)
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--pristine-tar'])
+ def test_from_committish(self, repo):
+ """
+ Test that importing a upstream git from another commit works
+ """
+ eq_(len(repo.get_commits()), 2)
+ ok_(import_ref(['arg0',
+ '--upstream-tree=upstream',
+ '--upstream-tag=upstream/%(version)s',
+ '-u2.6']) == 0)
+ self._check_repo_state(repo, 'master', self.def_branches,
+ tags=['debian/2.6-2', 'upstream/2.6'])
+ eq_(len(repo.get_commits()), 3)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import (ComponentTestBase)
+
+from tests.component.deb import DEB_TEST_DATA_DIR
+from tests.component.deb.fixtures import RepoFixtures
+
+from nose.tools import ok_, eq_
+
+from gbp.scripts.pq import main as pq
+from gbp.scripts.import_dsc import main as import_dsc
+
+
+class TestPq(ComponentTestBase):
+ """Test gbp pq"""
+
+ def _test_pq(self, repo, action, opts=[]):
+ args = ['arg0', action] + opts
+ os.chdir(os.path.abspath(repo.path))
+ ret = pq(args)
+ ok_(ret == 0, "Running gbp pq %s failed" % action)
+
+ @RepoFixtures.quilt30()
+ def test_rebase_import(self, repo):
+ """Test that rebase imports patches first"""
+ eq_(repo.branch, 'master')
+ eq_(repo.has_branch('patch-queue/master'), False)
+ self._test_pq(repo, 'rebase')
+ eq_(repo.has_branch('patch-queue/master'), True)
+
+ @RepoFixtures.quilt30()
+ def test_switch_import(self, repo):
+ """Test that switch imports patches first"""
+ eq_(repo.branch, 'master')
+ eq_(repo.has_branch('patch-queue/master'), False)
+ self._test_pq(repo, 'switch')
+ eq_(repo.has_branch('patch-queue/master'), True)
+
+ @RepoFixtures.quilt30()
+ def test_empty_cycle(self, repo):
+ eq_(repo.has_branch('patch-queue/master'), False)
+ eq_(repo.branch, 'master')
+ self._test_pq(repo, 'import')
+ eq_(repo.has_branch('patch-queue/master'), True)
+ eq_(repo.branch, 'patch-queue/master')
+ self._test_pq(repo, 'rebase')
+ eq_(repo.branch, 'patch-queue/master')
+ self._test_pq(repo, 'export')
+ eq_(repo.has_branch('patch-queue/master'), True)
+ eq_(repo.branch, 'master')
+ self._test_pq(repo, 'drop')
+ eq_(repo.has_branch('patch-queue/master'), False)
+
+ @RepoFixtures.quilt30()
+ def test_rename(self, repo):
+ patch = os.path.join(repo.path, 'debian/patches/0001-Rename.patch')
+
+ repo.set_config('diff.renames', 'true')
+ self._test_pq(repo, 'import')
+ repo.rename_file('configure.ac', 'renamed')
+ repo.commit_all("Rename")
+ self._test_pq(repo, 'export')
+ self.assertTrue(
+ os.path.exists(patch))
+ # Check the file was removed and added, not renamed
+ with open(patch) as f:
+ self.assertTrue('rename from' not in f.read())
+ self.assertTrue('rename to' not in f.read())
+
+ @staticmethod
+ def _dsc_name(pkg, version, dir):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ dir,
+ '%s_%s.dsc' % (pkg, version))
+
+ @staticmethod
+ def _append_patch(repo, name, contents):
+ with open(os.path.join(repo.path, 'debian/patches/series'), 'a') as series_file:
+ series_file.write('{}.patch\n'.format(name))
+
+ with open(os.path.join(repo.path, 'debian/patches/{}.patch'.format(name)), 'w') as patch:
+ patch.write(contents)
+
+ repo.add_files('debian/patches/{}.patch'.format(name))
+ repo.commit_files(msg='Add patch: {}.patch'.format(name),
+ files=['debian/patches/series',
+ 'debian/patches/{}.patch'.format(name)])
+
+ @RepoFixtures.quilt30()
+ def test_import(self, repo):
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.6-2', 'dsc-3.0')
+ eq_(import_dsc(['arg0', dsc]), 0)
+ self._test_pq(repo, 'import')
+
+ author, subject = repo.get_head_author_subject()
+ eq_(author, 'Santiago Vila <sanvila@debian.org>')
+ eq_(subject, 'Modified doc/Makefile.in to avoid '
+ '/usr/share/info/dir.gz')
+
+ self._test_pq(repo, 'switch')
+
+ self._append_patch(repo, 'foo', '''\
+Author: Mr. T. St <t@example.com>
+Description: Short DEP3 description
+ Long DEP3 description
+ .
+ Continued
+--- /dev/null
++++ b/foo
+@@ -0,0 +1 @@
++foo
+''')
+ self._test_pq(repo, 'import', ['--force'])
+
+ author, subject = repo.get_head_author_subject()
+ eq_(subject, 'Short DEP3 description')
+ eq_(author, '"Mr. T. St" <t@example.com>')
+
+ @RepoFixtures.quilt30()
+ def test_import_poor_dep3_behaviour(self, repo):
+ """Demonstrate the issues with the current DEP3 support"""
+
+ pkg = 'hello-debhelper'
+ dsc = self._dsc_name(pkg, '2.6-2', 'dsc-3.0')
+ eq_(import_dsc(['arg0', dsc]), 0)
+
+ self._append_patch(repo, 'foo', '''\
+Author: Mr. T. St <t@example.com>
+Description: A very long description with wrapp-
+ ing to increase readability in the file, which
+ is currently split into a short and long description.
+Origin: https://twitter.com/MrT/status/941789967361097728
+Forwarded: not-needed
+--- /dev/null
++++ b/foo
+@@ -0,0 +1 @@
++foo
+''')
+ self._test_pq(repo, 'import', ['--force'])
+
+ _, subject = repo.get_head_author_subject()
+ eq_(subject, 'A very long description with wrapp-')
+
+ self._test_pq(repo, 'export')
+
+ relevant_parts_of_patch = ''
+ with open('debian/patches/foo.patch') as patch_file:
+ for line in patch_file:
+ # skip the date as it's currently set to now(),
+ # not a deterministic value
+ if line.startswith('Date: '):
+ continue
+
+ # stop reading after the main part of the description;
+ # i.e. ignore the bit that git(1) fully controls.
+ if line.startswith('---'):
+ break
+
+ relevant_parts_of_patch += line
+
+ eq_(relevant_parts_of_patch, '''\
+From: "Mr. T. St" <t@example.com>
+Subject: A very long description with wrapp-
+
+Origin: https://twitter.com/MrT/status/941789967361097728
+Forwarded: not-needed
+
+ ing to increase readability in the file, which
+ is currently split into a short and long description.
+''')
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import ComponentTestBase
+from tests.component.deb.fixtures import RepoFixtures
+from tests.component.deb import DEB_TEST_DATA_DIR
+
+from gbp.scripts.pristine_tar import main as pristine_tar
+
+from nose.tools import ok_, eq_
+
+
+def _dsc_file(pkg, version, dir='dsc-3.0'):
+ return os.path.join(DEB_TEST_DATA_DIR, dir, '%s_%s.dsc' % (pkg, version))
+
+
+DEFAULT_DSC = _dsc_file('hello-debhelper', '2.6-2')
+
+
+class TestPristineTar(ComponentTestBase):
+ """Test pristine-tar commit tool"""
+ pkg = "hello-debhelper"
+ def_branches = ['master', 'upstream', 'pristine-tar']
+
+ def _orig(self, version, dir='dsc-3.0'):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ dir,
+ '%s_%s.orig.tar.gz' % (self.pkg, version))
+
+ @RepoFixtures.quilt30(DEFAULT_DSC, opts=['--no-pristine-tar'])
+ def test_run(self, repo):
+ """
+ Test that adding pristine-tar commit works
+ """
+ orig = self._orig('2.6')
+ ok_(pristine_tar(['arg0', 'commit', orig]) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'])
+
+ @RepoFixtures.quilt30(_dsc_file('hello-debhelper',
+ '2.8-1',
+ dir='dsc-3.0-additional-tarballs'),
+ opts=['--no-pristine-tar'])
+ def test_run_component_tarball(self, repo):
+ """
+ Test that adding pristine-tar commits with additional tarballs works
+ """
+ orig = self._orig('2.8', dir='dsc-3.0-additional-tarballs')
+ ok_(pristine_tar(['arg0', 'commit', '--component=foo', orig]) == 0)
+ self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'])
+
+ ptars = [('hello-debhelper_2.8.orig.tar.gz', 'pristine-tar'),
+ ('hello-debhelper_2.8.orig-foo.tar.gz', 'pristine-tar^')]
+ for f, w in ptars:
+ eq_(repo.get_subject(w), 'pristine-tar data for %s' % f)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository)
+from tests.component.deb.fixtures import RepoFixtures
+
+from nose.tools import eq_
+
+from gbp.scripts.clone import main as clone
+from gbp.scripts.pull import main as pull
+
+
+class TestPull(ComponentTestBase):
+ """Test pulling from a remote"""
+
+ @RepoFixtures.native()
+ def test_pull_explicit_remote(self, repo):
+ """Test that pulling of debian native packages works (explicit remote)"""
+ dest = os.path.join(self._tmpdir, 'cloned_repo')
+ clone(['arg0', repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+ eq_(pull(['argv0', 'origin']), 0)
+ assert len(repo.get_commits()) == 1
+
+ @RepoFixtures.native()
+ def test_pull_default_remote(self, repo):
+ """Test that pulling of debian native packages works (default remote)"""
+ dest = os.path.join(self._tmpdir, 'cloned_repo')
+ clone(['arg0', repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+ eq_(pull(['argv0']), 0)
+ assert len(repo.get_commits()) == 1
+
+ @RepoFixtures.quilt30()
+ def test_pull_all(self, repo):
+ """Test the '--all' commandline option"""
+ # Create new branch in repo
+ repo.create_branch('foob')
+
+ # Clone and create new commits in origin
+ dest = os.path.join(self._tmpdir, 'cloned_repo')
+ clone(['arg0', '--all', repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ tmp_workdir = os.path.join(self._tmpdir, 'tmp_workdir')
+ os.mkdir(tmp_workdir)
+ with open(os.path.join(tmp_workdir, 'new_file'), 'w'):
+ pass
+ repo.commit_dir(tmp_workdir, 'New commit in master', branch='master')
+ repo.commit_dir(tmp_workdir, 'New commit in foob', branch='foob')
+
+ # Check that the branch is not updated when --all is not used
+ eq_(pull(['argv0']), 0)
+ eq_(len(cloned.get_commits(until='master')), 3)
+ eq_(len(cloned.get_commits(until='upstream')), 1)
+ eq_(len(cloned.get_commits(until='foob')), 2)
+
+ # Check that --all updates all branches
+ repo.commit_dir(tmp_workdir, 'New commit in upstream', branch='upstream')
+ eq_(pull(['argv0', '--all']), 0)
+ eq_(len(cloned.get_commits(until='foob')), 3)
+ eq_(len(cloned.get_commits(until='upstream')), 2)
+
+ @RepoFixtures.native()
+ def test_tracking(self, repo):
+ """Test that --track-missing picks up missing branches"""
+ dest = os.path.join(self._tmpdir, 'cloned_repo')
+ clone(['arg0', repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ os.chdir(cloned.path)
+ self._check_repo_state(cloned, 'master', ['master'])
+ # Pull initially
+ eq_(pull(['argv0']), 0)
+ assert len(repo.get_commits()) == 1
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ # Pick up missing branches (none exist yet)
+ eq_(pull(['argv0', '--track-missing']), 0)
+ assert len(repo.get_commits()) == 1
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ # Pick up missing branches
+ repo.create_branch('pristine-tar')
+ repo.create_branch('upstream')
+ eq_(pull(['argv0', '--track-missing', '--pristine-tar']), 0)
+ assert len(repo.get_commits()) == 1
+ self._check_repo_state(cloned, 'master', ['master', 'pristine-tar', 'upstream'])
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import subprocess
+
+from tests.component import ComponentTestBase
+
+from tests.component.deb.fixtures import RepoFixtures
+from tests.testutils import skip_without_cmd
+
+from gbp.git import GitRepository
+from gbp.scripts.push import main as push
+
+
+class TestPush(ComponentTestBase):
+ """Test pushing to remote repos"""
+
+ def setUp(self):
+ ComponentTestBase.setUp(self)
+ self.target = GitRepository.create('target', bare=True)
+
+ @RepoFixtures.native()
+ def test_push_native(self, repo):
+ repo.add_remote_repo('origin', self.target.path)
+ self.assertEquals(push(['argv0']), 0)
+ self._check_repo_state(self.target, 'master',
+ ['master'],
+ tags=['debian/0.4.14'])
+ self.assertEquals(repo.head, self.target.head)
+
+ @RepoFixtures.quilt30()
+ def test_push_upstream(self, repo):
+ repo.add_remote_repo('origin', self.target.path)
+ self.assertEquals(push(['argv0']), 0)
+ self._check_repo_state(self.target, 'master',
+ ['master', 'upstream'],
+ tags=['debian/2.8-1', 'upstream/2.8'])
+ self.assertEquals(repo.head, self.target.head)
+
+ @RepoFixtures.quilt30(opts=['--pristine-tar'])
+ def test_push_pristine_tar(self, repo):
+ repo.add_remote_repo('origin', self.target.path)
+ self.assertEquals(push(['argv0', '--pristine-tar']), 0)
+ self._check_repo_state(self.target, 'master',
+ ['master', 'upstream', 'pristine-tar'],
+ tags=['debian/2.8-1', 'upstream/2.8'])
+ self.assertEquals(repo.head, self.target.head)
+
+ @RepoFixtures.quilt30(opts=['--pristine-tar'])
+ def test_push_detached_head(self, repo):
+ repo.checkout("HEAD^{commit}")
+ repo.add_remote_repo('origin', self.target.path)
+ self.assertEquals(push(['argv0', '--ignore-branch']), 0)
+ # Since branch head is detached we don't push it but upstream
+ # branch and tags must be there:
+ self._check_repo_state(self.target, None,
+ ['upstream'],
+ tags=['debian/2.8-1', 'upstream/2.8'])
+
+ @RepoFixtures.quilt30()
+ def test_push_skip_upstream(self, repo):
+ repo.add_remote_repo('origin', self.target.path)
+ self.assertEquals(push(['argv0', '--upstream-branch=']), 0)
+ self._check_repo_state(self.target, 'master',
+ ['master'],
+ tags=['debian/2.8-1', 'upstream/2.8'])
+ self.assertEquals(repo.head, self.target.head)
+
+ @RepoFixtures.native()
+ def test_push_tag_ne_branch(self, repo):
+ repo.add_remote_repo('origin', self.target.path)
+ self.add_file(repo, "foo.txt", "foo")
+ self.assertEquals(push(['argv0']), 0)
+ self._check_repo_state(self.target, 'master',
+ ['master'],
+ tags=['debian/0.4.14'])
+ self.assertEquals(repo.rev_parse("HEAD^"),
+ self.target.head)
+
+ @RepoFixtures.quilt30()
+ def test_not_debian_branch(self, repo):
+ repo.add_remote_repo('origin', self.target.path)
+ repo.create_branch("foo")
+ repo.set_branch("foo")
+ self.assertEquals(push(['argv0']), 1)
+ self._check_log(-2, ".*You are not on branch 'master' but on 'foo'")
+
+ @skip_without_cmd('debchange')
+ @RepoFixtures.quilt30()
+ def test_dont_push_unreleased(self, repo):
+ repo.add_remote_repo('origin', self.target.path)
+ subprocess.check_call(["debchange", "-i", "foo"])
+ self.assertEquals(push(['argv0']), 0)
+ self._check_repo_state(self.target, None,
+ ['upstream'],
+ tags=['upstream/2.8'])
+
+ @RepoFixtures.quilt30()
+ def test_push_not_origin(self, repo):
+ repo.add_remote_repo('notorigin', self.target.path)
+ self.assertEquals(push(['argv0', 'notorigin']), 0)
+ self._check_repo_state(self.target, 'master',
+ ['master', 'upstream'],
+ tags=['debian/2.8-1', 'upstream/2.8'])
+ self.assertEquals(repo.head, self.target.head)
+
+ @RepoFixtures.quilt30()
+ def test_push_not_origin_detect(self, repo):
+ repo.add_remote_repo('notorigin', self.target.path)
+ repo.set_config("branch.master.remote", "notorigin")
+ repo.set_config("branch.master.merge", "refs/heads/master")
+ self.assertEquals(push(['argv0']), 0)
+ self._check_repo_state(self.target, 'master',
+ ['master', 'upstream'],
+ tags=['debian/2.8-1', 'upstream/2.8'])
+ self.assertEquals(repo.head, self.target.head)
+
+ @RepoFixtures.quilt30()
+ def test_push_failure(self, repo):
+ """
+ Check that in case of failure we push all other branches/tags
+ """
+ repo.add_remote_repo('origin', self.target.path)
+
+ # Make the upstream branch not fast forwardable so pushing to it fails
+ repo.push('origin', 'master')
+ self.target.create_branch('upstream', 'master')
+
+ self.assertEquals(push(['argv0']), 1)
+ self._check_repo_state(self.target, 'master',
+ ['master', 'upstream'],
+ tags=['debian/2.8-1', 'upstream/2.8'])
+ self.assertEquals(repo.head, self.target.head)
+ self._check_in_log('.*Error running git push: To.*/target')
+ self._check_log(-1, ".*Failed to push some refs")
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2021 Andrej Shadura <andrew@shadura.me>
+# (C) 2021 Collabora Limited
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import (ComponentTestBase,
+ ComponentTestGitRepository)
+from tests.component.deb.fixtures import RepoFixtures
+
+from nose.tools import ok_
+
+from gbp.scripts.clone import main as clone
+from gbp.scripts.setup_gitattributes import main as setup_gitattributes
+
+
+sorted_gitattrs = [
+ '# Added by git-buildpackage to disable .gitattributes found in the upstream tree',
+ '* -export-ignore',
+ '* -export-subst',
+ '* dgit-defuse-attrs',
+ '[attr]dgit-defuse-attrs -text -eol -crlf -ident -filter -working-tree-encoding',
+]
+
+
+dgit_attributes = [
+ '*\tdgit-defuse-attrs',
+ '[attr]dgit-defuse-attrs\t-text -eol -crlf -ident -filter -working-tree-encoding',
+ '# ^ see GITATTRIBUTES in dgit(7) and dgit setup-new-tree in dgit(1)'
+]
+
+
+dgit34_attributes = [
+ '*\tdgit-defuse-attrs',
+ '[attr]dgit-defuse-attrs\t-text -eol -crlf -ident -filter',
+ '# ^ see dgit(7). To undo, leave a definition of [attr]dgit-defuse-attrs'
+]
+
+
+class TestSetupGitattributes(ComponentTestBase):
+ """Test setting up Git attributes"""
+
+ @RepoFixtures.native()
+ def test_setup_gitattrs_do_nothing(self, repo):
+ """Test that disabling all knows presets works and gives an error"""
+ dest = os.path.join(self._tmpdir,
+ 'cloned_repo')
+ clone(['arg0',
+ repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ attrs_file = os.path.join(dest, '.git', 'info', 'attributes')
+
+ # file shouldn’t exist at this point yet
+ self.assertFalse(os.path.exists(attrs_file) and os.path.getsize(attrs_file),
+ "%s is non-empty" % attrs_file)
+
+ os.chdir(cloned.path)
+ setup_gitattributes(['arg0', '--no-dgit-defuse-attrs'])
+
+ # file shouldn’t exist at this point yet
+ self.assertFalse(os.path.exists(attrs_file) and os.path.getsize(attrs_file),
+ "%s is non-empty" % attrs_file)
+
+ self._check_log(-1,
+ "gbp:error: Nothing to do, no settings to apply.")
+
+ @RepoFixtures.native()
+ def test_setup_gitattrs(self, repo):
+ """Test that setting up Git attributes manually works"""
+ dest = os.path.join(self._tmpdir,
+ 'cloned_repo')
+ clone(['arg0',
+ repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ attrs_file = os.path.join(dest, '.git', 'info', 'attributes')
+
+ # file shouldn’t exist at this point yet
+ self.assertFalse(os.path.exists(attrs_file) and os.path.getsize(attrs_file),
+ "%s is non-empty" % attrs_file)
+
+ os.chdir(cloned.path)
+ setup_gitattributes(['arg0'])
+
+ ok_(os.path.exists(attrs_file), "%s is missing" % attrs_file)
+
+ with open(attrs_file) as f:
+ attrs = sorted(f.read().splitlines())
+ self.assertEquals(attrs, sorted_gitattrs)
+
+ @RepoFixtures.native()
+ def test_setup_gitattrs_dgit(self, repo):
+ """Test that setting up Git attributes manually works even with dgit"""
+ dest = os.path.join(self._tmpdir,
+ 'cloned_repo')
+ clone(['arg0',
+ repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ attrs_file = os.path.join(dest, '.git', 'info', 'attributes')
+
+ # file shouldn’t exist at this point yet
+ self.assertFalse(os.path.exists(attrs_file) and os.path.getsize(attrs_file),
+ "%s is non-empty" % attrs_file)
+
+ with open(attrs_file, 'w') as f:
+ f.write('\n'.join(dgit_attributes))
+
+ os.chdir(cloned.path)
+ setup_gitattributes(['arg0', '--verbose'])
+
+ ok_(os.path.exists(attrs_file), "%s is missing" % attrs_file)
+
+ with open(attrs_file) as f:
+ attrs = sorted(f.read().splitlines())
+
+ expected_gitattrs = sorted(sorted_gitattrs + [
+ '# Old dgit macro disabled:',
+ '# [attr]dgit-defuse-attrs\t-text -eol -crlf -ident -filter -working-tree-encoding',
+ '# ^ see GITATTRIBUTES in dgit(7) and dgit setup-new-tree in dgit(1)',
+ ])
+
+ self.assertEquals(attrs, expected_gitattrs)
+
+ @RepoFixtures.native()
+ def test_setup_gitattrs_dgit34(self, repo):
+ """Test that setting up Git attributes manually works even with a very old dgit"""
+ dest = os.path.join(self._tmpdir,
+ 'cloned_repo')
+ clone(['arg0',
+ repo.path, dest])
+ cloned = ComponentTestGitRepository(dest)
+ self._check_repo_state(cloned, 'master', ['master'])
+
+ attrs_file = os.path.join(dest, '.git', 'info', 'attributes')
+
+ # file shouldn’t exist at this point yet
+ self.assertFalse(os.path.exists(attrs_file) and os.path.getsize(attrs_file),
+ "%s is non-empty" % attrs_file)
+
+ with open(attrs_file, 'w') as f:
+ f.write('\n'.join(dgit34_attributes))
+
+ os.chdir(cloned.path)
+ setup_gitattributes(['arg0', '--verbose'])
+
+ ok_(os.path.exists(attrs_file), "%s is missing" % attrs_file)
+
+ with open(attrs_file) as f:
+ attrs = sorted(f.read().splitlines())
+
+ expected_gitattrs = sorted(sorted_gitattrs + [
+ '# Old dgit macro disabled:',
+ '# [attr]dgit-defuse-attrs\t-text -eol -crlf -ident -filter',
+ '# ^ see dgit(7). To undo, leave a definition of [attr]dgit-defuse-attrs',
+ ])
+
+ self.assertEquals(attrs, expected_gitattrs)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2015-2017 Guido Günther <agx@sigxcpu.org>
+#
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+import os
+
+from tests.component import ComponentTestBase
+from tests.component.deb import DEB_TEST_DATA_DIR
+from tests.component.deb.fixtures import RepoFixtures
+
+from nose.tools import ok_, eq_
+
+from gbp.scripts.tag import main as tag
+from gbp.scripts.pq import main as pq
+
+
+class TestTag(ComponentTestBase):
+ """Test tagging a debian package"""
+
+ @staticmethod
+ def _dsc_name(pkg, version, dir):
+ return os.path.join(DEB_TEST_DATA_DIR,
+ dir,
+ '%s_%s.dsc' % (pkg, version))
+
+ @RepoFixtures.native()
+ def test_tag(self, repo):
+ """Test that tagging a native debian package works"""
+ repo.delete_tag('debian/0.4.14') # make sure we can tag again
+ eq_(repo.has_tag('debian/0.4.14'), False)
+ ret = tag(['arg0',
+ '--posttag=printenv > posttag.out'])
+ ok_(ret == 0, "Tagging the package failed")
+ eq_(os.path.exists('posttag.out'), True)
+ self.check_hook_vars('posttag', [("GBP_TAG", "debian/0.4.14"),
+ ("GBP_BRANCH", "master"),
+ "GBP_SHA1"])
+ eq_(repo.head, repo.rev_parse('debian/0.4.14^{}'))
+
+ @RepoFixtures.quilt30()
+ def test_tag_pq_branch(self, repo):
+ ret = pq(['argv0', 'import'])
+ eq_(repo.rev_parse('master'), repo.rev_parse('debian/2.8-1^{}'))
+ eq_(ret, 0)
+ eq_(repo.branch, 'patch-queue/master')
+ self.add_file(repo, 'foo.txt')
+ ret = tag(['argv0', '--retag', '--ignore-branch'])
+ eq_(ret, 0)
+ eq_(repo.branch, 'patch-queue/master')
+ eq_(repo.rev_parse('patch-queue/master^{}^'), repo.rev_parse('debian/2.8-1^{}'))
+
+ @RepoFixtures.quilt30()
+ def test_tag_detached_head(self, repo):
+ """
+ Test that tagging works with an detached head (#863167)
+ """
+ eq_(repo.rev_parse('master^{}'), repo.rev_parse('debian/2.8-1^{}'))
+ self.add_file(repo, 'debian/foo.txt')
+ repo.checkout("HEAD~")
+ ret = tag(['argv0', '--retag', '--ignore-branch'])
+ eq_(ret, 0)
+ repo.checkout("master")
+ eq_(repo.rev_parse('master~^{}'), repo.rev_parse('debian/2.8-1^{}'))
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Test module for RPM command line tools of the git-buildpackage suite"""
from nose.tools import nottest
import os
import shutil
-from xml.dom import minidom
+from glob import glob
-from gbp.git import GitRepository, GitRepositoryError
+from gbp.command_wrappers import Command
from tests.component import ComponentTestBase, ComponentTestGitRepository
-# Disable "Instance of 'Document' has no 'firstChild' member"
-# pylint: disable=E1103
-
RPM_TEST_DATA_SUBMODULE = os.path.join('tests', 'component', 'rpm', 'data')
RPM_TEST_DATA_DIR = os.path.abspath(RPM_TEST_DATA_SUBMODULE)
-class RepoManifest(object):
- """Class representing a test repo manifest file"""
- def __init__(self, filename=None):
- self._doc = minidom.Document()
- if filename:
- self._doc = minidom.parse(filename)
- if self._doc.firstChild.nodeName != 'gbp-test-manifest':
- raise Exception('%s is not a test repo manifest' % filename)
- else:
- self._doc.appendChild(self._doc.createElement("gbp-test-manifest"))
-
- def projects_iter(self):
- """Return an iterator over projects"""
- for prj_e in self._doc.getElementsByTagName('project'):
- branches = []
- for br_e in prj_e.getElementsByTagName('branch'):
- branches.append(dict(list(br_e.attributes.items())))
- yield prj_e.getAttribute('name'), branches
-
-
- def write(self, filename):
- """Write to file"""
- with open(filename, 'w') as fileobj:
- fileobj.write(self._doc.toprettyxml())
def setup():
"""Test Module setup"""
"""Baseclass for tests run in a Git repository with packaging data"""
@classmethod
- def setup_class(cls, mangle_branch_names=True):
+ def setUpClass(cls):
"""Initializations only made once per test run"""
- super(RpmRepoTestBase, cls).setup_class()
- cls.manifest = RepoManifest(os.path.join(RPM_TEST_DATA_DIR,
- 'test-repo-manifest.xml'))
+ super(RpmRepoTestBase, cls).setUpClass()
+
+ # Initialize test data repositories
+ cmd = Command('./manage.py', cwd=RPM_TEST_DATA_DIR, capture_stderr=True)
+ cmd(['import-repo', '-o', cls._tmproot])
+
cls.orig_repos = {}
- for prj, brs in cls.manifest.projects_iter():
- repo = GitRepository.create(os.path.join(cls._tmproot,
- '%s.repo' % prj))
- try:
- repo.add_remote_repo('origin', RPM_TEST_DATA_DIR, fetch=True)
- except GitRepositoryError:
- # Workaround for older git working on submodules initialized
- # with newer git
- gitfile = os.path.join(RPM_TEST_DATA_DIR, '.git')
- if os.path.isfile(gitfile):
- with open(gitfile) as fobj:
- link = fobj.readline().replace('gitdir:', '').strip()
- link_dir = os.path.join(RPM_TEST_DATA_DIR, link)
- repo.remove_remote_repo('origin')
- repo.add_remote_repo('origin', link_dir, fetch=True)
- else:
- raise
- # Fetch all remote refs of the orig repo, too
- repo.fetch('origin', tags=True,
- refspec='refs/remotes/*:refs/upstream/*')
- master_branch = 'master'
- for branch in brs:
- if mangle_branch_names:
- branch_name = branch['name']
- else:
- branch_name = branch['orig_name']
- if branch['name'] == 'master':
- master_branch = branch_name
- repo.create_branch(branch_name, branch['revision'])
- repo.set_branch(master_branch)
- repo.force_head('HEAD', hard=True)
- cls.orig_repos[prj] = repo
+ for path in glob(cls._tmproot + '/*.repo'):
+ prj = os.path.basename(path).rsplit('.', 1)[0]
+ cls.orig_repos[prj] = ComponentTestGitRepository(path)
@classmethod
@nottest
dirname = os.path.basename(cls.orig_repos[pkg_name].path)
shutil.copytree(cls.orig_repos[pkg_name].path, dirname)
os.chdir(dirname)
- return GitRepository('.')
+ return ComponentTestGitRepository('.')
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
# vim: set fileencoding=utf-8 :
#
-# (C) 2013 Intel Corporation <markus.lehtonen@linux.intel.com>
+# (C) 2013-2015 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
+#
"""Unit tests for the gbp-buildpackage-rpm tool"""
import glob
import shutil
import stat
import subprocess
-from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
+
+from nose import SkipTest
+from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
from gbp.git import GitRepository
from gbp.scripts.buildpackage_rpm import main as gbp_rpm
-
from tests.component.rpm import RpmRepoTestBase, RPM_TEST_DATA_DIR
-from tests.testutils import ls_dir, ls_tar, ls_zip
+from tests.testutils import ls_tar, ls_zip, capture
# Disable "Method could be a function warning"
# pylint: disable=R0201
def mock_gbp(args):
"""Wrapper for gbp-buildpackage-rpm"""
- return gbp_rpm(['arg0', '--git-notify=off'] + args +
- ['-ba', '--clean', '--target=noarch', '--nodeps'])
+ with capture.capture_stderr():
+ return gbp_rpm(['arg0', '--git-notify=off'] + args +
+ ['-ba', '--clean', '--target=noarch', '--nodeps'])
+
def mock_notify(summary, message, notify_opt):
"""Mock notification system"""
+ if notify_opt.is_off():
+ return True
# Auto will succeed
- if notify_opt.is_auto():
+ elif notify_opt.is_auto():
MOCK_NOTIFICATIONS.append((summary, message))
return True
# Otherwise fail
- return False
+ else:
+ return False
class TestGbpRpm(RpmRepoTestBase):
- """Basic tests for git-rpm-ch"""
+ """Basic tests for gbp buildpackage-rpm"""
@staticmethod
def ls_rpm(rpm):
raise Exception("Failed to get file metadata for %s: %s" %
(rpm, stderr))
return sorted([(nam, mod, dig) for dig, mod, nam in
- [lin.split(None, 2) for lin in stdout.splitlines()]])
+ [lin.split(None, 2) for lin in stdout.splitlines()]])
@staticmethod
def check_rpms(directory):
eq_(fobj.read(), content)
os.unlink(filepath)
- @classmethod
- def setup_class(cls, **kwargs):
- """Setup unit tests"""
- # Don't mangle branch names so that we're able to build the packages
- super(TestGbpRpm, cls).setup_class(mangle_branch_names=False, **kwargs)
-
def test_invalid_args(self):
"""Check graceful exit when called with invalid args"""
GitRepository.create('.')
- assert_raises(SystemExit, mock_gbp, ['--git-invalid-arg'])
-
- """
with assert_raises(SystemExit):
mock_gbp(['--git-invalid-arg'])
- """
def test_outside_repo(self):
"""Run outside a git repository"""
eq_(mock_gbp([]), 1)
self._check_log(0, 'gbp:error: %s is not a git repository' %
- os.path.abspath('.'))
-
- def test_invalid_config_file(self):
- """Test invalid config file"""
- # Create and commit dummy invalid config file
- repo = GitRepository.create('.')
- with open('.gbp.conf', 'w') as conffd:
- conffd.write('foobar\n')
- repo.add_files('.gbp.conf')
- repo.commit_all('Add conf')
- eq_(mock_gbp([]), 1)
- self._check_log(0, 'gbp:error: File contains no section headers.')
+ os.path.abspath('.'))
def test_native_build(self):
"""Basic test of native pkg"""
# Test nativity guessing from remote branches by creating a dummy
# remote branch
repo.update_ref('refs/remotes/fooremote/foobranch',
- 'srcdata/gbp-test/upstream')
+ 'upstream')
eq_(mock_gbp(['--git-upstream-branch=foobranch']), 0)
def test_option_native(self):
with open('untracked-file', 'w') as fobj:
fobj.write('this file is not tracked\n')
- eq_(mock_gbp([]), 1)
- eq_(mock_gbp(['--git-ignore-untracked']), 0)
- self.check_rpms('../rpmbuild/RPMS/*')
-
# Modify tracked file
with open('README', 'a') as fobj:
fobj.write('new stuff\n')
- eq_(mock_gbp(['--git-ignore-untracked']), 1)
+ eq_(mock_gbp([]), 1)
eq_(mock_gbp(['--git-ignore-new']), 0)
@mock.patch('gbp.notifications.notify', mock_notify)
def test_option_tmp_dir(self):
"""Test the --git-tmp-dir option"""
+ if os.getenv("FAKED_MODE"):
+ raise SkipTest("Skipping we're running under fakeroot")
+
self.init_test_repo('gbp-test-native')
- eq_(mock_gbp(['--git-tmp-dir=../gbptmp', '--git-no-build']), 0)
+ eq_(mock_gbp(['--git-tmp-dir=../gbptmp', '--git-builder=true']), 0)
ok_(os.path.isdir('../gbptmp'))
# Check tmpdir access/creation error
os.chmod('../gbptmp', 0)
try:
- eq_(mock_gbp(['--git-tmp-dir=../gbptmp/foo', '--git-no-build']), 1)
+ eq_(mock_gbp(['--git-tmp-dir=../gbptmp/foo', '--git-builder=true']), 1)
finally:
os.chmod('../gbptmp', stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
eq_(mock_gbp(['--git-tag', '--git-packaging-tag=rel-tag']), 1)
# Re-tag
- eq_(mock_gbp(['--git-retag', '--git-packaging-tag=rel-tag']), 1)
+ eq_(mock_gbp(['--git-retag', '--git-packaging-tag=rel-tag']), 3)
self._check_log(-1, "gbp:error: '--git-retag' needs either '--git-tag'")
eq_(mock_gbp(['--git-tag', '--git-packaging-tag=rel-tag',
ok_(repo.has_tag('rel-tag2'))
# Valid tag format string keys
- tag_keys = ['upstreamversion', 'release', 'version', 'vendor',
- 'nowtime', 'authortime', 'committime',
- 'nowtimenum', 'authortimenum', 'committimenum']
+ tag_keys = ['upstreamversion', 'release', 'version', 'vendor']
# Should fail if the fag format has invalid keys (foo here)
tag_fmt = '_'.join(['%(' + key + ')s' for key in tag_keys + ['foo']])
eq_(mock_gbp(['--git-tag', '--git-packaging-tag=%(foo)s']), 1)
# Remove 'foo' and should succeed
tag_fmt = '_'.join(['%(' + key + ')s' for key in tag_keys])
eq_(mock_gbp(['--git-tag-only', '--git-packaging-tag=%s' % tag_fmt]), 0)
- # New tag with same format should succeed when '*num' keys are present
- eq_(mock_gbp(['--git-tag-only', '--git-packaging-tag=%s' % tag_fmt]), 0)
def test_option_upstream_tree(self):
"""Test the --git-upstream-tree option"""
# Dummy update to upstream branch
pkg_branch = repo.get_branch()
- upstr_branch = 'srcdata/gbp-test/upstream'
- orig_files = ['gbp-test/' + path.decode() for \
- path in self.ls_tree(repo, upstr_branch)] + ['gbp-test']
+ upstr_branch = 'upstream'
+ orig_files = ['gbp-test/' + path.decode() for
+ path in repo.ls_tree(upstr_branch)] + ['gbp-test']
repo.set_branch(upstr_branch)
- with open('new-file', 'w') as fobj:
- fobj.write('New file\n')
- with open('new-file2', 'w') as fobj:
- fobj.write('New file 2\n')
- repo.add_files(['new-file', 'new-file2'])
- repo.commit_files('new-file', 'New content')
- repo.commit_files('new-file2', 'New content 2')
+ for fname in ['new-file', 'new-file2']:
+ self.add_file(repo, fname, 'new content %s' % fname)
repo.set_branch(pkg_branch)
# TAG (default) does not contain the new files
eq_(mock_gbp(['--git-upstream-tree=invalid-tree']), 2)
self._check_log(-1, ".*Invalid treeish object")
- def test_option_orig_prefix(self):
- """Test the --git-orig-prefix option"""
+ def test_pristine_tar(self):
+ """Test pristine-tar"""
repo = self.init_test_repo('gbp-test')
- # Building with invalid prefix should fail
- eq_(mock_gbp(['--git-orig-prefix=foo']), 1)
- upstr_branch = 'srcdata/gbp-test/upstream'
- ref_files = ['foo/' + path for path in self.ls_tree(repo, upstr_branch)]
- tar_files = ls_tar('../rpmbuild/SOURCES/gbp-test-1.1.tar.bz2', False)
- self.check_files(tar_files, ref_files)
-
- # Test invalid keys
- eq_(mock_gbp(['--git-orig-prefix=%(foo)s', '--git-no-build']), 1)
- self._check_log(-1, ".*Unknown key 'foo' in orig prefix format")
+ # Build succeeds when pristine-tar branch is present
+ eq_(mock_gbp(['--git-pristine-tar',
+ '--git-export=release/1.1-2']), 0)
+ self.check_rpms('../rpmbuild/RPMS/*')
+ shutil.rmtree('../rpmbuild')
-# def test_pristine_tar(self):
-# """Test pristine-tar"""
-# repo = self.init_test_repo('gbp-test')
-#
-# # Pristine-tar checkout fails when no pristine-tar branch
-# eq_(mock_gbp(['--git-pristine-tar',
-# '--git-export=srcdata/gbp-test/release/1.1-2']), 1)
-# self._check_log(-1, ".*Couldn't checkout")
-#
-# # Create pristine-tar branch and try again
-# repo.create_branch('pristine-tar', 'srcdata/gbp-test/pristine_tar')
-# eq_(mock_gbp(['--git-pristine-tar',
-# '--git-export=srcdata/gbp-test/release/1.1-2']), 0)
-# self.check_rpms('../rpmbuild/RPMS/*')
+ # Pristine-tar checkout fails with no pristine-tar branch
+ repo.rename_branch('pristine-tar', 'pristine_tar')
+ eq_(mock_gbp(['--git-pristine-tar',
+ '--git-export=release/1.1-2']), 1)
+ self._check_log(-1, ".*Pristine-tar couldn't checkout")
def test_pristine_tar_commit(self):
"""Test committing upstream tarball to pristine-tar"""
repo = self.init_test_repo('gbp-test')
+ repo.delete_branch('pristine-tar')
eq_(repo.has_branch('pristine-tar'), False)
eq_(mock_gbp(['--git-pristine-tar-commit',
- '--git-export=srcdata/gbp-test/release/1.0-1']), 0)
+ '--git-export=release/1.0-1']), 0)
eq_(len(repo.get_commits(until='pristine-tar')), 1)
shutil.rmtree('../rpmbuild')
eq_(len(repo.get_commits(until='pristine-tar')), 2)
shutil.rmtree('../rpmbuild')
- # Second time no pristine-tar should not be commited
+ # Second time no pristine-tar should not be committed
eq_(mock_gbp(['--git-pristine-tar-commit']), 0)
eq_(len(repo.get_commits(until='pristine-tar')), 2)
tarball_dir)
# Test build when tarball is found from cache
- eq_(mock_gbp(['--git-export=srcdata/gbp-test/release/1.0-1',
+ eq_(mock_gbp(['--git-export=release/1.0-1',
'--git-tarball-dir=%s' % tarball_dir]), 0)
ok_(os.path.islink(os.path.join('..', 'rpmbuild', 'SOURCES',
'gbp-test-1.0.tar.bz2')))
# Test build when tarball is not found from cache
- eq_(mock_gbp(['--git-export=srcdata/gbp-test/release/1.1-2',
+ eq_(mock_gbp(['--git-export=release/1.1-2',
'--git-tarball-dir=%s' % tarball_dir]), 0)
ok_(os.path.isfile(os.path.join('..', 'rpmbuild', 'SOURCES',
'gbp-test-1.1.tar.bz2')))
# Test building when not on any branch
repo.set_branch(repo.rev_parse('HEAD'))
- eq_(mock_gbp(['--git-no-build']), 1)
- eq_(mock_gbp(['--git-ignore-branch', '--git-no-build']), 0)
+ eq_(mock_gbp(['--git-builder=true']), 1)
+ eq_(mock_gbp(['--git-ignore-branch', '--git-builder=true']), 0)
def test_option_submodules(self):
"""Test the --git-submodules option"""
# Create submodule to upstream branch
sub_repo = self.orig_repos['gbp-test-native']
pkg_branch = repo.get_branch()
- upstr_branch = 'srcdata/gbp-test/upstream'
+ upstr_branch = 'upstream'
repo.set_branch(upstr_branch)
repo.add_submodule(sub_repo.path)
repo.commit_all('Add submodule')
repo.set_branch(pkg_branch)
- sub_files = self.ls_tree(sub_repo, 'HEAD')
+ sub_files = sub_repo.ls_tree('HEAD')
upstr_files = ['gbp-test/' + path.decode() for
- path in self.ls_tree(repo, upstr_branch)]
+ path in repo.ls_tree(upstr_branch)]
# Test the "no" option
eq_(mock_gbp(['--git-no-submodules', '--git-upstream-tree=%s' %
- upstr_branch, '--git-ignore-untracked']), 0)
+ upstr_branch, '--git-ignore-new']), 0)
tar_files = ls_tar('../rpmbuild/SOURCES/gbp-test-1.1.tar.bz2', False)
self.check_files(upstr_files, tar_files)
shutil.rmtree('../rpmbuild')
# Test the "yes" option
eq_(mock_gbp(['--git-submodules', '--git-upstream-tree=%s' %
- upstr_branch, '--git-ignore-untracked']), 0)
+ upstr_branch, '--git-ignore-new']), 0)
tar_files = ls_tar('../rpmbuild/SOURCES/gbp-test-1.1.tar.bz2', False)
ref_files = upstr_files + ['gbp-test/gbp-test-native.repo/' + path.decode() for
- path in sub_files]
+ path in sub_files]
self.check_files(ref_files, tar_files)
shutil.rmtree('../rpmbuild')
shutil.rmtree('gbp-test-native.repo')
repo.create('gbp-test-native.repo')
eq_(mock_gbp(['--git-submodules', '--git-upstream-tree=%s' %
- upstr_branch, '--git-ignore-untracked']), 2)
+ upstr_branch, '--git-ignore-new']), 2)
+ self._check_log(-2,
+ ".*Error generating submodules' archives: "
+ "Failed to list submodules of [0-9a-f]{40}: fatal: "
+ "not a tree object")
def test_option_submodules_native(self):
"""Test the --git-submodules option for native packages"""
repo.add_submodule(sub_repo.path)
repo.commit_all('Add submodule')
- sub_files = self.ls_tree(sub_repo, 'HEAD')
+ sub_files = sub_repo.ls_tree('HEAD')
master_files = ['gbp-test-native-1.0/' + path.decode() for
- path in self.ls_tree(repo, 'HEAD')]
+ path in repo.ls_tree('HEAD')]
# Test
eq_(mock_gbp(['--git-submodules']), 0)
zip_files = ls_zip('../rpmbuild/SOURCES/gbp-test-native-1.0.zip', False)
- ref_files = master_files + \
- ['gbp-test-native-1.0/gbp-test-native2.repo/' + path for
- path in sub_files]
+ ref_files = master_files + ['gbp-test-native-1.0/gbp-test-native2.repo/' + path.decode() for
+ path in sub_files]
self.check_files(ref_files, zip_files)
# Test submodule failure
shutil.rmtree('gbp-test-native2.repo')
repo.create('gbp-test-native2.repo')
- eq_(mock_gbp(['--git-submodules', '--git-ignore-untracked']), 1)
+ eq_(mock_gbp(['--git-submodules', '--git-ignore-new']), 1)
def test_option_builder(self):
"""Test --git-builder option and it's args"""
args = fobj.read()
eq_(args, '--arg1 --arg2 gbp-test-native.spec')
- def test_option_builder_osc(self):
- """Test --git-builder=osc"""
- self.init_test_repo('gbp-test-native')
- eq_(mock_gbp(['--git-builder=osc', '--git-no-build']), 0)
-
- eq_(set(os.listdir('../rpmbuild')),
- set(os.listdir('./packaging') + ['gbp-test-native-1.0.zip']))
-
def test_option_cleaner(self):
"""Test --git-cleaner option"""
self.init_test_repo('gbp-test-native')
self.init_test_repo('gbp-test-native')
cleaner = 'echo -n cleaner >> ../hooks'
+ preexport = 'echo -n preexport >> $GBP_TMP_DIR/../hooks'
postexport = 'echo -n postexport >> $GBP_TMP_DIR/../hooks'
prebuild = 'echo -n prebuild >> $GBP_BUILD_DIR/../hooks'
postbuild = 'echo -n postbuild >> $GBP_BUILD_DIR/../hooks'
posttag = 'echo -n posttag >> ../hooks'
args = ['--git-cleaner=%s' % cleaner,
+ '--git-preexport=%s' % preexport,
'--git-postexport=%s' % postexport,
'--git-prebuild=%s' % prebuild,
'--git-postbuild=%s' % postbuild,
eq_(mock_gbp(args + ['--git-tag-only', '--git-packaging-tag=tag1']), 0)
self.check_and_rm_file('../hooks', 'cleanerposttag')
- # Prebuild is not run when only exporting
- eq_(mock_gbp(args + ['--git-no-build']), 0)
- self.check_and_rm_file('../hooks', 'cleanerpostexport')
- shutil.rmtree('../rpmbuild')
-
# Export and build scripts are run when not tagging
eq_(mock_gbp(args), 0)
- self.check_and_rm_file('../hooks', 'cleanerpostexportprebuildpostbuild')
+ self.check_and_rm_file('../hooks', 'cleanerpreexportpostexportprebuildpostbuild')
shutil.rmtree('../rpmbuild')
# All hooks are run when building
eq_(mock_gbp(args + ['--git-tag', '--git-packaging-tag=tag2']), 0)
self.check_and_rm_file('../hooks',
- 'cleanerpostexportprebuildpostbuildposttag')
+ 'cleanerpreexportpostexportprebuildpostbuildposttag')
shutil.rmtree('../rpmbuild')
# Run with hooks disabled
eq_(mock_gbp(args + ['--git-no-hooks']), 0)
ok_(not os.path.exists('../hooks'))
- def test_option_export_only(self):
- """Test the (deprecated) --git-export-only option"""
- self.init_test_repo('gbp-test-native')
- eq_(mock_gbp(['--git-export-only']), 0)
- self._check_log(-1, ".*Deprecated option '--git-export-only'")
-
def test_builddir_options(self):
"""Test the options related to different build directories"""
self.init_test_repo('gbp-test-native')
eq_(mock_gbp(['--git-export-dir=../foo',
- '--git-rpmbuild-builddir=build',
- '--git-rpmbuild-buildrootdir=buildroot',
- '--git-rpmbuild-rpmdir=rpm',
- '--git-rpmbuild-sourcedir=source',
- '--git-rpmbuild-specdir=spec',
- '--git-rpmbuild-srpmdir=srpm']), 0)
+ '--git-export-sourcedir=source',
+ '--git-export-specdir=spec']), 0)
# Check all directories
eq_(set(os.listdir('../foo')),
- set(['build', 'buildroot', 'rpm', 'source', 'spec', 'srpm']))
-
- # Test export dir creation error (gbp will not create dir hierarchy)
- eq_(mock_gbp(['--git-export-dir=../bar/foo']), 1)
- self._check_log(-1, ".*gbp:error: Cannot create dir")
+ set(['BUILD', 'BUILDROOT', 'RPMS', 'source', 'spec', 'SRPMS']))
def test_export_failure(self):
"""Test export dir permission problems"""
+
+ if os.getenv("FAKED_MODE"):
+ raise SkipTest("Skipping we're running under fakeroot")
+
self.init_test_repo('gbp-test-native')
s_rwx = stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC
# Pre-create all files
- eq_(mock_gbp(['--git-no-build']), 0)
+ eq_(mock_gbp(['--git-builder=true']), 0)
# Error in exporting packaging files
os.chmod('../rpmbuild/SOURCES', 0)
try:
- eq_(mock_gbp(['--git-no-build']), 1)
+ eq_(mock_gbp(['--git-builder=true']), 1)
finally:
os.chmod('../rpmbuild/SOURCES', s_rwx)
- self._check_log(-1, ".*Error exporting files")
+ self._check_log(-1, ".*Error exporting packaging files")
# Error in creating archive
os.chmod('../rpmbuild/SOURCES/gbp-test-native-1.0.zip', 0)
try:
- eq_(mock_gbp(['--git-no-build']), 1)
+ eq_(mock_gbp(['--git-builder=true']), 1)
finally:
os.chmod('../rpmbuild/SOURCES/gbp-test-native-1.0.zip', s_rwx)
- self._check_log(-1, ".*Error creating ../rpmbuild/SOURCES/.*.zip")
+ self._check_log(-1, ".*Cannot create source tarball at '../rpmbuild/SOURCES'")
def test_option_export(self):
"""Test the --git-export-option"""
repo = self.init_test_repo('gbp-test')
# Test exporting of some other commit than HEAD
- eq_(mock_gbp(['--git-export=srcdata/gbp-test/release/1.0-1']), 0)
+ eq_(mock_gbp(['--git-export=release/1.0-1']), 0)
eq_(os.listdir('../rpmbuild/RPMS/noarch'),
- ['gbp-test-1.0-1.noarch.rpm'])
+ ['gbp-test-1.0-1.noarch.rpm'])
self.check_rpms('../rpmbuild/RPMS/*')
# Modify one tracked file, create one untracked and one ignored file
with open('ignored.tmp', 'w') as fobj:
fobj.write('ignored')
- base_args = ['--git-ignore-new', '--git-no-build']
+ base_args = ['--git-ignore-new', '--git-builder=true']
# Test exporting of git index
- foo_txt_index = repo.show('HEAD:foo.txt') + 'staged'
+ foo_txt_index = repo.show('HEAD:foo.txt').decode() + 'staged'
eq_(mock_gbp(base_args + ['--git-export=INDEX']), 0)
self.check_and_rm_file('../rpmbuild/SOURCES/foo.txt', foo_txt_index)
ok_(not os.path.exists('../rpmbuild/SOURCES/untracked'))
ok_(not os.path.exists('../rpmbuild/SOURCES/ignored.tmp'))
shutil.rmtree('../rpmbuild')
- # Test exporting of working copy (tracked files only)
- eq_(mock_gbp(base_args + ['--git-export=WC.TRACKED']), 0)
- foo_txt_wc = repo.show('HEAD:foo.txt') + 'staged' + 'unstaged'
- self.check_and_rm_file('../rpmbuild/SOURCES/foo.txt', foo_txt_wc)
- ok_(not os.path.exists('../rpmbuild/SOURCES/untracked'))
- ok_(not os.path.exists('../rpmbuild/SOURCES/ignored.tmp'))
- shutil.rmtree('../rpmbuild')
-
- # Test exporting of working copy (include untracked files)
- eq_(mock_gbp(base_args + ['--git-export=WC.UNTRACKED']), 0)
- self.check_and_rm_file('../rpmbuild/SOURCES/foo.txt', foo_txt_wc)
- self.check_and_rm_file('../rpmbuild/SOURCES/untracked', 'untracked')
- ok_(not os.path.exists('../rpmbuild/SOURCES/ignored.tmp'))
- shutil.rmtree('../rpmbuild')
-
# Test exporting of working copy (include all files)
eq_(mock_gbp(base_args + ['--git-export=WC']), 0)
+ foo_txt_wc = repo.show('HEAD:foo.txt').decode() + 'staged' + 'unstaged'
self.check_and_rm_file('../rpmbuild/SOURCES/foo.txt', foo_txt_wc)
self.check_and_rm_file('../rpmbuild/SOURCES/untracked', 'untracked')
self.check_and_rm_file('../rpmbuild/SOURCES/ignored.tmp', 'ignored')
eq_(mock_gbp(['--git-spec-file=foo.spec']), 1)
self._check_log(-1, "gbp:error: Can't parse spec: Git error")
- eq_(mock_gbp(['--git-spec-file=auto']), 1)
+ eq_(mock_gbp(['--git-spec-file=']), 1)
self._check_log(-1, "gbp:error: Can't parse spec: Multiple spec files")
eq_(mock_gbp(['--git-spec-file=packaging/gbp-test2.spec']), 0)
# No spec file found error
- repo.set_branch('srcdata/gbp-test2/upstream')
+ repo.set_branch('upstream')
eq_(mock_gbp([]), 1)
self._check_log(-1, ".*Can't parse spec: No spec file found")
# Test invalid key
eq_(mock_gbp(['--git-spec-vcs-tag=%(invalid-key)s']), 1)
- self._check_log(-1, ".*Unknown key 'invalid-key' in vcs tag format")
-
- def test_patch_export_options(self):
- """Test patch export options"""
- repo = self.init_test_repo('gbp-test2')
-
- # Test no-patch-export
- base_args = ['--git-builder=osc', '--git-no-build']
- eq_(mock_gbp(base_args + ['--git-no-patch-export']), 0)
- ref_files = self.ls_tree(repo, 'HEAD:packaging')
- ref_files.add('gbp-test2-2.0.tar.gz')
- eq_(ls_dir('../rpmbuild', False), ref_files)
- shutil.rmtree('../rpmbuild')
-
- # No patches should be generated if patch-export-rev is upstream version
-
- # Test patch compression and numbering
- eq_(mock_gbp(base_args + ['--git-no-patch-numbers',
- '--git-patch-export-compress=1']), 0)
- new_files = ls_dir('../rpmbuild', False) - ref_files
- ok_(len(new_files) > 0)
- for fname in new_files:
- # Patches should start with an alphabet and be compressed with gz
- ok_(re.match(r'^[a-zA-Z]\S*.patch.gz$', fname), fname)
-
- def test_devel_branch_support(self):
- """Test patch-generation from q/development branch"""
- repo = self.init_test_repo('gbp-test')
- pq_br = 'srcdata/gbp-test/pq/master'
-
- # Patch export with no apparent pq branch should fail
- eq_(mock_gbp(['--git-patch-export']), 2)
- self._check_log(-1, r".*Start commit \S+ not an ancestor of end commit")
-
- # With valid pq branch patch export should succeeded
- eq_(mock_gbp(['--git-patch-export', '--git-pq-branch=%s' % pq_br]), 0)
- self.check_rpms('../rpmbuild/RPMS/*')
- shutil.rmtree('../rpmbuild')
- eq_(mock_gbp(['--git-patch-export', '--git-pq-branch=%s' % pq_br,
- '--git-export=srcdata/gbp-test/master']), 0)
- self.check_rpms('../rpmbuild/RPMS/*')
- shutil.rmtree('../rpmbuild')
-
- # With pq branch but with wrong patch-export rev build should fail
- eq_(mock_gbp(['--git-patch-export', '--git-pq-branch=%s' % pq_br,
- '--git-patch-export-rev=HEAD']), 2)
- self._check_log(-1, r".*Start commit \S+ not an ancestor of end commit")
-
- # Patch-export should be auto-enabled when on pq branch
- repo.set_branch(pq_br)
- eq_(mock_gbp(['--git-pq-branch=%s' % pq_br, '--git-ignore-branch']), 0)
- self.check_rpms('../rpmbuild/RPMS/*')
- shutil.rmtree('../rpmbuild')
-
- # Fail when (apparently) on pq branch but no packaging branch found
- eq_(mock_gbp(['--git-pq-branch=%s' % pq_br, '--git-ignore-branch',
- '--git-packaging-branch=foo']), 1)
+ self._check_log(-1, r".*Failed to format %\(invalid-key\)s")
# vim: set fileencoding=utf-8 :
#
-# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
+# (C) 2012-2015 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Tests for the git-import-orig-rpm tool"""
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
+"""Test importing RPMs with git-import-orig"""
import os
import shutil
import sys
import subprocess
-import tarfile
-import tempfile
-from nose.plugins.skip import SkipTest
-from nose.tools import assert_raises, eq_ # pylint: disable=E0611
+from nose.tools import eq_
from io import StringIO
-from gbp.scripts.import_orig_rpm import main as import_orig_rpm
-from gbp.git import GitRepository
+from gbp.scripts.import_orig import main as import_orig
-from tests.testutils import ls_dir, ls_tar, ls_zip
-from tests.component import ComponentTestBase
+from tests.component import ComponentTestBase, ComponentTestGitRepository
from tests.component.rpm import RPM_TEST_DATA_DIR
# Disable "Method could be a function warning"
DATA_DIR = os.path.join(RPM_TEST_DATA_DIR, 'orig')
-DUMMY_SPEC = """
-Name: dummy
-Version: 1.0
-Release: 0
-License: GPL-2.0
-Summary: Dummy package
-Source: %(source)s
-
-%%description
-Dummy package generated by unit tests
-"""
-
def mock_import(args, stdin_data="\n\n", cwd=None):
- """Wrapper for import-orig-rpm for feeding mock stdin data to it"""
+ """Wrapper for import-orig for feeding mock stdin data to it"""
old_cwd = os.path.abspath(os.path.curdir)
if cwd:
os.chdir(cwd)
# Call import-orig-rpm with mock data
sys.stdin = mock_stdin
- ret = import_orig_rpm(['arg0'] + args)
+ ret = import_orig(['arg0'] + args)
sys.stdin = sys.__stdin__
mock_stdin.close()
"""Base class for all import-orig-rpm unit tests"""
@classmethod
- def setup_class(cls):
+ def setUpClass(cls):
"""Class setup, common for all test cases"""
- super(ImportOrigTestBase, cls).setup_class()
+ super(ImportOrigTestBase, cls).setUpClass()
def __init__(self, *args, **kwargs):
super(ImportOrigTestBase, self).__init__(*args, **kwargs)
- def setup(self):
+ def setUp(self):
"""Test case setup"""
- super(ImportOrigTestBase, self).setup()
+ super(ImportOrigTestBase, self).setUp()
@classmethod
def check_tree(cls, repo, treeish, filelist):
"""Check the contents (list of files) in a git treeish"""
- treeish_files = ImportOrigTestBase.ls_tree(repo, treeish)
+ treeish_files = repo.ls_tree(treeish)
ImportOrigTestBase.check_files(treeish_files, filelist)
class TestImportOrig(ImportOrigTestBase):
"""Basic tests for git-import-orig-rpm"""
- @staticmethod
- def _init_repo_with_dummy_packaging():
- """Create a dummy packaging branch with one commit"""
- repo = GitRepository.create('.')
- shutil.copy2('.git/HEAD', 'foobar')
- repo.add_files('.')
- repo.commit_all('First commit')
- return repo
-
- @staticmethod
- def _create_dummy_spec(path, **kwargs):
- """Create a dummy spec file"""
- with open(path, 'w') as fobj:
- print(kwargs)
- fobj.write(DUMMY_SPEC % kwargs)
-
def test_invalid_args(self):
"""
See that import-orig-rpm fails gracefully when called with invalid args
"""
- repo = GitRepository.create('.')
+ repo = ComponentTestGitRepository.create('.')
origs = [os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2'),
os.path.join(DATA_DIR, 'gbp-test-1.1.tar.bz2')]
+ # Test empty args
+ eq_(mock_import([]), 1)
+ self._clear_log()
+
# Test multiple archives
eq_(mock_import([] + origs), 1)
self._check_log(0, 'gbp:error: More than one archive specified')
self._clear_log()
- # Test invalid archive
- false_orig = os.path.join(RPM_TEST_DATA_DIR, 'gbp-test-1.0-1.src.rpm')
- eq_(mock_import([false_orig], 'foo\n1\n'), 1)
- self._check_log(0, "gbp:error: Unsupported archive format")
- self._clear_log()
-
- # Test non-existing archive
- eq_(mock_import(['none.tar.bz2'], 'foo\n1\n'), 1)
- self._check_log(0, "gbp:error: UpstreamSource: unable to find")
- self._clear_log()
-
# Check that nothing is in the repo
self._check_repo_state(repo, None, [])
- # Test invalid cmdline options
- assert_raises(SystemExit, mock_import, ['--invalid-arg=123'])
-
- """
- with assert_raises(SystemExit):
- mock_import(['--invalid-arg=123'])
- """
-
def test_import_outside_repo(self):
"""Test importing when not in a git repository"""
orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
# Import should fail
eq_(mock_import([orig]), 1)
self._check_log(0, 'gbp:error: %s is not a git repository' %
- os.path.abspath(os.getcwd()))
+ os.path.abspath(os.getcwd()))
def test_invalid_config_file(self):
"""Test invalid config file"""
# Create dummy invalid config file and try to import (should fail)
- GitRepository.create('.')
+ ComponentTestGitRepository.create('.')
with open('.gbp.conf', 'w') as conffd:
conffd.write('foobar\n')
- eq_(mock_import(['foo']), 1)
+ eq_(mock_import(['foo']), 3)
self._check_log(0, 'gbp:error: File contains no section headers.')
def test_import_tars(self):
"""Test importing of tarballs, with and without merging"""
- repo = GitRepository.create('.')
+ repo = ComponentTestGitRepository.create('.')
# Import first version, with --merge
orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
eq_(mock_import(['--merge', orig]), 0)
# Import second version, don't merge to master branch
orig = os.path.join(DATA_DIR, 'gbp-test-1.1.tar.bz2')
- eq_(mock_import([orig]), 0)
+ eq_(mock_import(['--no-merge', orig]), 0)
self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
eq_(len(repo.get_commits(until='master')), 1)
eq_(len(repo.get_commits(until='upstream')), 2)
def test_import_zip(self):
"""Test importing of zip archive"""
- repo = GitRepository.create('.')
+ repo = ComponentTestGitRepository.create('.')
# Import zip with, no master branch should be present
orig = os.path.join(DATA_DIR, 'gbp-test-native-1.0.zip')
+ files = ['.gbp.conf', 'packaging/gbp-test-native.spec',
+ 'dummy.sh', 'README', 'Makefile']
eq_(mock_import([orig]), 0)
- self._check_repo_state(repo, None, ['upstream'], [])
- eq_(repo.get_tags(), ['upstream/1.0'])
-
- def test_import_to_existing(self):
- """Test importing of to an existing repo"""
- # Create new repo and add dummy files
- repo = self._init_repo_with_dummy_packaging()
- sha1 = repo.rev_parse('HEAD^0')
-
- # Test missing upstream branch
- orig = os.path.join(DATA_DIR, 'gbp-test2-2.0.tar.gz')
- eq_(mock_import([orig]), 1)
- self._check_log(1, 'Repository does not have branch')
-
- # Create orphan, empty, 'usptream' branch
- tree = repo.write_tree('.git/_empty_index')
- commit = repo.commit_tree(tree=tree, msg='Initial upstream', parents=[])
- repo.update_ref("refs/heads/upstream", commit)
-
- # Test importing to non-clean repo
- files = ['foobar']
self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
- shutil.copy2('.git/HEAD', 'foobaz')
- self._clear_log()
- eq_(mock_import([orig]), 1)
- self._check_log(0, 'gbp:error: Repository has uncommitted changes')
- os.unlink('foobaz')
-
- # Create new branch
- repo.create_branch('mytopic')
- repo.set_branch('mytopic')
-
- # Finally, import should succeed
- eq_(mock_import([orig, '--merge']), 0)
- files = ['Makefile', 'README', 'dummy.sh', 'foobar']
- self._check_repo_state(repo, 'master',
- ['master', 'mytopic', 'upstream'], files)
- eq_(repo.get_tags(), ['upstream/2.0'])
- # Our topic branch shouldn't have changed, unlike master
- eq_(repo.rev_parse('mytopic^0'), sha1)
- eq_(len(repo.get_commits(until='mytopic')), 1)
- # One commit from topic branch, two from upstream, one merge commit
- eq_(len(repo.get_commits(until='master')), 4)
+ eq_(repo.get_tags(), ['upstream/1.0'])
def test_branch_update(self):
"""Check that the working copy is kept in sync with branch HEAD"""
- repo = GitRepository.create('.')
+ repo = ComponentTestGitRepository.create('.')
orig1 = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
orig2 = os.path.join(DATA_DIR, 'gbp-test-1.1.tar.bz2')
eq_(mock_import(['--merge', orig1]), 0)
# Unpack sources and create repo
orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
subprocess.Popen(['tar', 'xf', orig])
- repo = GitRepository.create('myrepo')
+ repo = ComponentTestGitRepository.create('myrepo')
os.chdir('myrepo')
# Import dir first, fool the version to be 0.9
eq_(mock_import(['../gbp-test'], 'gbp-test\n0.9\n'), 0)
files = ['Makefile', 'README', 'dummy.sh']
- self.check_tree(repo, 'upstream', files)
- self._check_repo_state(repo, None, ['upstream'], [])
+ self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
# Import from unpacked and check that the contents is the same
eq_(mock_import([orig]), 0)
def test_basic_filtering(self):
"""Basic test for import filter"""
- repo = GitRepository.create('.')
+ repo = ComponentTestGitRepository.create('.')
orig = os.path.join(DATA_DIR, 'gbp-test-1.1.with_dotgit.tar.bz2')
# Try importing a tarball with git metadata
eq_(mock_import([orig], 'gbp-test\n1.0\n'), 1)
# Try filtering out .git directory and shell scripts
eq_(mock_import(['--filter=.git', '--filter=*.sh', '--merge', orig],
- 'gbp-test\n1.0\n'), 0)
+ 'gbp-test\n1.0\n'), 0)
self._check_repo_state(repo, 'master', ['master', 'upstream'])
eq_(len(repo.get_commits(until='master')), 1)
eq_(len(repo.get_commits(until='upstream')), 1)
eq_(repo.get_tags(), ['upstream/1.0'])
added_files = repo.get_commit_info('upstream')['files']['A']
- eq_(set(added_files), set(['Makefile', 'README']))
+ eq_(set(added_files), set([b'Makefile', b'README']))
def test_noninteractive(self):
"""Test non-interactive mode"""
- repo = GitRepository.create('testrepo')
+ repo = ComponentTestGitRepository.create('testrepo')
orig = os.path.join(DATA_DIR, 'gbp-test-native-1.0.zip')
orig_renamed = os.path.join(os.path.abspath('.'), 'foo.zip')
shutil.copy(orig, orig_renamed)
self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
eq_(len(repo.get_commits(until='master')), 1)
- # Import "new" version, this time package name should be taken from spec
- eq_(mock_import(['--no-interactive', orig_renamed], stdin_data=''), 1)
- self._check_log(-1, "gbp:error: Couldn't determine upstream version")
-
- def test_option_create_missing(self):
- """Test importing of to an existing repo"""
- # Create new repo and add dummy files
- repo = self._init_repo_with_dummy_packaging()
-
- # Test missing upstream branch
- orig = os.path.join(DATA_DIR, 'gbp-test2-2.0.tar.gz')
- eq_(mock_import([orig]), 1)
- self._check_log(1, 'Repository does not have branch')
-
- # Try again, with --create-missing-branches
- eq_(mock_import(['--create-missing-branches', orig]), 0)
- self._check_repo_state(repo, 'master', ['master', 'upstream'])
- eq_(len(repo.get_commits(until='upstream')), 1)
-
def test_misc_options(self):
"""Test various options of git-import-orig-rpm"""
- repo = GitRepository.create('.')
- # Import one orig with default options to get 'upstream' branch
+ repo = ComponentTestGitRepository.create('.')
+ # Force --no-ff for merges because default behavior is slightly
+ # different in newer git versions (> 2.16)
+ repo.set_config("branch.pack.mergeoptions", "--no-ff")
+
+ # Import one orig with default options to get upstream and
+ # packaging branch
orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
- eq_(mock_import(['-u0.8', orig]), 0)
+ eq_(mock_import(['--debian-branch=pack',
+ '--upstream-branch=orig', '-u0.8', orig]), 0)
+ self._check_repo_state(repo, 'pack', ['pack', 'orig'])
# Import the "native" zip to get packaging files
orig = os.path.join(DATA_DIR, 'gbp-test-native-1.0.zip')
- base_args = ['--packaging-branch=pack', '--upstream-branch=orig',
- '--upstream-tag=orig/%(upstreamversion)s', '--merge']
+ base_args = ['--debian-branch=pack', '--upstream-branch=orig',
+ '--upstream-tag=orig/%(version)s', '--merge']
# Fake version to be 0.9
extra_args = ['-u0.9', '--upstream-vcs-tag=upstream/0.8', orig]
eq_(mock_import(base_args + extra_args), 0)
# Check repository state
- files = []
- self._check_repo_state(repo, None, ['pack', 'orig', 'upstream'], files)
- eq_(len(repo.get_commits(until='pack')), 2)
+ files = ['dummy.sh', 'packaging/gbp-test-native.spec',
+ '.gbp.conf', 'Makefile', 'README']
+ self._check_repo_state(repo, 'pack', ['pack', 'orig'], files)
+ eq_(len(repo.get_commits(until='pack')), 3)
# Check tags
tags = repo.get_tags()
eq_(set(tags), set(['upstream/0.8', 'orig/0.9']))
repo.commit_all('My new commit')
# Import a new version, name should be taken from spec
orig = os.path.join(DATA_DIR, 'gbp-test-1.1.tar.bz2')
- extra_args = ['--packaging-dir=packaging', '--no-interactive', '-u1.1',
- orig]
+ extra_args = ['--no-interactive', '-u1.1', orig]
eq_(mock_import(base_args + extra_args, ''), 0)
# Threeupstream versions, "my new" commit and one merge commit
- eq_(len(repo.get_commits(until='pack')), 5)
+ eq_(len(repo.get_commits(until='pack')), 6)
tags = repo.get_tags()
eq_(set(tags), set(['upstream/0.8', 'orig/0.9', 'orig/1.1']))
def test_import_hooks(self):
"""Basic test for postimport hook"""
- repo = GitRepository.create('.')
+ repo = ComponentTestGitRepository.create('.')
orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
- script = ("echo -n branch: $GBP_BRANCH, version: %(upstreamversion)s"
- " > hook.txt")
+ script = ("echo -n branch: $GBP_BRANCH > ../hook.txt")
eq_(mock_import(['--postimport', script, '--merge', orig]), 0)
self._check_repo_state(repo, 'master', ['master', 'upstream'])
eq_(repo.get_tags(), ['upstream/1.0'])
- with open('hook.txt', 'r') as hookout:
+ with open('../hook.txt', 'r') as hookout:
data = hookout.read()
- eq_(data, 'branch: master, version: 1.0')
+ eq_(data, 'branch: master')
def test_hook_error(self):
"""Test postimport hook failure"""
- repo = GitRepository.create('.')
+ repo = ComponentTestGitRepository.create('.')
orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
- eq_(mock_import(['--postimport=_notexist.sh', '--merge', orig]), 1)
- self._check_log(-2, "gbp:error: '_notexist.sh' failed:")
+ eq_(mock_import(['--postimport=/bin/false', '--merge', '--no-rollback', orig]), 1)
+ self._check_log(-2, "gbp:error: Postimport-hook '/bin/false' failed:")
self._check_log(-1, 'gbp:error: Import of %s failed' % orig)
# Other parts of the import should've succeeded
self._check_repo_state(repo, 'master', ['master', 'upstream'])
- def test_archive_from_spec(self):
- """Test taking archive file path from spec file"""
- repo = GitRepository.create('.')
- orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
-
- # Test non-existent spec file
- eq_(mock_import([]), 1)
- self._check_log(0, '.*No archive to import specified and no spec file')
-
- # Test non-existent archive
- self._create_dummy_spec('dummy.spec', source='non-existent.tar.gz')
- eq_(mock_import([]), 1)
- self._check_log(-1, '.*unable to find \S+non-existent.tar.gz')
-
- # Test failing download
- self._create_dummy_spec('dummy.spec', source='foo://bar.tar.gz')
- eq_(mock_import([]), 1)
- self._check_log(-1, '.*Download failed')
-
- # Test existing archive
- self._create_dummy_spec('dummy.spec', source=orig)
- eq_(mock_import([]), 0)
- self._check_repo_state(repo, None, ['upstream'], ['dummy.spec'])
-
-
-class TestPristineTar(ImportOrigTestBase):
- """
- Test importing with pristine-tar
-
- Especially, tests different options for mangling the tarball. We basically
- have these mostly independent options:
- - filter
- - filter-pristine-tar
- - pristine-tarball-name
- - orig-prefix
- And, these options can be used in importing directories and tarballs and zip
- files.
- """
-
- @classmethod
- def setup_class(cls):
- """Class setup, common for all test cases"""
- if not os.path.exists('/usr/bin/pristine-tar'):
- raise SkipTest('Skipping %s:%s as pristine-tar tool is not '
- 'available' % (__name__, cls.__name__))
- super(TestPristineTar, cls).setup_class()
-
- def __init__(self, *args, **kwargs):
- super(TestPristineTar, self).__init__(*args, **kwargs)
- self.repo = None
-
- def setup(self):
- """Test case setup"""
- super(TestPristineTar, self).setup()
- self.repo = GitRepository.create('repo')
-
- def check_repo(self, current_branch, branches=None, files=None):
- """Check the state of repo"""
- if branches is None:
- # Default branches
- branches = ['upstream', 'pristine-tar']
- return self._check_repo_state(self.repo, current_branch, branches,
- files)
-
- def check_tree(self, treeish, filelist):
- """Check treeish content"""
- return super(TestPristineTar, self).check_tree(self.repo, treeish,
- filelist)
-
- @staticmethod
- def unpack_tar(archive):
- """Unpack tarball, return directory containing sources"""
- tarobj = tarfile.open(archive, 'r')
- os.mkdir('unpacked')
- tarobj.extractall('unpacked')
- tarobj.close()
- dirlist = os.listdir('unpacked')
- if len(dirlist) == 1:
- return os.path.abspath(os.path.join('unpacked', dirlist[0]))
- else:
- return os.path.abspath('unpacked')
-
- def mock_import(self, args, stdin_data="\n\n"):
- """Import helper for pristine-tar"""
- return mock_import(args, stdin_data, self.repo.path)
-
- def ls_pristine_tar(self, archive):
- """List contents of the tarball committed into pristine-tar"""
- tmpdir = os.path.abspath(tempfile.mkdtemp(dir='.'))
- tarball = os.path.join(tmpdir, archive)
- try:
- popen = subprocess.Popen(['pristine-tar', 'checkout', tarball],
- cwd=self.repo.path)
- popen.wait()
- if popen.returncode:
- raise Exception('Pristine-tar checkout failed!')
- return ls_tar(tarball)
- finally:
- shutil.rmtree(tmpdir)
-
- def test_basic_import_pristine_tar(self):
- """Test importing with pristine-tar"""
- orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
- eq_(self.mock_import(['--pristine-tar', '--merge', orig]), 0)
- files = ['Makefile', 'README', 'dummy.sh']
- branches = ['master', 'upstream', 'pristine-tar']
- self.check_repo('master', branches, files)
- subject = self.repo.get_commit_info('pristine-tar')['subject']
- eq_(subject, 'pristine-tar data for %s' % os.path.basename(orig))
- self.check_files(ls_tar(orig),
- self.ls_pristine_tar('gbp-test-1.0.tar.bz2'))
-
- def test_rename(self):
- """Renaming orig archive"""
- orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
- args = ['--pristine-tar', '--pristine-tarball-name=my.tgz', orig]
- eq_(self.mock_import(args), 0)
- self.check_repo(None, None, [])
- self.check_files(ls_tar(orig), self.ls_pristine_tar('my.tgz'))
-
- def test_branch_update(self):
- """Check that the working copy is kept in sync with branch HEAD"""
- orig1 = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
- orig2 = os.path.join(DATA_DIR, 'gbp-test-1.1.tar.bz2')
- eq_(self.mock_import(['--pristine-tar', orig1]), 0)
- self.repo.set_branch('pristine-tar')
- eq_(self.mock_import(['--pristine-tar', orig2]), 0)
- self.check_repo('pristine-tar', None)
- eq_(len(self.repo.get_commits(until='pristine-tar')), 2)
-
- def test_zip(self):
- """Importing zip file"""
- orig = os.path.join(DATA_DIR, 'gbp-test-native-1.0.zip')
- eq_(self.mock_import(['--pristine-tar', orig]), 0)
- files = ['.gbp.conf', 'Makefile', 'README', 'dummy.sh',
- 'packaging/gbp-test-native.spec']
- self.check_repo(None, None, [])
- self.check_tree('upstream', files)
- self.check_files(ls_zip(orig),
- self.ls_pristine_tar('gbp-test-native-1.0.tar.gz'))
-
-#{ Test tarball mangling
- def test_nopristinefilter(self):
- """Test --no-pristine-tar-filter"""
- orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
- eq_(self.mock_import(['--pristine-tar', '--filter=README', orig]), 0)
- self.check_repo(None, None, [])
- self.check_tree('upstream', ['Makefile', 'dummy.sh'])
- self.check_files(ls_tar(orig),
- self.ls_pristine_tar('gbp-test-1.0.tar.bz2'))
-
- def test_nofilter_prefix(self):
- """Test prefix mangling without any filtering"""
- orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
- eq_(self.mock_import(['--pristine-tar', '--orig-prefix=new', orig]), 0)
- self.check_repo(None, None, None)
- self.check_tree('upstream', ['Makefile', 'dummy.sh', 'README'])
- prist_ref = set([fname.replace('gbp-test', 'new') for
- fname in ls_tar(orig)])
- self.check_files(prist_ref,
- self.ls_pristine_tar('gbp-test-1.0.tar.bz2'))
-
- def test_nopristinefilter_prefix(self):
- """Test --no-pristine-tar-filter with prefix mangling"""
- orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
- args = ['--pristine-tar', '--filter=README', '--orig-prefix=new', orig]
- eq_(self.mock_import(args), 0)
- self.check_repo(None, None, None)
- self.check_tree('upstream', ['Makefile', 'dummy.sh'])
- prist_ref = set([fname.replace('gbp-test', 'new') for
- fname in ls_tar(orig)])
- self.check_files(prist_ref,
- self.ls_pristine_tar('gbp-test-1.0.tar.bz2'))
-
- def test_filter_prefix_rename(self):
- """Test --no-pristine-tar-filter with prefix mangling"""
- orig = os.path.join(DATA_DIR, 'gbp-test2-2.0.tar.gz')
- args = ['--pristine-tar', '--filter=README', '--orig-prefix=new',
- '--pristine-tarball-name=new.tbz2', '--filter-pristine-tar',
- orig]
- eq_(self.mock_import(args), 0)
- self.check_repo(None, None, [])
- self.check_tree('upstream', ['Makefile', 'dummy.sh'])
- prist_ref = set(['new', 'new/Makefile', 'new/dummy.sh'])
- self.check_files(prist_ref, self.ls_pristine_tar('new.tbz2'))
-
- def test_dir_nopristinefilter(self):
- """Test importing directory with --no-pristine-tar-filter"""
- orig = self.unpack_tar(os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2'))
- args = ['--pristine-tar', '--filter=README', orig]
- eq_(self.mock_import(args, 'gbp-test\n1.0\n'), 0)
- files = ['Makefile', 'dummy.sh']
- self.check_repo(None, None, [])
- self.check_tree('upstream', ['Makefile', 'dummy.sh'])
- prist_ref = set(['gbp-test-1.0/%s' % fname for fname in ls_dir(orig)] +
- ['gbp-test-1.0'])
- self.check_files(prist_ref, self.ls_pristine_tar('gbp-test.tar.gz'))
-
- def test_dir_filter_prefix(self):
- """Test importing directory with prefix mangling"""
- orig = self.unpack_tar(os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2'))
- args = ['--pristine-tar', '--filter=README', '--filter-pristine-tar',
- '--orig-prefix=', '--pristine-tarball-name=my.tgz', orig]
- eq_(self.mock_import(args, 'gbp-test\n1.0\n'), 0)
- files = ['Makefile', 'dummy.sh']
- self.check_repo(None, None, [])
- self.check_tree('upstream', files)
- self.check_files(set(files), self.ls_pristine_tar('my.tgz'))
-
class TestBareRepo(ImportOrigTestBase):
"""Test importing to a bare repository"""
def test_basic_import_to_bare_repo(self):
"""Test importing inside bare git repository"""
- repo = GitRepository.create('.', bare=True)
+ repo = ComponentTestGitRepository.create('.', bare=True)
orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
eq_(mock_import([orig]), 0)
- self._check_repo_state(repo, None, ['upstream'])
+ self._check_repo_state(repo, 'master', ['master', 'upstream'])
eq_(len(repo.get_commits(until='upstream')), 1)
eq_(repo.get_tags(), ['upstream/1.0'])
repo.set_branch('upstream')
orig = os.path.join(DATA_DIR, 'gbp-test-1.1.tar.bz2')
eq_(mock_import([orig]), 0)
- self._check_repo_state(repo, 'upstream', ['upstream'])
+ self._check_repo_state(repo, 'upstream', ['master', 'upstream'])
eq_(len(repo.get_commits(until='upstream')), 2)
def test_pristine_import_to_bare(self):
"""Test importing inside bare git repository"""
- repo = GitRepository.create('.', bare=True)
+ repo = ComponentTestGitRepository.create('.', bare=True)
orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2')
eq_(mock_import([orig]), 0)
# No pristine-tar branch should be present
- self._check_repo_state(repo, None, ['upstream'])
-
+ self._check_repo_state(repo, 'master', ['master', 'upstream'])
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Basic tests for the git-import-srpm tool"""
import os
import shutil
-import urllib.request, urllib.error, urllib.parse
+import urllib
from nose.plugins.skip import SkipTest
from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
from mock import Mock
-from gbp.scripts.import_srpm import main as import_srpm
+import gbp.scripts.import_srpm as import_srpm
from gbp.git import GitRepository
from gbp.rpm import SrcRpmFile
from tests.component import ComponentTestBase
from tests.component.rpm import RPM_TEST_DATA_DIR as DATA_DIR
+from tests.testutils import capture_stderr
# Disable "Method could be a function warning"
# pylint: disable=R0201
+
def mock_import(args):
"""Wrapper for import-srpm"""
# Call import-orig-rpm with added arg0
- return import_srpm(['arg0'] + args)
+ with capture_stderr():
+ return import_srpm.main(['arg0'] + args)
class TestImportPacked(ComponentTestBase):
def test_invalid_args(self):
"""See that import-srpm fails gracefully if called with invalid args"""
eq_(mock_import([]), 1)
- assert_raises(SystemExit, mock_import, ['--invalid-arg=123'])
-
- """
with assert_raises(SystemExit):
mock_import(['--invalid-arg=123'])
- """
def test_basic_import(self):
"""Test importing of non-native src.rpm"""
eq_(mock_import(['--no-pristine-tar', srpm]), 0)
# Check repository state
repo = GitRepository('gbp-test')
- files = set(['Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt',
- 'gbp-test.spec', 'my.patch', 'mydir/myfile.txt'])
- self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
- # Four commits: upstream, packaging files, one patch and the removal
- # of imported patches
- eq_(len(repo.get_commits()), 4)
+ files = {'Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt',
+ 'gbp-test.spec', 'my.patch', 'my2.patch', 'my3.patch'}
+ self._check_repo_state(repo, 'master', ['master', 'upstream'],
+ files=files,
+ tags=['packaging/1.0-1', 'upstream/1.0'])
+ # Two commits: upstream and packaging files
+ eq_(len(repo.get_commits()), 2)
def test_basic_import2(self):
"""Import package with multiple spec files and full url patch"""
eq_(mock_import(['--no-pristine-tar', srpm]), 0)
# Check repository state
repo = GitRepository('gbp-test2')
- files = set(['Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt',
- 'gbp-test2.spec', 'gbp-test2-alt.spec', 'my.patch',
- 'mydir/myfile.txt'])
- self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
+ files = {'Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt',
+ 'gbp-test2.spec', 'gbp-test2-alt.spec', 'my.patch',
+ 'my2.patch', 'my3.patch'}
+ self._check_repo_state(repo, 'master', ['master', 'upstream'],
+ files=files,
+ tags=['packaging/1%2.0-0', 'upstream/2.0'])
+ # Two commits: upstream and packaging files
+ eq_(len(repo.get_commits()), 2)
- # Four commits: upstream, packaging files, one patch and the removal
- # of imported patches
- eq_(len(repo.get_commits()), 4)
+ def test_target_dir(self):
+ """Test importing to target dir"""
+ srpm = os.path.join(DATA_DIR, 'gbp-test-1.0-1.src.rpm')
+ eq_(mock_import(['--no-pristine-tar', srpm, 'targetdir']), 0)
+ # Check repository state
+ assert os.path.exists('targetdir')
+ repo = GitRepository('targetdir')
+ self._check_repo_state(repo, 'master', ['master', 'upstream'])
def test_basic_import_orphan(self):
"""
eq_(mock_import(['--no-pristine-tar', '--orphan-packaging', srpm]), 0)
# Check repository state
repo = GitRepository('gbp-test2')
- files = set(['bar.tar.gz', 'foo.txt', 'gbp-test2.spec',
- 'gbp-test2-alt.spec', 'my.patch', 'my2.patch', 'my3.patch'])
+ files = {'bar.tar.gz', 'foo.txt', 'gbp-test2.spec',
+ 'gbp-test2-alt.spec', 'my.patch', 'my2.patch', 'my3.patch'}
self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
# Only one commit: the packaging files
eq_(len(repo.get_commits()), 1)
srpm = os.path.join(DATA_DIR, 'gbp-test-native-1.0-1.src.rpm')
eq_(mock_import(['--native', srpm]), 0)
# Check repository state
- files = set(['.gbp.conf', 'Makefile', 'README', 'dummy.sh',
- 'packaging/gbp-test-native.spec'])
+ files = {'.gbp.conf', 'Makefile', 'README', 'dummy.sh',
+ 'packaging/gbp-test-native.spec'}
repo = GitRepository('gbp-test-native')
- self._check_repo_state(repo, 'master', ['master'], files)
+ self._check_repo_state(repo, 'master', ['master'],
+ files=files,
+ tags=['packaging/1.0-1'])
# Only one commit: the imported source tarball
eq_(len(repo.get_commits()), 1)
# Only one commit: packaging files
eq_(len(repo.get_commits()), 1)
- def test_import_compressed_patches(self):
- """Test importing of non-native src.rpm with compressed patches"""
- srpm = os.path.join(DATA_DIR, 'gbp-test-1.1-2.src.rpm')
- eq_(mock_import([srpm]), 0)
- # Check repository state
- repo = GitRepository('gbp-test')
- files = set(['Makefile', 'README', 'AUTHORS', 'NEWS', 'bar.tar.gz',
- 'dummy.sh', 'foo.txt', 'gbp-test.spec', 'my.patch',
- 'mydir/myfile.txt'])
- self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
- # Four commits: upstream, packaging files, three patches and the removal
- # of imported patches
- eq_(len(repo.get_commits()), 6)
-
def test_multiple_versions(self):
"""Test importing of multiple versions"""
- srpms = [ os.path.join(DATA_DIR, 'gbp-test-1.0-1.src.rpm'),
- os.path.join(DATA_DIR, 'gbp-test-1.0-1.other.src.rpm'),
- os.path.join(DATA_DIR, 'gbp-test-1.1-1.src.rpm') ]
+ srpms = [os.path.join(DATA_DIR, x) for x in ['gbp-test-1.0-1.src.rpm',
+ 'gbp-test-1.0-1.other.src.rpm',
+ 'gbp-test-1.1-1.src.rpm']]
eq_(mock_import(['--no-pristine-tar', srpms[0]]), 0)
repo = GitRepository('gbp-test')
self._check_repo_state(repo, 'master', ['master', 'upstream'])
- eq_(len(repo.get_commits()), 4)
+ eq_(len(repo.get_commits()), 2)
# Try to import same version again
eq_(mock_import([srpms[1]]), 0)
- eq_(len(repo.get_commits()), 4)
+ eq_(len(repo.get_commits()), 2)
eq_(len(repo.get_commits(until='upstream')), 1)
- eq_(mock_import(['--allow-same-version', srpms[1]]), 0)
- # Added new versio packaging plus one patch
- eq_(len(repo.get_commits()), 7)
+ eq_(mock_import(['--no-pristine-tar', '--allow-same-version', srpms[1]]), 0)
+ # Added new version of packaging
+ eq_(len(repo.get_commits()), 3)
eq_(len(repo.get_commits(until='upstream')), 1)
# Import new version
- eq_(mock_import([srpms[2]]), 0)
- files = set(['Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt',
- 'gbp-test.spec', 'my.patch', 'mydir/myfile.txt'])
+ eq_(mock_import(['--no-pristine-tar', srpms[2]]), 0)
+ files = {'Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt',
+ 'gbp-test.spec', 'my.patch', 'my2.patch', 'my3.patch'}
self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
- eq_(len(repo.get_commits()), 11)
+ eq_(len(repo.get_commits()), 5)
eq_(len(repo.get_commits(until='upstream')), 2)
# Check number of tags
eq_(len(repo.get_tags('upstream/*')), 2)
- eq_(len(repo.get_tags('vendor/*')), 3)
+ eq_(len(repo.get_tags('packaging/*')), 3)
def test_import_to_existing(self):
"""Test importing to an existing repo"""
self._check_log(-1, 'Also check the --create-missing-branches')
eq_(mock_import(['--no-pristine-tar', '--create-missing', srpm]), 0)
self._check_repo_state(repo, 'master', ['master', 'upstream'])
- # Four commits: our initial, upstream, packaging files, one patch,
- # and the removal of imported patches
- eq_(len(repo.get_commits()), 5)
+ # Four commits: our initial, upstream and packaging files
+ eq_(len(repo.get_commits()), 3)
# The import should fail because missing packaging-branch
srpm = os.path.join(DATA_DIR, 'gbp-test-1.1-1.src.rpm')
eq_(mock_import(['--packaging-branch=foo', srpm]), 1)
self._check_log(-1, 'Also check the --create-missing-branches')
-
def test_filter(self):
"""Test filter option"""
srpm = os.path.join(DATA_DIR, 'gbp-test-1.0-1.src.rpm')
# Check repository state
repo = GitRepository('gbp-test')
files = set(['Makefile', 'dummy.sh', 'bar.tar.gz', 'foo.txt',
- 'gbp-test.spec', 'my.patch', 'mydir/myfile.txt'])
+ 'gbp-test.spec', 'my.patch', 'my2.patch', 'my3.patch'])
self._check_repo_state(repo, 'master', ['master', 'upstream'], files)
+ def test_tagging(self):
+ """Test tag options of import-srpm"""
+ srpm = os.path.join(DATA_DIR, 'gbp-test-1.0-1.src.rpm')
+
+ # Invalid packaging tag keywords
+ eq_(mock_import(['--no-pristine-tar', '--packaging-tag=%(foo)s', srpm]),
+ 1)
+ self._check_log(-1, ".*Missing value 'foo' in *.*")
+ # Remove upstream tag
+ repo = GitRepository('gbp-test')
+ repo.delete_tag('upstream/1.0')
+
+ # Invalid upstream tag keywords
+ eq_(mock_import(['--no-pristine-tar', '--upstream-tag=%(foo)s', srpm]),
+ 1)
+ self._check_log(-1, ".*Missing value 'foo' in.*")
+
+ # Try with good keywords, with --skip-packaging-tag
+ eq_(mock_import(['--no-pristine-tar', '--vendor=foo',
+ '--skip-packaging-tag',
+ '--packaging-tag=%(vendor)s/%(version)s',
+ '--upstream-tag=upst/%(version)s', srpm]), 0)
+ eq_(repo.describe('upstream'), 'upst/1.0')
+ eq_(len(repo.get_tags()), 1)
+
+ # Re-import, creating packaging tag
+ eq_(mock_import(['--no-pristine-tar', '--vendor=foo',
+ '--packaging-tag=%(vendor)s/%(version)s',
+ '--upstream-tag=upst/%(version)s', srpm]), 0)
+ eq_(repo.describe('HEAD'), 'foo/1.0-1')
+ eq_(len(repo.get_tags()), 2)
+
+ def test_tagging_native(self):
+ """Test tagging of native packages with import-srpm"""
+ srpm = os.path.join(DATA_DIR, 'gbp-test-native-1.0-1.src.rpm')
+
+ # Invalid packaging tag keywords
+ eq_(mock_import(['--no-pristine-tar', '--packaging-tag=%(foo)s',
+ srpm, '--native']), 1)
+ self._check_log(-1, ".*Missing value 'foo' in {.*")
+
+ # Try with good keywords, with --skip-packaging-tag.
+ # Upstream tag format should not matter
+ eq_(mock_import(['--no-pristine-tar', '--vendor=foo', '--native',
+ '--skip-packaging-tag',
+ '--packaging-tag=%(vendor)s/%(version)s',
+ '--upstream-tag=%(foo)s', srpm]), 0)
+ repo = GitRepository('gbp-test-native')
+ eq_(len(repo.get_tags()), 0)
+
+ # Run again, now creating packaging tag
+ eq_(mock_import(['--no-pristine-tar', '--vendor=foo', '--native',
+ '--packaging-tag=%(vendor)s/%(version)s',
+ '--upstream-tag=%(foo)s', srpm]), 0)
+ eq_(repo.describe('HEAD'), 'foo/1.0-1')
+
def test_misc_options(self):
"""Test various options of git-import-srpm"""
srpm = os.path.join(DATA_DIR, 'gbp-test2-2.0-0.src.rpm')
- eq_(mock_import([
- '--no-patch-import',
- '--packaging-branch=pack',
- '--upstream-branch=orig',
- '--packaging-dir=packaging',
- '--packaging-tag=ver_%(upstreamversion)s-rel_%(release)s',
- '--upstream-tag=orig/%(upstreamversion)s',
- '--author-is-committer',
- srpm]), 0)
+ eq_(mock_import(['--no-pristine-tar',
+ '--packaging-branch=pack',
+ '--upstream-branch=orig',
+ '--packaging-dir=packaging',
+ '--packaging-tag=ver_%(upstreamversion)s-rel_%(release)s',
+ '--upstream-tag=orig/%(upstreamversion)s',
+ '--author-is-committer',
+ srpm]), 0)
# Check repository state
repo = GitRepository('gbp-test2')
- files = set(['Makefile', 'README', 'dummy.sh', 'packaging/bar.tar.gz',
- 'packaging/foo.txt', 'packaging/gbp-test2.spec',
- 'packaging/gbp-test2-alt.spec', 'packaging/my.patch',
- 'packaging/my2.patch', 'packaging/my3.patch'])
+ files = {'Makefile', 'README', 'dummy.sh', 'packaging/bar.tar.gz',
+ 'packaging/foo.txt', 'packaging/gbp-test2.spec',
+ 'packaging/gbp-test2-alt.spec', 'packaging/my.patch',
+ 'packaging/my2.patch', 'packaging/my3.patch'}
self._check_repo_state(repo, 'pack', ['pack', 'orig'], files)
eq_(len(repo.get_commits()), 2)
# Check packaging dir
eq_(info['author'].name, info['committer'].name)
eq_(info['author'].email, info['committer'].email)
+ # Create a new commit by committing an empty tree
+ commit = repo.commit_tree('4b825dc642cb6eb9a060e54bf8d69288fbee4904',
+ msg="Empty commit", parents=[])
+ repo.create_tag('foo/1.0', msg="New tag", commit=commit)
+ # Just blindly import another package on top of this to test more options
+ os.chdir('gbp-test2')
+ srpm = os.path.join(DATA_DIR, 'gbp-test-1.0-1.src.rpm')
+ eq_(mock_import(['--upstream-vcs-tag=foo/%(version)s',
+ '--upstream-branch=orig',
+ '--packaging-branch=pack',
+ srpm]), 0)
+ parents = repo.get_commits(until='orig', num=1, options='--format=%P')[0].split()
+ eq_(len(parents), 2)
+ ok_(commit in parents)
+ ok_(repo.rev_parse('orig/2.0^{}') in parents)
+
class TestImportUnPacked(ComponentTestBase):
"""Test importing of unpacked source rpms"""
- def setup(self):
- super(TestImportUnPacked, self).setup()
+ def setUp(self):
+ super(TestImportUnPacked, self).setUp()
# Unpack some source rpms
os.mkdir('multi-unpack')
for pkg in ['gbp-test-1.0-1.src.rpm', 'gbp-test2-2.0-0.src.rpm']:
# Check that importing dir with multiple spec files fails
eq_(mock_import(['multi-unpack']), 1)
self._check_log(-1, 'gbp:error: Failed determine spec file: '
- 'Multiple spec files found')
+ 'Multiple spec files found')
def test_import_spec(self):
"""Test importing of spec file"""
'master/gbp-test-1.0-1.src.rpm'
# Mock to use local files instead of really downloading
local_fn = os.path.join(DATA_DIR, os.path.basename(srpm))
- urllib.request.urlopen = Mock()
- urllib.request.urlopen.return_value = open(local_fn, 'rb')
+ import_srpm.urlopen = Mock()
+ import_srpm.urlopen.return_value = open(local_fn, 'rb')
- eq_(mock_import(['--no-pristine-tar', '--download', srpm]), 0)
+ eq_(mock_import(['--no-pristine-tar', srpm]), 0)
# Check repository state
repo = GitRepository('gbp-test')
self._check_repo_state(repo, 'master', ['master', 'upstream'])
def test_nonexistent_url(self):
- """Test graceful failure when trying download from nonexistent url"""
- srpm = 'http://url.does.not.exist.com/foo.src.rpm'
+ """Test graceful failure when trying download from non-existent url"""
+ srpm = 'http://honk.sigxcpu.org/does/not/exist'
# Do not connect to remote, mock failure
- urllib.request.urlopen = Mock()
- urllib.request.urlopen.side_effect = urllib.error.HTTPError(srpm, 404, "Not found",
- None, None)
+ import_srpm.urlopen = Mock()
+ import_srpm.urlopen.side_effect = urllib.error.HTTPError(srpm, 404, "Not found",
+ None, None)
- eq_(mock_import(['--download', srpm]), 1)
+ eq_(mock_import([srpm]), 1)
self._check_log(-1, "gbp:error: Download failed: HTTP Error 404")
self._clear_log()
def test_invalid_url(self):
"""Test graceful failure when trying download from invalid url"""
srpm = 'foob://url.does.not.exist.com/foo.src.rpm'
- eq_(mock_import(['--download', srpm]), 1)
- self._check_log(-1, "gbp:error: Download failed: unknown url type:")
+ eq_(mock_import([srpm]), 1)
+ self._check_log(-1, ".*No such file or directory: 'foob://url.does.not.exist.com/foo.src.rpm")
self._clear_log()
"""Test importing with pristine-tar"""
@classmethod
- def setup_class(cls):
+ def setUpClass(cls):
if not os.path.exists('/usr/bin/pristine-tar'):
raise SkipTest('Skipping %s:%s as pristine-tar tool is not '
'available' % (__name__, cls.__name__))
- super(TestPristineTar, cls).setup_class()
+ super(TestPristineTar, cls).setUpClass()
def test_basic_import_pristine_tar(self):
"""Test importing of non-native src.rpm, with pristine-tar"""
repo = GitRepository('gbp-test')
self._check_repo_state(repo, 'master', ['master', 'upstream',
'pristine-tar'])
- # Four commits: upstream, packaging files, one patch and the removal
- # of imported patches
- eq_(len(repo.get_commits()), 4)
+ # Two commits: upstream and packaging files
+ eq_(len(repo.get_commits()), 2)
def test_unsupported_archive(self):
"""Test importing of src.rpm with a zip source archive"""
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
"""Tests for the gbp pq-rpm tool"""
import os
import tempfile
-from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
+from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
from gbp.scripts.pq_rpm import main as pq
from gbp.git import GitRepository
from gbp.command_wrappers import GitCommand
+from gbp.rpm import SpecFile
from tests.component.rpm import RpmRepoTestBase
+from tests.testutils import capture_stderr
# Disable "Method could be a function warning"
# pylint: disable=R0201
# Call pq-rpm with added arg0
return pq(['arg0'] + args)
+
class TestPqRpm(RpmRepoTestBase):
"""Basic tests for gbp-pq-rpm"""
+ def _has_patches(self, specfile, patches):
+ spec = SpecFile(specfile)
+ eq_(sorted([p['linevalue'] for p in spec._patches().values()]),
+ sorted(patches))
+
def test_invalid_args(self):
"""See that pq-rpm fails gracefully when called with invalid args"""
GitRepository.create('.')
self._clear_log()
# Test invalid cmdline options
- assert_raises(SystemExit, mock_pq, ['--invalid-arg=123'])
-
- """
with assert_raises(SystemExit):
- mock_pq(['--invalid-arg=123'])
- """
+ with capture_stderr():
+ mock_pq(['--invalid-arg=123'])
def test_import_outside_repo(self):
"""Run pq-rpm when not in a git repository"""
eq_(mock_pq(['export']), 1)
self._check_log(0, 'gbp:error: %s is not a git repository' %
- os.path.abspath(os.getcwd()))
-
- def test_invalid_config_file(self):
- """Test invalid config file"""
- # Create dummy invalid config file and run pq-rpm
- GitRepository.create('.')
- with open('.gbp.conf', 'w') as conffd:
- conffd.write('foobar\n')
- eq_(mock_pq(['foo']), 1)
- self._check_log(0, 'gbp:error: Invalid config file: File contains no '
- 'section headers.')
+ os.path.abspath(os.getcwd()))
def test_import_export(self):
"""Basic test for patch import and export"""
repo = self.init_test_repo('gbp-test')
- branches = repo.get_local_branches() + ['development/master']
+ branches = repo.get_local_branches() + ['patch-queue/master']
# Test import
eq_(mock_pq(['import']), 0)
files = ['AUTHORS', 'dummy.sh', 'Makefile', 'NEWS', 'README',
- 'mydir/myfile.txt', '.gbp.conf']
- branches.append('development/master')
- self._check_repo_state(repo, 'development/master', branches, files)
- eq_(repo.get_merge_base('upstream', 'development/master'),
+ 'mydir/myfile.txt']
+ patches = ['my.patch', '0001-my-gz.patch', '0002-my-bzip2.patch', '0003-my2.patch']
+
+ branches.append('patch-queue/master')
+ self._check_repo_state(repo, 'patch-queue/master', branches, files)
+ eq_(repo.get_merge_base('upstream', 'patch-queue/master'),
repo.rev_parse('upstream'))
ok_(len(repo.get_commits('', 'upstream')) <
- len(repo.get_commits('', 'development/master')))
+ len(repo.get_commits('', 'patch-queue/master')))
# Test export
- eq_(mock_pq(['export']), 0)
+ eq_(mock_pq(['export', '--upstream-tag', 'upstream/%(version)s']), 0)
files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt',
- 'gbp-test.spec', '0001-my-gz.patch', '0002-my-bzip2.patch',
- '0003-my2.patch', 'my.patch']
- self._check_repo_state(repo, 'master', branches, files)
+ 'gbp-test.spec'] + patches
+ self._check_repo_state(repo, 'master', branches, files, clean=False)
eq_(repo.status()[' M'], [b'gbp-test.spec'])
+ self._has_patches('gbp-test.spec', patches)
# Another export after removing some patches
os.unlink('0001-my-gz.patch')
eq_(mock_pq(['export']), 0)
- self._check_repo_state(repo, 'master', branches, files)
+ self._check_repo_state(repo, 'master', branches, files, clean=False)
+ self._has_patches('gbp-test.spec', patches)
def test_import_export2(self):
"""Another test for import and export"""
repo = self.init_test_repo('gbp-test2')
- branches = repo.get_local_branches() + ['development/master-orphan']
+ branches = repo.get_local_branches() + ['patch-queue/master-orphan']
repo.set_branch('master-orphan')
# Import
eq_(mock_pq(['import']), 0)
- files = ['dummy.sh', 'Makefile', 'README', 'mydir/myfile.txt',
- '.gbp.conf']
- self._check_repo_state(repo, 'development/master-orphan', branches,
+ files = ['dummy.sh', 'Makefile', 'README', 'mydir/myfile.txt']
+ patches = ['packaging/0001-PATCH-My-modification.patch', 'my.patch']
+ self._check_repo_state(repo, 'patch-queue/master-orphan', branches,
files)
- # Test export
- eq_(mock_pq(['export']), 0)
- self._check_repo_state(repo, 'master-orphan', branches)
+ # Test export with --drop
+ branches.remove('patch-queue/master-orphan')
+ eq_(mock_pq(['export', '--drop', '--upstream-tag',
+ 'upstream/%(version)s', '--spec-file',
+ 'packaging/gbp-test2.spec']), 0)
+ self._check_repo_state(repo, 'master-orphan', branches, clean=False)
eq_(repo.status()[' M'], [b'packaging/gbp-test2.spec'])
-
- def test_import_in_subdir(self):
- """Test running gbp-rpm-pq from a subdir in the git tree"""
- repo = self.init_test_repo('gbp-test2')
- repo.set_branch('master-orphan')
- branches = repo.get_local_branches() + ['development/master-orphan']
- os.chdir('packaging')
-
- # Running from subdir should be ok
- eq_(mock_pq(['import']), 0)
- self._check_repo_state(repo, 'development/master-orphan', branches)
-
+ self._has_patches('packaging/gbp-test2.spec', patches)
def test_rebase(self):
"""Basic test for rebase action"""
repo = self.init_test_repo('gbp-test')
- repo.rename_branch('pq/master', 'development/master')
- repo.set_branch('development/master')
+ repo.rename_branch('pq/master', 'patch-queue/master')
+ repo.set_branch('patch-queue/master')
branches = repo.get_local_branches()
# Make development branch out-of-sync
GitCommand("rebase")(['--onto', 'upstream^', 'upstream'])
# Sanity check for our git rebase...
- ok_(repo.get_merge_base('development/master', 'upstream') !=
+ ok_(repo.get_merge_base('patch-queue/master', 'upstream') !=
repo.rev_parse('upstream'))
# Do rebase
eq_(mock_pq(['rebase']), 0)
- self._check_repo_state(repo, 'development/master', branches)
- ok_(repo.get_merge_base('development/master', 'upstream') ==
+ self._check_repo_state(repo, 'patch-queue/master', branches)
+ ok_(repo.get_merge_base('patch-queue/master', 'upstream') ==
repo.rev_parse('upstream'))
# Get to out-of-sync, again, and try rebase from master branch
GitCommand("rebase")(['--onto', 'upstream^', 'upstream'])
eq_(mock_pq(['switch']), 0)
eq_(mock_pq(['rebase']), 0)
- self._check_repo_state(repo, 'development/master', branches)
- ok_(repo.get_merge_base('development/master', 'upstream') ==
+ self._check_repo_state(repo, 'patch-queue/master', branches)
+ ok_(repo.get_merge_base('patch-queue/master', 'upstream') ==
repo.rev_parse('upstream'))
def test_switch(self):
"""Basic test for switch action"""
repo = self.init_test_repo('gbp-test')
- pkg_files = repo.list_files()
- branches = repo.get_local_branches() + ['development/master']
- # Switch to non-existent pq-branch should fail
- eq_(mock_pq(['switch']), 1)
- self._check_log(-1, ".*Branch 'development/master' does not exist")
+ branches = repo.get_local_branches() + ['patch-queue/master']
+ repo.create_branch('patch-queue/master')
- # Import and switch to base branch and back to pq
- eq_(mock_pq(['import']), 0)
+ # Switch to base branch and back to pq
eq_(mock_pq(['switch']), 0)
- self._check_repo_state(repo, 'master', branches)
+ self._check_repo_state(repo, 'patch-queue/master', branches)
eq_(mock_pq(['switch']), 0)
- self._check_repo_state(repo, 'development/master', branches)
-
- # Switch back to packaging branch
- eq_(mock_pq(['switch']), 0)
- self._check_repo_state(repo, 'master', branches, pkg_files)
+ self._check_repo_state(repo, 'master', branches)
def test_switch_drop(self):
"""Basic test for drop action"""
repo = self.init_test_repo('gbp-test')
- repo.rename_branch('pq/master', 'development/master')
- repo.set_branch('development/master')
+ repo.rename_branch('pq/master', 'patch-queue/master')
+ repo.set_branch('patch-queue/master')
branches = repo.get_local_branches()
- # Drop pq should fail when on pq branch
- eq_(mock_pq(['drop']), 1)
- self._check_log(-1, "gbp:error: On a patch-queue branch, can't drop it")
- self._check_repo_state(repo, 'development/master', branches)
+ # Switch to master
+ eq_(mock_pq(['switch']), 0)
+ self._check_repo_state(repo, 'master', branches)
+
+ # Drop should succeed when on master branch
+ eq_(mock_pq(['drop']), 0)
+ branches.remove('patch-queue/master')
+ self._check_repo_state(repo, 'master', branches)
+
+ def test_drop_pq(self):
+ """drop action should work on pq branch"""
+ repo = self.init_test_repo('gbp-test')
+ repo.rename_branch('pq/master', 'patch-queue/master')
+ repo.set_branch('patch-queue/master')
+ branches = repo.get_local_branches()
# Switch to master
eq_(mock_pq(['switch']), 0)
# Drop should succeed when on master branch
eq_(mock_pq(['drop']), 0)
- branches.remove('development/master')
+ branches.remove('patch-queue/master')
self._check_repo_state(repo, 'master', branches)
def test_force_import(self):
"""Test force import"""
repo = self.init_test_repo('gbp-test')
pkg_files = [f.decode() for f in repo.list_files()]
- repo.rename_branch('pq/master', 'development/master')
- repo.set_branch('development/master')
+ repo.rename_branch('pq/master', 'patch-queue/master')
+ repo.set_branch('patch-queue/master')
branches = repo.get_local_branches()
pq_files = [f.decode() for f in repo.list_files()]
# Re-import should fail
eq_(mock_pq(['import']), 1)
self._check_log(0, "gbp:error: Already on a patch-queue branch")
- self._check_repo_state(repo, 'development/master', branches, pq_files)
+ self._check_repo_state(repo, 'patch-queue/master', branches, pq_files)
# Mangle pq branch and try force import on top of that
repo.force_head('master', hard=True)
- self._check_repo_state(repo, 'development/master', branches, pkg_files)
+ self._check_repo_state(repo, 'patch-queue/master', branches, pkg_files)
eq_(mock_pq(['import', '--force']), 0)
- self._check_repo_state(repo, 'development/master', branches, pq_files)
+ # .gbp.conf won't get imported by pq
+ pq_files.remove('.gbp.conf')
+ self._check_repo_state(repo, 'patch-queue/master', branches, pq_files)
# Switch back to master
eq_(mock_pq(['switch']), 0)
# Force import should succeed
eq_(mock_pq(['import', '--force']), 0)
- self._check_repo_state(repo, 'development/master', branches, pq_files)
+ self._check_repo_state(repo, 'patch-queue/master', branches, pq_files)
def test_apply(self):
"""Basic test for apply action"""
repo = self.init_test_repo('gbp-test')
upstr_files = ['dummy.sh', 'Makefile', 'README']
- branches = repo.get_local_branches() + ['development/master']
+ branches = repo.get_local_branches() + ['patch-queue/master']
# No patch given
eq_(mock_pq(['apply']), 1)
self._check_log(-1, "gbp:error: No patch name given.")
# Create a pristine pq-branch
- repo.create_branch('development/master', 'upstream')
+ repo.create_branch('patch-queue/master', 'upstream')
# Apply patch
with tempfile.NamedTemporaryFile() as tmp_patch:
tmp_patch.write(repo.show('master:%s' % 'my.patch'))
tmp_patch.file.flush()
eq_(mock_pq(['apply', tmp_patch.name]), 0)
- self._check_repo_state(repo, 'development/master', branches,
+ self._check_repo_state(repo, 'patch-queue/master', branches,
upstr_files)
# Apply another patch, now when already on pq branch
tmp_patch.write(repo.show('master:%s' % 'my2.patch'))
tmp_patch.file.flush()
eq_(mock_pq(['apply', tmp_patch.name]), 0)
- self._check_repo_state(repo, 'development/master', branches,
+ self._check_repo_state(repo, 'patch-queue/master', branches,
upstr_files + ['mydir/myfile.txt'])
- def test_convert(self):
- """Basic test for convert action"""
- repo = self.init_test_repo('gbp-test2')
- branches = repo.get_local_branches() + ['master-orphan']
- files = ['packaging/bar.tar.gz', 'packaging/foo.txt',
- 'packaging/gbp-test2.spec', 'packaging/gbp-test2-alt.spec',
- 'packaging/my.patch', 'packaging/0001-My-addition.patch',
- '.gbp.conf']
- # First should fail because 'master-orphan' branch already exists
- eq_(mock_pq(['convert']), 1)
- self._check_log(-1, "gbp:error: Branch 'master-orphan' already exists")
-
- # Re-try with force
- eq_(mock_pq(['convert', '--force']), 0)
- self._check_repo_state(repo, 'master-orphan', branches, files)
-
- def test_convert_fail(self):
- """Tests for convert action error cases"""
- repo = self.init_test_repo('gbp-test')
- branches = repo.get_local_branches()
-
- # Already on orphan packaging branch
- eq_(mock_pq(['convert']), 1)
- self._check_repo_state(repo, 'master', branches)
- self._check_log(-1, ".*is not based on upstream version")
-
- # Create a pq branch and try from there
- eq_(mock_pq(['import']), 0)
- eq_(mock_pq(['convert']), 1)
- self._check_repo_state(repo, 'development/master',
- branches + ['development/master'])
- self._check_log(-1, ".*you're on patch-queue branch")
-
- # Switch back to orphan packaging branch and try again
- eq_(mock_pq(['switch']), 0)
- eq_(mock_pq(['convert']), 1)
- self._check_repo_state(repo, 'master',
- branches + ['development/master'])
- self._check_log(-1, r".*pq branch \S+ already exists")
-
def test_option_patch_numbers(self):
"""Test the --patch-numbers cmdline option"""
repo = self.init_test_repo('gbp-test')
- repo.rename_branch('pq/master', 'development/master')
+ repo.rename_branch('pq/master', 'patch-queue/master')
branches = repo.get_local_branches()
# Export
eq_(mock_pq(['export', '--no-patch-numbers']), 0)
+ patches = ['my-gz.patch', 'my-bzip2.patch', 'my2.patch', 'my.patch']
files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt',
- 'gbp-test.spec', 'my-gz.patch', 'my-bzip2.patch', 'my2.patch',
- 'my.patch']
- self._check_repo_state(repo, 'master', branches, files)
+ 'gbp-test.spec'] + patches
+ self._check_repo_state(repo, 'master', branches, files, clean=False)
+ self._has_patches('gbp-test.spec', patches)
def test_option_tmp_dir(self):
"""Test the --tmp-dir cmdline option"""
eq_(mock_pq(['import', '--spec-file=gbp-test.spec']), 0)
# Force import on top to test parsing spec from another branch
- eq_(mock_pq(['import', '--spec-file=gbp-test.spec', '--force']), 0)
+ eq_(mock_pq(['import', '--spec-file=gbp-test.spec', '--force',
+ '--upstream-tag', 'upstream/%(version)s']), 0)
# Test with export, too
eq_(mock_pq(['export', '--spec-file=foo.spec']), 1)
eq_(mock_pq(['import', '--packaging-dir=.']), 0)
# Test with export, --spec-file option should override packaging dir
- eq_(mock_pq(['export', '--packaging-dir=foo',
+ eq_(mock_pq(['export', '--packaging-dir=foo', '--upstream-tag',
+ 'upstream/%(version)s',
'--spec-file=gbp-test.spec']), 0)
- def test_option_pq_branch(self):
- """Test the --pq-branch and --packaging-branch options"""
- repo = self.init_test_repo('gbp-test')
- branches = repo.get_local_branches()
-
- # Invalid branch name
- eq_(mock_pq(['import', '--pq-branch=foo:']), 1)
- self._check_log(-1, "gbp:error: Cannot create patch-queue branch")
-
- # Try all possible keys in pq-branch format string
- eq_(mock_pq(['import',
- '--pq-branch=dev/%(branch)s/%(upstreamversion)s']), 0)
- branches.append('dev/master/1.1')
- self._check_repo_state(repo, 'dev/master/1.1', branches)
-
- # Switch to non-existent packaging branch should fail
- eq_(mock_pq(['switch', '--pq-branch=dev/master/1.1',
- '--packaging-branch=foobar']), 1)
- self._check_log(-1, "gbp:error: Git command failed: Error running git")
- self._check_repo_state(repo, 'dev/master/1.1', branches)
-
- # Export to existing packaging branch should be ok
- eq_(mock_pq(['switch', '--pq-branch=dev/master/1.1',
- '--packaging-branch=master']), 0)
- self._check_repo_state(repo, 'master', branches)
-
- def test_option_export_rev(self):
- """Test the --export-rev cmdline option"""
- repo = self.init_test_repo('gbp-test')
- repo.rename_branch('pq/master', 'development/master')
- branches = repo.get_local_branches()
- files = repo.list_files()
-
- # Export directly from upstream -> no patches expected
- eq_(mock_pq(['export', '--export-rev=upstream']), 0)
- files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt',
- 'gbp-test.spec', 'my.patch']
- self._check_repo_state(repo, 'master', branches, files)
-
- # Export another rev
- eq_(mock_pq(['export', '--export-rev=development/master~2']), 0)
- self._check_repo_state(repo, 'master', branches,
- files + ['0001-my-gz.patch'])
-
- # Export from upstream..master should fail
- eq_(mock_pq(['export', '--export-rev=master']), 1)
- self._check_log(-1, "gbp:error: Start commit .* not an ancestor of end")
- # Export invalid rev should fail
- eq_(mock_pq(['export', '--export-rev=foobar']), 1)
- self._check_log(-1, "gbp:error: Invalid treeish object foobar")
-
- # Export plain treeish. Doesn't work in pq (at least) -
- # just for testing exception handling here
- content = repo.list_tree('development/master')
- tree = repo.make_tree(content)
- eq_(mock_pq(['export', '--export-rev=%s' % tree]), 1)
- self._check_log(-1, "gbp:error: Start commit .* not an ancestor of end")
-
- def test_option_patch_compress(self):
- """Test the --patch-export-compress cmdline option"""
- repo = self.init_test_repo('gbp-test')
- repo.rename_branch('pq/master', 'development/master')
- branches = repo.get_local_branches()
-
- # Export, all generated patches should be compressed
- eq_(mock_pq(['export', '--patch-export-compress=1']), 0)
- files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt',
- 'gbp-test.spec', '0001-my-gz.patch.gz',
- '0002-my-bzip2.patch.gz', '0003-my2.patch.gz', 'my.patch']
- self._check_repo_state(repo, 'master', branches, files)
-
- def test_option_patch_export_squash(self):
- """Test the --patch-export-squash-until cmdline option"""
- repo = self.init_test_repo('gbp-test')
- repo.rename_branch('pq/master', 'development/master')
- repo.set_branch('development/master')
- branches = repo.get_local_branches()
-
- # Non-existent squash point should fail
- eq_(mock_pq(['export', '--patch-export-squash-until=foo']), 1)
- self._check_log(-1, r"gbp:error: Git command failed: revision 'foo\^0'")
-
- # Invalid squash point should fail
- eq_(mock_pq(['export', '--patch-export-squash-until=master']), 1)
- self._check_log(-1, "gbp:error: Given squash point 'master' not in the "
- "history of end commit 'development/master'")
-
- # Squashing up to the second latest patch -> 1 "normal" patch
- squash = 'development/master~1'
- eq_(mock_pq(['export', '--patch-export-squash-until=%s' % squash]), 0)
- squash += ':squash'
- eq_(mock_pq(['export', '--patch-export-squash-until=%s' % squash]), 0)
- files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt',
- 'gbp-test.spec', 'my.patch', 'squash.diff', '0002-my2.patch']
- self._check_repo_state(repo, 'master', branches, files)
-
- def test_option_patch_export_ignore(self):
- """Test the --patch-export-ignore-path cmdline option"""
- repo = self.init_test_repo('gbp-test')
- repo.rename_branch('pq/master', 'development/master')
- branches = repo.get_local_branches()
-
- # Export
- eq_(mock_pq(['export', '--patch-export-ignore-path=mydir/.*']), 0)
- files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt',
- 'gbp-test.spec', '0001-my-gz.patch', '0002-my-bzip2.patch',
- 'my.patch']
- self._check_repo_state(repo, 'master', branches, files)
-
def test_export_with_merges(self):
"""Test exporting pq-branch with merge commits"""
repo = self.init_test_repo('gbp-test')
- repo.rename_branch('pq/master', 'development/master')
- repo.set_branch('development/master')
+ repo.rename_branch('pq/master', 'patch-queue/master')
+ repo.set_branch('patch-queue/master')
branches = repo.get_local_branches()
# Create a merge commit in pq-branch
patches = repo.format_patches('HEAD^', 'HEAD', '.')
repo.force_head('HEAD^', hard=True)
- repo.commit_dir('.', 'Merge with master', 'development/master',
+ repo.commit_dir('.', 'Merge with master', 'patch-queue/master',
['master'])
merge_rev = repo.rev_parse('HEAD', short=7)
eq_(mock_pq(['apply', patches[0].decode()]), 0)
# Export should create diff up to the merge point and one "normal" patch
eq_(mock_pq(['export']), 0)
+ patches = ['my.patch',
+ '%s-to-%s.diff' % (upstr_rev, merge_rev), '0002-my2.patch']
files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt',
- 'gbp-test.spec', 'my.patch',
- '%s-to-%s.diff' % (upstr_rev, merge_rev), '0002-my2.patch']
- self._check_repo_state(repo, 'master', branches, files)
-
- def test_option_import_files(self):
- """Test the --import-files cmdline option"""
- repo = self.init_test_repo('gbp-test')
- # Add new conf file
- os.mkdir('debian')
- with open('debian/gbp.conf', 'w') as conf_file:
- conf_file.write('[DEFAULT]\npq-branch = my-pq-branch\n')
- repo.add_files(['debian/gbp.conf'], force=True)
- repo.commit_files(['debian/gbp.conf'], msg="Add conf file")
-
- # Import with default settings (should import gbp conf files)
- branches = repo.get_local_branches() + ['my-pq-branch']
- eq_(mock_pq(['import']), 0)
- self._check_repo_state(repo, 'my-pq-branch', branches)
- ok_('debian/gbp.conf' in repo.list_files())
- ok_('.gbp.conf' in repo.list_files())
-
- # Re-import with user-defined files
- eq_(mock_pq(['import', '--force', '--packaging-branch', 'master',
- '--import-files', 'foo.txt,my.patch']), 0)
- self._check_repo_state(repo, 'my-pq-branch', branches)
- ok_('foo.txt' in repo.list_files())
- ok_('my.patch' in repo.list_files())
-
- # Drop and re-import with no files
- eq_(mock_pq(['switch', '--packaging-branch', 'master', '--pq-branch',
- 'my-pq-branch']), 0)
- eq_(mock_pq(['drop']), 0)
- eq_(mock_pq(['import', '--packaging-branch', 'master',
- '--pq-branch', 'my-pq-branch', '--import-files=']), 0)
- self._check_repo_state(repo, 'my-pq-branch', branches)
- ok_('debian/gbp.conf' not in repo.list_files())
- ok_('.gbp.conf' not in repo.list_files())
-
- def test_option_new_packaging_dir(self):
- """Test the --new-packaging-dir cmdline option"""
- repo = self.init_test_repo('gbp-test2')
- branches = repo.get_local_branches() + ['master-orphan']
- files = ['rpm/bar.tar.gz', 'rpm/foo.txt', 'rpm/gbp-test2.spec',
- 'rpm/gbp-test2-alt.spec', 'rpm/my.patch',
- 'rpm/0001-My-addition.patch']
- # Drop already-existing master-orphan branch
- repo.delete_branch('master-orphan')
- # Try convert
- eq_(mock_pq(['convert', '--import-files=',
- '--new-packaging-dir=rpm']), 0)
- self._check_repo_state(repo, 'master-orphan', branches, files)
-
- def test_option_retain_history(self):
- """Test the --retain-history cmdline option"""
- repo = self.init_test_repo('gbp-test2')
- branches = repo.get_local_branches() + ['master-orphan']
- files = ['packaging/bar.tar.gz', 'packaging/foo.txt',
- 'packaging/gbp-test2.spec', 'packaging/gbp-test2-alt.spec',
- 'packaging/my.patch', 'packaging/0001-My-addition.patch',
- '.gbp.conf']
- # Drop pre-existing master-orphan branch
- repo.delete_branch('master-orphan')
-
- # Convert with history
- eq_(mock_pq(['convert', '--retain-history']), 0)
- self._check_repo_state(repo, 'master-orphan', branches, files)
- eq_(len(repo.get_commits('', 'master-orphan')), 7)
+ 'gbp-test.spec'] + patches
+ self._check_repo_state(repo, 'master', branches, files, clean=False)
+ self._has_patches('gbp-test.spec', patches)
def test_import_unapplicable_patch(self):
"""Test import when a patch does not apply"""
with open('my2.patch', 'w') as patch_file:
patch_file.write('-this-does\n+not-apply\n')
eq_(mock_pq(['import']), 1)
- self._check_log(-1, "("
- "Aborting|"
- "Please, commit your changes or stash them|"
- "gbp:error: Import failed.* You have local changes"
- ")")
- self._check_repo_state(repo, 'master', branches)
+ self._check_log(-2, "Please commit your changes or stash them")
+ self._check_repo_state(repo, 'master', branches, clean=False)
# Now commit the changes to the patch and try again
repo.add_files(['my2.patch'], force=True)
repo.commit_files(['my2.patch'], msg="Mangle patch")
eq_(mock_pq(['import']), 1)
self._check_log(-1, "gbp:error: Import failed: Error running git apply")
- self._check_repo_state(repo, 'master', branches)
-
+ self._check_repo_state(repo, 'master', branches, clean=False)
# vim: set fileencoding=utf-8 :
#
-# (C) 2013 Intel Corporation <markus.lehtonen@linux.intel.com>
+# (C) 2013-2015 Intel Corporation <markus.lehtonen@linux.intel.com>
# 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
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Tests for the git-rpm-ch tool"""
+# along with this program; if not, please see
+# <http://www.gnu.org/licenses/>
+"""Tests for the gbp-rpm-ch tool"""
import os
import re
-from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
+from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
from gbp.scripts.rpm_ch import main as rpm_ch
from gbp.git import GitRepository
+from tests.testutils import capture_stderr
from tests.component.rpm import RpmRepoTestBase
def mock_ch(args):
- """Wrapper for git-rpm-ch"""
+ """Wrapper for gbp-rpm-ch"""
+ with capture_stderr():
+ return rpm_ch(['arg0', '--packaging-branch=master',
+ '--spawn-editor=never'] + args)
- return rpm_ch(['arg0', '--packaging-branch=master',
- '--spawn-editor=never'] + args)
class TestRpmCh(RpmRepoTestBase):
- """Basic tests for git-rpm-ch"""
+ """Basic tests for gbp-rpm-ch"""
- def setup(self):
+ def setUp(self):
"""Test case setup"""
- super(TestRpmCh, self).setup()
+ super(TestRpmCh, self).setUp()
# Set environment so that commits succeed without git config
os.environ['GIT_AUTHOR_NAME'] = 'My Name'
os.environ['GIT_COMMITTER_NAME'] = 'My Name'
return fobj.readlines()
def test_invalid_args(self):
- """See that git-rpm-ch fails gracefully when called with invalid args"""
+ """See that gbp-rpm-ch fails gracefully when called with invalid args"""
GitRepository.create('.')
- assert_raises(SystemExit, mock_ch, ['--invalid-opt'])
-
- """
with assert_raises(SystemExit):
mock_ch(['--invalid-opt'])
- """
def test_import_outside_repo(self):
- """Run git-rpm-ch when not in a git repository"""
+ """Run gbp-rpm-ch when not in a git repository"""
eq_(mock_ch([]), 1)
self._check_log(0, 'gbp:error: No Git repository at ')
- def test_invalid_config_file(self):
- """Test invalid config file"""
- # Create dummy invalid config file and run git-rpm-ch
- GitRepository.create('.')
- with open('.gbp.conf', 'w') as conffd:
- conffd.write('foobar\n')
- eq_(mock_ch([]), 1)
- self._check_log(0, 'gbp:error: invalid config file: File contains no '
- 'section headers.')
-
def test_update_spec_changelog(self):
"""Test updating changelog in spec"""
repo = self.init_test_repo('gbp-test')
eq_(mock_ch([]), 0)
- eq_(repo.status(), {' M': ['gbp-test.spec']})
+ eq_(repo.status(), {' M': [b'gbp-test.spec']})
def test_update_changes_file(self):
"""Test updating a separate changes file"""
repo = self.init_test_repo('gbp-test-native')
eq_(mock_ch([]), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes']})
def test_create_spec_changelog(self):
"""Test creating changelog in spec file"""
# Give starting point
eq_(mock_ch(['--since=HEAD^']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test2.spec']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test2.spec']})
content = self.read_file('packaging/gbp-test2.spec')
# Should contain 4 lines (%changelog, header, 1 entry and an empty line)
eq_(len(content), len(orig_content) + 4)
# Give starting point
eq_(mock_ch(['--since=HEAD^', '--changelog-file=CHANGES']), 0)
- eq_(repo.status(), {'??': ['packaging/gbp-test2.changes']})
+ eq_(repo.status(), {'??': [b'packaging/gbp-test2.changes']})
content = self.read_file('packaging/gbp-test2.changes')
# Should contain 3 lines (header, 1 entry and an empty line)
eq_(len(content), 3)
- def test_option_all(self):
- """Test the --all cmdline option"""
- repo = self.init_test_repo('gbp-test2')
-
- eq_(mock_ch(['--changelog-file=CHANGES', '--all']), 0)
- content = self.read_file('packaging/gbp-test2.changes')
- # Should contain N+2 lines (header, N commits and an empty line)
- commit_cnt = len(repo.get_commits(since=None, until='master'))
- eq_(len(content), commit_cnt + 2)
-
def test_option_changelog_file(self):
"""Test the --changelog-file cmdline option"""
repo = self.init_test_repo('gbp-test-native')
# Guess changelog file
eq_(mock_ch(['--changelog-file=CHANGES']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes']})
# Use spec file as changelog
eq_(mock_ch(['--changelog-file=SPEC', '--since=HEAD^']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes',
- 'packaging/gbp-test-native.spec']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes',
+ b'packaging/gbp-test-native.spec']})
# Arbitrary name
eq_(mock_ch(['--changelog-file=foo.changes', '--since=HEAD^']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes',
- 'packaging/gbp-test-native.spec'],
- '??': ['foo.changes']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes',
+ b'packaging/gbp-test-native.spec'],
+ '??': [b'foo.changes']})
def test_option_spec_file(self):
"""Test the --spec-file cmdline option"""
eq_(mock_ch(['--spec-file=foo.spec']), 1)
self._check_log(-1, "gbp:error: Unable to read spec file")
- eq_(mock_ch(['--spec-file=auto']), 1)
+ eq_(mock_ch(['--spec-file=']), 1)
self._check_log(-1, "gbp:error: Multiple spec files found")
eq_(mock_ch(['--spec-file=packaging/gbp-test2.spec', '--since=HEAD^']),
0)
- eq_(repo.status(), {' M': ['packaging/gbp-test2.spec']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test2.spec']})
def test_option_packaging_dir(self):
"""Test the --packaging-dir cmdline option"""
# Packaging dir should be taken from spec file if it is defined
eq_(mock_ch(['--packaging-dir', 'foo', '--spec-file',
'packaging/gbp-test-native.spec']), 0)
- eq_(repo.status(), {' M': ['packaging/gbp-test-native.changes']})
+ eq_(repo.status(), {' M': [b'packaging/gbp-test-native.changes']})
def test_branch_options(self):
"""Test the --packaging-branch and --ignore-branch cmdline options"""
eq_(mock_ch(['--packaging-branch=foo', '--ignore-branch']), 0)
- def test_option_meta_bts(self):
- """Test parsing of the bts meta tags"""
- repo = self.init_test_repo('gbp-test-native')
-
- # Create a dummy commit that references bts
- with open('new-file', 'w') as fobj:
- fobj.write('foobar\n')
- repo.add_files('new-file')
- repo.commit_all('Fix\n\nCloses: #123\nFixes: #456\n Fixes: #789')
-
- eq_(mock_ch(['--since=HEAD^']), 0)
- content = self.read_file('packaging/gbp-test-native.changes')
- # rpm-ch shouldn't have picked the ref with leading whitespace
- eq_(content[1], '- Fix (Closes: #123) (Fixes: #456)\n')
-
- # Check the --meta-bts option
- eq_(mock_ch(['--since=HEAD^', '--meta-bts=Fixes']), 0)
- content = self.read_file('packaging/gbp-test-native.changes')
- eq_(content[1], '- Fix (Fixes: #456)\n')
-
def test_option_no_release(self):
"""Test the --no-release cmdline option"""
self.init_test_repo('gbp-test-native')
eq_(mock_ch(['--git-author', '--since=HEAD^1']), 0)
# Test the --git-author option
+ saved_author = os.environ.get('GIT_AUTHOR_NAME')
+ saved_email = os.environ.get('GIT_AUTHOR_EMAIL')
+ os.environ['GIT_AUTHOR_NAME'] = 'John Doe'
+ os.environ['GIT_AUTHOR_EMAIL'] = 'jd@host.com'
with open(os.path.join(repo.git_dir, 'config'), 'a') as fobj:
fobj.write('[user]\n name=John Doe\n email=jd@host.com\n')
eq_(mock_ch(['--git-author', '--since=HEAD^']), 0)
header = self.read_file('packaging/gbp-test-native.changes')[0]
ok_(re.match(r'.+ John Doe <jd@host\.com> .+', header), header)
+ if saved_author:
+ os.environ['GIT_AUTHOR_NAME'] = saved_author
+ if saved_email:
+ os.environ['GIT_AUTHOR_EMAIL'] = saved_email
def test_option_full(self):
"""Test the --full cmdline option"""
'Signed-off-by:.*']), 0)
commit_msg_body = repo.get_commit_info('HEAD')['body']
full_msg = [line for line in commit_msg_body.splitlines() if
- (line and not line.startswith('Signed-off-by:'))]
+ (line and not line.startswith('Signed-off-by:'))]
content = self.read_file('packaging/gbp-test-native.changes')
# New lines: header, 1 entry "header", filtered entry "body" from
# commit message and one empty line
header = self.read_file('packaging/gbp-test-native.changes')[0]
ok_(re.match(r'.+ foobar$', header))
- def test_option_commit(self):
- """Test the --commit cmdline option"""
- repo = self.init_test_repo('gbp-test')
-
- # Check unclean repo
- with open('untracked-file', 'w') as fobj:
- fobj.write('this file is not tracked\n')
- with open('foo.txt', 'a') as fobj:
- fobj.write('new stuff\n')
-
- # Unstaged file (foo.txt) -> failure
- eq_(mock_ch(['--commit', '--since=HEAD^']), 1)
- self._check_log(-1, 'gbp:error: Please commit or stage your changes')
-
- # Add file, update and commit, untracked file should be ignored
- repo.add_files('foo.txt')
- sha = repo.rev_parse('HEAD')
- eq_(mock_ch(['--commit', '--since=HEAD^']), 0)
- eq_(sha, repo.rev_parse('HEAD^'))
- eq_(repo.get_commit_info('HEAD')['files'],
- {'M': ['foo.txt', 'gbp-test.spec']})
-
- def test_option_commit_msg(self):
- """Test the --commit-msg cmdline option"""
- repo = self.init_test_repo('gbp-test2')
-
- eq_(mock_ch(['--commit', '--since=HEAD^', '--commit-msg=Foo']), 0)
- eq_(repo.get_commit_info('HEAD')['subject'], 'Foo')
-
- # Unknown key in format string causes failure
- eq_(mock_ch(['--commit', '--since=HEAD^', '--commit-msg=%(foo)s']), 1)
- self._check_log(-1, "gbp:error: Unknown key 'foo' in commit-msg string")
-
- def test_tagging(self):
- """Test commiting/tagging"""
- repo = self.init_test_repo('gbp-test-native')
-
- # Update and commit+tag
- eq_(mock_ch(['--tag', '--packaging-tag=new-tag', '--since=HEAD^']), 0)
- ok_(repo.has_tag('new-tag'))
- sha = repo.rev_parse('HEAD')
- eq_(sha, repo.rev_parse('new-tag^0'))
-
- # Should fail if the tag already exists
- eq_(mock_ch(['--tag', '--packaging-tag=new-tag', '--since=HEAD^']), 1)
-
- # Update and commit+tag
- eq_(mock_ch(['--tag', '--packaging-tag=new-tag', '--since=HEAD^',
- '--retag']), 0)
- ok_(repo.has_tag('new-tag'))
- sha2 = repo.rev_parse('HEAD')
- ok_(sha2 != sha)
- eq_(sha2, repo.rev_parse('new-tag^0'))
-
- def test_tagging2(self):
- """Test commiting/tagging spec file"""
- repo = self.init_test_repo('gbp-test2')
-
- # Check unclean repo
- with open('untracked-file', 'w') as fobj:
- fobj.write('this file is not tracked\n')
- with open('README', 'a') as fobj:
- fobj.write('some new content\n')
-
- # Unstaged file (README) -> failure
- eq_(mock_ch(['--tag', '--packaging-tag=new-tag', '--since=HEAD^']), 1)
- self._check_log(-1, 'gbp:error: Please commit or stage your changes')
-
- # Add file, update and commit+tag, untracked file should be ignored
- repo.add_files('README')
- eq_(mock_ch(['--tag', '--packaging-tag=new-tag', '--since=HEAD^']), 0)
- ok_(repo.has_tag('new-tag'))
- sha = repo.rev_parse('HEAD')
- eq_(sha, repo.rev_parse('new-tag^0'))
-
def test_option_editor_cmd(self):
"""Test the --editor-cmd and --spawn-editor cmdline options"""
repo = self.init_test_repo('gbp-test-native')
eq_(mock_ch(['--spawn-editor=release', '--editor-cmd=rm']), 0)
- eq_(repo.status(), {' D': ['packaging/gbp-test-native.changes']})
+ eq_(repo.status(), {' D': [b'packaging/gbp-test-native.changes']})
repo.force_head('HEAD', hard=True)
ok_(repo.is_clean())
eq_(mock_ch(['--spawn-editor=always', '--editor-cmd=']),
0)
- def test_option_message(self):
- """Test the --message cmdline option"""
- self.init_test_repo('gbp-test-native')
- orig_content = self.read_file('packaging/gbp-test-native.changes')
-
- eq_(mock_ch(['--message', 'my entry\nanother entry']), 0)
- content = self.read_file('packaging/gbp-test-native.changes')
- # Added header, two entries and a blank line
- eq_(len(content), len(orig_content) + 4)
- eq_(content[2], '- another entry\n')
-
def test_user_customizations(self):
"""Test the user customizations"""
repo = self.init_test_repo('gbp-test-native')
orig_content = self.read_file('packaging/gbp-test-native.changes')
# Add new commit with known content
- with open('new-file.txt', 'w') as fobj:
- fobj.write('this is new content\n')
- repo.add_files('new-file.txt')
- repo.commit_staged('Add new file')
+ self.add_file(repo, 'new-file.txt', 'this is new content\n')
# Only track a non-existent file
eq_(mock_ch(['--since=HEAD^', 'non-existent-path']), 0)
def test_commit_guessing_fail(self):
"""Test for failure of start commit guessing"""
- repo = self.init_test_repo('gbp-test-native')
+ self.init_test_repo('gbp-test-native')
# Add "very old" header to changelog
with open('packaging/gbp-test-native.changes', 'w') as ch_fp:
# last changelog section
eq_(mock_ch([]), 1)
self._check_log(-1, "gbp:error: Couldn't determine starting point")
-
sys.path.insert(0, os.path.abspath('..'))
-import gbp
-import gbp.log
+import gbp # noqa: E402
+import gbp.log # noqa: E402
gbp.log.setup(False, False)
_chdir_backup = None
_tmpdirs = []
+
def chdir(dir):
global _chdir_backup
if not _chdir_backup:
_chdir_backup = os.path.abspath(os.curdir)
os.chdir(str(dir))
+
def new_tmpdir(name):
global _tmpdirs
- _tmpdirs = []
- prefix='gbp_%s_' % name
+ prefix = 'gbp_%s_' % name
tmpdir = TmpDir(prefix)
_tmpdirs.append(tmpdir)
return tmpdir
+
def teardown():
if _chdir_backup:
os.chdir(_chdir_backup)
tmpdir.rmdir()
del _tmpdirs[:]
+
class TmpDir(object):
def __init__(self, suffix='', prefix='tmp'):
--- /dev/null
+From: Guido Günther <agx@sigxcpu.org>
+Subject: [text] foobar
+
+ foo
+
+diff --git a/foo b/foo
+new file mode 100644
+index 0000000..257cc56
+--- /dev/null
++++ b/foo
+@@ -0,0 +1 @@
++foo
# Data for TestGbpConfig
-[coolcommand]
-branchname = abranch
\ No newline at end of file
+[config]
+color-scheme = checkcheck
--- /dev/null
+# Data for TestGbpCreateRemoteRepo
+
+[remote-config config1]
+remote-url-pattern = ssh://git.debian.org/git/pkg-libvirt/%(pkg)s.git
+template-dir = /srv/alioth.debian.org/chroot/home/groups/pkg-libvirt/git-template
+
+[remote-config config2]
+remote-url-pattern = ssh://git.debian.org/git/calendarserver/%(pkg)s.git
--- /dev/null
+FOO:
+
+file for testing rpm support of git-buildpackage.
--- /dev/null
+diff --git a/dummy.sh b/dummy.sh
+index 8c33db6..6f04268 100755
+--- dummy.sh
++++ dummy.sh
+@@ -1,3 +1,3 @@
+ #!/bin/sh
+
+-echo "Hello world"
++echo "Hello GBP"
--- /dev/null
+diff --git a/mydir/myfile.txt b/mydir/myfile.txt
+new file mode 100644
+index 0000000..2cdad29
+--- /dev/null
++++ b/mydir/myfile.txt
+@@ -0,0 +1 @@
++Dummy
--- /dev/null
+diff --git a/README b/README
+index a1311cb..a59f1b9 100644
+--- a/README
++++ b/README
+@@ -1 +1 @@
+-Just for testing git-buildpackage.
++Just for testing GBP.
--- /dev/null
+Name: gbp-test-native
+Summary: Test package for git-buildpackage
+Version: 1.0
+Release: 1
+Group: Development/Libraries
+License: GPLv2
+Source1: %{name}-%{version}.zip
+BuildRequires: unzip
+
+%description
+Package for testing the RPM functionality of git-buildpackage.
+Mimics a "native" package
+
+
+%prep
+unzip %{SOURCE1}
+%setup -T -D
+
+
+%build
+make
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+cp -R * %{buildroot}/%{_datadir}/%{name}
+
+
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}
--- /dev/null
+Name: gbp-test-native2
+Summary: Test package for git-buildpackage
+Version: 2.0
+Release: 0
+Group: Development/Libraries
+License: GPLv2
+Source: foo.txt
+BuildRequires: unzip
+
+%description
+Package for testing the RPM functionality of git-buildpackage.
+Mimics a "native" package that doesn't have any source tarball.
+
+
+%prep
+# Just create build dir
+%setup -T -c
+cp %{SOURCE0} .
+
+
+%build
+# Nothing to do
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+cp -R * %{buildroot}/%{_datadir}/%{name}
+
+
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}
--- /dev/null
+Name: gbp-test
+Summary: Test package for git-buildpackage
+Version: 1.0
+Release: 1
+Group: Development/Libraries
+License: GPLv2
+Source: %{name}-%{version}.tar.bz2
+Source1: foo.txt
+Source20: bar.tar.gz
+# Gbp-Ignore-Patches: 0
+Patch0: my.patch
+Patch10: my2.patch
+Patch20: my3.patch
+
+
+%description
+Package for testing the RPM functionality of git-buildpackage.
+
+
+%prep
+%setup -n %{name} -a 20
+
+%patch0
+%patch10 -p1
+
+
+%build
+make
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+cp -R * %{buildroot}/%{_datadir}/%{name}
+install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
+
+
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}
--- /dev/null
+Name: gbp-test2
+Summary: Test package 2 for git-buildpackage
+Epoch: 2
+Version: 3.0
+Release: 0
+Group: Development/Libraries
+License: GPLv2
+Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz
+Source0: foo.txt
+Source20: bar.tar.gz
+# Gbp-Ignore-Patches: 0
+Patch0: my.patch
+Patch10: my2.patch
+Patch20: my3.patch
+Packager: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+VCS: myoldvcstag
+
+%description
+Package for testing the RPM functionality of git-buildpackage.
+
+%package empty
+Summary: Empty subpackage
+
+%description empty
+Empty subpackage for the %{name} test package.
+
+
+%prep
+%setup -T -n %{name}-%{version} -c -a 10
+
+%patch
+%patch -P 10 -p1
+
+echo "Do things"
+
+# Gbp-Patch-Macros
+
+%build
+make
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+cp -R * %{buildroot}/%{_datadir}/%{name}
+install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
+
+
+%changelog
+* Tue Feb 04 2014 Name <email> 1
+- My change
+
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}
+
+%files empty
+%defattr(-,root,root,-)
--- /dev/null
+../rpmbuild/SPECS/gbp-test-native.spec
\ No newline at end of file
--- /dev/null
+../rpmbuild/SPECS/gbp-test-native2.spec
\ No newline at end of file
--- /dev/null
+#
+# Spec for testing some quirks of spec parsing
+#
+
+Name: pkg_name
+Summary: Spec for testing some quirks of spec parsing
+Version: 0.1
+Release: 1.2
+License: GPLv2
+Source1: foobar.tar.gz
+# Gbp-Ignore-Patches: 2 4 888
+Patch1: 01.patch
+Patch2: 02.patch
+Patch3: 03.patch
+Patch4: 04.patch
+Patch5: 05.patch
+
+%description
+Spec for testing some quirks of spec parsing. No intended for building an RPM.
+
+%prep
+# We don't have Source0 so rpmbuild would fail, but gbp shouldn't crash
+%setup -q
+
+# Patches are applied out-of-order wrt. numbering
+%patch5
+%patch2
+%patch1 -F2
+# Patch 999 does not exist, rpmbuild would fail but GBP should not
+%patch999
--- /dev/null
+Name: gbp-test
+Summary: Test package for git-buildpackage
+Version: 1.0
+Release: 1
+Group: Development/Libraries
+License: GPLv2
+Source: %{name}-%{version}.tar.bz2
+Source1: foo.txt
+Source20: bar.tar.gz
+# Gbp-Ignore-Patches: 0
+Patch0: my.patch
+# Patches auto-generated by git-buildpackage:
+Patch1: new.patch
+
+
+%description
+Package for testing the RPM functionality of git-buildpackage.
+
+
+%prep
+%setup -n %{name} -a 20
+
+%patch0
+# new.patch
+%patch1 -p1
+
+
+%build
+make
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+cp -R * %{buildroot}/%{_datadir}/%{name}
+install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
+
+
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}
--- /dev/null
+Name: gbp-test
+VCS: myvcstag
+Summary: Test package for git-buildpackage
+Version: 1.0
+Release: 1
+Group: Development/Libraries
+License: GPLv2
+Source: %{name}-%{version}.tar.bz2
+Source1: foo.txt
+Source20: bar.tar.gz
+# Gbp-Ignore-Patches: 0
+Patch0: my.patch
+# Patches auto-generated by git-buildpackage:
+Patch1: new.patch
+
+
+%description
+Package for testing the RPM functionality of git-buildpackage.
+
+
+%prep
+%setup -n %{name} -a 20
+
+%patch0
+# new.patch
+%patch1 -p1
+
+
+%build
+make
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+cp -R * %{buildroot}/%{_datadir}/%{name}
+install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
+
+
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}
+%changelog
+* Wed Feb 05 2014 Name <email> 1
+- New entry
--- /dev/null
+#
+# Spec file for testing all RPM tags (that we know of
+#
+
+%define suse_release %(test -e /etc/SuSE-release && head -n1 /etc/SuSE-release | cut -d ' ' -f2 | cut --output-delimiter=0 -d. -f1,2 || echo 0)
+%if "%{suse_release}" >= "1201"
+%define test_weak_dep_tags 1
+%if "%{suse_release}" < "1302"
+%define test_weak_dep_tags_2 1
+%endif
+%endif
+
+%define test_arch_os_tags %(test -n "$GBP_SKIP_ARCH_OS_TAGS" && echo 0 || echo 1)
+
+%define source_fn_base source
+%define patch_fn_base patch
+
+# Gbp-Undefined-Tag: foobar
+
+# Test that we accept different cases
+NAME: my_name
+version: 0
+ReLeasE: 0
+
+# Rest of the tags
+Epoch: 0
+Summary: my_summary
+License: my_license
+Distribution: my_distribution
+Vendor: my_vendor
+Group: my_group
+Packager: my_packager
+Url: my_url
+Vcs: my_vcs
+Source: my_source
+Patch1: my_%patch_fn_base
+Patch0: my_%{patch_fn_base}0
+Nosource: 0
+Nopatch: 0
+#Icon: my_icon
+BuildRoot: my_buildroot
+Provides: my_provides
+Requires: my_requires
+Conflicts: my_conflicts
+Obsoletes: my_obsoletes
+BuildConflicts: my_buildconflicts
+BuildRequires: my_buildrequires
+AutoReqProv: No
+AutoReq: No
+AutoProv: No
+DistTag: my_disttag
+BugUrl: my_bugurl
+
+%if 0%{?test_weak_dep_tags}
+Recommends: my_recommends
+Suggests: my_suggests
+Supplements: my_supplements
+Enhances: my_enhances
+%if 0%{?test_weak_dep_tags_2}
+BuildRecommends:my_buildrecommends
+BuildSuggests: my_buildsuggests
+BuildSupplements:my_buildsupplements
+BuildEnhances: my_buildenhances
+%endif
+%endif
+
+# These should be filtered out by GBP
+%if "%{test_arch_os_tags}" != "0"
+BuildArch: my_buildarch
+ExcludeArch: my_excludearch
+ExclusiveArch: my_exclusivearch
+ExcludeOs: my_excludeos
+ExclusiveOs: my_exclusiveos
+%endif
+
+%description
+Package for testing GBP.
+
--- /dev/null
+#
+# Spec file for testing deleting/adding/updating tags and macros
+#
+
+# Gbp-Undefined-Tag: foobar
+
+# Test that we accept different cases
+Name: my_name
+Version: 0
+Release: 1
+Summary: my_summary
+License: new license
+Distribution: my_distribution
+Group: my_group
+Packager: my_packager
+Url: my_url
+Vcs: my_vcs
+Nosource: 0
+Nopatch: 0
+BuildRoot: my_buildroot
+Provides: my_provides
+Requires: my_requires
+Conflicts: my_conflicts
+Obsoletes: my_obsoletes
+BuildConflicts: my_buildconflicts
+BuildRequires: my_buildrequires
+AutoReqProv: No
+AutoReq: No
+AutoProv: No
+DistTag: my_disttag
+BugUrl: my_bugurl
+
+%description
+Package for testing GBP.
+
+%prep
+%setup -n my_prefix
+
+%patch0 my new args
+
+%build
+
+%install
--- /dev/null
+#
+# Spec file for testing deleting/adding/updating tags and macros
+#
+
+# Gbp-Undefined-Tag: foobar
+
+# Test that we accept different cases
+Name: my_name
+Version: 0
+Release: 1
+Summary: my_summary
+License: my_license
+Distribution: my_distribution
+Vendor: my_vendor
+Group: my_group
+Packager: my_packager
+Url: my_url
+Vcs: my_vcs
+Source: my_source
+Patch1: my_%patch_fn_base
+Patch0: my_%{patch_fn_base}0
+Nosource: 0
+Nopatch: 0
+BuildRoot: my_buildroot
+Provides: my_provides
+Requires: my_requires
+Conflicts: my_conflicts
+Obsoletes: my_obsoletes
+BuildConflicts: my_buildconflicts
+BuildRequires: my_buildrequires
+AutoReqProv: No
+AutoReq: No
+AutoProv: No
+DistTag: my_disttag
+BugUrl: my_bugurl
+
+%description
+Package for testing GBP.
+
+%prep
+%setup -n my_prefix
+
+%patch -b my_patch
+%patch -P0 -b my_patch0
+
+%build
+
+%install
--- /dev/null
+../rpmbuild/SPECS/gbp-test.spec
\ No newline at end of file
--- /dev/null
+Name: gbp-test2
+Summary: Test package 2 for git-buildpackage
+Epoch: 2
+Version: 3.0
+Release: 0
+Group: Development/Libraries
+License: GPLv2
+Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz
+Source0: foo.txt
+Source20: bar.tar.gz
+# Gbp-Ignore-Patches: 0
+Patch0: my.patch
+# Patches auto-generated by git-buildpackage:
+Patch1: new.patch
+Packager: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+
+%description
+Package for testing the RPM functionality of git-buildpackage.
+
+%package empty
+Summary: Empty subpackage
+
+%description empty
+Empty subpackage for the %{name} test package.
+
+
+%prep
+%setup -T -n %{name}-%{version} -c -a 10
+
+
+echo "Do things"
+
+# Gbp-Patch-Macros
+# new.patch
+%if 1
+%patch1 -p1
+%endif
+
+%build
+make
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+cp -R * %{buildroot}/%{_datadir}/%{name}
+install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
+
+
+%changelog
+* Wed Feb 05 2014 Name <email> 2
+- New entry
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}
+
+%files empty
+%defattr(-,root,root,-)
--- /dev/null
+Name: gbp-test2
+Summary: Test package 2 for git-buildpackage
+Epoch: 2
+Version: 3.0
+Release: 0
+Group: Development/Libraries
+License: GPLv2
+Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz
+Source0: foo.txt
+Source20: bar.tar.gz
+# Gbp-Ignore-Patches: 0
+Patch0: my.patch
+# Patches auto-generated by git-buildpackage:
+Patch1: 1.patch
+Patch2: 2.patch
+Packager: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+VCS: myvcstag
+
+%description
+Package for testing the RPM functionality of git-buildpackage.
+
+%package empty
+Summary: Empty subpackage
+
+%description empty
+Empty subpackage for the %{name} test package.
+
+
+%prep
+%setup -T -n %{name}-%{version} -c -a 10
+
+
+echo "Do things"
+
+# Gbp-Patch-Macros
+# 1.patch
+%if true
+%patch1 -p1
+%endif
+# 2.patch
+%ifarch %ix86
+%patch2 -p1
+%endif
+
+%build
+make
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+cp -R * %{buildroot}/%{_datadir}/%{name}
+install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
+
+
+%changelog
+* Tue Feb 04 2014 Name <email> 1
+- My change
+
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}
+
+%files empty
+%defattr(-,root,root,-)
--- /dev/null
+../rpmbuild/SPECS/gbp-test2.spec
\ No newline at end of file
--- /dev/null
+Name: gbp-test3
+Summary: Test package 3 for git-buildpackage
+Version: 1.0
+Release: 0
+Group: Development/Libraries
+License: GPLv2
+Source: %{name}-%{version}.tar.gz
+# Gbp-Ignore-Patches: 10
+Patch0: my.patch
+Patch10: my2.patch
+Patch20: my3.patch
+
+%description
+Another test package for git-buildpackage.
+
+
+%prep
+%autosetup -n %{name}-%{version}
+
+
+%build
+make
+
+
+%install
+mkdir -p %{buildroot}/%{_datadir}/%{name}
+
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""
+Test L{gbp.deb.changelog.ChangeLog}
+"""
+from .. import context # noqa: 401
+from .. testutils import have_cmd
+
+import nose
+
+cl_debian = """git-buildpackage (0.5.32) unstable; urgency=low
+
+ * [efe9220] Use known_compressions in guess_upstream_version too
+ (Closes: #645477)
+ * [e984baf] git-import-orig: fix --filter
+
+ -- Guido Günther <agx@sigxcpu.org> Mon, 17 Oct 2011 10:15:22 +0200
+
+git-buildpackage (0.5.31) unstable; urgency=low
+
+ [ Guido Günther ]
+ * [3588d88] Fix pristine-tar error message
+ * [8da98da] gbp-pq: don't fail on missing series file but create an empty
+ branch instead
+
+ [ Salvatore Bonaccorso ]
+ * [b33cf74] Fix URL to cl2vcs service.
+ Refer to https://honk.sigxcpu.org/cl2vcs instead of
+ https://honk.sigxcpu.org/cl2vcs for the cl2vcs service. (Closes: #640141)
+
+ -- Guido Günther <agx@sigxcpu.org> Wed, 28 Sep 2011 20:21:34 +0200
+"""
+
+cl_upstream = """python-dateutil (1.0-1) unstable; urgency=low
+
+ * Initial release (Closes: #386256)
+
+ -- Guido Günther <agx@sigxcpu.org> Wed, 6 Sep 2006 10:33:06 +0200
+"""
+
+cl_epoch = """xserver-xorg-video-nv (1:1.2.0-3) unstable; urgency=low
+
+ [ Steve Langasek ]
+ * Upload to unstable
+
+ -- David Nusinow <dnusinow@debian.org> Mon, 18 Sep 2006 19:57:45 -0400
+"""
+
+
+def setup():
+ """Setup test module"""
+ if not have_cmd('debchange'):
+ raise nose.SkipTest('debchange tool not present')
+
+
+def test_parse_debian_only():
+ """
+ Parse a the changelog of debian only package
+
+ Methods tested:
+ - L{gbp.deb.changelog.ChangeLog.__init__}
+
+ Properties tested:
+ - L{gbp.deb.changelog.ChangeLog.version}
+ - L{gbp.deb.changelog.ChangeLog.debian_version}
+ - L{gbp.deb.changelog.ChangeLog.upstream_version}
+ - L{gbp.deb.changelog.ChangeLog.epoch}
+ - L{gbp.deb.changelog.ChangeLog.noepoch}
+
+ >>> import gbp.deb.changelog
+ >>> cl = gbp.deb.changelog.ChangeLog(cl_debian)
+ >>> cl.version
+ '0.5.32'
+ >>> cl.version == cl['Version']
+ True
+ >>> cl.debian_version
+ '0.5.32'
+ >>> cl.debian_version == cl['Debian-Version']
+ True
+ >>> cl.noepoch
+ '0.5.32'
+ >>> cl.noepoch == cl['NoEpoch-Version']
+ True
+ >>> cl.epoch
+ >>> cl.upstream_version
+ """
+
+
+def test_parse_no_eopch():
+ """
+ Parse a the changelog of a package without eopch
+
+ Methods tested:
+ - L{gbp.deb.changelog.ChangeLog.__init__}
+ - L{gbp.deb.changelog.ChangeLog.has_epoch}
+
+ Properties tested:
+ - L{gbp.deb.changelog.ChangeLog.version}
+ - L{gbp.deb.changelog.ChangeLog.debian_version}
+ - L{gbp.deb.changelog.ChangeLog.upstream_version}
+ - L{gbp.deb.changelog.ChangeLog.epoch}
+ - L{gbp.deb.changelog.ChangeLog.noepoch}
+
+ >>> import gbp.deb.changelog
+ >>> cl = gbp.deb.changelog.ChangeLog(cl_upstream)
+ >>> cl.version
+ '1.0-1'
+ >>> cl.version == cl['Version']
+ True
+ >>> cl.debian_version
+ '1'
+ >>> cl.debian_version == cl['Debian-Version']
+ True
+ >>> cl.noepoch
+ '1.0-1'
+ >>> cl.noepoch == cl['NoEpoch-Version']
+ True
+ >>> cl.epoch
+ >>> cl.upstream_version
+ '1.0'
+ >>> cl.has_epoch()
+ False
+ >>> cl.distribution
+ 'unstable'
+ """
+
+
+def test_parse_eopch():
+ """
+ Parse a the changelog of a package without epoch
+
+ Methods tested:
+ - L{gbp.deb.changelog.ChangeLog.__init__}
+ - L{gbp.deb.changelog.ChangeLog.has_epoch}
+
+ Properties tested:
+ - L{gbp.deb.changelog.ChangeLog.version}
+ - L{gbp.deb.changelog.ChangeLog.debian_version}
+ - L{gbp.deb.changelog.ChangeLog.upstream_version}
+ - L{gbp.deb.changelog.ChangeLog.epoch}
+ - L{gbp.deb.changelog.ChangeLog.noepoch}
+
+ >>> import gbp.deb.changelog
+ >>> cl = gbp.deb.changelog.ChangeLog(cl_epoch)
+ >>> cl.version
+ '1:1.2.0-3'
+ >>> cl.version == cl['Version']
+ True
+ >>> cl.debian_version
+ '3'
+ >>> cl.debian_version == cl['Debian-Version']
+ True
+ >>> cl.noepoch
+ '1.2.0-3'
+ >>> cl.noepoch == cl['NoEpoch-Version']
+ True
+ >>> cl.epoch
+ '1'
+ >>> cl.upstream_version
+ '1.2.0'
+ >>> cl.has_epoch()
+ True
+ """
+
+
+def test_parse_name():
+ """
+ Methods tested:
+ - L{gbp.deb.changelog.ChangeLog.__init__}
+
+ Properties tested:
+ - L{gbp.deb.changelog.ChangeLog.name}
+
+ >>> import gbp.deb.changelog
+ >>> cl = gbp.deb.changelog.ChangeLog(cl_debian)
+ >>> cl.name
+ 'git-buildpackage'
+ """
+
+
+def test_parse_last_mod():
+ """
+ Test author, email and date of last modification
+
+ Methods tested:
+ - L{gbp.deb.changelog.ChangeLog.__init__}
+
+ Properties tested:
+ - L{gbp.deb.changelog.ChangeLog.name}
+ - L{gbp.deb.changelog.ChangeLog.email}
+ - L{gbp.deb.changelog.ChangeLog.date}
+
+ >>> import gbp.deb.changelog
+ >>> cl = gbp.deb.changelog.ChangeLog(cl_debian)
+ >>> cl.author.startswith('Guido')
+ True
+ >>> cl.email
+ 'agx@sigxcpu.org'
+ >>> cl.date
+ 'Mon, 17 Oct 2011 10:15:22 +0200'
+ """
+
+
+def test_parse_sections():
+ """
+ Test if we can parse sections out of the changelog
+
+ Methods tested:
+ - L{gbp.deb.changelog.ChangeLog.__init__}
+ - L{gbp.deb.changelog.ChangeLogSection.__init__}
+ - L{gbp.deb.changelog.ChangeLogSection.parse}
+
+ Properties tested:
+ - L{gbp.deb.changelog.ChangeLog.sections}
+
+ >>> import gbp.deb.changelog
+ >>> cl = gbp.deb.changelog.ChangeLog(cl_debian)
+ >>> cl.sections[0].package
+ 'git-buildpackage'
+ >>> cl.sections[0].version
+ '0.5.32'
+ >>> cl.sections[1].package
+ 'git-buildpackage'
+ >>> cl.sections[1].version
+ '0.5.31'
+ """
+
+
+def test_get_changes():
+ """
+ Test if we can get changes
+
+ Methods tested:
+ - L{gbp.deb.changelog.ChangeLog.__init__}
+ - L{gbp.deb.changelog.ChangeLog.get_changes}
+
+ >>> import gbp.deb.changelog
+ >>> cl = gbp.deb.changelog.ChangeLog(cl_debian)
+ >>> len(cl.get_changes().split('\\n'))
+ 19
+ >>> len(cl.get_changes('0.5.31').split('\\n'))
+ 7
+ >>> cl['Changes'].split('\\n')[0]
+ ' git-buildpackage (0.5.32) unstable; urgency=low'
+ >>> len(cl['Changes'])
+ 187
+ """
+
+
+def test_add_section():
+ """
+ Test if we can add a section to an existing changelog
+
+ Methods tested:
+ - L{gbp.deb.changelog.ChangeLog.__init__}
+ - L{gbp.deb.changelog.ChangeLog._parse}
+ - L{gbp.deb.changelog.ChangeLog.add_section}
+ - L{gbp.deb.changelog.ChangeLog.spawn_dch}
+
+ >>> import os
+ >>> import tempfile
+ >>> import shutil
+ >>> import gbp.deb.changelog
+ >>> from ..testutils import OsReleaseFile
+ >>> os_release = OsReleaseFile()
+ >>> olddir = os.path.abspath(os.path.curdir)
+ >>> testdir = tempfile.mkdtemp(prefix='gbp-test-changelog-')
+ >>> testdebdir = os.path.join(testdir, 'debian')
+ >>> testclname = os.path.join(testdebdir, "changelog")
+ >>> os.mkdir(testdebdir)
+ >>> clh = open(os.path.join(testdebdir, "changelog"), "w", encoding='utf-8')
+ >>> ret = clh.write(cl_debian)
+ >>> clh.close()
+ >>> os.chdir(testdir)
+ >>> os.path.abspath(os.path.curdir) == testdir
+ True
+ >>> cl = gbp.deb.changelog.ChangeLog(filename=testclname)
+ >>> cl.add_section(msg=["Test add section"], distribution=None, author="Debian Maintainer", email="maint@debian.org")
+ >>> cl = gbp.deb.changelog.ChangeLog(filename=testclname)
+ >>> version = '0.5.32ubuntu1' if os_release['ID'] == 'ubuntu' else '0.5.33'
+ >>> cl.version == version
+ True
+ >>> cl.debian_version == version
+ True
+ >>> distributions = ['UNRELEASED', os_release['VERSION_CODENAME'] or 'unstable']
+ >>> cl['Distribution'] in distributions
+ True
+ >>> 'Test add section' in cl['Changes']
+ True
+ >>> os.chdir(olddir)
+ >>> os.path.abspath(os.path.curdir) == olddir
+ True
+ >>> shutil.rmtree(testdir, ignore_errors=True)
+ """
+
+
+def test_add_entry():
+ """
+ Test if we can add an entry to an existing changelog
+
+ Methods tested:
+ - L{gbp.deb.changelog.ChangeLog.__init__}
+ - L{gbp.deb.changelog.ChangeLog._parse}
+ - L{gbp.deb.changelog.ChangeLog.add_entry}
+ - L{gbp.deb.changelog.ChangeLog.spawn_dch}
+
+ >>> import os
+ >>> import tempfile
+ >>> import shutil
+ >>> import gbp.deb.changelog
+ >>> from ..testutils import OsReleaseFile
+ >>> os_release = OsReleaseFile()
+ >>> olddir = os.path.abspath(os.path.curdir)
+ >>> testdir = tempfile.mkdtemp(prefix='gbp-test-changelog-')
+ >>> testdebdir = os.path.join(testdir, 'debian')
+ >>> testclname = os.path.join(testdebdir, "changelog")
+ >>> os.mkdir(testdebdir)
+ >>> clh = open(os.path.join(testdebdir, "changelog"), "w", encoding='utf-8')
+ >>> ret = clh.write(cl_debian)
+ >>> clh.close()
+ >>> os.chdir(testdir)
+ >>> os.path.abspath(os.path.curdir) == testdir
+ True
+ >>> cl = gbp.deb.changelog.ChangeLog(filename=testclname)
+ >>> cl.add_section(msg=["Test add section"], distribution=None, author="Debian Maintainer", email="maint@debian.org")
+ >>> cl.add_entry(msg=["Test add entry"], author="Debian Maintainer", email="maint@debian.org")
+ >>> cl = gbp.deb.changelog.ChangeLog(filename=testclname)
+ >>> version = '0.5.32ubuntu1' if os_release['ID'] == 'ubuntu' else '0.5.33'
+ >>> cl.version == version
+ True
+ >>> cl.debian_version == version
+ True
+ >>> distributions = ['UNRELEASED', os_release['VERSION_CODENAME'] or 'unstable']
+ >>> cl['Distribution'] in distributions
+ True
+ >>> 'Test add entry' in cl['Changes']
+ True
+ >>> cl['Changes'].split('*',1)[1]
+ ' Test add section\\n * Test add entry'
+ >>> os.chdir(olddir)
+ >>> os.path.abspath(os.path.curdir) == olddir
+ True
+ >>> shutil.rmtree(testdir, ignore_errors=True)
+ """
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""
+Test L{gbp.config.GbpOptionParser}
+Test L{gbp.config.GbpOptionParserDebian}
+"""
+
+from .. import context # noqa: F401
+
+
+def test_option_parser():
+ """
+ Methods tested:
+ - L{gbp.config.GbpOptionParser.add_config_file_option}
+ - L{gbp.config.GbpOptionParser.add_boolean_config_file_option}
+
+ >>> import gbp.config
+ >>> c = gbp.config.GbpOptionParser('common', prefix='test')
+ >>> c.add_config_file_option(option_name='upstream-branch', dest='upstream')
+ >>> c.add_boolean_config_file_option(option_name='overlay', dest='overlay')
+ >>> c.add_boolean_config_file_option(option_name='track', dest='track')
+ """
+
+
+def test_option_parser_debian():
+ """
+ Methods tested:
+ - L{gbp.config.GbpOptionParserDebian.add_config_file_option}
+
+ >>> import gbp.config
+ >>> c = gbp.config.GbpOptionParserDebian('debian')
+ >>> c.add_config_file_option(option_name='builder', dest='builder')
+ Traceback (most recent call last):
+ ...
+ KeyError: 'builder'
+ >>> c.add_config_file_option(option_name='builder', dest='builder', help='foo')
+ """
+
+
+def test_option_group():
+ """
+ Methods tested:
+ - L{gbp.config.GbpOptionGroup.add_config_file_option}
+ - L{gbp.config.GbpOptionGroup.add_boolean_config_file_option}
+
+ >>> import gbp.config
+ >>> c = gbp.config.GbpOptionParser('debian')
+ >>> g = gbp.config.GbpOptionGroup(c, 'wheezy')
+ >>> g.add_config_file_option(option_name='debian-branch', dest='branch')
+ >>> g.add_boolean_config_file_option(option_name='track', dest='track')
+ """
+
+
+def test_tristate():
+ """
+ Methods tested:
+ - L{gbp.config.GbpOptionParser.add_config_file_option}
+
+ >>> import gbp.config
+ >>> c = gbp.config.GbpOptionParser('tristate')
+ >>> c.add_config_file_option(option_name="color", dest="color", type='tristate')
+ >>> options, args= c.parse_args(['--color=auto'])
+ >>> options.color
+ auto
+ >>> options.color.is_off()
+ False
+ >>> c = gbp.config.GbpOptionParser('tristate')
+ >>> c.add_config_file_option(option_name="color", dest="color", type='tristate')
+ >>> options, args= c.parse_args(['--color=off'])
+ >>> options.color
+ off
+ >>> options.color.is_off()
+ True
+ """
+
+
+def test_filter():
+ """
+ The filter option should always parse as a list
+ >>> import os
+ >>> from gbp.config import GbpOptionParser
+ >>> tmpdir = str(context.new_tmpdir('bar'))
+ >>> confname = os.path.join(tmpdir, 'gbp.conf')
+ >>> GbpOptionParser._set_config_file_value('bar', 'filter', 'asdf', filename=confname)
+ >>> os.environ['GBP_CONF_FILES'] = confname
+ >>> parser = GbpOptionParser('bar')
+ >>> parser.config['filter']
+ ['asdf']
+ >>> f = open(confname, 'w')
+ >>> ret = f.write("[bar]\\nfilter = ['this', 'is', 'a', 'list']\\n")
+ >>> f.close()
+ >>> parser = GbpOptionParser('bar')
+ >>> parser.config['filter']
+ ['this', 'is', 'a', 'list']
+ >>> del os.environ['GBP_CONF_FILES']
+ """
+
+
+def test_filters():
+ """
+ The filter can be given in plural form
+ >>> import os
+ >>> from gbp.config import GbpOptionParser
+ >>> tmpdir = str(context.new_tmpdir('bar'))
+ >>> confname = os.path.join(tmpdir, 'gbp.conf')
+ >>> GbpOptionParser._set_config_file_value('bar', 'filters', '["abc", "def"]\\n', filename=confname)
+ >>> os.environ['GBP_CONF_FILES'] = confname
+ >>> parser = GbpOptionParser('bar')
+ >>> parser.config['filter']
+ ['abc', 'def']
+ >>> del os.environ['GBP_CONF_FILES']
+ """
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""
+Test L{gbp.deb.control.Control}
+"""
+
+from .. import context # noqa: 401
+
+cl_debian = """Source: git-buildpackage
+Section: vcs
+Priority: optional
+Maintainer: Guido Günther <agx@sigxcpu.org>
+Build-Depends: debhelper (>= 7.0.50~), python (>> 2.6.6-3~),
+ pychecker, gtk-doc-tools, sgml2x, docbook-utils, jade, python-dateutil, python-nose,
+ bash-completion, perl, python-epydoc, python-coverage, python-setuptools,
+ # For the testsuite
+ git (>= 1:1.7.9.1-1~), bzip2, unzip, pristine-tar
+Standards-Version: 3.9.3
+Vcs-Git: git://honk.sigxcpu.org/git/git-buildpackage.git
+Vcs-Browser: http://git.debian.org/?p=users/agx/git-buildpackage.git
+Homepage: https://honk.sigxcpu.org/piki/projects/git-buildpackage/
+X-Python-Version: >= 2.6
+
+Package: git-buildpackage
+Architecture: all
+Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, devscripts (>= 2.10.66~),
+ git (>= 1:1.7.9.1-1~), python-dateutil
+Recommends: pristine-tar (>= 0.5), cowbuilder
+Suggests: python-notify, unzip
+Description: Suite to help with Debian packages in Git repositories
+ This package contains the following tools:
+ * git-import-{dsc,dscs}: import existing Debian source packages into a git
+ repository
+ * git-import-orig: import a new upstream version into the git repository
+ * git-buildpackage: build a package out of a git repository, check for local
+ modifications and tag appropriately
+ * git-dch: generate Debian changelog entries from Git commit messages
+ * gbp-{pull,clone}: clone and pull from remote repos
+ * gbp-pq: manage debian/patches easily
+ * gbp-create-remote-repo: create remote repositories
+"""
+
+
+def test_parse_control():
+ """
+ Parse a the control of debian package
+
+ Methods tested:
+ - L{gbp.deb.control.Control.__init__}
+
+ Properties tested:
+ - L{gbp.deb.control.Control.name}
+ - L{gbp.deb.control.Control.section}
+ - L{gbp.deb.control.Control.priority}
+
+ >>> import gbp.deb.control
+ >>> cl = gbp.deb.control.Control(cl_debian)
+ >>> cl.name
+ 'git-buildpackage'
+ >>> cl.name == cl['Source']
+ True
+ >>> cl.section
+ 'vcs'
+ >>> cl.section == cl['Section']
+ True
+ >>> cl.priority
+ 'optional'
+ >>> cl.priority == cl['Priority']
+ True
+ >>> cl['Standards-Version']
+ '3.9.3'
+ >>> cl['Package']
+
+ """
+
+
+def test_no_control_error():
+ """
+ Raise an error if no control file exist or is empty
+
+ Methods tested:
+ - L{gbp.deb.control.Control.__init__}
+
+ >>> import gbp.deb.control
+ >>> cl = gbp.deb.control.Control(filename="doesnotexist")
+ Traceback (most recent call last):
+ ...
+ gbp.deb.control.NoControlError: Control file doesnotexist does not exist
+ >>> cl = gbp.deb.control.Control("notparsable")
+ Traceback (most recent call last):
+ ...
+ gbp.deb.control.ParseControlError: Empty or invalid control file or contents
+ """
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""
+Test L{gbp.git.GitModifier}
+"""
+
+from .. import context # noqa: F401
+
+
+def test_author():
+ """
+ Methods tested:
+ - L{gbp.git.GitModifier.get_author_env}
+ - L{gbp.git.GitModifier.get_committer_env}
+ - L{gbp.git.GitModifier.keys}
+
+ >>> import gbp.git
+ >>> modifier = gbp.git.GitModifier('foo', 'bar')
+ >>> modifier.name
+ 'foo'
+ >>> modifier.email
+ 'bar'
+ >>> modifier.get_author_env()['GIT_AUTHOR_EMAIL']
+ 'bar'
+ >>> modifier.get_author_env()['GIT_AUTHOR_NAME']
+ 'foo'
+ >>> modifier.get_committer_env()['GIT_COMMITTER_NAME']
+ 'foo'
+ >>> modifier.get_committer_env()['GIT_COMMITTER_EMAIL']
+ 'bar'
+ >>> modifier._get_env('foo')
+ Traceback (most recent call last):
+ ...
+ gbp.git.modifier.GitModifierError: Neither committer nor author
+ >>> modifier['name']
+ 'foo'
+ >>> modifier['email']
+ 'bar'
+ >>> modifier['date']
+ """
+
+
+def test_date():
+ """
+ Methods tested:
+ - L{gbp.git.GitModifier.__init__}
+
+ Properties tested:
+ - L{gbp.git.GitModifier.date}
+ - L{gbp.git.GitModifier.datetime}
+ - L{gbp.git.GitModifier.tz_offset}
+
+ >>> import gbp.git
+ >>> import datetime
+ >>> modifier = gbp.git.GitModifier('foo', 'bar', 1)
+ >>> modifier.date
+ '1 +0000'
+ >>> modifier.date = '1 +0400'
+ >>> modifier.date
+ '1 +0400'
+ >>> modifier['date']
+ '1 +0400'
+ >>> modifier.datetime # doctest: +ELLIPSIS
+ datetime.datetime(1970, 1, 1, 4, 0, 1, tzinfo=<gbp.git.modifier.GitTz...>)
+ >>> modifier.date = datetime.datetime(1970, 1, 1, 0, 0, 1)
+ >>> modifier.date
+ '1 +0000'
+ >>> modifier.datetime # doctest: +ELLIPSIS
+ datetime.datetime(1970, 1, 1, 0, 0, 1, tzinfo=<gbp.git.modifier.GitTz...>)
+ >>> modifier.tz_offset
+ '+0000'
+ """
+
+
+def test_dict():
+ """
+ Test C{dict} interface
+ >>> import gbp.git
+ >>> modifier = gbp.git.GitModifier('foo', 'bar', 1)
+ >>> sorted(modifier.keys())
+ ['date', 'email', 'name']
+ >>> sorted(modifier.items())
+ [('date', '1 +0000'), ('email', 'bar'), ('name', 'foo')]
+ >>> modifier.get('name')
+ 'foo'
+ >>> modifier.get('doesnotexist')
+ """
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""
+Test L{gbp.git.GitRepository}
+
+This testcase creates several repositores:
+
+ - A repository at I{dirs['repo']} called I{repo}
+ - A bare repository at I{dirs['bare']} called I{bare}
+ - A clone of I{repo} below I{dirs['clone']} called I{clone}
+ - A mirror of I{repo} below I{mirror_dirs['clone']} called I{mirror}
+"""
+
+from .. import context
+
+import gbp.log
+
+gbp.log.setup(color=False, verbose=True)
+
+dirs = {}
+subdirs = ['repo', 'bare', 'clone', 'mirror_clone']
+
+
+def setup_module():
+ tmpdir = context.new_tmpdir(__name__)
+ for s in subdirs:
+ dirs[s] = tmpdir.join(s)
+
+
+def teardown_module():
+ for s in subdirs:
+ del dirs[s]
+ context.teardown()
+
+
+def test_create():
+ """
+ Create a repository
+
+ Methods tested:
+ - L{gbp.git.GitRepository.create}
+
+ Properties tested:
+ - L{gbp.git.GitRepository.path}
+ - L{gbp.git.GitRepository.git_dir}
+
+ >>> import os, gbp.git
+ >>> repo = gbp.git.GitRepository.create(dirs['repo'])
+ >>> repo.path == dirs['repo']
+ True
+ >>> repo.git_dir == os.path.join(dirs['repo'], '.git')
+ True
+ >>> type(repo) == gbp.git.GitRepository
+ True
+ """
+
+
+def test_empty():
+ """
+ Empty repos have no branch
+
+ Methods tested:
+ - L{gbp.git.GitRepository.get_branch}
+ - L{gbp.git.GitRepository.is_empty}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.get_branch()
+ >>> repo.branch
+ >>> repo.is_empty()
+ True
+ """
+
+
+def test_subdir():
+ """
+ Make surewe can init repos from a subdir
+ >>> import gbp.git, os
+ >>> os.mkdir(os.path.join(dirs['repo'], 'subdir'))
+ >>> repo = gbp.git.GitRepository(os.path.join(dirs['repo'], 'subdir'), toplevel=False)
+ >>> repo.path == dirs['repo']
+ True
+ >>> repo = gbp.git.GitRepository(os.path.join(dirs['repo'], 'subdir'), toplevel=True) # doctest:+ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Not the toplevel of a Git repository at ...
+ """
+
+
+def test_add_files():
+ """
+ Add some dummy data
+
+ Methods tested:
+ - L{gbp.git.GitRepository.add_files}
+ - L{gbp.git.GitRepository.commit_all}
+ - L{gbp.git.GitRepository.is_clean}
+
+ Properties tested:
+ - L{gbp.git.GitRepository.head}
+
+ >>> import gbp.git, shutil, os
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> ret = shutil.copy(os.path.join(repo.path, ".git/HEAD"),
+ ... os.path.join(repo.path, "testfile"))
+ >>> repo.is_clean()[0]
+ False
+ >>> repo.is_clean('doesnotexist')[0]
+ True
+ >>> repo.is_clean(paths='testfile')[0]
+ False
+ >>> repo.is_clean(paths=['doesnotexist', 'testfile'])[0]
+ False
+ >>> repo.is_clean(ignore_untracked=True)[0]
+ True
+ >>> repo.add_files(repo.path, force=True)
+ >>> repo.commit_all(msg="foo")
+ >>> repo.is_clean()[0]
+ True
+ >>> h = repo.head
+ >>> len(h)
+ 40
+ """
+
+
+def test_rename_file():
+ """
+ Methods tested:
+ - L{gbp.git.GitRepository.rename_file}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.rename_file("testfile", "testfile2")
+ >>> repo.rename_file("testfile2", "testfile")
+ >>> repo.rename_file("doesnotexit", "testfile2")
+ Traceback (most recent call last):
+ ...
+ gbp.errors.GbpError: Failed to move 'doesnotexit' to 'testfile2': fatal: bad source, source=doesnotexit, destination=testfile2
+ """
+
+
+def test_branch_master():
+ """
+ First branch is called I{master}
+
+ Methods tested:
+ - L{gbp.git.GitRepository.get_branch}
+ >>> import gbp.git, shutil
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.get_branch()
+ 'master'
+ >>> repo.branch
+ 'master'
+ """
+
+
+def test_clean():
+ """
+ Remove untracked files from the working tree
+
+ Methods tested:
+ - L{gbp.git.GitRepository.clean}
+
+ >>> import gbp.git, shutil, os
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> ret = shutil.copy(os.path.join(repo.path, ".git/HEAD"),
+ ... os.path.join(repo.path, "testclean"))
+ >>> repo.clean(dry_run=True)
+ >>> repo.is_clean()[0]
+ False
+ >>> repo.clean(directories=True, force=True)
+ >>> repo.is_clean()[0]
+ True
+ """
+
+
+def test_create_branch():
+ """
+ Create a branch name I{foo}
+
+ Methods tested:
+ - L{gbp.git.GitRepository.create_branch}
+ - L{gbp.git.GitRepository.branch_contains}
+
+ >>> import gbp.git, shutil
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.create_branch("foo")
+ >>> repo.branch_contains("foo", 'HEAD')
+ True
+ >>> repo.branch_contains("doesnotexist", 'HEAD', remote=True)
+ False
+ """
+
+
+def test_delete_branch():
+ """
+ Create a branch named I{foo2} and delete it
+
+ Methods tested:
+ - L{gbp.git.GitRepository.create_branch}
+ - L{gbp.git.GitRepository.delete_branch}
+
+ >>> import gbp.git, shutil
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.create_branch("bar")
+ >>> repo.delete_branch("bar")
+ >>> repo.delete_branch("master")
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Can't delete the branch you're on
+ """
+
+
+def test_set_branch():
+ """
+ Switch to branch named I{foo}
+
+ Methods tested:
+ - L{gbp.git.GitRepository.set_branch}
+ - L{gbp.git.GitRepository.get_branch}
+ - L{gbp.git.GitRepository.branch}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.set_branch("foo")
+ >>> repo.get_branch() == "foo"
+ True
+ >>> repo.branch == "foo"
+ True
+ """
+
+
+def test_rename_branch():
+ """
+ Create branch named I{baz}, rename it to I{bax} and finally delete it
+
+ Methods tested:
+ - L{gbp.git.GitRepository.create_branch}
+ - L{gbp.git.GitRepository.rename_branch}
+ - L{gbp.git.GitRepository.delete_branch}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.create_branch("baz")
+ >>> repo.rename_branch("baz", "bax")
+ >>> repo.delete_branch("bax")
+ """
+
+
+def test_set_upstream_branch():
+ """
+ Set upstream branch master -> origin/master
+
+ >>> import os, shutil
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> os.makedirs(os.path.join(repo.git_dir, 'refs/remotes/origin'))
+ >>> ret = shutil.copy(os.path.join(repo.git_dir, 'refs/heads/master'), \
+ os.path.join(repo.git_dir, 'refs/remotes/origin/'))
+ >>> repo.add_remote_repo('origin', 'git://git.example.com/git/origin')
+ >>> repo.set_upstream_branch('master', 'origin/master')
+ >>> repo.get_upstream_branch('master')
+ 'origin/master'
+ >>> repo.set_upstream_branch('bla', 'origin/master')
+ Traceback (most recent call last):
+ gbp.git.repository.GitRepositoryError: Branch bla doesn't exist!
+ >>> repo.set_upstream_branch('foo', 'origin/bla')
+ Traceback (most recent call last):
+ gbp.git.repository.GitRepositoryError: Branch origin/bla doesn't exist!
+ """
+
+
+def test_get_upstream_branch():
+ """
+ Get info about upstream branches set in test_set_upstream_branch
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.get_upstream_branch('master')
+ 'origin/master'
+ >>> repo.get_upstream_branch('foo')
+ ''
+ >>> repo.get_upstream_branch('bla')
+ Traceback (most recent call last):
+ gbp.git.repository.GitRepositoryError: Branch bla doesn't exist!
+ """
+
+
+def test_tag():
+ """
+ Create a tag named I{tag} and check its existance
+
+ Methods tested:
+ - L{gbp.git.GitRepository.create_tag}
+ - L{gbp.git.GitRepository.verify_tag}
+ - L{gbp.git.GitRepository.has_tag}
+ - L{gbp.git.GitRepository.get_tags}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.create_tag("tag")
+ >>> repo.has_tag("tag")
+ True
+ >>> repo.has_tag("unknown")
+ False
+ >>> repo.create_tag("tag2", msg="foo")
+ >>> repo.has_tag("tag2")
+ True
+ >>> repo.verify_tag("tag2")
+ False
+ >>> repo.get_tags()
+ ['tag', 'tag2']
+ >>> repo.tags
+ ['tag', 'tag2']
+ """
+
+
+def test_describe():
+ """
+ Describe commit-ish
+
+ Methods tested:
+ - L{gbp.git.GitRepository.describe}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> sha = repo.rev_parse('HEAD')
+ >>> repo.describe('HEAD')
+ 'tag2'
+ >>> repo.describe('HEAD', longfmt=True) == 'tag2-0-g%s' % sha[:7]
+ True
+ >>> repo.describe('HEAD', pattern='foo*')
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Can't describe HEAD. Git error: fatal: No names found, cannot describe anything.
+ >>> repo.describe('HEAD', pattern='foo*', always=True) == sha[:7]
+ True
+ >>> repo.describe('HEAD', always=True, abbrev=16)
+ 'tag2'
+ >>> repo.describe('HEAD', pattern='foo*', always=True, abbrev=16) == sha[:16]
+ True
+ >>> tag = repo.describe('HEAD', longfmt=True, abbrev=16) == 'tag2-0-g%s' % sha[:16]
+ >>> repo.delete_tag('tag2')
+ >>> repo.describe('HEAD', tags=True)
+ 'tag'
+ >>> repo.describe('HEAD', tags=True, exact_match=True)
+ 'tag'
+ >>> repo.create_tag('tag2', msg='foo')
+ """
+
+
+def test_find_tag():
+ """
+ Find tags
+
+ Methods tested:
+ - L{gbp.git.GitRepository.find_tag}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.find_tag('HEAD')
+ 'tag2'
+ >>> repo.find_tag('HEAD', pattern='foo*')
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Can't describe HEAD. Git error: fatal: No names found, cannot describe anything.
+ """
+
+
+def test_find_branch_tag():
+ """
+ Find the closest tags on a certain branch to a given commit
+
+ Methods tested:
+ - L{gbp.git.GitRepository.find_branch_tag}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.find_branch_tag('HEAD', 'master', 'tag*')
+ 'tag2'
+ >>> repo.find_branch_tag('HEAD', 'master', 'v*') # doctest:+ELLIPSIS
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Can't describe .... Git error: fatal: No names found, cannot describe anything.
+ """
+
+
+def test_move_tag():
+ """
+ Move a tag
+
+ Methods tested:
+ - L{gbp.git.GitRepository.move_tag}
+ - L{gbp.git.GitRepository.has_tag}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.move_tag("tag", "moved")
+ >>> repo.has_tag("tag")
+ False
+ >>> repo.has_tag("moved")
+ True
+ """
+
+
+def test_delete_tag():
+ """
+ Delete tags
+
+ Methods tested:
+ - L{gbp.git.GitRepository.delete_tag}
+ - L{gbp.git.GitRepository.has_tag}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.has_tag("moved")
+ True
+ >>> repo.delete_tag("moved")
+ >>> repo.has_tag("moved")
+ False
+ """
+
+
+def test_get_obj_type():
+ """
+ Find commit SHA1 related to tags
+
+ Methods tested:
+ - L{gbp.git.GitRepository.create_tag}
+ - L{gbp.git.GitRepository.get_obj_type}
+ - L{gbp.git.GitRepository.delete_tag}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.create_tag("tag3", "tag msg")
+ >>> repo.get_obj_type("tag3")
+ 'tag'
+ >>> repo.get_obj_type("HEAD")
+ 'commit'
+ >>> repo.get_obj_type("HEAD:testfile")
+ 'blob'
+ >>> repo.delete_tag("tag3")
+ """
+
+
+def test_list_files():
+ """
+ List files in the index
+
+ Methods tested:
+ - L{gbp.git.GitRepository.list_files}
+ - L{gbp.git.GitRepository.add_files}
+ - L{gbp.git.GitRepository.commit_staged}
+ - L{gbp.git.GitRepository.commit_files}
+ - L{gbp.git.GitRepository.force_head}
+
+ >>> import gbp.git, os, shutil
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> src = os.path.join(repo.path, ".git/HEAD")
+ >>> dst = os.path.join(repo.path, "testfile")
+ >>> repo.list_files()
+ [b'testfile']
+ >>> repo.list_files(['modified'])
+ []
+ >>> repo.list_files(['modified', 'deleted'])
+ []
+ >>> repo.list_files(['modified', 'deleted', 'cached'])
+ [b'testfile']
+ >>> ret = shutil.copy(src, dst)
+ >>> repo.list_files(['modified'])
+ [b'testfile']
+ >>> repo.add_files(dst)
+ >>> repo.commit_staged(msg="foo")
+ >>> repo.list_files(['modified'])
+ []
+ >>> repo.list_files(['foo'])
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Unknown type 'foo'
+ >>> repo.force_head('HEAD^', hard=True)
+ >>> repo.list_files(['modified'])
+ []
+ >>> ret = shutil.copy(src, dst)
+ >>> repo.list_files(['modified'])
+ [b'testfile']
+ >>> repo.commit_files(dst, msg="foo")
+ >>> repo.list_files(['modified'])
+ []
+ """
+
+
+def test_get_commits():
+ """
+ Test listing commits
+
+ Methods tested:
+ - L{gbp.git.GitRepository.get_commits}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> commits = repo.get_commits()
+ >>> type(commits) == list and len(commits) == 2
+ True
+ >>> len(repo.get_commits(num=1)) == 1
+ True
+ >>> commits2 = repo.get_commits(since='HEAD~1')
+ >>> len(commits2) == 1
+ True
+ >>> commits2[0] == commits[0]
+ True
+ >>> commits2 = repo.get_commits(until='HEAD~1')
+ >>> len(commits2) == 1
+ True
+ >>> commits2[0] == commits[-1]
+ True
+ >>> repo.get_commits(paths=['foo', 'bar'])
+ []
+ >>> repo.get_commits(paths=['testfile']) == commits
+ True
+ """
+
+
+def test_get_commit_info():
+ """
+ Test inspecting commits
+
+ Methods tested:
+ - L{gbp.git.GitRepository.get_commit_info}
+
+ >>> import gbp.git
+ >>> from datetime import datetime
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> info = repo.get_commit_info('HEAD')
+ >>> info['id']
+ 'HEAD'
+ >>> info['body']
+ ''
+ >>> info['subject']
+ 'foo'
+ >>> '@' in info['author'].email
+ True
+ >>> '@' in info['committer'].email
+ True
+ >>> now = datetime.now()
+ >>> (now - datetime.fromtimestamp(int(info['author'].date.split()[0]))).seconds < 10
+ True
+ >>> (now - datetime.fromtimestamp(int(info['committer'].date.split()[0]))).seconds < 10
+ True
+ >>> info['patchname']
+ 'foo'
+ >>> info['files'] # doctest:+ELLIPSIS
+ defaultdict(<class 'list'>, {'M': [b'testfile']})
+ >>> repo.get_subject('HEAD')
+ 'foo'
+ """
+
+
+def test_diff():
+ """
+ Test git-diff
+
+ Methods tested:
+ - L{gbp.git.GitRepository.diff}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> len(repo.diff('HEAD~1', 'HEAD')) > 3
+ True
+ >>> len(repo.diff('HEAD~1', 'HEAD', 'testfile')) > 3
+ True
+ >>> len(repo.diff('HEAD~1', 'HEAD', 'testfile', text=True)) > 3
+ True
+ >>> len(repo.diff('HEAD~1', 'HEAD', 'filenotexist')) == 0
+ True
+ >>> repo.diff('HEAD~1', 'HEAD') == repo.diff('HEAD~1')
+ True
+ """
+
+
+def test_diff_status():
+ """
+ Methods tested:
+ - L{gbp.git.GitRepository.diff_status}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.diff_status("HEAD", "HEAD")
+ defaultdict(<class 'list'>, {})
+ >>> repo.diff_status("HEAD~1", "HEAD")
+ defaultdict(<class 'list'>, {'M': [b'testfile']})
+ """
+
+
+def test_mirror_clone():
+ """
+ Mirror a repository
+
+ Methods tested:
+ - L{gbp.git.GitRepository.clone}
+ - L{gbp.git.GitRepository.is_empty}
+ - L{gbp.git.GitRepository.set_branch}
+ - L{gbp.git.GitRepository.has_branch}
+ - L{gbp.git.GitRepository.branch}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.set_branch('master')
+ >>> repo.branch
+ 'master'
+ >>> mirror = gbp.git.GitRepository.clone(dirs['mirror_clone'], repo.path, mirror=True)
+ >>> mirror.is_empty()
+ False
+ >>> mirror.branch
+ 'master'
+ >>> mirror.has_branch('foo')
+ True
+ >>> mirror.has_branch('bar')
+ False
+ >>> mirror.set_branch('foo')
+ >>> mirror.branch
+ 'foo'
+ >>> mirror.force_head('foo^')
+ """
+
+
+def test_clone():
+ """
+ Clone a repository
+
+ Methods tested:
+ - L{gbp.git.GitRepository.clone}
+ - L{gbp.git.GitRepository.is_empty}
+ - L{gbp.git.GitRepository.set_branch}
+ - L{gbp.git.GitRepository.branch}
+ - L{gbp.git.GitRepository.get_merge_branch}
+ - L{gbp.git.GitRepository.get_remote_branches}
+ - L{gbp.git.GitRepository.get_local_branches}
+ - L{gbp.git.GitRepository.get_remote_repos}
+ - L{gbp.git.GitRepository.has_remote_repo}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.set_branch('master')
+ >>> clone = gbp.git.GitRepository.clone(dirs['clone'], repo.path)
+ >>> clone.is_empty()
+ False
+ >>> clone.branch
+ 'master'
+ >>> clone.get_remote_branches()
+ ['origin/HEAD', 'origin/foo', 'origin/master']
+ >>> clone.get_local_branches()
+ ['master']
+ >>> clone.get_merge_branch('master')
+ 'origin/master'
+ >>> clone.create_branch('foo', 'origin/foo')
+ >>> clone.get_merge_branch('foo')
+ 'origin/foo'
+ >>> clone.create_branch('bar')
+ >>> clone.get_merge_branch('bar') # None if no merge branch exists
+ >>> clone.get_local_branches()
+ ['bar', 'foo', 'master']
+ >>> clone.get_remote_repos()
+ ['origin']
+ >>> clone.has_remote_repo('origin')
+ True
+ >>> clone.has_branch('origin/master', remote=True)
+ True
+ >>> clone.has_remote_repo('godiug')
+ False
+ """
+
+
+def test_get_remotes():
+ """
+ Check remotes
+
+ Methods tested:
+ - L{gbp.git.GitRepository.get_remotes}
+
+ >>> import os
+ >>> import gbp.git.repository
+ >>> repo = gbp.git.repository.GitRepository(os.path.join(dirs['clone'], 'repo'))
+ >>> remotes = repo.get_remotes()
+ >>> len(remotes)
+ 1
+ >>> origin = remotes['origin']
+ >>> origin.name
+ 'origin'
+ >>> origin.fetch_url == dirs['repo']
+ True
+ >>> origin.push_urls == [dirs['repo']]
+ True
+ """
+
+
+def test_merge():
+ """
+ Merge a branch
+
+ Methods tested:
+ - L{gbp.git.GitRepository.merge}
+ - L{gbp.git.GitRepository.set_branch}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.set_branch('master')
+ >>> repo.merge('foo')
+ >>> repo.is_in_merge()
+ False
+ """
+
+
+def test_pull():
+ """
+ Pull from a remote repository
+
+ Methods tested:
+ - L{gbp.git.GitRepository.set_branch}
+ - L{gbp.git.GitRepository.pull}
+
+ >>> import gbp.git, os
+ >>> d = os.path.join(dirs['clone'], 'repo')
+ >>> clone = gbp.git.GitRepository(d)
+ >>> clone.set_branch('master')
+ >>> clone.pull()
+ >>> clone.pull(all_remotes=True)
+ >>> clone.pull('origin', all_remotes=True)
+ """
+
+
+def test_fetch():
+ """
+ Fetch from a remote repository
+
+ Methods tested:
+ - L{gbp.git.GitRepository.fetch}
+ - L{gbp.git.GitRepository.push}
+ - L{gbp.git.GitRepository.push_tag}
+ - L{gbp.git.GitRepository.add_remote_repo}
+ - L{gbp.git.GitRepository.remove_remote_repo}
+
+ >>> import gbp.git, os
+ >>> d = os.path.join(dirs['clone'], 'repo')
+ >>> clone = gbp.git.GitRepository(d)
+ >>> clone.fetch()
+ >>> clone.push()
+ >>> clone.push('origin', dry_run=True)
+ >>> clone.push('origin')
+ >>> clone.push('origin', 'master')
+ >>> clone.push('origin', 'master', force=True)
+ >>> clone.create_tag('tag3')
+ >>> clone.push_tag('origin', 'tag3', True)
+ >>> clone.push_tag('origin', 'tag3')
+ >>> clone.create_tag('tag4')
+ >>> clone.push('origin', 'master', tags=True)
+ >>> clone.add_remote_repo('foo', dirs['repo'])
+ >>> clone.fetch('foo')
+ >>> clone.fetch('foo', tags=True)
+ >>> clone.fetch('foo', refspec='refs/heads/master')
+ >>> clone.fetch(all_remotes=True)
+ >>> clone.remove_remote_repo('foo')
+ """
+
+
+def test_create_bare():
+ """
+ Create a bare repository
+
+ Methods tested:
+ - L{gbp.git.GitRepository.create}
+ - L{gbp.git.GitRepository.is_empty}
+
+ >>> import gbp.git
+ >>> bare = gbp.git.GitRepository.create(dirs['bare'], bare=True, description="msg")
+ >>> bare.path == dirs['bare']
+ True
+ >>> bare.git_dir == dirs['bare']
+ True
+ >>> type(bare) == gbp.git.GitRepository
+ True
+ >>> bare.is_empty()
+ True
+ >>> bare.is_clean()
+ (True, '')
+ """
+
+
+def test_nonexistent():
+ """
+ Check that accessing a non-existent repository fails.
+
+ Methods tested:
+ - L{gbp.git.GitRepository.__init__}
+
+ >>> import gbp.git
+ >>> bare = gbp.git.GitRepository("/does/not/exist")
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: No Git repository at '/does/not/exist'
+ """
+
+
+def test_create_noperm():
+ """
+ Check that creating a repository at a path that isn't writeable fails
+
+ Methods tested:
+ - L{gbp.git.GitRepository.create}
+
+ >>> import gbp.git
+ >>> gbp.git.GitRepository.create("/does/not/exist")
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Cannot create Git repository at '/does/not/exist': [Errno 13] Permission denied: '/does'
+ """
+
+
+def test_checkout():
+ """
+ Checkout treeishs
+
+ Methods tested:
+ - L{gbp.git.GitRepository.checkout}
+ - L{gbp.git.GitRepository.get_branch}
+ - L{gbp.git.GitRepository.set_branch}
+ - L{gbp.git.GitRepository.rev_parse}
+
+ Properties tested:
+ - L{gbp.git.GitRepository.branch}
+ - L{gbp.git.GitRepository.tags}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.checkout('master')
+ >>> repo.branch
+ 'master'
+ >>> repo.rev_parse('doesnotexist')
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: revision 'doesnotexist' not found
+ >>> sha1 = repo.rev_parse('master', short=10)
+ >>> len(sha1)
+ 10
+ >>> sha1 = repo.rev_parse('master')
+ >>> len(sha1)
+ 40
+ >>> repo.checkout(sha1)
+ >>> repo.branch
+ >>> repo.get_branch()
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Currently not on a branch
+ >>> tag = repo.tags[0]
+ >>> repo.checkout(tag)
+ >>> repo.branch
+ """
+
+
+def test_gc():
+ """
+ Test garbage collection
+
+ Methods tested:
+ - L{gbp.git.GitRepository.collect_garbage}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.collect_garbage()
+ >>> repo.collect_garbage(prune=True)
+ >>> repo.collect_garbage(prune='all', aggressive=True)
+ """
+
+
+def test_grep_log():
+ """
+ Test grepping through commit messages
+
+ Methods tested:
+ - L{gbp.git.GitRepository.grep_log}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.set_branch('master')
+ >>> len(repo.grep_log('foo')) == 2
+ True
+ >>> len(repo.grep_log('foo', 'master')) == 2
+ True
+ >>> repo.grep_log('blafasel')
+ []
+ >>> repo.grep_log('foo', 'doesnotexist')
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Error grepping log for foo: fatal: bad revision 'doesnotexist'
+ """
+
+
+def test_is_ff():
+ """
+ Test if branch is fast forwardable
+
+ Methods tested:
+ - L{gbp.git.GitRepository.is_fast_forward}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.is_fast_forward('master', 'foo')
+ (True, True)
+ >>> repo.create_branch('ff', 'HEAD^')
+ >>> repo.is_fast_forward('ff', 'master')
+ (True, False)
+ >>> repo.is_fast_forward('master', 'ff')
+ (False, True)
+ """
+
+
+def test_update_ref():
+ """
+ Test updating a reference
+
+ Methods tested:
+ - L{gbp.git.GitRepository.update_ref}
+
+ >>> import gbp.git, os
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.update_ref('new_ref', 'master', msg='update')
+ >>> os.path.exists(os.path.join(repo.git_dir, 'new_ref'))
+ True
+ """
+
+
+def test_make_tree():
+ """
+ Test git-mk-tree
+
+ Methods tested:
+ - L{gbp.git.GitRepository.write_file}
+ - L{gbp.git.GitRepository.list_tree}
+ - L{gbp.git.GitRepository.make_tree}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> sha1 = repo.write_file('testfile')
+ >>> sha1
+ '19af7398c894bc5e86e17259317e4db519e9241f'
+ >>> head = list(repo.list_tree('HEAD'))
+ >>> head
+ [('100644', 'blob', '19af7398c894bc5e86e17259317e4db519e9241f', b'testfile')]
+ >>> head.append(['100644', 'blob', '19af7398c894bc5e86e17259317e4db519e9241f', 'testfile2'])
+ >>> newtree = repo.make_tree(head)
+ >>> newtree
+ '745951810c9e22fcc6de9b23f05efd6ab5512123'
+ >>> list(repo.list_tree(newtree, recurse=False, paths='testfile'))
+ [('100644', 'blob', '19af7398c894bc5e86e17259317e4db519e9241f', b'testfile')]
+ >>> list(repo.list_tree(newtree, recurse=False, paths='testfile', sizes=True))
+ [('100644', 'blob', '19af7398c894bc5e86e17259317e4db519e9241f', 20, b'testfile')]
+ >>> repo.make_tree([])
+ '4b825dc642cb6eb9a060e54bf8d69288fbee4904'
+ """
+
+
+def test_update_submodules():
+ """
+ Updating submodules if we don't have any is a noop
+
+ Methods tested:
+ - L{gbp.git.GitRepository.has_submodules}
+ - L{gbp.git.GitRepository.update_submodules}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.has_submodules()
+ False
+ >>> repo.update_submodules()
+ """
+
+
+def test_get_merge_base():
+ """
+ Find the common ancestor of two objects
+
+ Methods tested:
+ - L{gbp.git.GitRepository.get_merge_base}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> sha1 = repo.get_merge_base('master', 'foo')
+ >>> len(sha1)
+ 40
+ >>> repo.get_merge_base('master', 'doesnotexist')
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Failed to get common ancestor: fatal: Not a valid object name doesnotexist
+ """
+
+
+def test_status():
+ r"""
+ Methods tested:
+ - L{gbp.git.GitRepository.status}
+
+ >>> import gbp.git, os, shutil
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> fname = os.path.join(repo.path, "test_status")
+ >>> ret = shutil.copy(os.path.join(repo.path, ".git/HEAD"), fname)
+ >>> list(repo.status().items())
+ [('??', [b'test_status'])]
+ >>> list(repo.status(['bla*']).items())
+ []
+ >>> list(repo.status(['te*']).items())
+ [('??', [b'test_status'])]
+ >>> repo.add_files(repo.path, force=True)
+ >>> repo.commit_all(msg='added %s' % fname)
+ >>> _ = repo._git_inout('mv', [fname, fname + 'new'])
+ >>> list(repo.status().items())
+ [('R ', [b'test_status\x00test_statusnew'])]
+ """
+
+
+def test_cmd_has_feature():
+ r"""
+ Methods tested:
+ - L{gbp.git.GitRepository._cmd_has_feature}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo._cmd_has_feature("commit", "a")
+ True
+ >>> repo._cmd_has_feature("commit", "reuse-message")
+ True
+ >>> repo._cmd_has_feature("merge", "n")
+ True
+ >>> repo._cmd_has_feature("merge", "stat")
+ True
+ >>> repo._cmd_has_feature("format-patch", "cc")
+ True
+ >>> repo._cmd_has_feature("merge", "foobaroption")
+ False
+ >>> repo._cmd_has_feature("foobarcmd", "foobaroption")
+ Traceback (most recent call last):
+ ...
+ gbp.git.repository.GitRepositoryError: Invalid git command 'foobarcmd': No manual entry for gitfoobarcmd
+ >>> repo._cmd_has_feature("show", "standard-notes")
+ True
+ >>> repo._cmd_has_feature("show", "no-standard-notes")
+ True
+ """
+
+
+def test_set_user_name_and_email():
+ r"""
+ Methods tested:
+ - L{gbp.git.GitRepository.set_user_name}
+ - L{gbp.git.GitRepository.set_user_email}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.set_user_name("Michael Stapelberg")
+ >>> repo.set_user_email("stapelberg@test.invalid")
+ """
+
+
+def test_set_config_and_get_config():
+ r"""
+ Methods tested:
+ - L{gbp.git.GitRepository.set_config}
+ - L{gbp.git.GitRepository.get_config}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(dirs['repo'])
+ >>> repo.set_config("user.email", "foo@example.com")
+ >>> repo.get_config("user.email")
+ 'foo@example.com'
+ """
+
+
+def test_git_dir():
+ """
+ Properties tested:
+ - L{gbp.git.GitRepository.git_dir}
+ >>> import os, gbp.git
+ >>> git_dir = os.path.join(dirs['repo'], '.git')
+ >>> os.environ['GIT_DIR'] = git_dir
+ >>> somewhere = gbp.git.GitRepository(os.path.join(dirs['repo'], '..'))
+ >>> somewhere.git_dir == git_dir
+ True
+ >>> del os.environ['GIT_DIR']
+ """
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+"""
+Test L{gbp.git.GitVfs}
+"""
+
+import os
+import gbp.log
+
+from .. import context # noqa: F401
+
+gbp.log.setup(color=False, verbose=True)
+
+
+def setup_repo():
+ repo_dir = context.new_tmpdir(__name__)
+ repo = gbp.git.GitRepository.create(str(repo_dir))
+ content = b'al pha\na\nb\nc'
+ with open(os.path.join(repo.path, 'foo.txt'), 'w') as f:
+ f.write(content.decode())
+ repo.add_files(repo.path, force=True)
+ repo.commit_all(msg="foo")
+ return (repo, content)
+
+
+def test_read():
+ """
+ Create a repository
+
+ Methods tested:
+ - L{gbp.git.GitVfs.open}
+ - L{gbp.git.GitVfs._File.readline}
+ - L{gbp.git.GitVfs._File.readlines}
+ - L{gbp.git.GitVfs._File.read}
+ - L{gbp.git.GitVfs._File.close}
+
+ >>> import gbp.git.vfs
+ >>> (repo, content) = setup_repo()
+ >>> vfs = gbp.git.vfs.GitVfs(repo, 'HEAD')
+ >>> gf = vfs.open('foo.txt')
+ >>> gf.readline()
+ 'al pha\\n'
+ >>> gf.readline()
+ 'a\\n'
+ >>> gf.readlines()
+ ['b\\n', 'c']
+ >>> gf.readlines()
+ []
+ >>> gf.readline()
+ ''
+ >>> gf.readline()
+ ''
+ >>> gf.close()
+ >>> gbp.git.vfs.GitVfs(repo, 'HEAD').open('foo.txt').read() == content.decode()
+ True
+ >>> gf = vfs.open('doesnotexist') # doctest:+IGNORE_EXCEPTION_DETAIL
+ Traceback (most recent call last):
+ ...
+ OSError: can't get HEAD:doesnotexist: fatal: Path 'doesnotexist' does not exist in 'HEAD'
+ >>> context.teardown()
+ """
+
+
+def test_binary_read():
+ """
+ Create a repository
+
+ Methods tested:
+ - L{gbp.git.GitVfs.open}
+ - L{gbp.git.GitVfs._File.readline}
+ - L{gbp.git.GitVfs._File.readlines}
+ - L{gbp.git.GitVfs._File.read}
+ - L{gbp.git.GitVfs._File.close}
+
+ >>> import gbp.git.vfs
+ >>> (repo, content) = setup_repo()
+ >>> vfs = gbp.git.vfs.GitVfs(repo, 'HEAD')
+ >>> gf = vfs.open('foo.txt', 'rb')
+ >>> gf.readline()
+ b'al pha\\n'
+ >>> gf.readline()
+ b'a\\n'
+ >>> gf.readlines()
+ [b'b\\n', b'c']
+ >>> gf.readlines()
+ []
+ >>> gf.readline()
+ b''
+ >>> gf.readline()
+ b''
+ >>> gf.close()
+ >>> gbp.git.vfs.GitVfs(repo, 'HEAD').open('foo.txt', 'rb').read() == content
+ True
+ >>> gf = vfs.open('doesnotexist') # doctest:+IGNORE_EXCEPTION_DETAIL
+ Traceback (most recent call last):
+ ...
+ OSError: can't get HEAD:doesnotexist: fatal: Path 'doesnotexist' does not exist in 'HEAD'
+ >>> context.teardown()
+ """
+
+
+def test_content_manager():
+ """
+ Create a repository
+
+ Methods tested:
+ - L{gbp.git.GitVfs.open}
+
+ >>> import gbp.git.vfs
+ >>> (repo, content) = setup_repo()
+ >>> vfs = gbp.git.vfs.GitVfs(repo, 'HEAD')
+ >>> with vfs.open('foo.txt') as gf:
+ ... data = gf.readlines()
+ >>> data
+ ['al pha\\n', 'a\\n', 'b\\n', 'c']
+ """
--- /dev/null
+# vim: set fileencoding=utf-8 :
+"""
+Test pristine-tar related methods in
+
+ - L{gbp.deb.pristinetar.DebianPristineTar}
+
+and
+
+ - L{gbp.deb.git.DebianGitRepository}
+
+This testcase creates this reposity:
+
+ - A repository at I{dirs['repo']} called I{repo}
+
+"""
+
+import os
+from .. import context
+
+test_data = os.path.join(context.projectdir, "tests/data/pristine_tar")
+dirs = {}
+
+
+def setup_module():
+ dirs['repo'] = context.new_tmpdir(__name__).join('repo')
+
+
+def teardown_module():
+ del dirs['repo']
+ context.teardown()
+
+
+def test_create():
+ """
+ Create a repository
+
+ Methods tested:
+ - L{gbp.deb.git.DebianGitRepository.create}
+
+ >>> import os, gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository.create(dirs['repo'])
+ """
+
+
+def test_empty_repo():
+ """
+ Empty repos have no branch pristine-tar branch
+
+ Methods tested:
+ - L{gbp.deb.git.DebianGitRepository.has_pristine_tar_branch}
+ - L{gbp.deb.pristinetar.DebianPristineTar.has_commit}
+
+ >>> import gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> repo.has_pristine_tar_branch()
+ False
+ >>> repo.pristine_tar.has_commit('upstream', '1.0', 'gzip')
+ False
+ """
+
+
+def test_commit_dir():
+ """
+ Empty repos have no branch pristine-tar branch
+
+ Methods tested:
+ - L{gbp.git.repository.GitRepository.commit_dir}
+ - L{gbp.git.repository.GitRepository.create_branch}
+
+ >>> import gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> commit = repo.commit_dir(test_data, msg="initial commit", branch=None)
+ >>> repo.create_branch('upstream')
+ """
+
+
+def test_create_tarball():
+ """
+ Create a tarball from a git tree and add a stub signature
+
+ Methods tested:
+ - L{gbp.deb.git.DebianGitRepository.archive}
+
+ >>> import gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> repo.archive('tar', 'upstream/', '../upstream_1.0.orig.tar', 'upstream')
+ >>> gbp.command_wrappers.Command('gzip', [ '-n', '%s/../upstream_1.0.orig.tar' % dirs['repo']])()
+ >>> with open('%s/../upstream_1.0.orig.tar.gz.asc' % dirs['repo'], 'w') as f: f.write("sig")
+ 3
+ """
+
+
+def test_pristine_tar_commit():
+ """
+ Commit the delta to the pristine-tar branch
+
+ Methods tested:
+ - L{gbp.deb.pristinetar.DebianPristineTar.commit}
+
+ >>> import gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> repo.pristine_tar.commit('../upstream_1.0.orig.tar.gz', 'upstream')
+ """
+
+
+def test_pristine_tar_commit_with_sig():
+ """
+ Commit the delta to the pristine-tar branch including a signature
+
+ Methods tested:
+ - L{gbp.deb.pristinetar.DebianPristineTar.commit}
+
+ >>> import gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> repo.pristine_tar.commit('../upstream_1.0.orig.tar.gz', 'upstream',
+ ... signaturefile='../upstream_1.0.orig.tar.gz.asc')
+ """
+
+
+def test_pristine_has_commit():
+ """
+ Find delta on the pristine tar branch
+
+ Methods tested:
+ - L{gbp.deb.pristinetar.DebianPristineTar.has_commit}
+ - L{gbp.pkg.pristinetar.PristineTar.get_commit}
+
+ >>> import gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> repo.pristine_tar.has_commit('upstream', '1.0', 'bzip2')
+ False
+ >>> repo.pristine_tar.has_commit('upstream', '1.0', 'gzip')
+ True
+ >>> repo.pristine_tar.has_commit('upstream', '1.0')
+ True
+ >>> branch = repo.rev_parse('pristine-tar')
+ >>> commit, sig = repo.pristine_tar.get_commit('upstream_1.0.orig.tar.gz')
+ >>> branch == commit
+ True
+ >>> sig
+ True
+ >>> repo.pristine_tar.commit('../upstream_1.0.orig.tar.gz', 'upstream')
+ >>> branch = repo.rev_parse('pristine-tar')
+ >>> commit, sig = repo.pristine_tar.get_commit('upstream_1.0.orig.tar.gz')
+ >>> branch == commit
+ True
+ >>> sig
+ False
+ """
+
+
+def test_pristine_tar_checkout():
+ """
+ Checkout a tarball using pristine-tar
+
+ Methods tested:
+ - L{gbp.deb.pristinetar.DebianPristineTar.checkout}
+
+ >>> import gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> repo.pristine_tar.checkout('upstream', '1.0', 'gzip', '..')
+ """
+
+
+def test_pristine_tar_checkout_with_sig():
+ """
+ Checkout a tarball using pristine-tar
+
+ Methods tested:
+ - L{gbp.deb.pristinetar.DebianPristineTar.checkout}
+
+ >>> import gbp.deb.git
+ >>> from gbp.deb.policy import DebianPkgPolicy
+
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> sf = os.path.join(repo.path,
+ ... DebianPkgPolicy.build_signature_name('upstream', '1.0', 'gzip', '..'))
+ >>> os.unlink(sf)
+ >>> repo.pristine_tar.checkout('upstream', '1.0', 'gzip', '..',
+ ... signature=True)
+ >>> os.path.exists(sf) or not repo.pristine_tar.has_feature_sig()
+ True
+ """
+
+
+def test_pristine_tar_verify():
+ """
+ Verify a tarball using pristine-tar
+
+ Methods tested:
+ - L{gbp.deb.pristinetar.DebianPristineTar.verify}
+
+ >>> import gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> if repo.pristine_tar.has_feature_verify():
+ ... repo.pristine_tar.verify('../upstream_1.0.orig.tar.gz')
+ """
+
+
+def test_pristine_tar_checkout_nonexistent():
+ """
+ Checkout a tarball that does not exist using pristine-tar
+
+ Methods tested:
+ - L{gbp.deb.pristinetar.DebianPristineTar.checkout}
+
+ # Silence error output
+ >>> import gbp.deb.git
+ >>> repo = gbp.deb.git.DebianGitRepository(dirs['repo'])
+ >>> _gbp_log_err_bak = gbp.log.err
+ >>> gbp.log.err = lambda x: None
+ >>> repo.pristine_tar.checkout('upstream', '1.1', 'gzip', '..') # doctest:+IGNORE_EXCEPTION_DETAIL
+ Traceback (most recent call last):
+ ...
+ gbp.command_wrappers.CommandExecFailed: Pristine-tar couldn't checkout "upstream_1.1.orig.tar.gz": fatal: Path 'upstream_1.1.orig.tar.gz.delta' does not exist in 'refs/heads/pristine-tar'
+ pristine-tar: git show refs/heads/pristine-tar:upstream_1.1.orig.tar.gz.delta failed
+ >>> gbp.log.err = _gbp_log_err_bak
+ """
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+from gbp.scripts.create_remote_repo import (build_remote_script, # noqa: F401
+ parse_url) # noqa: F401
+
+
+def test_build_remote_script():
+ """
+ >>> build_remote_script({'base': 'base', 'dir': 'dir', 'pkg': 'pkg', 'template-dir': None, 'bare': True}, 'branch')
+ '\\nset -e\\numask 002\\nif [ -d base"dir" ]; then\\n echo "Repository at "basedir" already exists - giving up."\\n exit 1\\nfi\\nmkdir -p base"dir"\\ncd base"dir"\\ngit init --shared --bare\\necho "pkg packaging" > ./description\\necho "ref: refs/heads/branch" > ./HEAD\\n'
+ """
+
+
+def test_build_remote_script_template_dir():
+ """
+ >>> build_remote_script({'base': 'base', 'dir': 'dir', 'pkg': 'pkg', 'template-dir': '/doesnot/exist', 'bare': True}, 'branch')
+ '\\nset -e\\numask 002\\nif [ -d base"dir" ]; then\\n echo "Repository at "basedir" already exists - giving up."\\n exit 1\\nfi\\nmkdir -p base"dir"\\ncd base"dir"\\ngit init --shared --bare --template=/doesnot/exist\\necho "pkg packaging" > ./description\\necho "ref: refs/heads/branch" > ./HEAD\\n'
+ """
+
+
+def test_build_remote_script_bare():
+ """
+ >>> build_remote_script({'base': 'base', 'dir': 'dir', 'pkg': 'pkg', 'template-dir': None, 'bare': False}, 'branch')
+ '\\nset -e\\numask 002\\nif [ -d base"dir" ]; then\\n echo "Repository at "basedir" already exists - giving up."\\n exit 1\\nfi\\nmkdir -p base"dir"\\ncd base"dir"\\ngit init --shared\\necho "pkg packaging" > .git/description\\necho "ref: refs/heads/branch" > .git/HEAD\\n'
+ """
+
+
+def test_parse_url():
+ """
+ >>> url = parse_url("ssh://host/path/%(pkg)s", "origin", "package")
+ >>> url['base']
+ ''
+ >>> url['dir']
+ '/path/package'
+ >>> url['host']
+ 'host'
+ >>> url['name']
+ 'origin'
+ >>> url['pkg']
+ 'package'
+ >>> url['port']
+ >>> url['scheme']
+ 'ssh'
+ >>> url['template-dir']
+ >>> url['url']
+ 'ssh://host/path/package'
+
+ >>> url = parse_url("ssh://host:22/path/to/repo.git", "origin", "package")
+ >>> url['base']
+ ''
+ >>> url['dir']
+ '/path/to/repo.git'
+ >>> url['host']
+ 'host'
+ >>> url['name']
+ 'origin'
+ >>> url['pkg']
+ 'package'
+ >>> url['port']
+ '22'
+ >>> url['scheme']
+ 'ssh'
+ >>> url['template-dir']
+ >>> url['url']
+ 'ssh://host:22/path/to/repo.git'
+
+ >>> url = parse_url("ssh://host:22/~/path/%(pkg)s.git", "origin", "package")
+ >>> url['dir']
+ 'path/package.git'
+ >>> url['host']
+ 'host'
+ >>> url['name']
+ 'origin'
+ >>> url['pkg']
+ 'package'
+ >>> url['port']
+ '22'
+ >>> url['scheme']
+ 'ssh'
+ >>> url['template-dir']
+ >>> url['url']
+ 'ssh://host:22/~/path/package.git'
+ >>> url['bare']
+ True
+
+ >>> url = parse_url("ssh://host:22/~user/path/%(pkg)s.git", "origin", "package", "/doesnot/exist", bare=False)
+ >>> url['dir']
+ 'path/package.git'
+ >>> url['host']
+ 'host'
+ >>> url['name']
+ 'origin'
+ >>> url['pkg']
+ 'package'
+ >>> url['port']
+ '22'
+ >>> url['scheme']
+ 'ssh'
+ >>> url['template-dir']
+ '/doesnot/exist'
+ >>> url['url']
+ 'ssh://host:22/~user/path/package.git'
+ >>> url['bare']
+ False
+
+ >>> parse_url("git://host/repo.git", "origin", "package")
+ Traceback (most recent call last):
+ ...
+ gbp.errors.GbpError: URL must use ssh protocol.
+ >>> parse_url("ssh://host/path/repo", "origin", "package")
+ Traceback (most recent call last):
+ ...
+ gbp.errors.GbpError: URL needs to contain either a repository name or '%(pkg)s'
+ >>> parse_url("ssh://host:asdf/path/%(pkg)s.git", "origin", "package")
+ Traceback (most recent call last):
+ ...
+ gbp.errors.GbpError: URL contains invalid port.
+ >>> parse_url("ssh://host/~us er/path/%(pkg)s.git", "origin", "package")
+ Traceback (most recent call last):
+ ...
+ gbp.errors.GbpError: URL contains invalid ~username expansion.
+ """
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-
-"""
-Test L{gbp.deb.changelog.ChangeLog}
-"""
-from . import context
-import os
-import nose
-
-cl_debian = """git-buildpackage (0.5.32) unstable; urgency=low
-
- * [efe9220] Use known_compressions in guess_upstream_version too
- (Closes: #645477)
- * [e984baf] git-import-orig: fix --filter
-
- -- Guido Günther <agx@sigxcpu.org> Mon, 17 Oct 2011 10:15:22 +0200
-
-git-buildpackage (0.5.31) unstable; urgency=low
-
- [ Guido Günther ]
- * [3588d88] Fix pristine-tar error message
- * [8da98da] gbp-pq: don't fail on missing series file but create an empty
- branch instead
-
- [ Salvatore Bonaccorso ]
- * [b33cf74] Fix URL to cl2vcs service.
- Refer to https://honk.sigxcpu.org/cl2vcs instead of
- https://honk.sigxcpu.org/cl2vcs for the cl2vcs service. (Closes: #640141)
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 28 Sep 2011 20:21:34 +0200
-"""
-
-cl_upstream="""python-dateutil (1.0-1) unstable; urgency=low
-
- * Initial release (Closes: #386256)
-
- -- Guido Günther <agx@sigxcpu.org> Wed, 6 Sep 2006 10:33:06 +0200
-"""
-
-cl_epoch="""xserver-xorg-video-nv (1:1.2.0-3) unstable; urgency=low
-
- [ Steve Langasek ]
- * Upload to unstable
-
- -- David Nusinow <dnusinow@debian.org> Mon, 18 Sep 2006 19:57:45 -0400
-"""
-
-def setup():
- """Setup test module"""
- if not os.path.exists('/usr/bin/dch'):
- raise nose.SkipTest('dch tool not present')
-
-def test_parse_debian_only():
- """
- Parse a the changelog of debian only package
-
- Methods tested:
- - L{gbp.deb.changelog.ChangeLog.__init__}
-
- Properties tested:
- - L{gbp.deb.changelog.ChangeLog.version}
- - L{gbp.deb.changelog.ChangeLog.debian_version}
- - L{gbp.deb.changelog.ChangeLog.upstream_version}
- - L{gbp.deb.changelog.ChangeLog.epoch}
- - L{gbp.deb.changelog.ChangeLog.noepoch}
-
- >>> import gbp.deb.changelog
- >>> cl = gbp.deb.changelog.ChangeLog(cl_debian)
- >>> cl.version
- '0.5.32'
- >>> cl.version == cl['Version']
- True
- >>> cl.debian_version
- '0.5.32'
- >>> cl.debian_version == cl['Debian-Version']
- True
- >>> cl.noepoch
- '0.5.32'
- >>> cl.noepoch == cl['NoEpoch-Version']
- True
- >>> cl.epoch
- >>> cl.upstream_version
- """
-
-def test_parse_no_eopch():
- """
- Parse a the changelog of a package without eopch
-
- Methods tested:
- - L{gbp.deb.changelog.ChangeLog.__init__}
- - L{gbp.deb.changelog.ChangeLog.has_epoch}
-
- Properties tested:
- - L{gbp.deb.changelog.ChangeLog.version}
- - L{gbp.deb.changelog.ChangeLog.debian_version}
- - L{gbp.deb.changelog.ChangeLog.upstream_version}
- - L{gbp.deb.changelog.ChangeLog.epoch}
- - L{gbp.deb.changelog.ChangeLog.noepoch}
-
- >>> import gbp.deb.changelog
- >>> cl = gbp.deb.changelog.ChangeLog(cl_upstream)
- >>> cl.version
- '1.0-1'
- >>> cl.version == cl['Version']
- True
- >>> cl.debian_version
- '1'
- >>> cl.debian_version == cl['Debian-Version']
- True
- >>> cl.noepoch
- '1.0-1'
- >>> cl.noepoch == cl['NoEpoch-Version']
- True
- >>> cl.epoch
- >>> cl.upstream_version
- '1.0'
- >>> cl.has_epoch()
- False
- """
-
-def test_parse_eopch():
- """
- Parse a the changelog of a package without epoch
-
- Methods tested:
- - L{gbp.deb.changelog.ChangeLog.__init__}
- - L{gbp.deb.changelog.ChangeLog.has_epoch}
-
- Properties tested:
- - L{gbp.deb.changelog.ChangeLog.version}
- - L{gbp.deb.changelog.ChangeLog.debian_version}
- - L{gbp.deb.changelog.ChangeLog.upstream_version}
- - L{gbp.deb.changelog.ChangeLog.epoch}
- - L{gbp.deb.changelog.ChangeLog.noepoch}
-
- >>> import gbp.deb.changelog
- >>> cl = gbp.deb.changelog.ChangeLog(cl_epoch)
- >>> cl.version
- '1:1.2.0-3'
- >>> cl.version == cl['Version']
- True
- >>> cl.debian_version
- '3'
- >>> cl.debian_version == cl['Debian-Version']
- True
- >>> cl.noepoch
- '1.2.0-3'
- >>> cl.noepoch == cl['NoEpoch-Version']
- True
- >>> cl.epoch
- '1'
- >>> cl.upstream_version
- '1.2.0'
- >>> cl.has_epoch()
- True
- """
-
-def test_parse_name():
- """
- Methods tested:
- - L{gbp.deb.changelog.ChangeLog.__init__}
-
- Properties tested:
- - L{gbp.deb.changelog.ChangeLog.name}
-
- >>> import gbp.deb.changelog
- >>> cl = gbp.deb.changelog.ChangeLog(cl_debian)
- >>> cl.name
- 'git-buildpackage'
- """
-
-def test_parse_last_mod():
- """
- Test author, email and date of last modification
-
- Methods tested:
- - L{gbp.deb.changelog.ChangeLog.__init__}
-
- Properties tested:
- - L{gbp.deb.changelog.ChangeLog.name}
- - L{gbp.deb.changelog.ChangeLog.email}
- - L{gbp.deb.changelog.ChangeLog.date}
-
- >>> import gbp.deb.changelog
- >>> cl = gbp.deb.changelog.ChangeLog(cl_debian)
- >>> cl.author.startswith('Guido')
- True
- >>> cl.email
- 'agx@sigxcpu.org'
- >>> cl.date
- 'Mon, 17 Oct 2011 10:15:22 +0200'
- """
-
-def test_parse_sections():
- """
- Test if we can parse sections out of the changelog
-
- Methods tested:
- - L{gbp.deb.changelog.ChangeLog.__init__}
- - L{gbp.deb.changelog.ChangeLogSection.__init__}
- - L{gbp.deb.changelog.ChangeLogSection.parse}
-
- Properties tested:
- - L{gbp.deb.changelog.ChangeLog.sections}
-
- >>> import gbp.deb.changelog
- >>> cl = gbp.deb.changelog.ChangeLog(cl_debian)
- >>> cl.sections[0].package
- 'git-buildpackage'
- >>> cl.sections[0].version
- '0.5.32'
- >>> cl.sections[1].package
- 'git-buildpackage'
- >>> cl.sections[1].version
- '0.5.31'
- """
-
-def test_add_section():
- """
- Test if we can add a section to an existant changelog
-
- Methods tested:
- - L{gbp.deb.changelog.ChangeLog.__init__}
- - L{gbp.deb.changelog.ChangeLog._parse}
- - L{gbp.deb.changelog.ChangeLog.add_section}
- - L{gbp.deb.changelog.ChangeLog.spawn_dch}
-
- >>> import os
- >>> import tempfile
- >>> import shutil
- >>> import gbp.deb.changelog
- >>> from .testutils import OsReleaseFile
- >>> os_release = OsReleaseFile('/etc/lsb-release')
- >>> olddir = os.path.abspath(os.path.curdir)
- >>> testdir = tempfile.mkdtemp(prefix='gbp-test-changelog-')
- >>> testdebdir = os.path.join(testdir, 'debian')
- >>> testclname = os.path.join(testdebdir, "changelog")
- >>> os.mkdir(testdebdir)
- >>> clh = open(os.path.join(testdebdir, "changelog"), "w")
- >>> clh.write(cl_debian)
- >>> clh.close()
- >>> os.chdir(testdir)
- >>> os.path.abspath(os.path.curdir) == testdir
- True
- >>> cl = gbp.deb.changelog.ChangeLog(filename=testclname)
- >>> cl.add_section(msg=["Test add section"], distribution=None, author="Debian Maintainer", email="maint@debian.org")
- >>> cl = gbp.deb.changelog.ChangeLog(filename=testclname)
- >>> version = '0.5.32ubuntu1' if os_release['DISTRIB_ID'] == 'Ubuntu' else '0.5.33'
- >>> cl.version == version
- True
- >>> cl.debian_version == version
- True
- >>> distributions = ['UNRELEASED', os_release['DISTRIB_CODENAME'] or 'unstable']
- >>> cl['Distribution'] in distributions
- True
- >>> 'Test add section' in cl['Changes']
- True
- >>> os.chdir(olddir)
- >>> os.path.abspath(os.path.curdir) == olddir
- True
- >>> shutil.rmtree(testdir, ignore_errors=True)
- """
-
-def test_add_entry():
- """
- Test if we can add an entry to an existant changelog
-
- Methods tested:
- - L{gbp.deb.changelog.ChangeLog.__init__}
- - L{gbp.deb.changelog.ChangeLog._parse}
- - L{gbp.deb.changelog.ChangeLog.add_entry}
- - L{gbp.deb.changelog.ChangeLog.spawn_dch}
-
- >>> import os
- >>> import tempfile
- >>> import shutil
- >>> import gbp.deb.changelog
- >>> from .testutils import OsReleaseFile
- >>> os_release = OsReleaseFile('/etc/lsb-release')
- >>> olddir = os.path.abspath(os.path.curdir)
- >>> testdir = tempfile.mkdtemp(prefix='gbp-test-changelog-')
- >>> testdebdir = os.path.join(testdir, 'debian')
- >>> testclname = os.path.join(testdebdir, "changelog")
- >>> os.mkdir(testdebdir)
- >>> clh = open(os.path.join(testdebdir, "changelog"), "w")
- >>> clh.write(cl_debian)
- >>> clh.close()
- >>> os.chdir(testdir)
- >>> os.path.abspath(os.path.curdir) == testdir
- True
- >>> cl = gbp.deb.changelog.ChangeLog(filename=testclname)
- >>> cl.add_section(msg=["Test add section"], distribution=None, author="Debian Maintainer", email="maint@debian.org")
- >>> cl.add_entry(msg=["Test add entry"], author="Debian Maintainer", email="maint@debian.org")
- >>> cl = gbp.deb.changelog.ChangeLog(filename=testclname)
- >>> version = '0.5.32ubuntu1' if os_release['DISTRIB_ID'] == 'Ubuntu' else '0.5.33'
- >>> cl.version == version
- True
- >>> cl.debian_version == version
- True
- >>> distributions = ['UNRELEASED', os_release['DISTRIB_CODENAME'] or 'unstable']
- >>> cl['Distribution'] in distributions
- True
- >>> 'Test add entry' in cl['Changes']
- True
- >>> os.chdir(olddir)
- >>> os.path.abspath(os.path.curdir) == olddir
- True
- >>> shutil.rmtree(testdir, ignore_errors=True)
- """
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-
-"""
-Test L{gbp.config.GbpOptionParser}
-Test L{gbp.config.GbpOptionParserDebian}
-"""
-
-from . import context
-
-def test_option_parser():
- """
- Methods tested:
- - L{gbp.config.GbpOptionParser.add_config_file_option}
- - L{gbp.config.GbpOptionParser.add_boolean_config_file_option}
-
- >>> import gbp.config
- >>> c = gbp.config.GbpOptionParser('common', prefix='test')
- >>> c.add_config_file_option(option_name='upstream-branch', dest='upstream')
- >>> c.add_boolean_config_file_option(option_name='overlay', dest='overlay')
- >>> c.add_boolean_config_file_option(option_name='track', dest='track')
- """
-
-def test_option_parser_debian():
- """
- Methods tested:
- - L{gbp.config.GbpOptionParserDebian.add_config_file_option}
-
- >>> import gbp.config
- >>> c = gbp.config.GbpOptionParserDebian('debian')
- >>> c.add_config_file_option(option_name='builder', dest='builder')
- Traceback (most recent call last):
- ...
- KeyError: 'builder'
- >>> c.add_config_file_option(option_name='builder', dest='builder', help='foo')
- """
-
-def test_option_group():
- """
- Methods tested:
- - L{gbp.config.GbpOptionGroup.add_config_file_option}
- - L{gbp.config.GbpOptionGroup.add_boolean_config_file_option}
-
- >>> import gbp.config
- >>> c = gbp.config.GbpOptionParser('debian')
- >>> g = gbp.config.GbpOptionGroup(c, 'wheezy')
- >>> g.add_config_file_option(option_name='debian-branch', dest='branch')
- >>> g.add_boolean_config_file_option(option_name='track', dest='track')
- """
-
-def test_tristate():
- """
- Methods tested:
- - L{gbp.config.GbpOptionParser.add_config_file_option}
-
- >>> import gbp.config
- >>> c = gbp.config.GbpOptionParser('tristate')
- >>> c.add_config_file_option(option_name="color", dest="color", type='tristate')
- >>> options, args= c.parse_args(['--color=auto'])
- >>> options.color
- auto
- """
-
-def test_filter():
- """
- The filter option should always parse as a list
- >>> import os
- >>> from gbp.config import GbpOptionParser
- >>> tmpdir = str(context.new_tmpdir('bar'))
- >>> confname = os.path.join(tmpdir, 'gbp.conf')
- >>> f = open(confname, 'w')
- >>> f.write('[bar]\\nfilter = asdf\\n')
- >>> f.close()
- >>> os.environ['GBP_CONF_FILES'] = confname
- >>> parser = GbpOptionParser('bar')
- >>> parser.config['filter']
- ['asdf']
- >>> f = open(confname, 'w')
- >>> f.write("[bar]\\nfilter = ['this', 'is', 'a', 'list']\\n")
- >>> f.close()
- >>> parser = GbpOptionParser('bar')
- >>> parser.config['filter']
- ['this', 'is', 'a', 'list']
- >>> del os.environ['GBP_CONF_FILES']
- """
-
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-
-"""
-Test L{gbp.deb.control.Control}
-"""
-
-from . import context
-
-cl_debian = """Source: git-buildpackage
-Section: vcs
-Priority: optional
-Maintainer: Guido Günther <agx@sigxcpu.org>
-Build-Depends: debhelper (>= 7.0.50~), python (>> 2.6.6-3~),
- pychecker, gtk-doc-tools, sgml2x, docbook-utils, jade, python-dateutil, python-nose,
- bash-completion, perl, python-epydoc, python-coverage, python-setuptools,
- # For the testsuite
- git (>= 1:1.7.9.1-1~), bzip2, unzip, pristine-tar
-Standards-Version: 3.9.3
-Vcs-Git: git://honk.sigxcpu.org/git/git-buildpackage.git
-Vcs-Browser: http://git.debian.org/?p=users/agx/git-buildpackage.git
-Homepage: https://honk.sigxcpu.org/piki/projects/git-buildpackage/
-X-Python-Version: >= 2.6
-
-Package: git-buildpackage
-Architecture: all
-Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, devscripts (>= 2.10.66~),
- git (>= 1:1.7.9.1-1~), python-dateutil
-Recommends: pristine-tar (>= 0.5), cowbuilder
-Suggests: python-notify, unzip
-Description: Suite to help with Debian packages in Git repositories
- This package contains the following tools:
- * git-import-{dsc,dscs}: import existing Debian source packages into a git
- repository
- * git-import-orig: import a new upstream version into the git repository
- * git-buildpackage: build a package out of a git repository, check for local
- modifications and tag appropriately
- * git-dch: generate Debian changelog entries from Git commit messages
- * gbp-{pull,clone}: clone and pull from remote repos
- * gbp-pq: manage debian/patches easily
- * gbp-create-remote-repo: create remote repositories
-"""
-
-def test_parse_control():
- """
- Parse a the control of debian package
-
- Methods tested:
- - L{gbp.deb.control.Control.__init__}
-
- Properties tested:
- - L{gbp.deb.control.Control.name}
- - L{gbp.deb.control.Control.section}
- - L{gbp.deb.control.Control.priority}
-
- >>> import gbp.deb.control
- >>> cl = gbp.deb.control.Control(cl_debian)
- >>> cl.name
- 'git-buildpackage'
- >>> cl.name == cl['Source']
- True
- >>> cl.section
- 'vcs'
- >>> cl.section == cl['Section']
- True
- >>> cl.priority
- 'optional'
- >>> cl.priority == cl['Priority']
- True
- >>> cl['Standards-Version']
- '3.9.3'
- >>> cl['Package']
-
- """
-
-def test_no_control_error():
- """
- Raise an error if no control file exist or is empty
-
- Methods tested:
- - L{gbp.deb.control.Control.__init__}
-
- >>> import gbp.deb.control
- >>> cl = gbp.deb.control.Control(filename="doesnotexist")
- Traceback (most recent call last):
- ...
- NoControlError: Control file doesnotexist does not exist
- >>> cl = gbp.deb.control.Control("notparsable")
- Traceback (most recent call last):
- ...
- ParseControlError: Empty or invalid control file or contents
- """
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-
-"""
-Test L{gbp.git.GitModifier}
-"""
-
-from . import context
-
-def test_author():
- """
- Methods tested:
- - L{gbp.git.GitModifier.get_author_env}
- - L{gbp.git.GitModifier.get_committer_env}
- - L{gbp.git.GitModifier.keys}
-
- >>> import gbp.git
- >>> modifier = gbp.git.GitModifier('foo', 'bar')
- >>> modifier.name
- 'foo'
- >>> modifier.email
- 'bar'
- >>> modifier.get_author_env()['GIT_AUTHOR_EMAIL']
- 'bar'
- >>> modifier.get_author_env()['GIT_AUTHOR_NAME']
- 'foo'
- >>> modifier.get_committer_env()['GIT_COMMITTER_NAME']
- 'foo'
- >>> modifier.get_committer_env()['GIT_COMMITTER_EMAIL']
- 'bar'
- >>> modifier._get_env('foo')
- Traceback (most recent call last):
- ...
- GitModifierError: Neither committer nor author
- >>> modifier['name']
- 'foo'
- >>> modifier['email']
- 'bar'
- >>> modifier['date']
- """
-
-def test_date():
- """
- Methods tested:
- - L{gbp.git.GitModifier.__init__}
-
- Properties tested:
- - L{gbp.git.GitModifier.date}
- - L{gbp.git.GitModifier.datetime}
- - L{gbp.git.GitModifier.tz_offset}
-
- >>> import gbp.git
- >>> import datetime
- >>> modifier = gbp.git.GitModifier('foo', 'bar', 1)
- >>> modifier.date
- '1 +0000'
- >>> modifier.date = '1 +0400'
- >>> modifier.date
- '1 +0400'
- >>> modifier['date']
- '1 +0400'
- >>> modifier.datetime # doctest: +ELLIPSIS
- datetime.datetime(1970, 1, 1, 4, 0, 1, tzinfo=<gbp.git.modifier.GitTz...>)
- >>> modifier.date = datetime.datetime(1970, 1, 1, 0, 0, 1)
- >>> modifier.date
- '1 +0000'
- >>> modifier.datetime # doctest: +ELLIPSIS
- datetime.datetime(1970, 1, 1, 0, 0, 1, tzinfo=<gbp.git.modifier.GitTz...>)
- >>> modifier.tz_offset
- '+0000'
- """
-
-def test_dict():
- """
- Test C{dict} interface
- >>> import gbp.git
- >>> modifier = gbp.git.GitModifier('foo', 'bar', 1)
- >>> sorted(modifier.keys())
- ['date', 'email', 'name']
- >>> sorted(modifier.items())
- [('date', '1 +0000'), ('email', 'bar'), ('name', 'foo')]
- """
-
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-
-"""
-Test L{gbp.git.GitRepository}
-
-This testcase creates several repositores:
-
- - A repository at L{repo_dir} called I{repo}
- - A bare repository at L{bare_dir} called I{bare}
- - A clone of I{repo} below L{clone_dir} called I{clone}
- - A mirror of I{repo} below L{mirror_clone_dir} called I{mirror}
-"""
-
-from . import context
-
-import gbp.log
-
-gbp.log.setup(color=False, verbose=True)
-
-repo_dir, bare_dir, clone_dir, mirror_clone_dir = list(map(
- lambda x, tmpdir=context.new_tmpdir(__name__): tmpdir.join(x),
- ['repo', 'bare', 'clone', 'mirror_clone']))
-
-def test_create():
- """
- Create a repository
-
- Methods tested:
- - L{gbp.git.GitRepository.create}
-
- Properties tested:
- - L{gbp.git.GitRepository.path}
- - L{gbp.git.GitRepository.git_dir}
-
- >>> import os, gbp.git
- >>> repo = gbp.git.GitRepository.create(repo_dir)
- >>> repo.path == repo_dir
- True
- >>> repo.git_dir == os.path.join(repo_dir, '.git')
- True
- >>> type(repo) == gbp.git.GitRepository
- True
- """
-
-
-def test_empty():
- """
- Empty repos have no branch
-
- Methods tested:
- - L{gbp.git.GitRepository.get_branch}
- - L{gbp.git.GitRepository.is_empty}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.get_branch()
- >>> repo.branch
- >>> repo.is_empty()
- True
- """
-
-
-def test_add_files():
- """
- Add some dummy data
-
- Methods tested:
- - L{gbp.git.GitRepository.add_files}
- - L{gbp.git.GitRepository.commit_all}
- - L{gbp.git.GitRepository.is_clean}
- - L{gbp.git.GitRepository.status}
-
- Properties tested:
- - L{gbp.git.GitRepository.head}
-
- >>> import gbp.git, shutil, os
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> shutil.copy(os.path.join(repo.path, ".git/HEAD"), \
- os.path.join(repo.path, "testfile"))
- >>> repo.is_clean()[0]
- False
- >>> repo.is_clean(ignore_untracked=True)[0]
- True
- >>> repo.add_files('testfile', force=True, untracked=False)
- >>> list(repo.status().items())
- [('??', ['testfile'])]
- >>> repo.add_files(repo.path, force=True)
- >>> list(repo.status().items())
- [('A ', ['testfile'])]
- >>> repo.commit_all(msg="foo")
- >>> repo.is_clean()[0]
- True
- >>> h = repo.head
- >>> len(h)
- 40
- """
-
-
-def test_branch_master():
- """
- First branch is called I{master}
-
- Methods tested:
- - L{gbp.git.GitRepository.get_branch}
- >>> import gbp.git, shutil
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.get_branch()
- 'master'
- >>> repo.branch
- 'master'
- """
-
-def test_clean():
- """
- Remove untracked files from the working tree
-
- Methods tested:
- - L{gbp.git.GitRepository.clean}
-
- >>> import gbp.git, shutil, os
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> shutil.copy(os.path.join(repo.path, ".git/HEAD"), \
- os.path.join(repo.path, "testclean"))
- >>> repo.clean(dry_run=True)
- >>> repo.is_clean()[0]
- False
- >>> repo.clean(directories=True, force=True)
- >>> repo.is_clean()[0]
- True
- """
-
-def test_create_branch():
- """
- Create a branch name I{foo}
-
- Methods tested:
- - L{gbp.git.GitRepository.create_branch}
- - L{gbp.git.GitRepository.branch_contains}
-
- >>> import gbp.git, shutil
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.create_branch("foo")
- >>> repo.branch_contains("foo", 'HEAD')
- True
- >>> repo.branch_contains("doesnotexist", 'HEAD', remote=True)
- False
- """
-
-def test_delete_branch():
- """
- Create a branch named I{foo2} and delete it
-
- Methods tested:
- - L{gbp.git.GitRepository.create_branch}
- - L{gbp.git.GitRepository.delete_branch}
-
- >>> import gbp.git, shutil
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.create_branch("bar")
- >>> repo.delete_branch("bar")
- >>> repo.delete_branch("master")
- Traceback (most recent call last):
- ...
- GitRepositoryError: Can't delete the branch you're on
- """
-
-def test_set_branch():
- """
- Switch to branch named I{foo}
-
- Methods tested:
- - L{gbp.git.GitRepository.set_branch}
- - L{gbp.git.GitRepository.get_branch}
- - L{gbp.git.GitRepository.branch}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.set_branch("foo")
- >>> repo.get_branch() == "foo"
- True
- >>> repo.branch == "foo"
- True
- """
-
-
-def test_rename_branch():
- """
- Create branch named I{baz}, rename it to I{bax} and finally delete it
-
- Methods tested:
- - L{gbp.git.GitRepository.create_branch}
- - L{gbp.git.GitRepository.rename_branch}
- - L{gbp.git.GitRepository.delete_branch}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.create_branch("baz")
- >>> repo.rename_branch("baz", "bax")
- >>> repo.delete_branch("bax")
- """
-
-
-def test_set_upstream_branch():
- """
- Set upstream branch master -> origin/master
-
- >>> import os, shutil
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> os.makedirs(os.path.join(repo.git_dir, 'refs/remotes/origin'))
- >>> shutil.copy(os.path.join(repo.git_dir, 'refs/heads/master'), \
- os.path.join(repo.git_dir, 'refs/remotes/origin/'))
- >>> repo.add_remote_repo('origin', 'git://git.example.com/git/origin')
- >>> repo.set_upstream_branch('master', 'origin/master')
- >>> repo.get_upstream_branch('master')
- 'origin/master'
- >>> repo.set_upstream_branch('bla', 'origin/master')
- Traceback (most recent call last):
- GitRepositoryError: Branch bla doesn't exist!
- >>> repo.set_upstream_branch('foo', 'origin/bla')
- Traceback (most recent call last):
- GitRepositoryError: Branch origin/bla doesn't exist!
- """
-
-def test_get_upstream_branch():
- """
- Get info about upstream branches set in test_set_upstream_branch
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.get_upstream_branch('master')
- 'origin/master'
- >>> repo.get_upstream_branch('foo')
- ''
- >>> repo.get_upstream_branch('bla')
- Traceback (most recent call last):
- GitRepositoryError: Branch bla doesn't exist!
- """
-
-def test_tag():
- """
- Create a tag named I{tag} and check it's existance
-
- Methods tested:
- - L{gbp.git.GitRepository.create_tag}
- - L{gbp.git.GitRepository.verify_tag}
- - L{gbp.git.GitRepository.has_tag}
- - L{gbp.git.GitRepository.get_tags}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.create_tag("tag")
- >>> repo.has_tag("tag")
- True
- >>> repo.has_tag("unknown")
- False
- >>> repo.create_tag("tag2", msg="foo")
- >>> repo.has_tag("tag2")
- True
- >>> repo.verify_tag("tag2")
- False
- >>> repo.get_tags()
- ['tag', 'tag2']
- >>> repo.tags
- ['tag', 'tag2']
- """
-
-def test_describe():
- """
- Describe commit-ish
-
- Methods tested:
- - L{gbp.git.GitRepository.describe}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> sha = repo.rev_parse('HEAD')
- >>> repo.describe('HEAD')
- 'tag2'
- >>> repo.describe('HEAD', longfmt=True) == 'tag2-0-g%s' % sha[:7]
- True
- >>> repo.describe('HEAD', pattern='foo*')
- Traceback (most recent call last):
- ...
- GitRepositoryError: Can't describe HEAD. Git error: fatal: No names found, cannot describe anything.
- >>> repo.describe('HEAD', pattern='foo*', always=True) == sha[:7]
- True
- >>> repo.describe('HEAD', always=True, abbrev=16)
- 'tag2'
- >>> repo.describe('HEAD', pattern='foo*', always=True, abbrev=16) == sha[:16]
- True
- >>> tag = repo.describe('HEAD', longfmt=True, abbrev=16) == 'tag2-0-g%s' % sha[:16]
- >>> repo.delete_tag('tag2')
- >>> repo.describe('HEAD', tags=True)
- 'tag'
- >>> repo.describe('HEAD', tags=True, exact_match=True)
- 'tag'
- >>> repo.create_tag('tag2', msg='foo')
- """
-
-def test_find_tag():
- """
- Find tags
-
- Methods tested:
- - L{gbp.git.GitRepository.find_tag}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.find_tag('HEAD')
- 'tag2'
- >>> repo.find_tag('HEAD', pattern='foo*')
- Traceback (most recent call last):
- ...
- GitRepositoryError: Can't describe HEAD. Git error: fatal: No names found, cannot describe anything.
- """
-
-def test_move_tag():
- """
- Move a tag
-
- Methods tested:
- - L{gbp.git.GitRepository.move_tag}
- - L{gbp.git.GitRepository.has_tag}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.move_tag("tag", "moved")
- >>> repo.has_tag("tag")
- False
- >>> repo.has_tag("moved")
- True
- """
-
-def test_delete_tag():
- """
- Delete tags
-
- Methods tested:
- - L{gbp.git.GitRepository.delete_tag}
- - L{gbp.git.GitRepository.has_tag}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.has_tag("moved")
- True
- >>> repo.delete_tag("moved")
- >>> repo.has_tag("moved")
- False
- """
-
-def test_get_obj_type():
- """
- Find commit SHA1 related to tags
-
- Methods tested:
- - L{gbp.git.GitRepository.create_tag}
- - L{gbp.git.GitRepository.get_obj_type}
- - L{gbp.git.GitRepository.delete_tag}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.create_tag("tag3", "tag msg")
- >>> repo.get_obj_type("tag3")
- 'tag'
- >>> repo.get_obj_type("HEAD")
- 'commit'
- >>> repo.get_obj_type("HEAD:testfile")
- 'blob'
- >>> repo.delete_tag("tag3")
- """
-
-def test_list_files():
- """
- List files in the index
-
- Methods tested:
- - L{gbp.git.GitRepository.list_files}
- - L{gbp.git.GitRepository.add_files}
- - L{gbp.git.GitRepository.commit_staged}
- - L{gbp.git.GitRepository.commit_files}
- - L{gbp.git.GitRepository.force_head}
-
- >>> import gbp.git, os, shutil
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> src = os.path.join(repo.path, ".git/HEAD")
- >>> dst = os.path.join(repo.path, "testfile")
- >>> repo.list_files()
- ['testfile']
- >>> repo.list_files(['modified'])
- []
- >>> repo.list_files(['modified', 'deleted'])
- []
- >>> repo.list_files(['modified', 'deleted', 'cached'])
- ['testfile']
- >>> shutil.copy(src, dst)
- >>> repo.list_files(['modified'])
- ['testfile']
- >>> repo.add_files(dst)
- >>> repo.commit_staged(msg="foo")
- >>> repo.list_files(['modified'])
- []
- >>> repo.list_files(['foo'])
- Traceback (most recent call last):
- ...
- GitRepositoryError: Unknown type 'foo'
- >>> repo.force_head('HEAD^', hard=True)
- >>> repo.list_files(['modified'])
- []
- >>> shutil.copy(src, dst)
- >>> repo.list_files(['modified'])
- ['testfile']
- >>> repo.commit_files(dst, msg="foo")
- >>> repo.list_files(['modified'])
- []
- """
-
-def test_get_commits():
- """
- Test listing commits
-
- Methods tested:
- - L{gbp.git.GitRepository.get_commits}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> commits = repo.get_commits()
- >>> type(commits) == list and len(commits) == 2
- True
- >>> len(repo.get_commits(num=1)) == 1
- True
- >>> commits2 = repo.get_commits(since='HEAD~1')
- >>> len(commits2) == 1
- True
- >>> commits2[0] == commits[0]
- True
- >>> commits2 = repo.get_commits(until='HEAD~1')
- >>> len(commits2) == 1
- True
- >>> commits2[0] == commits[-1]
- True
- >>> repo.get_commits(paths=['foo', 'bar'])
- []
- >>> repo.get_commits(paths=['testfile']) == commits
- True
- """
-
-
-def test_get_commit_info():
- """
- Test inspecting commits
-
- Methods tested:
- - L{gbp.git.GitRepository.get_commit_info}
-
- >>> import gbp.git
- >>> from datetime import datetime
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> info = repo.get_commit_info('HEAD')
- >>> info['id']
- 'HEAD'
- >>> info['body']
- ''
- >>> info['subject']
- 'foo'
- >>> '@' in info['author'].email
- True
- >>> '@' in info['committer'].email
- True
- >>> now = datetime.now()
- >>> (now - datetime.fromtimestamp(int(info['author'].date.split()[0]))).seconds < 10
- True
- >>> (now - datetime.fromtimestamp(int(info['committer'].date.split()[0]))).seconds < 10
- True
- >>> info['patchname']
- 'foo'
- >>> info['files']
- defaultdict(<type 'list'>, {'M': ['testfile']})
- >>> repo.get_subject('HEAD')
- 'foo'
- """
-
-def test_diff():
- """
- Test git-diff
-
- Methods tested:
- - L{gbp.git.GitRepository.diff}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> len(repo.diff('HEAD~1', 'HEAD')) > 3
- True
- >>> len(repo.diff('HEAD~1', 'HEAD', 'testfile')) > 3
- True
- >>> len(repo.diff('HEAD~1', 'HEAD', 'testfile', text=True)) > 3
- True
- >>> len(repo.diff('HEAD~1', 'HEAD', 'filenotexist')) == 0
- True
- """
-
-def test_diff_status():
- """
- Methods tested:
- - L{gbp.git.GitRepository.diff_status}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.diff_status("HEAD", "HEAD")
- defaultdict(<type 'list'>, {})
- >>> repo.diff_status("HEAD~1", "HEAD")
- defaultdict(<type 'list'>, {'M': ['testfile']})
- """
-
-def test_mirror_clone():
- """
- Mirror a repository
-
- Methods tested:
- - L{gbp.git.GitRepository.clone}
- - L{gbp.git.GitRepository.is_empty}
- - L{gbp.git.GitRepository.set_branch}
- - L{gbp.git.GitRepository.has_branch}
- - L{gbp.git.GitRepository.branch}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.set_branch('master')
- >>> mirror = gbp.git.GitRepository.clone(mirror_clone_dir, repo.path, mirror=True)
- >>> mirror.is_empty()
- False
- >>> mirror.branch
- 'master'
- >>> mirror.has_branch('foo')
- True
- >>> mirror.has_branch('bar')
- False
- >>> mirror.set_branch('foo')
- >>> mirror.branch
- 'foo'
- >>> mirror.force_head('foo^')
- """
-
-def test_clone():
- """
- Clone a repository
-
- Methods tested:
- - L{gbp.git.GitRepository.clone}
- - L{gbp.git.GitRepository.is_empty}
- - L{gbp.git.GitRepository.set_branch}
- - L{gbp.git.GitRepository.branch}
- - L{gbp.git.GitRepository.get_merge_branch}
- - L{gbp.git.GitRepository.get_remote_branches}
- - L{gbp.git.GitRepository.get_local_branches}
- - L{gbp.git.GitRepository.get_remote_repos}
- - L{gbp.git.GitRepository.has_remote_repo}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.set_branch('master')
- >>> clone = gbp.git.GitRepository.clone(clone_dir, repo.path)
- >>> clone.is_empty()
- False
- >>> clone.branch
- 'master'
- >>> clone.get_remote_branches()
- ['origin/HEAD', 'origin/foo', 'origin/master']
- >>> clone.get_local_branches()
- ['master']
- >>> clone.get_merge_branch('master')
- 'origin/master'
- >>> clone.create_branch('foo', 'origin/foo')
- >>> clone.get_merge_branch('foo')
- 'origin/foo'
- >>> clone.create_branch('bar')
- >>> clone.get_merge_branch('bar') # None if no merge branch exists
- >>> clone.get_local_branches()
- ['bar', 'foo', 'master']
- >>> remotes = clone.get_remote_repos()
- >>> {'origin': [repo_dir, repo_dir]} == remotes
- True
- >>> clone.has_remote_repo('origin')
- True
- >>> clone.has_branch('origin/master', remote=True)
- True
- >>> clone.has_remote_repo('godiug')
- False
- """
-
-def test_get_remotes():
- """
- Merge a branch
-
- Methods tested:
- - L{gbp.git.GitRepository.get_remotes}
-
- >>> import os
- >>> import gbp.git.repository
- >>> repo = gbp.git.repository.GitRepository(os.path.join(clone_dir, 'repo'))
- >>> remotes = repo.get_remotes()
- >>> len(remotes)
- 1
- >>> origin = remotes['origin']
- >>> origin.name
- 'origin'
- >>> origin.fetch_url == repo_dir
- True
- >>> origin.push_urls == [repo_dir]
- True
- """
-
-def test_merge():
- """
- Merge a branch
-
- Methods tested:
- - L{gbp.git.GitRepository.merge}
- - L{gbp.git.GitRepository.set_branch}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.set_branch('master')
- >>> repo.merge('foo')
- """
-
-def test_pull():
- """
- Pull from a remote repository
-
- Methods tested:
- - L{gbp.git.GitRepository.set_branch}
- - L{gbp.git.GitRepository.pull}
-
- >>> import gbp.git, os
- >>> d = os.path.join(clone_dir, 'repo')
- >>> clone = gbp.git.GitRepository(d)
- >>> clone.set_branch('master')
- >>> clone.pull()
- >>> clone.pull(all_remotes=True)
- >>> clone.pull('origin', all_remotes=True)
- """
-
-def test_fetch():
- """
- Fetch from a remote repository
-
- Methods tested:
- - L{gbp.git.GitRepository.fetch}
- - L{gbp.git.GitRepository.push}
- - L{gbp.git.GitRepository.push_tag}
- - L{gbp.git.GitRepository.add_remote_repo}
- - L{gbp.git.GitRepository.remove_remote_repo}
-
- >>> import gbp.git, os
- >>> d = os.path.join(clone_dir, 'repo')
- >>> clone = gbp.git.GitRepository(d)
- >>> clone.fetch()
- >>> clone.push()
- >>> clone.push('origin')
- >>> clone.push('origin', 'master')
- >>> clone.push('origin', 'master', force=True)
- >>> clone.create_tag('tag3')
- >>> clone.push_tag('origin', 'tag3')
- >>> clone.create_tag('tag4')
- >>> clone.push('origin', 'master', tags=True)
- >>> clone.add_remote_repo('foo', repo_dir)
- >>> clone.fetch('foo')
- >>> clone.fetch('foo', tags=True)
- >>> clone.fetch('foo', refspec='refs/heads/master')
- >>> clone.fetch(all_remotes=True)
- >>> clone.remove_remote_repo('foo')
- """
-
-def test_create_bare():
- """
- Create a bare repository
-
- Methods tested:
- - L{gbp.git.GitRepository.create}
- - L{gbp.git.GitRepository.is_empty}
-
- >>> import gbp.git
- >>> bare = gbp.git.GitRepository.create(bare_dir, bare=True, description="msg")
- >>> bare.path == bare_dir
- True
- >>> bare.git_dir == bare_dir
- True
- >>> type(bare) == gbp.git.GitRepository
- True
- >>> bare.is_empty()
- True
- >>> bare.is_clean()
- (True, '')
- """
-
-def test_nonexistant():
- """
- Check that accessing a non existant repository fails.
-
- Methods tested:
- - L{gbp.git.GitRepository.__init__}
-
- >>> import gbp.git
- >>> bare = gbp.git.GitRepository("/does/not/exist")
- Traceback (most recent call last):
- ...
- GitRepositoryError: No Git repository at '/does/not/exist' (or any parent dir)
- """
-
-def test_create_noperm():
- """
- Check that creating a repository at a path that isn't writeable fails
-
- Methods tested:
- - L{gbp.git.GitRepository.create}
-
- >>> import gbp.git
- >>> gbp.git.GitRepository.create("/does/not/exist")
- Traceback (most recent call last):
- ...
- GitRepositoryError: Cannot create Git repository at '/does/not/exist': Permission denied
- """
-
-def test_checkout():
- """
- Checkout treeishs
-
- Methods tested:
- - L{gbp.git.GitRepository.checkout}
- - L{gbp.git.GitRepository.get_branch}
- - L{gbp.git.GitRepository.set_branch}
- - L{gbp.git.GitRepository.rev_parse}
-
- Properties tested:
- - L{gbp.git.GitRepository.branch}
- - L{gbp.git.GitRepository.tags}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.checkout('master')
- >>> repo.branch
- 'master'
- >>> repo.rev_parse('doesnotexist')
- Traceback (most recent call last):
- ...
- GitRepositoryError: revision 'doesnotexist' not found
- >>> sha1 = repo.rev_parse('master', short=10)
- >>> len(sha1)
- 10
- >>> sha1 = repo.rev_parse('master')
- >>> len(sha1)
- 40
- >>> repo.checkout(sha1)
- >>> repo.branch
- >>> repo.get_branch()
- Traceback (most recent call last):
- ...
- GitRepositoryError: Currently not on a branch
- >>> tag = repo.tags[0]
- >>> repo.checkout(tag)
- >>> repo.branch
- """
-
-def test_gc():
- """
- Test garbace collection
-
- Methods tested:
- - L{gbp.git.GitRepository.collect_garbage}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.collect_garbage()
- """
-
-def test_grep_log():
- """
- Test grepping through commit messages
-
- Methods tested:
- - L{gbp.git.GitRepository.grep_log}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.set_branch('master')
- >>> len(repo.grep_log('foo')) == 2
- True
- >>> len(repo.grep_log('foo', 'master')) == 2
- True
- >>> repo.grep_log('blafasel')
- []
- >>> repo.grep_log('foo', 'doesnotexist')
- Traceback (most recent call last):
- ...
- GitRepositoryError: Error grepping log for foo: fatal: bad revision 'doesnotexist'
- """
-
-def test_is_ff():
- """
- Test if branch is fast forwardable
-
- Methods tested:
- - L{gbp.git.GitRepository.is_fast_forward}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.is_fast_forward('master', 'foo')
- (True, True)
- >>> repo.create_branch('ff', 'HEAD^')
- >>> repo.is_fast_forward('ff', 'master')
- (True, False)
- >>> repo.is_fast_forward('master', 'ff')
- (False, True)
- """
-
-def test_update_ref():
- """
- Test updating a reference
-
- Methods tested:
- - L{gbp.git.GitRepository.update_ref}
-
- >>> import gbp.git, os
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.update_ref('new_ref', 'master', msg='update')
- >>> os.path.exists(os.path.join(repo.git_dir, 'new_ref'))
- True
- """
-
-
-def test_make_tree():
- """
- Test git-mk-tree
-
- Methods tested:
- - L{gbp.git.GitRepository.write_file}
- - L{gbp.git.GitRepository.list_tree}
- - L{gbp.git.GitRepository.make_tree}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> sha1 = repo.write_file('testfile')
- >>> sha1
- '19af7398c894bc5e86e17259317e4db519e9241f'
- >>> head = repo.list_tree('HEAD')
- >>> head
- [['100644', 'blob', '19af7398c894bc5e86e17259317e4db519e9241f', 'testfile']]
- >>> head.append(['100644', 'blob', '19af7398c894bc5e86e17259317e4db519e9241f', 'testfile2'])
- >>> newtree = repo.make_tree(head)
- >>> newtree
- '745951810c9e22fcc6de9b23f05efd6ab5512123'
- >>> repo.list_tree(newtree, recurse=False, paths='testfile')
- [['100644', 'blob', '19af7398c894bc5e86e17259317e4db519e9241f', 'testfile']]
- """
-
-
-def test_update_submodules():
- """
- Updating submodules if we don't have any is a noop
-
- Methods tested:
- - L{gbp.git.GitRepository.has_submodules}
- - L{gbp.git.GitRepository.update_submodules}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo.has_submodules()
- False
- >>> repo.update_submodules()
- """
-
-def test_get_merge_base():
- """
- Find the common ancestor of two objects
-
- Methods tested:
- - L{gbp.git.GitRepository.get_merge_base}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> sha1 = repo.get_merge_base('master', 'foo')
- >>> len(sha1)
- 40
- >>> repo.get_merge_base('master', 'doesnotexist')
- Traceback (most recent call last):
- ...
- GitRepositoryError: Failed to get common ancestor: fatal: Not a valid object name doesnotexist
- """
-
-def test_status():
- r"""
- Methods tested:
- - L{gbp.git.GitRepository.status}
-
- >>> import gbp.git, os, shutil
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> fname = os.path.join(repo.path, "test_status")
- >>> shutil.copy(os.path.join(repo.path, ".git/HEAD"), fname)
- >>> list(repo.status().items())
- [('??', ['test_status'])]
- >>> list(repo.status().items())
- []
- >>> list(repo.status().items())
- [('??', ['test_status'])]
- >>> repo.add_files(repo.path, force=True)
- >>> repo.commit_all(msg='added %s' % fname)
- >>> _ = repo._git_inout('mv', [fname, fname + 'new'])
- >>> list(repo.status().items())
- [('R ', ['test_status\x00test_statusnew'])]
- """
-
-def test_cmd_has_feature():
- r"""
- Methods tested:
- - L{gbp.git.GitRepository._cmd_has_feature}
-
- >>> import gbp.git
- >>> repo = gbp.git.GitRepository(repo_dir)
- >>> repo._cmd_has_feature("commit", "a")
- True
- >>> repo._cmd_has_feature("commit", "reuse-message")
- True
- >>> repo._cmd_has_feature("merge", "n")
- True
- >>> repo._cmd_has_feature("merge", "stat")
- True
- >>> repo._cmd_has_feature("format-patch", "cc")
- True
- >>> repo._cmd_has_feature("merge", "foobaroption")
- False
- >>> repo._cmd_has_feature("foobarcmd", "foobaroption")
- Traceback (most recent call last):
- ...
- GitRepositoryError: Invalid git command 'foobarcmd': No manual entry for gitfoobarcmd
- >>> repo._cmd_has_feature("show", "standard-notes")
- True
- >>> repo._cmd_has_feature("show", "no-standard-notes")
- True
- """
-
-def test_teardown():
- """
- Perform the teardown
-
- >>> context.teardown()
- """
-
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-
-"""
-Test L{gbp.git.GitVfs}
-"""
-
-import gbp.log
-
-from . import context
-
-gbp.log.setup(color=False, verbose=True)
-import gbp.git
-
-
-def test_read():
- """
- Create a repository
-
- Methods tested:
- - L{gbp.git.GitVfs.open}
- - L{gbp.git.GitVfs._File.readline}
- - L{gbp.git.GitVfs._File.readlines}
- - L{gbp.git.GitVfs._File.read}
- - L{gbp.git.GitVfs._File.close}
-
- >>> import os, gbp.git.vfs
- >>> repo_dir = context.new_tmpdir(__name__)
- >>> repo = gbp.git.GitRepository.create(str(repo_dir))
- >>> f = open(os.path.join(repo.path, 'foo.txt'), 'w')
- >>> content = 'al pha\\na\\nb\\nc'
- >>> f.write('al pha\\na\\nb\\nc')
- >>> f.close()
- >>> repo.add_files(repo.path, force=True)
- >>> repo.commit_all(msg="foo")
- >>> vfs = gbp.git.vfs.GitVfs(repo, 'HEAD')
- >>> gf = vfs.open('foo.txt')
- >>> gf.readline()
- 'al pha\\n'
- >>> gf.readline()
- 'a\\n'
- >>> gf.readlines()
- ['b\\n', 'c']
- >>> gf.readlines()
- []
- >>> gf.readline()
- ''
- >>> gf.readline()
- ''
- >>> gf.close()
- >>> gbp.git.vfs.GitVfs(repo, 'HEAD').open('foo.txt').read() == content
- True
- >>> gf = vfs.open('doesnotexist')
- Traceback (most recent call last):
- ...
- IOError: can't get HEAD:doesnotexist: fatal: Path 'doesnotexist' does not exist in 'HEAD'
- >>> context.teardown()
- """
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-
-"""
-Test pristine-tar related methods in
-
- - L{gbp.deb.DebianPristineTar}
-
-and
-
- - L{gbp.deb.git.DebianGitRepository}
-
-This testcase creates this reposity:
-
- - A repository at L{repo_dir} called I{repo}
-
-"""
-
-from . import context
-
-import os
-
-repo_dir = context.new_tmpdir(__name__).join('repo')
-test_data = os.path.join(context.projectdir, "tests/test_PristineTar_data")
-
-def test_create():
- """
- Create a repository
-
- Methods tested:
- - L{gbp.deb.git.DebianGitRepository.create}
-
- >>> import os, gbp.deb.git
- >>> repo = gbp.deb.git.DebianGitRepository.create(repo_dir)
- """
-
-def test_empty_repo():
- """
- Empty repos have no branch pristine-tar branch
-
- Methods tested:
- - L{gbp.deb.git.DebianGitRepository.has_pristine_tar_branch}
- - L{gbp.deb.pristinetar.DebianPristineTar.has_commit}
-
- >>> import gbp.deb.git
- >>> repo = gbp.deb.git.DebianGitRepository(repo_dir)
- >>> repo.has_pristine_tar_branch()
- False
- >>> repo.pristine_tar.has_commit('upstream', '1.0', 'gzip')
- False
- """
-
-def test_commit_dir():
- """
- Empty repos have no branch pristine-tar branch
-
- Methods tested:
- - L{gbp.git.repository.GitRepository.commit_dir}
- - L{gbp.git.repository.GitRepository.create_branch}
-
- >>> import gbp.deb.git
- >>> repo = gbp.deb.git.DebianGitRepository(repo_dir)
- >>> commit = repo.commit_dir(test_data, msg="initial commit", branch=None)
- >>> repo.create_branch('upstream')
- """
-
-def test_create_tarball():
- """
- Create a tarball from a git tree
-
- Methods tested:
- - L{gbp.deb.git.DebianGitRepository.archive}
-
- >>> import gbp.deb.git
- >>> repo = gbp.deb.git.DebianGitRepository(repo_dir)
- >>> repo.archive('tar', 'upstream/', '%s/../upstream_1.0.orig.tar' % repo_dir, 'upstream')
- >>> gbp.command_wrappers.Command('gzip', [ '-n', '%s/../upstream_1.0.orig.tar' % repo_dir])()
- """
-
-def test_pristine_tar_commit():
- """
- Commit the delta to the pristine-tar branch
-
- Methods tested:
- - L{gbp.deb.pristinetar.DebianPristineTar.commit}
-
- >>> import gbp.deb.git
- >>> repo = gbp.deb.git.DebianGitRepository(repo_dir)
- >>> repo.pristine_tar.commit('../upstream_1.0.orig.tar.gz', 'upstream')
- """
-
-def test_pristine_has_commit():
- """
- Find delta on the pristine tar branch
-
- Methods tested:
- - L{gbp.deb.pristinetar.DebianPristineTar.has_commit}
- - L{gbp.pkg.pristinetar.PristineTar.get_commit}
-
- >>> import gbp.deb.git
- >>> repo = gbp.deb.git.DebianGitRepository(repo_dir)
- >>> repo.pristine_tar.has_commit('upstream', '1.0', 'bzip2')
- False
- >>> repo.pristine_tar.has_commit('upstream', '1.0', 'gzip')
- True
- >>> repo.pristine_tar.has_commit('upstream', '1.0')
- True
- >>> branch = repo.rev_parse('pristine-tar')
- >>> commit = repo.pristine_tar.get_commit('upstream_1.0.orig.tar.gz')
- >>> branch == commit
- True
- """
-
-def test_pristine_tar_checkout():
- """
- Checkout a tarball using pristine-tar
-
- Methods tested:
- - L{gbp.deb.pristinetar.DebianPristineTar.checkout}
-
- >>> import gbp.deb.git
- >>> repo = gbp.deb.git.DebianGitRepository(repo_dir)
- >>> repo.pristine_tar.checkout('upstream', '1.0', 'gzip', '..')
- """
-
-
-def test_teardown():
- """
- Perform the teardown
-
- >>> context.teardown()
- """
-
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
--- /dev/null
+# vim: set fileencoding=utf-8 :
+"""Test L{gbp.deb.rollbackgit}"""
+
+import os
+
+from . testutils import DebianGitTestRepo
+from gbp.deb.rollbackgit import RollbackDebianGitRepository
+from gbp.git.repository import GitRepositoryError
+
+
+class TestRollbackGitRepository(DebianGitTestRepo):
+
+ def setUp(self):
+ DebianGitTestRepo.setUp(self, RollbackDebianGitRepository)
+
+ def test_empty_rollback(self):
+ self.repo.rollback()
+ self.assertEquals(self.repo.rollback_errors, [])
+
+ def test_rrr_tag(self):
+ self.repo.rrr_tag('doesnotexist')
+ self.assertEquals(self.repo.rollbacks, [('doesnotexist', 'tag', 'delete', None)])
+ self.repo.rollback()
+ self.assertEquals(self.repo.rollback_errors, [])
+
+ def test_rrr_branch(self):
+ self.repo.rrr_branch('doesnotexist', 'delete')
+ self.assertEquals(self.repo.rollbacks, [('doesnotexist', 'branch', 'delete', None)])
+ self.repo.rollback()
+ self.assertEquals(self.repo.rollback_errors, [])
+
+ def test_rrr_merge(self):
+ self.repo.rrr_merge('HEAD')
+ self.assertEquals(self.repo.rollbacks, [('HEAD', 'commit', 'abortmerge', None)])
+ self.repo.rollback()
+ self.assertEquals(self.repo.rollback_errors, [])
+
+ def test_rrr_merge_abort(self):
+ self.repo.rrr_merge('HEAD')
+ self.assertEquals(self.repo.rollbacks, [('HEAD', 'commit', 'abortmerge', None)])
+ # Test that we abort the merge in case MERGE_HEAD exists
+ with open(os.path.join(self.repo.git_dir, 'MERGE_HEAD'), 'w'):
+ pass
+ self.assertTrue(self.repo.is_in_merge())
+ self.repo.rollback()
+ self.assertFalse(self.repo.is_in_merge())
+ self.assertEquals(self.repo.rollback_errors, [])
+
+ def test_rrr_unknown_action(self):
+ with self.assertRaisesRegexp(GitRepositoryError, "Unknown action 'unknown' for tag 'doesnotmatter'"):
+ self.repo.rrr('doesnotmatter', 'unknown', 'tag')
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2013 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Test import-orig functions"""
-from . import context
-
-import glob
-import os
-import tarfile
-import tempfile
-# Try unittest2 for CentOS
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
-
-from gbp.errors import GbpError
-from gbp.pkg import UpstreamSource
-from gbp.scripts.common.import_orig import prepare_sources
-from gbp.scripts.import_orig import find_source
-from tests.testutils import ls_dir, ls_tar
-
-
-class TestImportOrigBase(unittest.TestCase):
- """Base class for handling context"""
- @classmethod
- def setup_class(cls):
- """Class set-up, run only once"""
- cls._tmpdir = str(context.new_tmpdir(__name__))
-
- @classmethod
- def teardown_class(cls):
- """Class teardown, run only once"""
- context.teardown()
-
-
-class TestFindSource(TestImportOrigBase):
- """Test the Debian-specific find_source() function"""
-
- def test_failure(self):
- """Test failure modes"""
- with self.assertRaisesRegex(GbpError,
- "More than one archive specified"):
- find_source(False, ['too', 'much'])
-
- with self.assertRaisesRegex(GbpError,
- "No archive to import specified"):
- find_source(False, [])
-
- with self.assertRaisesRegex(GbpError,
- "you can't pass both --uscan and a filename"):
- find_source(True, ['tarball'])
-
- def test_success(self):
- """Successfully get source archive"""
- tar_fn = 'tarball.tar'
- # Create dummy (empty) tarball
- tarfile.open(tar_fn, 'w' ).close()
- self.assertEqual(os.path.abspath(tar_fn),
- find_source(False, [tar_fn]).path)
-
-
-class TestPrepareSources(TestImportOrigBase):
- """Test the prepare_sources() function"""
- test_pkg_name = 'test'
- test_pkg_ver = '1.0'
-
- @staticmethod
- def _create_test_sources(destdir):
- """Create dummy source archives"""
- destdir = os.path.abspath(destdir)
- origs = {}
-
- # "Normall" gzipped tarball
- archive_fn = os.path.join(destdir, 'test-1.0.tar.gz')
- src_dir = os.path.join(context.projectdir, 'gbp')
- tarobj = tarfile.open(archive_fn, mode='w:gz')
- for fname in (glob.glob('%s/*.py' % src_dir) +
- glob.glob('%s/pkg/*.py' % src_dir)):
- arcname = 'test-1.0/' + os.path.relpath(fname, src_dir)
- tarobj.add(fname, arcname=arcname)
- tarobj.close()
- origs['tar'] = archive_fn
-
- # Unpacked sources
- tarobj = tarfile.open(origs['tar'], 'r')
- tarobj.extractall(destdir)
- tarobj.close()
- origs['dir'] = os.path.join(destdir,'test-1.0')
- return origs
-
- @classmethod
- def setup_class(cls):
- """Class set-up, run only once"""
- super(TestPrepareSources, cls).setup_class()
- # Different source archives
- cls._origs = cls._create_test_sources(cls._tmpdir)
-
- def test_dir(self):
- """Basic test for unpacked sources, no filtering etc"""
- tmpdir = tempfile.mkdtemp(dir=self._tmpdir, prefix='dir_basic_')
- source = UpstreamSource(self._origs['dir'])
- orig, prist = prepare_sources(source, 'test', '1.0', None,
- None, False, None, tmpdir)
- self.assertEqual(ls_dir(self._origs['dir']), ls_dir(orig))
- self.assertEqual(prist, '')
-
- def test_dir_filter(self):
- """Test filtering of unpacked sources"""
- tmpdir = tempfile.mkdtemp(dir=self._tmpdir, prefix='dir_filter_')
- source = UpstreamSource(self._origs['dir'])
- orig, prist = prepare_sources(source, 'test', '1.0', None,
- ['pkg'], False, None, tmpdir)
- orig_filt_ref = set([fname for fname in ls_dir(self._origs['dir'])
- if not fname.startswith('pkg')])
- self.assertEqual(orig_filt_ref, ls_dir(orig))
- self.assertEqual(prist, '')
-
- def test_dir_pristine_nofilter(self):
- """Test filtering of unpacked sources, not filtering pristine-tar"""
- tmpdir = tempfile.mkdtemp(dir=self._tmpdir, prefix='dir_filter2_')
- source = UpstreamSource(self._origs['dir'])
- orig, prist = prepare_sources(source, 'test', '1.0', 'test.tar.gz',
- ['pkg'], False, None, tmpdir)
- src_ls = ls_dir(self._origs['dir'])
- orig_filt_ref = set([fname for fname in src_ls
- if not fname.startswith('pkg')])
- prist_ref = set(['test-1.0/%s' % fname for fname in src_ls] +
- ['test-1.0'])
- self.assertEqual(orig_filt_ref, ls_dir(orig))
- self.assertEqual(prist_ref, ls_tar(prist))
-
- def test_dir_pristine_filter(self):
- """Test filtering pristine-tar and mangling prefix"""
- tmpdir = tempfile.mkdtemp(dir=self._tmpdir, prefix='dir_filter3_')
- source = UpstreamSource(self._origs['dir'])
- orig, prist = prepare_sources(source, 'test', '1.0', 'test.tar.gz',
- ['pkg'], True, 'newpref', tmpdir)
- src_ls = ls_dir(self._origs['dir'])
- orig_filt_ref = set([fname for fname in src_ls
- if not fname.startswith('pkg')])
- prist_ref = set(['newpref/%s' % fname for fname in orig_filt_ref] +
- ['newpref'])
- self.assertEqual(orig_filt_ref, ls_dir(orig))
- self.assertEqual(prist_ref, ls_tar(prist))
-
- def test_tar(self):
- """Basic test for tarball sources, with pristine-tar"""
- tmpdir = tempfile.mkdtemp(dir=self._tmpdir, prefix='tar_basic_')
- source = UpstreamSource(self._origs['tar'])
- orig, prist = prepare_sources(source, 'test', '1.0', 'test.tgz',
- None, False, 'test-1.0', tmpdir)
- src_ls = ls_tar(self._origs['tar'])
- orig_ref = set([fname.replace('test-1.0/', '') for fname in src_ls
- if fname != 'test-1.0'])
- self.assertEqual(orig_ref, ls_dir(orig))
- self.assertEqual(src_ls, ls_tar(prist))
-
- def test_tar_pristine_prefix(self):
- """Test tarball import with prefix mangling"""
- tmpdir = tempfile.mkdtemp(dir=self._tmpdir, prefix='tar_prefix_')
- source = UpstreamSource(self._origs['tar'])
- _orig, prist = prepare_sources(source, 'test', '1.0', 'test.tgz',
- None, False, 'np', tmpdir)
- src_ls = ls_tar(self._origs['tar'])
- prist_ref = set([fname.replace('test-1.0', 'np') for fname in src_ls])
- self.assertEqual(prist_ref, ls_tar(prist))
-
- def test_tar_filter_pristine_prefix(self):
- """Filter tarball, pristine-tar prefix mangling but not filter"""
- tmpdir = tempfile.mkdtemp(dir=self._tmpdir, prefix='tar_filter_')
- source = UpstreamSource(self._origs['tar'])
- orig, prist = prepare_sources(source, 'test', '1.0', 'test.tgz',
- ['pkg'], False, 'newp', tmpdir)
- src_ls = ls_tar(self._origs['tar'])
- orig_ref = set([fname.replace('test-1.0/', '') for fname in src_ls
- if fname != 'test-1.0' and not fname.startswith('test-1.0/pkg')])
- prist_ref = set([fname.replace('test-1.0', 'newp') for fname in src_ls])
- self.assertEqual(orig_ref, ls_dir(orig))
- self.assertEqual(prist_ref, ls_tar(prist))
-
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Test the classes under L{gbp.rpm}"""
-
-import filecmp
-import os
-import shutil
-import tempfile
-from nose.tools import assert_raises, eq_ #pylint: disable=no-name-in-module
-
-from gbp.errors import GbpError
-from gbp.rpm import (SrcRpmFile, SpecFile, parse_srpm, NoSpecError, guess_spec,
- guess_spec_repo, spec_from_repo)
-from gbp.git.repository import GitRepository
-
-DATA_DIR = os.path.abspath(os.path.splitext(__file__)[0] + '_data')
-SRPM_DIR = os.path.join(DATA_DIR, 'srpms')
-SPEC_DIR = os.path.join(DATA_DIR, 'specs')
-
-class SpecFileTester(SpecFile):
- """Helper class for testing"""
-
- def protected(self, name):
- """Get a protected member"""
- return super(SpecFileTester, self).__getattribute__(name)
-
-
-class TestSrcRpmFile(object):
- """Test L{gbp.rpm.SrcRpmFile}"""
-
- def setup(self):
- self.tmpdir = tempfile.mkdtemp(prefix='gbp_%s_' % __name__, dir='.')
-
- def teardown(self):
- shutil.rmtree(self.tmpdir)
-
- def test_srpm(self):
- """Test parsing of a source rpm"""
- srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test-1.0-1.src.rpm'))
- assert srpm.version == {'release': '1', 'upstreamversion': '1.0'}
- assert srpm.name == 'gbp-test'
- assert srpm.upstreamversion == '1.0'
- assert srpm.packager is None
-
- def test_srpm_2(self):
- """Test parsing of another source rpm"""
- srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test2-3.0-0.src.rpm'))
- assert srpm.version == {'release': '0', 'upstreamversion': '3.0',
- 'epoch': '2'}
- assert srpm.packager == 'Markus Lehtonen '\
- '<markus.lehtonen@linux.intel.com>'
-
- def test_unpack_srpm(self):
- """Test unpacking of a source rpm"""
- srpm = SrcRpmFile(os.path.join(SRPM_DIR, 'gbp-test-1.0-1.src.rpm'))
- srpm.unpack(self.tmpdir)
- for fn in ['gbp-test-1.0.tar.bz2', 'foo.txt', 'bar.tar.gz', 'my.patch',
- 'my2.patch', 'my3.patch']:
- assert os.path.exists(os.path.join(self.tmpdir, fn)), \
- "%s not found" % fn
-
-
-class TestSpecFile(object):
- """Test L{gbp.rpm.SpecFile}"""
-
- def setup(self):
- self.tmpdir = tempfile.mkdtemp(prefix='gbp_%s_' % __name__, dir='.')
-
- def teardown(self):
- shutil.rmtree(self.tmpdir)
-
- def test_spec(self):
- """Test parsing of a valid spec file"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test.spec')
- spec = SpecFileTester(spec_filepath)
-
- # Test basic properties
- assert spec.specfile == os.path.basename(spec_filepath)
- assert spec.specdir == os.path.dirname(spec_filepath)
- assert spec.specpath == spec_filepath
-
- assert spec.name == 'gbp-test'
- assert spec.packager is None
-
- assert spec.upstreamversion == '1.0'
- assert spec.release == '1'
- assert spec.epoch is None
- assert spec.version == {'release': '1', 'upstreamversion': '1.0'}
-
- orig = spec.orig_src
- assert orig['filename'] == 'gbp-test-1.0.tar.bz2'
- assert orig['uri'] == 'gbp-test-1.0.tar.bz2'
- assert orig['filename_base'] == 'gbp-test-1.0'
- assert orig['archive_fmt'] == 'tar'
- assert orig['compression'] == 'bzip2'
- assert orig['prefix'] == 'gbp-test/'
-
- def test_spec_2(self):
- """Test parsing of another valid spec file"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test2.spec')
- spec = SpecFile(spec_filepath)
-
- # Test basic properties
- assert spec.name == 'gbp-test2'
- assert spec.packager == 'Markus Lehtonen ' \
- '<markus.lehtonen@linux.intel.com>'
-
- assert spec.epoch == '2'
- assert spec.version == {'release': '0', 'upstreamversion': '3.0',
- 'epoch': '2'}
-
- orig = spec.orig_src
- assert orig['filename'] == 'gbp-test2-3.0.tar.gz'
- assert orig['uri'] == 'ftp://ftp.host.com/gbp-test2-3.0.tar.gz'
- assert orig['archive_fmt'] == 'tar'
- assert orig['compression'] == 'gzip'
- assert orig['prefix'] == ''
-
- def test_spec_3(self):
- """Test parsing of yet another valid spec file"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-native.spec')
- spec = SpecFile(spec_filepath)
-
- # Test basic properties
- assert spec.name == 'gbp-test-native'
- orig = spec.orig_src
- assert orig['filename'] == 'gbp-test-native-1.0.zip'
- assert orig['archive_fmt'] == 'zip'
- assert orig['compression'] == None
- assert orig['prefix'] == 'gbp-test-native-1.0/'
-
- def test_spec_4(self):
- """Test parsing of spec without orig tarball"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-native2.spec')
- spec = SpecFile(spec_filepath)
-
- # Test basic properties
- assert spec.name == 'gbp-test-native2'
- assert spec.orig_src is None
-
- def test_parse_raw(self):
- """Test parsing of a valid spec file"""
- assert_raises(NoSpecError, SpecFile, None, None)
- assert_raises(NoSpecError, SpecFile, 'filename', 'filedata')
-
- """
- with assert_raises(NoSpecError):
- SpecFile(None, None)
- with assert_raises(NoSpecError):
- SpecFile('filename', 'filedata')
- """
-
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test.spec')
- with open(spec_filepath, 'r') as spec_fd:
- spec_data = spec_fd.read()
- spec = SpecFile(filedata=spec_data)
-
- # Test basic properties
- assert spec.specfile == None
- assert spec.specdir == None
- assert spec.name == 'gbp-test'
-
- def test_update_spec(self):
- """Test spec autoupdate functionality"""
- # Create temporary spec file
- tmp_spec = os.path.join(self.tmpdir, 'gbp-test.spec')
- shutil.copy2(os.path.join(SPEC_DIR, 'gbp-test.spec'), tmp_spec)
-
- reference_spec = os.path.join(SPEC_DIR, 'gbp-test-reference.spec')
- spec = SpecFile(tmp_spec)
- spec.update_patches(['new.patch'], {})
- spec.write_spec_file()
- assert filecmp.cmp(tmp_spec, reference_spec) is True
-
- # Test adding the VCS tag and adding changelog
- reference_spec = os.path.join(SPEC_DIR, 'gbp-test-reference2.spec')
- spec.set_tag('VCS', None, 'myvcstag')
- spec.set_changelog("* Wed Feb 05 2014 Name <email> 1\n- New entry\n")
- spec.write_spec_file()
- assert filecmp.cmp(tmp_spec, reference_spec) is True
-
- def test_update_spec2(self):
- """Another test for spec autoupdate functionality"""
- tmp_spec = os.path.join(self.tmpdir, 'gbp-test2.spec')
- shutil.copy2(os.path.join(SPEC_DIR, 'gbp-test2.spec'), tmp_spec)
-
- reference_spec = os.path.join(SPEC_DIR, 'gbp-test2-reference2.spec')
- spec = SpecFile(tmp_spec)
- spec.update_patches(['1.patch', '2.patch'],
- {'1.patch': {'if': 'true'},
- '2.patch': {'ifarch': '%ix86'}})
- spec.set_tag('VCS', None, 'myvcstag')
- spec.write_spec_file()
- assert filecmp.cmp(tmp_spec, reference_spec) is True
-
- # Test updating patches again, removing the VCS tag and re-writing
- # changelog
- reference_spec = os.path.join(SPEC_DIR, 'gbp-test2-reference.spec')
- spec.update_patches(['new.patch'], {'new.patch': {'if': '1'}})
- spec.set_tag('VCS', None, '')
- spec.set_changelog("* Wed Feb 05 2014 Name <email> 2\n- New entry\n\n")
- spec.write_spec_file()
- assert filecmp.cmp(tmp_spec, reference_spec) is True
-
- def test_modifying(self):
- """Test updating/deleting of tags and macros"""
- tmp_spec = os.path.join(self.tmpdir, 'gbp-test.spec')
- shutil.copy2(os.path.join(SPEC_DIR, 'gbp-test-updates.spec'), tmp_spec)
- reference_spec = os.path.join(SPEC_DIR,
- 'gbp-test-updates-reference.spec')
- spec = SpecFileTester(tmp_spec)
-
- # Mangle tags
- prev = spec.protected('_delete_tag')('Vendor', None)
- spec.protected('_set_tag')('License', None, 'new license', prev)
- spec.protected('_delete_tag')('source', 0)
- assert spec.sources() == {}
- spec.protected('_delete_tag')('patch', 0)
- spec.protected('_delete_tag')('patch', -1)
- assert spec.protected('_patches')() == {}
- prev = spec.protected('_delete_tag')('invalidtag', None)
-
- assert_raises(GbpError, spec.protected('_set_tag'),
- 'Version', None, '', prev)
- assert_raises(GbpError, spec.set_tag,
- 'invalidtag', None, 'value')
-
- """
- with assert_raises(GbpError):
- # Check that setting empty value fails
- spec.protected('_set_tag')('Version', None, '', prev)
- with assert_raises(GbpError):
- # Check that setting invalid tag with public method fails
- spec.set_tag('invalidtag', None, 'value')
- """
-
- # Mangle macros
- prev = spec.protected('_delete_special_macro')('patch', -1)
- spec.protected('_delete_special_macro')('patch', 123)
- spec.protected('_set_special_macro')('patch', 0, 'my new args', prev)
- assert_raises(GbpError, spec.protected('_delete_special_macro'),
- 'invalidmacro', 0)
- assert_raises(GbpError, spec.protected('_set_special_macro'),
- 'invalidmacro', 0, 'args', prev)
-
- """
- with assert_raises(GbpError):
- spec.protected('_delete_special_macro')('invalidmacro', 0)
- with assert_raises(GbpError):
- spec.protected('_set_special_macro')('invalidmacro', 0, 'args',
- prev)
- """
-
- # Check resulting spec file
- spec.write_spec_file()
- assert filecmp.cmp(tmp_spec, reference_spec) is True
-
- def test_modifying_err(self):
- """Test error conditions of modification methods"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test2.spec')
- spec = SpecFileTester(spec_filepath)
-
- # Unknown/invalid section name
- assert_raises(GbpError, spec.protected('_set_section'),
- 'patch', 'new content\n')
- """
- with assert_raises(GbpError):
- spec.protected('_set_section')('patch', 'new content\n')
- """
-
- # Multiple sections with the same name
- assert_raises(GbpError, spec.protected('_set_section'),
- 'files', '%{_sysconfdir}/foo\n')
-
- """
- with assert_raises(GbpError):
- spec.protected('_set_section')('files', '%{_sysconfdir}/foo\n')
- """
-
- def test_changelog(self):
- """Test changelog methods"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test2.spec')
- spec = SpecFile(spec_filepath)
-
- # Read changelog
- eq_(spec.get_changelog(),
- "* Tue Feb 04 2014 Name <email> 1\n- My change\n\n\n")
-
- # Set changelog and check again
- new_text = "* Wed Feb 05 2014 Name <email> 2\n- New entry\n\n\n"
- spec.set_changelog(new_text)
- eq_(spec.get_changelog(), new_text)
-
- def test_quirks(self):
- """Test spec that is broken/has anomalities"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-quirks.spec')
- spec = SpecFile(spec_filepath)
-
- # Check that we quess orig source and prefix correctly
- assert spec.orig_src['prefix'] == 'foobar/'
-
- def test_tags(self):
- """Test parsing of all the different tags of spec file"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-tags.spec')
- spec = SpecFileTester(spec_filepath)
-
- # Check all the tags
- for name, val in spec.protected('_tags').items():
- rval = None
- if name in ('version', 'release', 'epoch'):
- rval = '0'
- elif name in ('autoreq', 'autoprov', 'autoreqprov'):
- rval = 'No'
- elif name not in spec.protected('_listtags'):
- rval = 'my_%s' % name
- if rval:
- assert val['value'] == rval, ("'%s:' is '%s', expecting '%s'" %
- (name, val['value'], rval))
- assert spec.ignorepatches == []
- # Check patch numbers and patch filenames
- patches = {}
- for patch in spec.protected('_tags')['patch']['lines']:
- patches[patch['num']] = patch['linevalue']
-
- assert patches == {0: 'my_patch0', -1: 'my_patch'}
-
- def test_patch_series(self):
- """Test the getting the patches as a patchseries"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-native.spec')
- spec = SpecFileTester(spec_filepath)
-
- assert len(spec.patchseries()) == 0
- spec.update_patches(['1.patch', '2.patch', '3.patch'], {})
- assert len(spec.patchseries()) == 3
- spec.protected('_gbp_tags')['ignore-patches'].append({'args': "0"})
- spec.update_patches(['4.patch'], {})
- assert len(spec.patchseries()) == 1
- assert len(spec.patchseries(ignored=True)) == 2
- spec.protected('_delete_special_macro')('patch', 0)
- assert len(spec.patchseries(ignored=True)) == 1
- series = spec.patchseries(unapplied=True, ignored=True)
- assert len(series) == 2
- assert os.path.basename(series[-1].path) == '1.patch'
-
- def test_patch_series_quirks(self):
- """Patches are applied in order different from the patch numbering"""
- spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-quirks.spec')
- spec = SpecFileTester(spec_filepath)
-
- # Check series is returned in the order the patches are applied
- files = [os.path.basename(patch.path) for patch in spec.patchseries()]
- assert files == ['05.patch', '01.patch']
- # Also ignored patches are returned in the correct order
- files = [os.path.basename(patch.path) for patch in
- spec.patchseries(ignored=True)]
- assert files == ['05.patch', '02.patch', '01.patch']
- # Unapplied patches are added to the end of the series
- files = [os.path.basename(patch.path) for patch in
- spec.patchseries(unapplied=True)]
- assert files == ['05.patch', '01.patch', '03.patch']
- # Return all patches (for which tag is found)
- files = [os.path.basename(patch.path) for patch in
- spec.patchseries(unapplied=True, ignored=True)]
- assert files == ['05.patch', '02.patch', '01.patch', '03.patch',
- '04.patch']
-
-
-class TestUtilityFunctions(object):
- """Test utility functions of L{gbp.rpm}"""
- def setup(self):
- self.tmpdir = tempfile.mkdtemp(prefix='gbp_%s_' % __name__, dir='.')
-
- def teardown(self):
- shutil.rmtree(self.tmpdir)
-
- def test_parse_srpm(self):
- """Test parse_srpm() function"""
- parse_srpm(os.path.join(SRPM_DIR, 'gbp-test-1.0-1.src.rpm'))
- assert_raises(GbpError, parse_srpm,
- os.path.join(DATA_DIR, 'notexists.src.rpm'))
-
- """
- with assert_raises(GbpError):
- parse_srpm(os.path.join(DATA_DIR, 'notexists.src.rpm'))
- with assert_raises(GbpError):
- parse_srpm(os.path.join(SPEC_DIR, 'gbp-test.spec'))
- """
-
- def test_guess_spec(self):
- """Test guess_spec() function"""
- # Spec not found
- assert_raises(NoSpecError, guess_spec,
- DATA_DIR, recursive=False)
-
- """
- with assert_raises(NoSpecError):
- guess_spec(DATA_DIR, recursive=False)
- """
-
- # Multiple spec files
- assert_raises(NoSpecError, guess_spec,
- DATA_DIR, recursive=True)
- assert_raises(NoSpecError, guess_spec,
- SPEC_DIR, recursive=False)
-
- """
- with assert_raises(NoSpecError):
- guess_spec(DATA_DIR, recursive=True)
- with assert_raises(NoSpecError):
- guess_spec(SPEC_DIR, recursive=False)
- """
-
- # Spec found
- spec = guess_spec(SPEC_DIR, recursive=False,
- preferred_name = 'gbp-test2.spec')
- assert spec.specfile == 'gbp-test2.spec'
- assert spec.specdir == SPEC_DIR
-
- def test_guess_spec_repo(self):
- """Test guess_spec_repo() and spec_from_repo() functions"""
- # Create dummy repository with some commits
- repo = GitRepository.create(self.tmpdir)
- with open(os.path.join(repo.path, 'foo.txt'), 'w') as fobj:
- fobj.write('bar\n')
- repo.add_files('foo.txt')
- repo.commit_all('Add dummy file')
- os.mkdir(os.path.join(repo.path, 'packaging'))
- shutil.copy(os.path.join(SPEC_DIR, 'gbp-test.spec'),
- os.path.join(repo.path, 'packaging'))
- repo.add_files('packaging/gbp-test.spec')
- repo.commit_all('Add spec file')
-
- # Spec not found
- assert_raises(NoSpecError, guess_spec_repo,
- repo, 'HEAD~1', recursive=True)
- assert_raises(NoSpecError, guess_spec_repo,
- repo, 'HEAD', recursive=False)
-
- """
- with assert_raises(NoSpecError):
- guess_spec_repo(repo, 'HEAD~1', recursive=True)
- with assert_raises(NoSpecError):
- guess_spec_repo(repo, 'HEAD', recursive=False)
- """
-
- # Spec found
- spec = guess_spec_repo(repo, 'HEAD', 'packaging', recursive=False)
- spec = guess_spec_repo(repo, 'HEAD', recursive=True)
- assert spec.specfile == 'gbp-test.spec'
- assert spec.specdir == 'packaging'
- assert spec.specpath == 'packaging/gbp-test.spec'
-
- # Test spec_from_repo()
- assert_raises(NoSpecError, spec_from_repo,
- repo, 'HEAD~1', 'packaging/gbp-test.spec')
-
- """
- with assert_raises(NoSpecError):
- spec_from_repo(repo, 'HEAD~1', 'packaging/gbp-test.spec')
- """
-
- spec = spec_from_repo(repo, 'HEAD', 'packaging/gbp-test.spec')
- assert spec.specfile == 'gbp-test.spec'
-
-# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-#
-# (C) 2014 Intel Corporation <markus.lehtonen@linux.intel.com>
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-"""Test RPM changelog classes and parsing"""
-
-from datetime import datetime
-from nose.tools import assert_raises, eq_, ok_ # pylint: disable=E0611
-from tempfile import NamedTemporaryFile
-
-from gbp.rpm.changelog import _ChangelogHeader, _ChangelogEntry
-from gbp.rpm.changelog import _ChangelogSection, Changelog
-from gbp.rpm.changelog import ChangelogParser, ChangelogError
-from gbp.rpm.policy import RpmPkgPolicy
-
-
-class TestChangelogHeader(object):
- """Test the _ChangelogHeader class"""
-
- def test_str_format(self):
- """Basic test for header"""
- time = datetime(2014, 1, 29, 12, 13, 14)
- header = _ChangelogHeader(RpmPkgPolicy, time, name="John Doe",
- email="user@host.com", revision="1")
- eq_(str(header), "* Wed Jan 29 2014 John Doe <user@host.com> 1\n")
-
- def test_str_format_err(self):
- """Test missing properties"""
- time = datetime(2014, 1, 29, 12, 13, 14)
- header = _ChangelogHeader(RpmPkgPolicy, time, name="John", revision="1")
- assert_raises(ChangelogError, str, header)
-
- """
- with assert_raises(ChangelogError):
- str(header)
- """
-
- def test_container(self):
- """Test the container methods of the class"""
- header = _ChangelogHeader(RpmPkgPolicy, datetime(2014, 1, 1), name="N",
- revision="1")
- # Test __getitem__()
- eq_(header['name'], "N")
- eq_(header['email'], None)
- # Test __contains__()
- ok_('name' in header)
- ok_('foo' not in header)
-
-
-class TestChangelogEntry(object):
- """Test the _ChangelogEntry class"""
-
- def test_str_format(self):
- """Basic test"""
- entry = _ChangelogEntry(RpmPkgPolicy, author="John Doe",
- text="- foo\n bar")
- eq_(str(entry), "- foo\n bar\n")
-
-
-class TestChangelogSection(object):
- """Test the _ChangelogSection class"""
-
- def setup(self):
- """Initialize test"""
- time = datetime(2014, 1, 29, 12, 13, 14)
- self.default_sect = _ChangelogSection(RpmPkgPolicy, time, name="J. D.",
- email="u@h", revision="1")
- entry = _ChangelogEntry(RpmPkgPolicy, "J. D.", "- my change")
- self.default_sect.entries = [entry]
-
- def test_str_format(self):
- """Basic test"""
- section = self.default_sect
- eq_(str(section), "* Wed Jan 29 2014 J. D. <u@h> 1\n- my change\n\n")
-
- def test_append_entry(self):
- """Test add_entry() method"""
- section = self.default_sect
- entry = _ChangelogEntry(RpmPkgPolicy, author="",
- text="- another\n change")
- new_entry = section.append_entry(entry)
- eq_(str(section), "* Wed Jan 29 2014 J. D. <u@h> 1\n- my change\n"
- "- another\n change\n\n")
- eq_(new_entry, section.entries[-1])
-
-
- def test_set_header(self):
- """Test set_header() method"""
- section = self.default_sect
- time = datetime(2014, 1, 30)
- section.set_header(time=time, name="Jane", email="u@h", revision="1.1")
- eq_(str(section), "* Thu Jan 30 2014 Jane <u@h> 1.1\n- my change\n\n")
-
-class TestChangelogParser(object):
- """Test the default changelog parser"""
-
- cl_default_style = """\
-* Wed Jan 29 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
-- Version bump
-- Drop foo.patch
-
-* Tue Jan 28 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.2
-- Update to 0.2
-
-* Mon Jan 27 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.1
-- Initial version
-"""
- cl_with_authors = """\
-* Wed Jan 29 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
-[Markus Lehtonen]
-- Version bump
-[John Doe]
-- Bug fix
-"""
- # Invalid timestamp / name
- cl_broken_header_1 = """\
-* Wed Jan 29 2014Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
-- Version bump
-"""
- # Whitespace before the asterisk in the header
- cl_broken_header_2 = """\
- * Wed Jan 29 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
-- Version bump
-"""
- # Invalid timestamp
- cl_broken_header_3 = """\
-* Wed Jan 32 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
-- Version bump
-"""
- # Missing email
- cl_broken_header_4 = """\
-* Wed Jan 29 2014 Markus Lehtonen 0.3-1
-- Version bump
-"""
- # Garbage before section header
- cl_broken_header_5 = """\
----garbage---
-* Wed Jan 29 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> 0.3-1
-- Version bump
-"""
-
- parser = ChangelogParser(RpmPkgPolicy)
-
- def test_parse_changelog(self):
- """Basic tests for successful parsing"""
- # Raw parsing of changelog
- changelog = self.parser.raw_parse_string(self.cl_default_style)
- eq_(len(changelog.sections), 3)
-
- # Check that re-creating the changelog doesn't mangle it
- eq_(str(changelog), self.cl_default_style)
-
- # Parse and check section
- section = self.parser.parse_section(changelog.sections[0])
-
- eq_(section.header['time'], datetime(2014, 1, 29))
- eq_(section.header['name'], "Markus Lehtonen")
- eq_(section.header['email'], "markus.lehtonen@linux.intel.com")
- eq_(section.header['revision'], "0.3-1")
-
- # Check that re-creating section doesn't mangle it
- eq_(str(section), changelog.sections[0])
-
- def test_parse_authors(self):
- """Test parsing of authors from changelog entries"""
- section = self.parser.parse_section(self.cl_with_authors)
- eq_(section.entries[0].author, "Markus Lehtonen")
- eq_(section.entries[1].author, "John Doe")
-
- def test_parse_changelog_file(self):
- """Basic tests for parsing a file"""
- # Create file and parse it
- tmpfile = NamedTemporaryFile()
- tmpfile.write(self.cl_default_style)
- tmpfile.file.flush()
- changelog = self.parser.raw_parse_file(tmpfile.name)
- # Check parsing results
- eq_(len(changelog.sections), 3)
- eq_(str(changelog), self.cl_default_style)
- # Cleanup
- tmpfile.close()
-
- def test_parse_section_fail(self):
- """Basic tests for failures of changelog section parsing"""
- assert_raises(ChangelogError, self.parser.parse_section,
- self.cl_broken_header_1)
- assert_raises(ChangelogError, self.parser.parse_section,
- self.cl_broken_header_2)
- assert_raises(ChangelogError, self.parser.parse_section,
- self.cl_broken_header_3)
- assert_raises(ChangelogError, self.parser.parse_section,
- self.cl_broken_header_4)
-
- """
- with assert_raises(ChangelogError):
- self.parser.parse_section(self.cl_broken_header_1)
-
- with assert_raises(ChangelogError):
- self.parser.parse_section(self.cl_broken_header_2)
-
- with assert_raises(ChangelogError):
- self.parser.parse_section(self.cl_broken_header_3)
-
- with assert_raises(ChangelogError):
- self.parser.parse_section(self.cl_broken_header_4)
- """
-
- def test_parse_changelog_fail(self):
- """Basic tests for changelog parsing failures"""
- assert_raises(ChangelogError, self.parser.raw_parse_string,
- self.cl_broken_header_5)
-
- """
- with assert_raises(ChangelogError):
- self.parser.raw_parse_string(self.cl_broken_header_5)
- """
-
-
-class TestChangelog(object):
- """Unit tests for the Changelog class"""
-
- def basic_test(self):
- """Test basic initialization"""
- changelog = Changelog(RpmPkgPolicy)
- eq_(str(changelog), "")
-
- def test_add_section(self):
- """Test the add_section() method"""
- changelog = Changelog(RpmPkgPolicy)
- time = datetime(2014, 1, 30)
- new_section = changelog.add_section(time=time, name="Jane Doe",
- email="j@doe.com", revision="1.2")
- eq_(str(changelog), "* Thu Jan 30 2014 Jane Doe <j@doe.com> 1.2\n\n")
- eq_(new_section, changelog.sections[0])
+++ /dev/null
-FOO:
-
-file for testing rpm support of git-buildpackage.
+++ /dev/null
-diff --git a/dummy.sh b/dummy.sh
-index 8c33db6..6f04268 100755
---- dummy.sh
-+++ dummy.sh
-@@ -1,3 +1,3 @@
- #!/bin/sh
-
--echo "Hello world"
-+echo "Hello GBP"
+++ /dev/null
-diff --git a/mydir/myfile.txt b/mydir/myfile.txt
-new file mode 100644
-index 0000000..2cdad29
---- /dev/null
-+++ b/mydir/myfile.txt
-@@ -0,0 +1 @@
-+Dummy
+++ /dev/null
-diff --git a/README b/README
-index a1311cb..a59f1b9 100644
---- a/README
-+++ b/README
-@@ -1 +1 @@
--Just for testing git-buildpackage.
-+Just for testing GBP.
+++ /dev/null
-Name: gbp-test-native
-Summary: Test package for git-buildpackage
-Version: 1.0
-Release: 1
-Group: Development/Libraries
-License: GPLv2
-Source1: %{name}-%{version}.zip
-BuildRequires: unzip
-
-%description
-Package for testing the RPM functionality of git-buildpackage.
-Mimics a "native" package
-
-
-%prep
-unzip %{SOURCE1}
-%setup -T -D
-
-
-%build
-make
-
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -R * %{buildroot}/%{_datadir}/%{name}
-
-
-
-%files
-%defattr(-,root,root,-)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}
+++ /dev/null
-Name: gbp-test-native2
-Summary: Test package for git-buildpackage
-Version: 2.0
-Release: 0
-Group: Development/Libraries
-License: GPLv2
-Source: foo.txt
-BuildRequires: unzip
-
-%description
-Package for testing the RPM functionality of git-buildpackage.
-Mimics a "native" package that doesn't have any source tarball.
-
-
-%prep
-# Just create build dir
-%setup -T -c
-cp %{SOURCE0} .
-
-
-%build
-# Nothing to do
-
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -R * %{buildroot}/%{_datadir}/%{name}
-
-
-
-%files
-%defattr(-,root,root,-)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}
+++ /dev/null
-Name: gbp-test
-Summary: Test package for git-buildpackage
-Version: 1.0
-Release: 1
-Group: Development/Libraries
-License: GPLv2
-Source: %{name}-%{version}.tar.bz2
-Source1: foo.txt
-Source20: bar.tar.gz
-# Gbp-Ignore-Patches: 0
-Patch0: my.patch
-Patch10: my2.patch
-Patch20: my3.patch
-
-
-%description
-Package for testing the RPM functionality of git-buildpackage.
-
-
-%prep
-%setup -n %{name} -a 20
-
-%patch0
-%patch10 -p1
-
-
-%build
-make
-
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -R * %{buildroot}/%{_datadir}/%{name}
-install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
-
-
-
-%files
-%defattr(-,root,root,-)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}
+++ /dev/null
-Name: gbp-test2
-Summary: Test package 2 for git-buildpackage
-Epoch: 2
-Version: 3.0
-Release: 0
-Group: Development/Libraries
-License: GPLv2
-Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz
-Source: foo.txt
-Source20: bar.tar.gz
-# Gbp-Ignore-Patches: -1
-Patch: my.patch
-Patch10: my2.patch
-Patch20: my3.patch
-Packager: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-VCS: myoldvcstag
-
-%description
-Package for testing the RPM functionality of git-buildpackage.
-
-%package empty
-Summary: Empty subpackage
-
-%description empty
-Empty subpackage for the %{name} test package.
-
-
-%prep
-%setup -T -n %{name}-%{version} -c -a 10
-
-%patch
-%patch -P 10 -p1
-
-echo "Do things"
-
-# Gbp-Patch-Macros
-
-%build
-make
-
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -R * %{buildroot}/%{_datadir}/%{name}
-install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
-
-
-%changelog
-* Tue Feb 04 2014 Name <email> 1
-- My change
-
-
-%files
-%defattr(-,root,root,-)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}
-
-%files empty
-%defattr(-,root,root,-)
+++ /dev/null
-Name: gbp-test2
-Summary: Test package 2 for git-buildpackage
-Epoch: 2
-Version: 3.0
-Release: 0
-Group: Development/Libraries
-License: GPLv2
-Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz
-Source: foo.txt
-Source20: bar.tar.gz
-# Gbp-Ignore-Patches: 0
-Patch: my.patch
-Patch10: my2.patch
-Patch20: my3.patch
-Packager: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-
-%description
-Package for testing the RPM functionality of git-buildpackage.
-
-
-%prep
-%setup -T -n %{name}-%{version} -c -a 10
-
-%patch
-%patch -P 10 -p1
-
-echo "Do things"
-
-# Gbp-Patch-Macros
-
-%build
-make
-
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -R * %{buildroot}/%{_datadir}/%{name}
-install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
-
-
-
-%files
-%defattr(-,root,root,-)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}
+++ /dev/null
-../rpmbuild/SPECS/gbp-test-native.spec
\ No newline at end of file
+++ /dev/null
-../rpmbuild/SPECS/gbp-test-native2.spec
\ No newline at end of file
+++ /dev/null
-#
-# Spec for testing some quirks of spec parsing
-#
-
-Name: pkg_name
-Summary: Spec for testing some quirks of spec parsing
-Version: 0.1
-Release: 1.2
-License: GPLv2
-Source1: foobar.tar.gz
-# Gbp-Ignore-Patches: 2 4 888
-Patch1: 01.patch
-Patch2: 02.patch
-Patch3: 03.patch
-Patch4: 04.patch
-Patch5: 05.patch
-
-%description
-Spec for testing some quirks of spec parsing. No intended for building an RPM.
-
-%prep
-# We don't have Source0 so rpmbuild would fail, but gbp shouldn't crash
-%setup -q
-
-# Patches are applied out-of-order wrt. numbering
-%patch5
-%patch2
-%patch1
-# Patch 999 does not exist, rpmbuild would fail but GBP should not
-%patch999
+++ /dev/null
-Name: gbp-test
-Summary: Test package for git-buildpackage
-Version: 1.0
-Release: 1
-Group: Development/Libraries
-License: GPLv2
-Source: %{name}-%{version}.tar.bz2
-Source1: foo.txt
-Source20: bar.tar.gz
-# Gbp-Ignore-Patches: 0
-Patch0: my.patch
-# Patches auto-generated by git-buildpackage:
-Patch1: new.patch
-
-
-%description
-Package for testing the RPM functionality of git-buildpackage.
-
-
-%prep
-%setup -n %{name} -a 20
-
-%patch0
-# new.patch
-%patch1 -p1
-
-
-%build
-make
-
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -R * %{buildroot}/%{_datadir}/%{name}
-install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
-
-
-
-%files
-%defattr(-,root,root,-)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}
+++ /dev/null
-Name: gbp-test
-VCS: myvcstag
-Summary: Test package for git-buildpackage
-Version: 1.0
-Release: 1
-Group: Development/Libraries
-License: GPLv2
-Source: %{name}-%{version}.tar.bz2
-Source1: foo.txt
-Source20: bar.tar.gz
-# Gbp-Ignore-Patches: 0
-Patch0: my.patch
-# Patches auto-generated by git-buildpackage:
-Patch1: new.patch
-
-
-%description
-Package for testing the RPM functionality of git-buildpackage.
-
-
-%prep
-%setup -n %{name} -a 20
-
-%patch0
-# new.patch
-%patch1 -p1
-
-
-%build
-make
-
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -R * %{buildroot}/%{_datadir}/%{name}
-install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
-
-
-
-%files
-%defattr(-,root,root,-)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}
-%changelog
-* Wed Feb 05 2014 Name <email> 1
-- New entry
+++ /dev/null
-#
-# Spec file for testing all RPM tags (that we know of
-#
-
-%define suse_release %(test -e /etc/SuSE-release && head -n1 /etc/SuSE-release | cut -d ' ' -f2 | cut --output-delimiter=0 -d. -f1,2 || echo 0)
-%if "%{suse_release}" >= "1201"
-%define test_weak_dep_tags 1
-%endif
-
-%define test_arch_os_tags %(test -n "$GBP_SKIP_ARCH_OS_TAGS" && echo 0 || echo 1)
-
-%define source_fn_base source
-%define patch_fn_base patch
-
-# Gbp-Undefined-Tag: foobar
-
-# Test that we accept different cases
-NAME: my_name
-version: 0
-ReLeasE: 0
-
-# Rest of the tags
-Epoch: 0
-Summary: my_summary
-License: my_license
-Distribution: my_distribution
-Vendor: my_vendor
-Group: my_group
-Packager: my_packager
-Url: my_url
-Vcs: my_vcs
-Source: my_source
-Patch: my_%patch_fn_base
-Patch0: my_%{patch_fn_base}0
-Nosource: 0
-Nopatch: 0
-#Icon: my_icon
-BuildRoot: my_buildroot
-Provides: my_provides
-Requires: my_requires
-Conflicts: my_conflicts
-Obsoletes: my_obsoletes
-BuildConflicts: my_buildconflicts
-BuildRequires: my_buildrequires
-AutoReqProv: No
-AutoReq: No
-AutoProv: No
-DistTag: my_disttag
-BugUrl: my_bugurl
-Collections: my_collections
-
-%if 0%{?test_weak_dep_tags}
-Recommends: my_recommends
-Suggests: my_suggests
-Supplements: my_supplements
-Enhances: my_enhances
-BuildRecommends:my_buildrecommends
-BuildSuggests: my_buildsuggests
-BuildSupplements:my_buildsupplements
-BuildEnhances: my_buildenhances
-%endif
-
-# These should be filtered out by GBP
-%if "%{test_arch_os_tags}" != "0"
-BuildArch: my_buildarch
-ExcludeArch: my_excludearch
-ExclusiveArch: my_exclusivearch
-ExcludeOs: my_excludeos
-ExclusiveOs: my_exclusiveos
-%endif
-
-%description
-Package for testing GBP.
-
+++ /dev/null
-#
-# Spec file for testing deleting/adding/updating tags and macros
-#
-
-# Gbp-Undefined-Tag: foobar
-
-# Test that we accept different cases
-Name: my_name
-Version: 0
-Release: 1
-Summary: my_summary
-License: new license
-Distribution: my_distribution
-Group: my_group
-Packager: my_packager
-Url: my_url
-Vcs: my_vcs
-Nosource: 0
-Nopatch: 0
-BuildRoot: my_buildroot
-Provides: my_provides
-Requires: my_requires
-Conflicts: my_conflicts
-Obsoletes: my_obsoletes
-BuildConflicts: my_buildconflicts
-BuildRequires: my_buildrequires
-AutoReqProv: No
-AutoReq: No
-AutoProv: No
-DistTag: my_disttag
-BugUrl: my_bugurl
-Collections: my_collections
-
-%description
-Package for testing GBP.
-
-%prep
-%setup -n my_prefix
-
-%patch0 my new args
-
-%build
-
-%install
+++ /dev/null
-#
-# Spec file for testing deleting/adding/updating tags and macros
-#
-
-# Gbp-Undefined-Tag: foobar
-
-# Test that we accept different cases
-Name: my_name
-Version: 0
-Release: 1
-Summary: my_summary
-License: my_license
-Distribution: my_distribution
-Vendor: my_vendor
-Group: my_group
-Packager: my_packager
-Url: my_url
-Vcs: my_vcs
-Source: my_source
-Patch: my_%patch_fn_base
-Patch0: my_%{patch_fn_base}0
-Nosource: 0
-Nopatch: 0
-BuildRoot: my_buildroot
-Provides: my_provides
-Requires: my_requires
-Conflicts: my_conflicts
-Obsoletes: my_obsoletes
-BuildConflicts: my_buildconflicts
-BuildRequires: my_buildrequires
-AutoReqProv: No
-AutoReq: No
-AutoProv: No
-DistTag: my_disttag
-BugUrl: my_bugurl
-Collections: my_collections
-
-%description
-Package for testing GBP.
-
-%prep
-%setup -n my_prefix
-
-%patch -b my_patch
-%patch -P0 -b my_patch0
-
-%build
-
-%install
+++ /dev/null
-../rpmbuild/SPECS/gbp-test.spec
\ No newline at end of file
+++ /dev/null
-Name: gbp-test2
-Summary: Test package 2 for git-buildpackage
-Epoch: 2
-Version: 3.0
-Release: 0
-Group: Development/Libraries
-License: GPLv2
-Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz
-Source: foo.txt
-Source20: bar.tar.gz
-# Gbp-Ignore-Patches: -1
-Patch: my.patch
-# Patches auto-generated by git-buildpackage:
-Patch0: new.patch
-Packager: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-
-%description
-Package for testing the RPM functionality of git-buildpackage.
-
-%package empty
-Summary: Empty subpackage
-
-%description empty
-Empty subpackage for the %{name} test package.
-
-
-%prep
-%setup -T -n %{name}-%{version} -c -a 10
-
-%patch
-
-echo "Do things"
-
-# Gbp-Patch-Macros
-# new.patch
-%if 1
-%patch0 -p1
-%endif
-
-%build
-make
-
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -R * %{buildroot}/%{_datadir}/%{name}
-install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
-
-
-%changelog
-* Wed Feb 05 2014 Name <email> 2
-- New entry
-
-%files
-%defattr(-,root,root,-)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}
-
-%files empty
-%defattr(-,root,root,-)
+++ /dev/null
-Name: gbp-test2
-Summary: Test package 2 for git-buildpackage
-Epoch: 2
-Version: 3.0
-Release: 0
-Group: Development/Libraries
-License: GPLv2
-Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz
-Source: foo.txt
-Source20: bar.tar.gz
-# Gbp-Ignore-Patches: -1
-Patch: my.patch
-# Patches auto-generated by git-buildpackage:
-Patch0: 1.patch
-Patch1: 2.patch
-Packager: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-VCS: myvcstag
-
-%description
-Package for testing the RPM functionality of git-buildpackage.
-
-%package empty
-Summary: Empty subpackage
-
-%description empty
-Empty subpackage for the %{name} test package.
-
-
-%prep
-%setup -T -n %{name}-%{version} -c -a 10
-
-%patch
-
-echo "Do things"
-
-# Gbp-Patch-Macros
-# 1.patch
-%if true
-%patch0 -p1
-%endif
-# 2.patch
-%ifarch %ix86
-%patch1 -p1
-%endif
-
-%build
-make
-
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{_datadir}/%{name}
-cp -R * %{buildroot}/%{_datadir}/%{name}
-install %{SOURCE0} %{buildroot}/%{_datadir}/%{name}
-
-
-%changelog
-* Tue Feb 04 2014 Name <email> 1
-- My change
-
-
-%files
-%defattr(-,root,root,-)
-%dir %{_datadir}/%{name}
-%{_datadir}/%{name}
-
-%files empty
-%defattr(-,root,root,-)
+++ /dev/null
-../rpmbuild/SPECS/gbp-test2.spec
\ No newline at end of file
+++ /dev/null
-# vim: set fileencoding=utf-8 :
-
-from . import context
-
-import os
-import shutil
-import subprocess
-import tarfile
-import tempfile
-# Try unittest2 for CentOS
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
-import zipfile
-
-import gbp.log
-import gbp.deb.git
-import gbp.errors
-from gbp.deb.changelog import ChangeLog
-
-class DebianGitTestRepo(unittest.TestCase):
- """Scratch repo for a single unit test"""
-
- def setUp(self):
- self.tmpdir = context.new_tmpdir(__name__)
-
- repodir = self.tmpdir.join('test_repo')
- self.repo = gbp.deb.git.DebianGitRepository.create(repodir)
-
- def tearDown(self):
- context.teardown()
-
- def add_file(self, name, content=None, msg=None):
- """
- Add a single file with name I{name} and content I{content}. If
- I{content} is C{none} the content of the file is undefined.
-
- @param name: the file's path relativ to the git repo
- @type name: C{str}
- @param content: the file's content
- @type content: C{str}
- """
- path = os.path.join(self.repo.path, name)
-
- d = os.path.dirname(path)
- if not os.path.exists(d):
- os.makedirs(d)
-
- with open(path, 'w+') as f:
- content == None or f.write(content)
- self.repo.add_files(name, force=True)
- self.repo.commit_files(path, msg or "added %s" % name)
-
-class OsReleaseFile(object):
- """Repesents a simple file with key-value pairs"""
-
- def __init__(self, filename):
- self._values = {}
-
- try:
- with open(filename, 'r') as filed:
- for line in filed.readlines():
- try:
- key, value = line.split('=', 1)
- except ValueError:
- pass
- else:
- self._values[key] = value.strip()
- except IOError as err:
- gbp.log.info('Failed to read OS release file %s: %s' %
- (filename, err))
-
- def __getitem__(self, key):
- if key in self._values:
- return self._values[key]
- return None
-
- def __contains__(self, key):
- return key in self._values
-
- def __str__(self):
- return str(self._values)
-
- def __repr__(self):
- return repr(self._values)
-
-class MockedChangeLog(ChangeLog):
- contents = """foo (%s) experimental; urgency=low
-
- %s
-
- -- Debian Maintainer <maint@debian.org> Sat, 01 Jan 2012 00:00:00 +0100"""
-
- def __init__(self, version, changes = "a important change"):
- ChangeLog.__init__(self,
- contents=self.contents % (version, changes))
-
-
-def get_dch_default_urgency():
- """Determine the default urgency level used by dch"""
- urgency = 'medium'
- tempdir = tempfile.mkdtemp()
- tmp_dch_name = os.path.join(tempdir, 'changelog')
- try:
- dch_cmd = ['dch', '--create', '--empty', '--changelog', tmp_dch_name,
- '--package=foo', '--newversion=1',
- '--distribution=UNRELEASED']
- ret = subprocess.Popen(dch_cmd).wait()
- except OSError:
- pass
- else:
- if ret == 0:
- with open(tmp_dch_name) as dchfile:
- header = dchfile.readline().strip()
- urgency = header.split()[-1].replace('urgency=', '')
- finally:
- if os.path.isdir(tempdir):
- shutil.rmtree(tempdir)
- return urgency
-
-def ls_dir(directory, directories=True):
- """List the contents of directory, recurse to subdirectories"""
- contents = set()
- for root, dirs, files in os.walk(directory):
- prefix = ''
- if root != directory:
- prefix = os.path.relpath(root, directory) + '/'
- contents.update(['%s%s' % (prefix, fname) for fname in files])
- if directories:
- contents.update(['%s%s' % (prefix, dname) for dname in dirs])
- return contents
-
-def ls_tar(tarball, directories=True):
- """List the contents of tar archive"""
- tmpdir = tempfile.mkdtemp()
- try:
- tarobj = tarfile.open(tarball, 'r')
- tarobj.extractall(tmpdir)
- return ls_dir(tmpdir, directories)
- finally:
- shutil.rmtree(tmpdir)
-
-def ls_zip(archive, directories=True):
- """List the contents of zip file"""
- tmpdir = tempfile.mkdtemp()
- try:
- zipobj = zipfile.ZipFile(archive, 'r')
- zipobj.extractall(tmpdir)
- return ls_dir(tmpdir, directories)
- finally:
- shutil.rmtree(tmpdir)
-
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+from .. import context # noqa: F401
+
+import os
+import shutil
+import subprocess
+import tarfile
+import tempfile
+import unittest
+import zipfile
+
+import gbp.log
+import gbp.errors
+from gbp.deb.changelog import ChangeLog
+
+from . gbplogtester import GbpLogTester
+from . debiangittestrepo import DebianGitTestRepo
+from . capture import capture_stdout, capture_stderr
+from . popen import patch_popen
+
+__all__ = ['GbpLogTester', 'DebianGitTestRepo', 'OsReleaseFile',
+ 'MockedChangeLog', 'get_dch_default_urgency',
+ 'capture_stderr', 'capture_stdout',
+ 'ls_dir', 'ls_tar', 'ls_zip',
+ 'patch_popen', 'have_cmd', 'skip_without_cmd']
+
+
+class OsReleaseFile(object):
+ """Repesents a simple file with key-value pairs"""
+
+ def __init__(self, filename="/etc/os-release"):
+ self._values = {}
+
+ try:
+ with open(filename, 'r') as filed:
+ for line in filed.readlines():
+ try:
+ key, value = line.split('=', 1)
+ except ValueError:
+ pass
+ else:
+ self._values[key] = value.strip()
+ except IOError as err:
+ gbp.log.info('Failed to read OS release file %s: %s' %
+ (filename, err))
+
+ def __getitem__(self, key):
+ if key in self._values:
+ return self._values[key]
+ return None
+
+ def __contains__(self, key):
+ return key in self._values
+
+ def __str__(self):
+ return str(self._values)
+
+ def __repr__(self):
+ return repr(self._values)
+
+
+class MockedChangeLog(ChangeLog):
+ contents = """foo (%s) experimental; urgency=low
+
+ %s
+
+ -- Debian Maintainer <maint@debian.org> Sat, 01 Jan 2012 00:00:00 +0100"""
+
+ def __init__(self, version, changes="a important change"):
+ ChangeLog.__init__(self,
+ contents=self.contents % (version, changes))
+
+
+def get_dch_default_urgency():
+ """Determine the default urgency level used by dch"""
+ urgency = 'medium'
+ tempdir = tempfile.mkdtemp()
+ tmp_dch_name = os.path.join(tempdir, 'changelog')
+ try:
+ dch_cmd = ['debchange', '--create', '--empty', '--changelog', tmp_dch_name,
+ '--package=foo', '--newversion=1',
+ '--distribution=UNRELEASED']
+ ret = subprocess.Popen(dch_cmd).wait()
+ except OSError:
+ pass
+ else:
+ if ret == 0:
+ with open(tmp_dch_name, encoding='utf-8') as dchfile:
+ header = dchfile.readline().strip()
+ urgency = header.split()[-1].replace('urgency=', '')
+ finally:
+ if os.path.isdir(tempdir):
+ shutil.rmtree(tempdir)
+ return urgency
+
+
+def ls_dir(directory, directories=True):
+ """List the contents of directory, recurse to subdirectories"""
+ contents = set()
+ for root, dirs, files in os.walk(directory):
+ prefix = ''
+ if root != directory:
+ prefix = os.path.relpath(root, directory) + '/'
+ contents.update(['%s%s' % (prefix, fname) for fname in files])
+ if directories:
+ contents.update(['%s%s' % (prefix, dname) for dname in dirs])
+ return contents
+
+
+def ls_tar(tarball, directories=True):
+ """List the contents of tar archive"""
+ tmpdir = tempfile.mkdtemp()
+ try:
+ tarobj = tarfile.open(tarball, 'r')
+ tarobj.extractall(tmpdir)
+ return ls_dir(tmpdir, directories)
+ finally:
+ shutil.rmtree(tmpdir)
+
+
+def ls_zip(archive, directories=True):
+ """List the contents of zip file"""
+ tmpdir = tempfile.mkdtemp()
+ try:
+ zipobj = zipfile.ZipFile(archive, 'r')
+ zipobj.extractall(tmpdir)
+ return ls_dir(tmpdir, directories)
+ finally:
+ shutil.rmtree(tmpdir)
+
+
+def have_cmd(cmd):
+ """Check if a command is available"""
+ return True if shutil.which(cmd) else False
+
+
+def skip_without_cmd(cmd):
+ """Skip if a command is not available"""
+ if have_cmd(cmd):
+ return lambda func: func
+ else:
+ return unittest.skip("Command '%s' not found" % cmd)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+import sys
+from contextlib import contextmanager
+from io import StringIO
+
+
+class _StderrCapture(StringIO):
+ def save(self):
+ self.safed = sys.stderr
+ sys.stderr = self
+
+ def restore(self):
+ if self.safed is not None:
+ sys.stderr = self.safed
+ self.safed = None
+
+ def output(self):
+ self.seek(0)
+ return self.read()
+
+
+class _StdoutCapture(StringIO):
+ def save(self):
+ self.safed = sys.stdout
+ sys.stdout = self
+
+ def restore(self):
+ if self.safed is not None:
+ sys.stdout = self.safed
+ self.safed = None
+
+ def output(self):
+ self.seek(0)
+ return self.read()
+
+
+@contextmanager
+def capture_stderr():
+ """Capture an output and return its content"""
+ c = _StderrCapture()
+ c.save()
+ yield c
+ c.restore()
+
+
+@contextmanager
+def capture_stdout():
+ """Capture an output and return its content"""
+ c = _StdoutCapture()
+ c.save()
+ yield c
+ c.restore()
--- /dev/null
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2016 Guido Günther <agx@sigxcpu.org>
+# 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, please see
+# <http://www.gnu.org/licenses/>
+
+from functools import wraps
+
+import unittest
+
+
+class TestCaseWithData(unittest.TestCase):
+ @staticmethod
+ def feed(data):
+ def wrapper(fn):
+ @wraps(fn)
+ def feed_item(self, *args):
+ for d in data:
+ try:
+ fn(self, *((d,) + args))
+ except self.failureException as e:
+ raise self.failureException(e.message + " with data %s" % repr(d))
+ return feed_item
+ return wrapper
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+from .. import context
+
+import os
+import unittest
+
+import gbp.deb.git
+
+
+class DebianGitTestRepo(unittest.TestCase):
+ """Scratch repo for a single unit test"""
+
+ def setUp(self, repo_cls=None):
+ name = 'test_repo'
+ self.tmpdir = context.new_tmpdir(__name__)
+
+ if repo_cls is None:
+ repo_cls = gbp.deb.git.DebianGitRepository
+
+ repodir = self.tmpdir.join(name)
+ self.repodir = os.path.join(str(self.tmpdir), name)
+ self.repo = repo_cls.create(repodir)
+
+ def tearDown(self):
+ context.teardown()
+
+ def add_file(self, name, content=None, msg=None, mode=None):
+ """
+ Add a single file with name I{name} and content I{content}. If
+ I{content} is C{none} the content of the file is undefined.
+
+ @param name: the file's path relativ to the git repo
+ @type name: C{str}
+ @param content: the file's content
+ @type content: C{str}
+ """
+ path = os.path.join(self.repo.path, name)
+
+ d = os.path.dirname(path)
+ if not os.path.exists(d):
+ os.makedirs(d)
+
+ with open(path, mode or 'w+') as f:
+ content is None or f.write(content)
+ self.repo.add_files(name, force=True)
+ self.repo.commit_files(path, msg or "added %s" % name)
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+import re
+from io import StringIO
+from nose.tools import ok_, assert_less
+
+import gbp.log
+
+
+class GbpLogTester(object):
+ """
+ Helper class for tests that need to capture logging output
+ """
+ def __init__(self):
+ """Object initialization"""
+ # Warnings and Errors
+ self._log = None
+ self._loghandler = None
+ # Info and Debug messages
+ self._log_info = None
+ self._loghandler_info = None
+
+ def _capture_log(self, capture=True):
+ """ Capture log"""
+ if capture:
+ assert self._log is None, "Log capture already started"
+
+ handlers = list(gbp.log.LOGGER.handlers)
+ for hdl in handlers:
+ gbp.log.LOGGER.removeHandler(hdl)
+
+ self._log = StringIO()
+ self._loghandler = gbp.log.GbpStreamHandler(self._log, False)
+ self._loghandler.addFilter(gbp.log.GbpFilter([gbp.log.WARNING,
+ gbp.log.ERROR]))
+
+ self._log_info = StringIO()
+ self._loghandler_info = gbp.log.GbpStreamHandler(self._log_info, False)
+ self._loghandler_info.addFilter(gbp.log.GbpFilter([gbp.log.DEBUG,
+ gbp.log.INFO]))
+ gbp.log.LOGGER.addHandler(self._loghandler)
+ gbp.log.LOGGER.addHandler(self._loghandler_info)
+ else:
+ assert self._log is not None, "Log capture not started"
+ gbp.log.LOGGER.removeHandler(self._loghandler)
+ self._loghandler.close()
+ self._log.close()
+ self._loghandler = self._log = None
+
+ gbp.log.LOGGER.removeHandler(self._loghandler_info)
+ self._loghandler_info.close()
+ self._log_info.close()
+ self._loghandler_info = self._log_info = None
+
+ def _get_log(self):
+ """Get the captured log output"""
+ self._log.seek(0)
+ return self._log.readlines()
+
+ def _get_log_info(self):
+ self._log_info.seek(0)
+ return self._log_info.readlines()
+
+ def _check_log_empty(self):
+ """Check that nothig was logged"""
+ output = self._get_log()
+ ok_(output == [], "Log is not empty: %s" % output)
+
+ def _check_log(self, linenum, regex):
+ """Check that the specified line on log matches expectations"""
+ if self._log is None:
+ raise Exception("BUG in unittests: no log captured!")
+ log = self._get_log()
+ assert_less(linenum, len(log),
+ "Not enough log lines: %d" % len(log))
+ output = self._get_log()[linenum].strip()
+ ok_(re.match(regex, output),
+ "Log entry '%s' doesn't match '%s'" % (output, regex))
+
+ def _check_in_log(self, regex):
+ """Check that at least one line in log matches expectations"""
+ found = False
+ if self._log is None:
+ raise Exception("BUG in unittests: no log captured!")
+ log = self._get_log()
+ for line in log:
+ if re.match(regex, line):
+ found = True
+ break
+ ok_(found, "No line of %s matched '%s'" % (log, regex))
+
+ def _check_in_info_log(self, regex):
+ """Check that at least one line in info log matches expectations"""
+ found = False
+ if self._log_info is None:
+ raise Exception("BUG in unittests: no log captured!")
+ log = self._get_log_info()
+ for line in log:
+ if re.match(regex, line):
+ found = True
+ break
+ ok_(found, "No line of %s matched '%s'" % (log, regex))
+
+ def _clear_log(self):
+ """Clear the mock strerr"""
+ if self._log is not None:
+ self._log.seek(0)
+ self._log.truncate()
--- /dev/null
+# vim: set fileencoding=utf-8 :
+
+import functools
+import mock
+
+
+def patch_popen(stdout=b'', stderr=b'', returncode=1):
+ """Decorator to easily set the return value of popen.communicate()"""
+ def patch_popen_decorator(func):
+ @functools.wraps(func)
+ def wrap(self):
+ with mock.patch('subprocess.Popen') as create_mock:
+ popen_mock = mock.Mock(**{'returncode': returncode,
+ 'communicate.return_value': (stdout, stderr)})
+ create_mock.return_value = popen_mock
+ return func(self, create_mock)
+ return wrap
+ return patch_popen_decorator
--- /dev/null
+[tox]
+envlist = pep8, py27
+skipsdist = True
+
+[testenv]
+whitelist_externals =
+ find
+install_command = pip install {opts} {packages}
+deps = -r{toxinidir}/requirements.txt
+sitepackages = True
+commands =
+ find . -type f -name "*.pyc" -delete
+
+[testenv:pep8]
+deps = hacking
+commands =
+ find . -type f -name "*.pyc" -delete
+ flake8 {posargs}
+
+[testenv:py27]
+commands =
+ find . -type f -name "*.pyc" -delete
+ python setup.py nosetests --verbosity=3 --with-xcoverage {posargs}