Update the debian files to build gbp 0.9.29.
authorwanchao-xu <wanchao.xu@samsung.com>
Fri, 29 Mar 2024 02:40:07 +0000 (10:40 +0800)
committerwanchao-xu <wanchao.xu@samsung.com>
Fri, 29 Mar 2024 02:40:07 +0000 (10:40 +0800)
Change-Id: I407ec1f15222955c7963ffb6d6031e762e4d6f03
Signed-off-by: wanchao-xu <wanchao.xu@samsung.com>
34 files changed:
debian/NEWS
debian/clean [new file with mode: 0644]
debian/compat [deleted file]
debian/control [changed mode: 0755->0644]
debian/copyright
debian/gbp.completion [new file with mode: 0644]
debian/gbp.conf [new file with mode: 0644]
debian/git-buildpackage-bb.install [deleted file]
debian/git-buildpackage-common.doc-base [deleted file]
debian/git-buildpackage-common.docs [deleted file]
debian/git-buildpackage-common.examples [deleted file]
debian/git-buildpackage-common.install [deleted file]
debian/git-buildpackage-common.links [deleted file]
debian/git-buildpackage-common.manpages [deleted file]
debian/git-buildpackage-rpm.install
debian/git-buildpackage-rpm.manpages [new file with mode: 0644]
debian/git-buildpackage.bash-completion
debian/git-buildpackage.doc-base [new file with mode: 0644]
debian/git-buildpackage.docs [new file with mode: 0644]
debian/git-buildpackage.examples [new file with mode: 0644]
debian/git-buildpackage.install
debian/git-buildpackage.links [new file with mode: 0644]
debian/git-buildpackage.manpages
debian/git-buildpackage.zsh-completion [deleted file]
debian/links [deleted file]
debian/not-installed
debian/pk4/gbp [new file with mode: 0755]
debian/rules
debian/salsa-ci.yml [new file with mode: 0644]
debian/source/format
debian/source/options [deleted file]
debian/tests/control [new file with mode: 0644]
debian/tests/smoke-rpm [new file with mode: 0755]
debian/zsh/_gbp [new file with mode: 0644]

index 519498924d2afdfc0b4a847ff5b229e99547bc45..304944a37be82926674ca1e491a19d2c53045100 100644 (file)
@@ -1,3 +1,19 @@
+git-buildpackage (0.8.14) experimental; urgency=medium
+
+  gbp import-orig's --merge-mode option now defaults to 'auto' selecting
+  'replace' for 3.0 (quilt) packages and 'merge' otherwise. If you want to
+  retain the old behaviour of 'merge' please do so in gbp.conf.
+
+ -- Guido Günther <agx@sigxcpu.org>  Tue, 04 Apr 2017 07:20:04 +0200
+
+git-buildpackage (0.6.26) unstable; urgency=medium
+
+  All gbp-* and git-* commands are now gone as announced in the
+  deprecation notice from June 2013. From now on only "gbp <command>" is
+  supported.
+
+ -- Guido Günther <agx@sigxcpu.org>  Mon, 27 Apr 2015 21:55:23 +0200
+
 git-buildpackage (0.6.9) unstable; urgency=medium
 
   This version changes the default of the cleaner options from 'debuild clean'
@@ -22,7 +38,7 @@ git-buildpackage (0.6.0) unstable; urgency=low
 
 git-buildpackage (0.4.61) unstable; urgency=low
 
-  In order to not override dpkg-buildpackge's defaults for 3.0 source packages
+  In order to not override dpkg-buildpackage'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.
diff --git a/debian/clean b/debian/clean
new file mode 100644 (file)
index 0000000..026cf3b
--- /dev/null
@@ -0,0 +1,5 @@
+build/
+coverage.xml
+gbp.egg-info/
+gbp/version.py
+nosetests.xml
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index ec63514..0000000
+++ /dev/null
@@ -1 +0,0 @@
-9
old mode 100755 (executable)
new mode 100644 (file)
index b068b91..cb94eb5
@@ -3,31 +3,49 @@ Section: vcs
 Priority: optional
 Maintainer: Guido Günther <agx@sigxcpu.org>
 Build-Depends:
