From e4b8e832194949b228db4fd00eab558dfc8b7d27 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Tue, 28 May 2019 21:10:02 +0000 Subject: Refactor creation of logscript Instead of using interpolation and here-strings, write function that renders mustache template. This approach makes code cleaner and more scalable. * data/logscript: add mustach template of 'log/run' script, that is installed when "logscript" option in effect. * Makefile: set DH_RUNIT_DATADIR variable in "check" target. This way, templates from ./data/ directory are used, not from system location. * debian/control: add dependency on Text::Hogan library -- implementation of "mustache" templating standard. * dh_runit(template_from_data_directory): new function * dh_runit: install 'log/run' with "template_from_data_directory" function. * t/928935.t: check that "logscript" option correctly creates 'log/run' script, with correct permissions. --- debian/control | 2 ++ debian/dh-runit.install | 1 + 2 files changed, 3 insertions(+) (limited to 'debian') diff --git a/debian/control b/debian/control index 946f548..9b889e1 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Build-Depends: perl, perl-doc, libfile-copy-recursive-perl, + libtext-hogan-perl, Standards-Version: 4.3.0 Vcs-Browser: https://salsa.debian.org/runit-team/dh-runit Vcs-Git: https://salsa.debian.org/runit-team/dh-runit.git @@ -15,6 +16,7 @@ Homepage: https://salsa.debian.org/runit-team/dh-runit Package: dh-runit Architecture: all Depends: debhelper (>= 9), + libtext-hogan-perl, ${misc:Depends}, ${shlibs:Depends} Description: debhelper add-on to handle runit runscripts diff --git a/debian/dh-runit.install b/debian/dh-runit.install index e3f2d9d..a08eda2 100644 --- a/debian/dh-runit.install +++ b/debian/dh-runit.install @@ -2,3 +2,4 @@ dh_runit /usr/bin postrm-runit /usr/share/debhelper/autoscripts postinst-runit /usr/share/debhelper/autoscripts runit.pm /usr/share/perl5/Debian/Debhelper/Sequence +data/* /usr/share/dh-runit/data/ -- cgit v1.2.3