chiark / gitweb /
git-debrebase: Split into its own package
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Jun 2018 14:18:55 +0000 (15:18 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Jun 2018 21:42:48 +0000 (22:42 +0100)
* 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 <ijackson@chiark.greenend.org.uk>
.gitignore
Debian/Dgit/GDR.pm [new file with mode: 0644]
Makefile
debian/control
debian/rules
debian/tests/control
git-debrebase
tests/enumerate-tests

index 2a5d032a5eadbeec06761100c38205acde2aea0b..e821bb4afae698838adf0f04a3a977422d0c1da7 100644 (file)
@@ -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 (file)
index 0000000..ca7e621
--- /dev/null
@@ -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;
index 21ccc1b79765fb0fa40856b3bcd8613d3cdc1de3..0073b427f0e8d243fae291248a1ce1b379816883 100644 (file)
--- 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)))
index 3180c8596f3b7d13cdf73d64f5a4af2c5c2b2aab..224e52a123d985d0b80992515f618b38e3656661 100644 (file)
@@ -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,
index e51f893421ebb764dc82ecb201f58bc2e3acb605..baff8f897a2b35d12f6c1db02675507b49656141 100755 (executable)
@@ -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
 
index ee9b7d7f43d7d391e9abf9c004c22d81404e0e67..a72f1b8919d7ae971c0a35840732ed469692c547 100644 (file)
@@ -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
index 1295360d8a6f85c0b73a7525c256ac512e495163..216d7dfa150e9018a488839d07a9c60341d7313b 100755 (executable)
@@ -19,6 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 END { $? = $Debian::Dgit::ExitStatus::desired // -1; };
+use Debian::Dgit::GDR;
 use Debian::Dgit::ExitStatus;
 
 use strict;
index 52cc289e2e2885c86d3aa24ff79dfebbcef34c1a..bf86d664b413b2d6d3bbe996010cbbed2ec9268f 100755 (executable)
@@ -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