- bash-completion,
+ bash-completion (>= 1:2.1-4.2~),
+ debhelper-compat (= 13),
  dh-python,
- debhelper (>= 9~),
- docbook-utils,
+ dh-sequence-bash-completion,
+ dh-sequence-python3,
+ docbook2x,
+ flake8,
  gtk-doc-tools,
openjade,
libdistro-info-perl,
  perl,
+ pydoctor,
  python3,
- python-epydoc | pydoctor | python-pydoctor,
+ python3-coverage,
+ python3-dateutil,
+ python3-filelock,
+ python3-mock,
  python3-nose,
+ python3-nosexcover,
  python3-pkg-resources,
+ python3-rpm,
  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
+ python3-yaml,
+ xsltproc,
+# For the testsuite
+ bzip2 <!nocheck>,
+ cpio <!nocheck>,
+ devscripts (>= 2.17.7~) <!nocheck>,
+ git (>= 1:1.7.9.1-1~) <!nocheck>,
+ pristine-tar (>= 1.14) <!nocheck>,
+ rpm (>= 4.16.1) <!nocheck>,
+ unzip <!nocheck>,
+ zipmerge <!nocheck>,
+# For the network tests
+ curl <!nocheck>,
+ python3-requests <!nocheck>,
+Standards-Version: 4.4.0
+Vcs-Git: https://git.sigxcpu.org/cgit/git-buildpackage/
+Vcs-Browser: https://git.sigxcpu.org/cgit/git-buildpackage/
 Homepage: https://honk.sigxcpu.org/piki/projects/git-buildpackage/
-X-Python3-Version: >= 3.5
-
+Rules-Requires-Root: no
+X-Python3-Version: >= 3.7
 
-Package: git-buildpackage-common
+Package: git-buildpackage
 Architecture: all
 Depends: ${python3:Depends},
  ${shlibs:Depends},
