From: Ian Jackson Date: Sun, 17 Jun 2018 14:18:55 +0000 (+0100) Subject: git-debrebase: Split into its own package X-Git-Tag: archive/debian/5.0~8 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=93c90551df21fc7df60ade835e29bdbe91f65744 git-debrebase: Split into its own package * Provide and use Debian::Dgit::GDR which does the same for @INC as Debian::Dgit:Infra, only for GDR. It's not *entirely* similar as its doc comment talks about ExitStatus too. * In Makefile, split off lots of GDR_* variables and the two targets install-gdr and installdirs-gdr We take no care that only the required manpages are built for each install target; instead, they all go in MANPAGES and `all'. * Add a control file stanza. git-debrebase takes over the dependenc on libfile-fnmatch-perl. We Recommend dgit and gbp. (Even though if you're working with neither the Debian archive nor `3.0 (quilt)', you need neither.) * In rules, add specpkg_install_gdr, to run the Makefile machinery. * In the test dependencies, GDR now means to ask for git-debrebase and also git-buildpackage (for make-patches). libfile-fnmatch-perl is handled via the dependencies of git-debrebase.deb. * Add a .gitignore for the staging area in debian/ Signed-off-by: Ian Jackson --- diff --git a/.gitignore b/.gitignore index 2a5d032a..e821bb4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *~ tests/tmp debian/dgit +debian/git-debrebase debian/dgit-infrastructure debian/files debian/*.substvars diff --git a/Debian/Dgit/GDR.pm b/Debian/Dgit/GDR.pm new file mode 100644 index 00000000..ca7e621d --- /dev/null +++ b/Debian/Dgit/GDR.pm @@ -0,0 +1,26 @@ +# -*- perl -*- + +package Debian::Dgit::GDR; + +use strict; +use warnings; + +# Scripts and programs which are going to `use Debian::Dgit' but which +# live in git-debrebase (ie are installed with install-gdr) +# should `use Debian::Dgit::GDR' first. All this module does is +# adjust @INC so that the script gets the version of the script from +# the git-debrebase package (which is installed in a different +# location and may be a different version). + +# To use this with ExitStatus, put at the top (before use strict, even): +# +# END { $? = $Debian::Dgit::ExitStatus::desired // -1; }; +# use Debian::Dgit::GDR; +# use Debian::Dgit::ExitStatus; +# +# and then replace every call to `exit' with `finish'. +# Add a `finish 0' to the end of the program. + +# unshift @INC, q{/usr/share/dgit/gdr/perl5}; ###substituted### + +1; diff --git a/Makefile b/Makefile index 21ccc1b7..0073b427 100644 --- a/Makefile +++ b/Makefile @@ -33,11 +33,8 @@ infraexamplesdir=$(prefix)/share/doc/dgit-infrastructure/examples txtdocdir=$(prefix)/share/doc/dgit absurddir=$(prefix)/share/dgit/absurd -PROGRAMS=dgit dgit-badcommit-fixup git-debrebase -MAN1PAGES=dgit.1 \ - git-debrebase.1 - -MAN5PAGES=git-debrebase.5 +PROGRAMS=dgit dgit-badcommit-fixup +MAN1PAGES=dgit.1 MAN7PAGES=dgit.7 \ dgit-user.7 dgit-nmu-simple.7 \ @@ -49,6 +46,14 @@ TXTDOCS=README.dsc-import PERLMODULES=Debian/Dgit.pm Debian/Dgit/ExitStatus.pm ABSURDITIES=git +GDR_PROGRAMS=git-debrebase +GDR_PERLMODULES= \ + Debian/Dgit.pm \ + Debian/Dgit/GDR.pm \ + Debian/Dgit/ExitStatus.pm +GDR_MAN1PAGES=git-debrebase.1 +GDR_MAN5PAGES=git-debrebase.5 + INFRA_PROGRAMS=dgit-repos-server dgit-ssh-dispatch \ dgit-repos-policy-debian dgit-repos-admin-debian \ dgit-repos-policy-trusting dgit-mirror-rsync @@ -58,7 +63,8 @@ INFRA_PERLMODULES= \ Debian/Dgit/Infra.pm \ Debian/Dgit/Policy/Debian.pm -MANPAGES=$(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES) +MANPAGES=$(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES) \ + $(GDR_MAN1PAGES) $(GDR_MAN5PAGES) all: $(MANPAGES) $(addprefix substituted/,$(PROGRAMS)) @@ -73,7 +79,6 @@ install: installdirs all $(INSTALL_PROGRAM) $(addprefix absurd/,$(ABSURDITIES)) \ $(DESTDIR)$(absurddir) $(INSTALL_DATA) $(MAN1PAGES) $(DESTDIR)$(man1dir) - $(INSTALL_DATA) $(MAN5PAGES) $(DESTDIR)$(man5dir) $(INSTALL_DATA) $(MAN7PAGES) $(DESTDIR)$(man7dir) $(INSTALL_DATA) $(TXTDOCS) $(DESTDIR)$(txtdocdir) set -e; for m in $(PERLMODULES); do \ @@ -87,6 +92,14 @@ installdirs: $(DESTDIR)$(txtdocdir) $(DESTDIR)$(absurddir) \ $(addprefix $(DESTDIR)$(perldir)/, $(dir $(PERLMODULES))) +install-gdr: installdirs-gdr + $(INSTALL_PROGRAM) $(GDR_PROGRAMS) $(DESTDIR)$(bindir) + $(INSTALL_DATA) $(GDR_MAN1PAGES) $(DESTDIR)$(man1dir) + $(INSTALL_DATA) $(GDR_MAN5PAGES) $(DESTDIR)$(man5dir) + set -e; for m in $(GDR_PERLMODULES); do \ + $(INSTALL_DATA) $$m $(DESTDIR)$(perldir)/$${m%/*}; \ + done + install-infra: installdirs-infra $(INSTALL_PROGRAM) $(addprefix infra/, $(INFRA_PROGRAMS)) \ $(DESTDIR)$(bindir) @@ -96,6 +109,11 @@ install-infra: installdirs-infra $(INSTALL_DATA) $$m $(DESTDIR)$(perldir)/$${m%/*}; \ done +installdirs-gdr: + $(INSTALL_DIR) $(DESTDIR)$(bindir) \ + $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir) \ + $(addprefix $(DESTDIR)$(perldir)/, $(dir $(GDR_PERLMODULES))) + installdirs-infra: $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(infraexamplesdir) \ $(addprefix $(DESTDIR)$(perldir)/, $(dir $(INFRA_PERLMODULES))) diff --git a/debian/control b/debian/control index 3180c859..224e52a1 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,7 @@ Depends: perl, libwww-perl, libdpkg-perl, git-core, devscripts, dpkg-dev, libdigest-sha-perl, dput, curl, apt, libjson-perl, ca-certificates, libtext-iconv-perl, libtext-glob-perl -Recommends: ssh-client, libfile-fnmatch-perl +Recommends: ssh-client Suggests: sbuild Architecture: all Description: git interoperability with the Debian archive @@ -26,6 +26,15 @@ Description: git interoperability with the Debian archive . dgit clone and dgit fetch construct git commits from uploads. +Package: git-debrebase +Depends: perl, git-core, libdpkg-perl, libfile-fnmatch-perl + ${misc:Depends} +Recommends: dgit, git-buildpackage +Architecture: all +Description: rebasing git workflow tool for Debian packaging + git-debrebase is a tool for representing in git, and manpulating, + Debian packages based on upstream source code. + Package: dgit-infrastructure Depends: ${misc:Depends}, perl, git-core, gpgv, chiark-utils-bin, libjson-perl, libdigest-sha-perl, libdbd-sqlite3-perl, sqlite3, diff --git a/debian/rules b/debian/rules index e51f8934..baff8f89 100755 --- a/debian/rules +++ b/debian/rules @@ -32,9 +32,12 @@ override_dh_gencontrol: globalperl=/usr/share/perl5 -override_dh_auto_install: specpkg_install_infra +override_dh_auto_install: specpkg_install_gdr specpkg_install_infra make install prefix=/usr DESTDIR=debian/dgit +specpkg_install_gdr: p=git-debrebase +specpkg_install_gdr: pm=GDR + specpkg_install_infra: p=dgit-infrastructure specpkg_install_infra: pm=Infra diff --git a/debian/tests/control b/debian/tests/control index ee9b7d7f..a72f1b89 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -18,7 +18,7 @@ Restrictions: x-dgit-intree-only x-dgit-git-only Tests: gdr-diverge-nmu gdr-diverge-nmu-dgit gdr-edits gdr-import-dgit gdr-newupstream-v0 gdr-subcommands gdr-viagit Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, git-buildpackage, libfile-fnmatch-perl, faketime +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, git-debrebase, git-buildpackage, faketime Tests: gitattributes Tests-Directory: tests/tests diff --git a/git-debrebase b/git-debrebase index 1295360d..216d7dfa 100755 --- a/git-debrebase +++ b/git-debrebase @@ -19,6 +19,7 @@ # along with this program. If not, see . END { $? = $Debian::Dgit::ExitStatus::desired // -1; }; +use Debian::Dgit::GDR; use Debian::Dgit::ExitStatus; use strict; diff --git a/tests/enumerate-tests b/tests/enumerate-tests index 52cc289e..bf86d664 100755 --- a/tests/enumerate-tests +++ b/tests/enumerate-tests @@ -60,7 +60,7 @@ dependencies-gencontrol () { case "$dep" in NO-DEFAULT) dependencies='' ;; GDR) gencontrol-add-deps \ - git-buildpackage libfile-fnmatch-perl faketime + git-debrebase git-buildpackage faketime ;; *) gencontrol-add-deps "$dep" ;; esac