@@ -35,62 +53,49 @@ Depends: ${python3: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
+ python3-pkg-resources,
+ python3-yaml,
+ sensible-utils,
+Recommends: pristine-tar (>= 1.41),
+ cowbuilder | pbuilder | sbuild,
+ python3-requests
+Breaks: dgit (<< 9.16~)
+Suggests: python3-notify2, unzip, sudo
 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
+  * gbp buildpackage: build a package out of a Git repository, check for local
     modifications and tag appropriately
+  * gbp import-orig: import a new upstream version into the Git repository
+  * gbp export-orig: export an upstream tarball from the Git repository
+  * gbp import-{dsc,dscs}: import existing Debian source packages into a Git
+    repository
   * 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
+  * gbp push: push content to remote repositories
+  * gbp tag: tag a Debian package in Git
+  * gbp pristine-tar: create pristine-tar commits
+  * gbp setup-gitattributes: set up Git attributes to disable transformations
 
 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
+ cpio,
+ git-buildpackage (= ${binary:Version}),
+ python3-rpm (>= 4.16.1),
+ rpm (>= 4.16.1),
+Recommends: pristine-tar (>= 0.5)
+Suggests: python3-notify, unzip, zipmerge, mock
+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
+  * gbp buildpackage-rpm: build a package out of a Git repository, check for
+    local modifications and tag appropriately
+  * gbp 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
+  * gbp pq-rpm: manage patches easily
+ .
+ These tools are currently in an experimental state. Branch names and
+ repository layouts might change without lots of prior warning.
index 32a20193efdbc362bd38d958ae21493df52ed1ce..d7fd7ce85c90a34a9ce52cf355aa53608508e038 100644 (file)
@@ -1,30 +1,24 @@
-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.
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+
+Files: *
+Copyright:
+ 2006-2022 Guido Günther <agx@sigxcpu.org>
+License: GPL-2
+ 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
+
+Files: bin/git-pbuilder
+Copyright:
+ 2014-2016 Russ Allbery <rra@stanford.edu>
+ 2008-2013 The Board of Trustees of the Leland Stanford Junior University
+License: expat-variant
+ 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.
diff --git a/debian/gbp.completion b/debian/gbp.completion
new file mode 100644 (file)
index 0000000..37e85ea
--- /dev/null
@@ -0,0 +1,189 @@
+# -*- shell-script -*-
+#
+# Bash tab auto-completion rules for git-buildpackage.
+#
+# Copyright (C) 2010  Siegfried-Angel Gevatter Pujals <siegfried@gevatter.com>
+# Copyright (C) 2010,2013,2015  Guido Günther <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_remote_configs ()
+{
+    GBP_DISABLE_GBP_CONF_DEPRECATION=true \
+    GBP_DISABLE_SECTION_DEPRECATION=true \
+        gbp create-remote-repo list | sed -ne 's/^ \+\([a-z]\+\)/\1/p'
+}
+
+
+_gbp_options ()
+{
+    GBP_DISABLE_GBP_CONF_DEPRECATION=true \
+    GBP_DISABLE_SECTION_DEPRECATION=true \
+        gbp "${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:-"--debian-branch\= --upstream-branch\= --upstream-tree\="}
+    local tag_opts=${3:-"--debian-tag\= --upstream-tag\= --upstream-vcs-tag\="}
+    local tristate_opts=${4:-"--color\="}
+    local cbdist_opts=${5:-"--git-dist\="}
+    local remote_config_opts="--remote-config\="
+    local file_opts="--postimport\= --git-builder\= --git-cleaner\= \
+                     --git-export-dir\= --git-postbuild\= --git-postexport\= \
+                     --git-posttag\= --git-prebuild\= --git-preexport\= --git-tarball-dir\= \
+                     --posttag\= --tarball-dir\="
+    local start_opt=""
+
+# 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
+        start_opt=1
+        cur=""
+    fi
+
+    if [[ ${prev} == --* ]]; then
+      if [[ "${branch_opts}" == *$prev* && "${prev}" == --* ]]; then
+          local refs=$(_gbp_branches)
+          COMPREPLY=( $(compgen -W "$refs" -- $cur ) )
+          return 0
+      fi
+
+      if [[ "${tag_opts}" == *$prev* && "${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
+
+      if [[ "${remote_config_opts}" == *$prev* ]]; then
+          local remote_configs=$(_gbp_remote_configs)
+          COMPREPLY=( $(compgen -W "$remote_configs" -- $cur ) )
+          return 0
+      fi
+
+      if [[ "${file_opts}" == *$prev* ]]; then
+          COMPREPLY=( $(compgen -f -- $cur ) )
+          return 0
+      fi
+    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'
+    if [ -n "$start_opt" ]; then
+        COMPREPLY=""  # we don't have any good suggestions
+    else
+        COMPREPLY=($(compgen -W "$tab_opts" -- $cur))
+    fi
+}
+
+# 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
+}
+
+_gbp-buildpackage()
+{
+    local options=$(_gbp_options 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\="
+
+    _gbp_comp "$options" "$branch_opts" "$tag_opts" "$tristate_opts" \
+              "$cbdist_opts"
+}
+
+
+_gbp-pq ()
+{
+    local options=$(_gbp_options pq)
+    options="$options export import rebase drop apply switch"
+    _gbp_comp "$options"
+}
+
+
+_gbp-create-remote-repo ()
+{
+    local options=$(_gbp_options create-remote-repo)
+    options="$options list"
+    _gbp_comp "$options"
+}
+
+
+_gbp-generic-cmd()
+{
+    local options=$(_gbp_options "${1}")
+    _gbp_comp "$options"
+}
+
+
+_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
+        if type _gbp-"${command}" >& /dev/null; then
+            _gbp-"${command}"
+        else
+            _gbp-generic-cmd "${command}"
+        fi
+    fi
+} && complete -F _gbp -o default gbp
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644 (file)
index 0000000..ef14e41
--- /dev/null
@@ -0,0 +1,6 @@
+[DEFAULT]
+debian-branch = master
+
+[dch]
+id-length = 7
+postedit = sed -i s"!^Version:.*!Version:    $GBP_DEBIAN_VERSION!" packaging/git-buildpackage.spec
diff --git a/debian/git-buildpackage-bb.install b/debian/git-buildpackage-bb.install
deleted file mode 100644 (file)
index c76b64b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/python*/dist-packages/gbp/bb/
-usr/lib/python*/dist-packages/gbp/scripts/*bb*.py*
diff --git a/debian/git-buildpackage-common.doc-base b/debian/git-buildpackage-common.doc-base
deleted file mode 100644 (file)
index b377b27..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-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
diff --git a/debian/git-buildpackage-common.docs b/debian/git-buildpackage-common.docs
deleted file mode 100644 (file)
index 7fdec51..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-README
-docs/manual-html/
diff --git a/debian/git-buildpackage-common.examples b/debian/git-buildpackage-common.examples
deleted file mode 100644 (file)
index e39721e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-examples/*
diff --git a/debian/git-buildpackage-common.install b/debian/git-buildpackage-common.install
deleted file mode 100644 (file)
index 5283d54..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-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
diff --git a/debian/git-buildpackage-common.links b/debian/git-buildpackage-common.links
deleted file mode 100644 (file)
index e74ac0b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/usr/share/doc/git-buildpackage-common/manual-html/gbp.html /usr/share/doc/git-buildpackage-common/manual-html/index.html
diff --git a/debian/git-buildpackage-common.manpages b/debian/git-buildpackage-common.manpages
deleted file mode 100644 (file)
index 3280f63..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-docs/gbp.1
-docs/gbp-clone.1
-docs/gbp-config.1
-docs/gbp-pull.1
-docs/*.5
index 8c49491e2a1a18df29116d6f6ffe503ebce2e75d..f79d4f172330ac001392dab920c20459971e6fa8 100644 (file)
@@ -1,3 +1,6 @@
-usr/bin/*rpm*
-usr/lib/python*/dist-packages/gbp/rpm/*.py*
-usr/lib/python*/dist-packages/gbp/scripts/*rpm*.py*
+usr/bin/gbp-builder-mock /usr/share/git-buildpackage/
+usr/lib/python3.*/dist-packages/gbp/rpm usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*//dist-packages/gbp/scripts/import_srpm.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/pq_rpm.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/buildpackage_rpm.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/rpm_ch.py usr/lib/python3/dist-packages/gbp/scripts/
diff --git a/debian/git-buildpackage-rpm.manpages b/debian/git-buildpackage-rpm.manpages
new file mode 100644 (file)
index 0000000..183ab2f
--- /dev/null
@@ -0,0 +1,4 @@
+docs/gbp-import-srpm.1
+docs/gbp-pq-rpm.1
+docs/gbp-buildpackage-rpm.1
+docs/gbp-rpm-ch.1
index 053b93328cf41f3982c6c6888999950408c48c34..f87e558b921b0afddf3c1b2ddbea2f8376503b52 100644 (file)
@@ -1,228 +1 @@
-# -*- 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
+debian/gbp.completion gbp
diff --git a/debian/git-buildpackage.doc-base b/debian/git-buildpackage.doc-base
new file mode 100644 (file)
index 0000000..e24e821
--- /dev/null
@@ -0,0 +1,11 @@
+Document: git-buildpackage
+Title: Git-Buildpackage Manual
+Author: Guido Günther
+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/manual-html/index.html
+Files: /usr/share/doc/git-buildpackage/manual-html/*.html
diff --git a/debian/git-buildpackage.docs b/debian/git-buildpackage.docs
new file mode 100644 (file)
index 0000000..00356a6
--- /dev/null
@@ -0,0 +1,3 @@
+README.md
+docs/manual-html/
+build/apidocs/
diff --git a/debian/git-buildpackage.examples b/debian/git-buildpackage.examples
new file mode 100644 (file)
index 0000000..e39721e
--- /dev/null
@@ -0,0 +1 @@
+examples/*
index 7a276d7ef115763941b5f4b75a481cd0dcc462ff..956ac8c3c5fcbfcea2e62b237b858933771f6263 100644 (file)
@@ -1,16 +1,41 @@
-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
+debian/zsh/_gbp                       usr/share/zsh/vendor-completions
+debian/pk4/gbp                        usr/share/pk4/hooks-available/unpack
+usr/bin/gbp
 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*
+usr/lib/python3.*/dist-packages/gbp-* usr/lib/python3/dist-packages/
+usr/lib/python3.*/dist-packages/gbp/command_wrappers.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/config.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/dch.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/deb/ usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/errors.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/format.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/git/ usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/__init__.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/log.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/notifications.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/paths.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/patch_series.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/pkg/ usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/scripts/buildpackage.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/clone.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/common/ usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/config.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/create_remote_repo.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/dch.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/import_dsc.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/import_dscs.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/import_orig.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/import_ref.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/export_orig.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/__init__.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/pq.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/pristine_tar.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/pull.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/push.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/setup_gitattributes.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/supercommand.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/scripts/tag.py usr/lib/python3/dist-packages/gbp/scripts/
+usr/lib/python3.*/dist-packages/gbp/tmpfile.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/tristate.py usr/lib/python3/dist-packages/gbp/
+usr/lib/python3.*/dist-packages/gbp/version.py usr/lib/python3/dist-packages/gbp/
+usr/share/git-buildpackage/gbp.conf etc/git-buildpackage/
diff --git a/debian/git-buildpackage.links b/debian/git-buildpackage.links
new file mode 100644 (file)
index 0000000..1e696e3
--- /dev/null
@@ -0,0 +1,2 @@
+/usr/share/man/man1/gbp.1.gz /usr/share/man/man1/git-buildpackage.1.gz
+/usr/lib/python3/dist-packages/gbp/scripts/supercommand.py /usr/bin/gbp
index fc9374532817d4d274ab1add2ac82fb193621fe9..5f128659df84b371a9ddf28ba74efec962918a06 100644 (file)
@@ -1,8 +1,19 @@
+docs/gbp.1
 docs/gbp-buildpackage.1
+docs/gbp-clone.1
+docs/gbp.conf.5
+docs/gbp-config.1
 docs/gbp-create-remote-repo.1
 docs/gbp-dch.1
+docs/gbp-export-orig.1
 docs/gbp-import-dsc.1
 docs/gbp-import-dscs.1
 docs/gbp-import-orig.1
+docs/gbp-import-ref.1
 docs/gbp-pq.1
+docs/gbp-pristine-tar.1
+docs/gbp-pull.1
+docs/gbp-push.1
+docs/gbp-setup-gitattributes.1
+docs/gbp-tag.1
 docs/git-pbuilder.1
diff --git a/debian/git-buildpackage.zsh-completion b/debian/git-buildpackage.zsh-completion
deleted file mode 100644 (file)
index 3ff1e7e..0000000
+++ /dev/null
@@ -1,488 +0,0 @@
-#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 "$@"
diff --git a/debian/links b/debian/links
deleted file mode 100644 (file)
index 0a561b0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/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
index e5804d047529b1a3a0f8b4b0efee59a481c3f064..0a7a6e0642190fa23091a46c96812bd3e0534c90 100644 (file)
@@ -5,3 +5,4 @@ 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__
+
diff --git a/debian/pk4/gbp b/debian/pk4/gbp
new file mode 100755 (executable)
index 0000000..7f795be
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+
+gbp import-dsc --debian-branch=pk4 --upstream-branch=upstream "$1" "$2"
+# Add local gbp.conf to override any branch settings in 'debian/gbp.conf'
+# (since this checkout wasn't created by "gbp clone"). We want to be sure the
+# branches exist so we can build the package right away.
+cat <<EOF > "$2"/.git/gbp.conf
+[DEFAULT]
+upstream-branch = upstream
+debian-branch = pk4
+EOF
index 0ac72e4871ee3386cf6de275fb7aec7f654da280..a20be4bb714b712fbdce2fda84ef8aeb2c4867e5 100755 (executable)
@@ -1,61 +1,17 @@
 #!/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
+       dh $@ --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
+       make
 
-override_dh_auto_build:
-       dh_auto_build
-       make -C docs
+execute_after_dh_auto_build:
+       make 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
+execute_after_dh_fixperms:
+       chmod a+x debian/git-buildpackage/usr/lib/python3/dist-packages/gbp/scripts/supercommand.py
 
-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/
+execute_after_dh_auto_clean:
        make -C docs/ clean
-       -rm gbp/version.py
-
-override_dh_compress:
-       dh_compress --exclude=usr/share/doc/git-buildpackage/examples/
-
+       find gbp -name __init__.py -printf '%h/__pycache__/\n' | xargs rm -fr
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
new file mode 100644 (file)
index 0000000..768d72e
--- /dev/null
@@ -0,0 +1,9 @@
+---
+include:
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
+
+# Reprotest triggers a test failure not related to reproducibility
+variables:
+  SALSA_CI_DISABLE_REPROTEST: 1
+
index d3827e75a5cadb9fe4a27e1cb9b6d192e7323120..89ae9db8f88b823b6a7eabf55e203658739da122 100644 (file)
@@ -1 +1 @@
-1.0
+3.0 (native)
diff --git a/debian/source/options b/debian/source/options
deleted file mode 100644 (file)
index f259290..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-extend-diff-ignore = "^(tests/test_rpm_data/.*|tests/component/rpm/data/.*|tests/component/deb/data/.*)"
-diff-ignore
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644 (file)
index 0000000..0e94bff
--- /dev/null
@@ -0,0 +1,3 @@
+Tests: smoke-rpm
+Depends: @, @builddeps@
+Restrictions: allow-stderr
diff --git a/debian/tests/smoke-rpm b/debian/tests/smoke-rpm
new file mode 100755 (executable)
index 0000000..b7694d1
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -e
+set -x
+
+cleanup()
+{
+  [ -z "${GBP_TEMPDIR}" ] || rm -rf "${GBP_TEMPDIR}"
+}
+
+trap cleanup EXIT
+
+git init .
+git config user.email "you@example.com"
+git config user.name "Doesnot Matter"
+git add .
+git commit -m"Smoketest" -a
+
+gbp buildpackage-rpm --help
+
+# Build an RPM of ourselfes if build-deps are available
+if python3 -c "import setuptools"; then
+  GBP_TEMPDIR=$(mktemp -d)
+  gbp buildpackage-rpm --git-packaging-dir=packaging/ \
+                       --git-export-dir="$GBP_TEMPDIR" \
+                       -D'%__python3 /usr/bin/python3' \
+                       -D'%__python /usr/bin/python3' \
+                       -D'%python_sitelib %(%{__python3} -Ic "from sysconfig import get_path; print(get_path('"'platlib'"', '"'posix_prefix'"'))")' \
+                       -D'%_arch noarch' \
+                       -bb --nodeps
+fi
diff --git a/debian/zsh/_gbp b/debian/zsh/_gbp
new file mode 100644 (file)
index 0000000..c8bb173
--- /dev/null
@@ -0,0 +1,570 @@
+#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'
+                       'config:Query configuration values'
+                       'create-remote-repo:Create a remote Git repository'
+                       'dch:Generate the debian/changelog from  Git commit history'
+                       'export-orig:Create orig tarballs from git'
+                       'import-dsc:Import a single Debian source package'
+                       'import-dscs:Import multiple Debian source packages'
+                       'import-orig:Import a new upstream tarball'
+                       'import-ref:Update upstream sources when using Git only'
+                       'pq:Manage debian/patches using Git rebase'
+                       'pristine-tar:Manage pristine-tar commits in a git repository'
+                       'pull:Update a Git repository from a remote'
+                       'push:Push Debian packaging changes to a Git remote'
+                       'tag:Tag a Debian packages in a Git repository'
+               )
+
+               _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 uncommitted 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 \
+               '--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]' \
+               '--meta-closes-bugnum=-[What bug number format 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]' \
+               '(--local -l)'{-l,--local}'=-[Increment the release number for a local build]' \
+               '--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 never 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]' \
+               '--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 uncommitted 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 \
+               '--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]' \
+               '--meta-closes-bugnum=-[What bug number format 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 never 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]' \
+               '--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 \
+               '--all[Update all remote-tracking branches that have identical name in the remote]' \
+               '--depth=-[Depth for deepening shallow clones]' \
+               '--force[Update even non fast-forward]' \
+               '--ignore-branch[Dont care if on a detached state]' \
+               '--no-ignore-branch[Negates --ignore-branch]' \
+               '--no-pristine-tar[Negates --pristine-tar]' \
+               '--no-track-missing[Negates --track-missing]' \
+               '--redo-pq[Rebuild the patch queue]' \
+               '--track-missing[Track missing remote branches, default is "False"]'
+}
+
+_gbp-push() {
+       __gbp_common_options
+       __gbp_branch_options
+       __gbp_tag_format_options
+       _arguments \
+               '--dry-run[Dry run, do not push]' \
+               '--ignore-branch[Dont care if on a detached state]' \
+               '--no-ignore-branch[Negates --ignore-branch]'
+}
+
+_gbp-import-ref() {
+       __gbp_common_options
+        __gbp_tag_sign_options
+       _arguments \
+               '--debian-branch=-[The branch the Debian package is being developed on]' \
+               '--keyid=-[Use this keyid for gpg signing tags]' \
+               '--merge-mode=-[How to fold the upstream commits onto the Debian packaging branch]' \
+               '--no-rollback[Do not rollback changes in case of an error]' \
+               '--postimport=-[Run cmd after the import]' \
+               '--rollback[Rollback changes in case of an error]' \
+               '--upstream-branch=-[The branch the upstream sources are put onto]' \
+               '--upstream-tag=-[Format string for upstream tags]' \
+               '--upstream-tree=-[What to merge into the debian-branch]:tree:(BRANCH TAG TREEISH)' \
+               '--upstream-version=-[The upstream version to merge]'
+}
+
+_gbp-export-orig() {
+       __gbp_common_options
+       _arguments \
+               '--component=-[Component name for additional tarballs]' \
+               '--compression=-[Compression type]:compression:(auto gzip bzip2 lzma xz)' \
+               '--compression-level=-[Set compression level]:level:(1 2 3 4 5 6 7 8 9)' \
+               '--force-create[Force creation of orig tarball]' \
+               '--no-pristine-tar[Negates --pristine-tar]' \
+               '--no-submodules[Negates --submodules]' \
+               '--pristine-tar[Use pristine-tar to create orig tarball]' \
+               '--submodules[Transparently handle submodules in the upstream tree]' \
+               '--tarball-dir=-[Location to look for external tarballs]:tarball directory:_files -/' \
+               '--upstream-branch=-[The branch the upstream sources are put onto]' \
+               '--upstream-signatures=-[Use upstream signature]' \
+               '--upstream-tag=-[Format string for upstream tags]' \
+               '--upstream-tree=-[What to merge into the debian-branch]:tree:(BRANCH TAG TREEISH)'
+}
+
+_gbp-pristine-tar() {
+       __gbp_common_options
+       _arguments \
+               '--component=-[Component name for additional tarballs]' \
+               '--upstream-tag=-[Format string for upstream tags]'
+}
+
+_gbp-tag() {
+       __gbp_common_options
+       __gbp_tag_sign_options
+       _arguments \
+               '--debian-branch=-[The branch the Debian package is being developed on]' \
+               "--debian-tag=-[Format string for debian tags]" \
+               "--debian-tag-msg=-[Format string for signed debian-tag messages]" \
+               '--git-no-ignore-branch[Negates --git-ignore-branch]' \
+               '--ignore-branch[Dont care if on a detached state]' \
+               '--ignore-new[Build with uncommitted changes in the source tree]' \
+               '--no-ignore-new[Negates --git-ignore-new]' \
+               '--posttag=-[Hook run after a successful tag operation]:command:' \
+               '--retag[Do not fail if the tag already exists]'
+}
+
+_gbp-config() {
+       __gbp_common_options
+}
+
+_gbp "$@"