From bad883cd8c4e4a2a520015141a4b685a85c450ba Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Tue, 5 Mar 2019 15:17:43 +0000 Subject: Correctly create symlinks in /etc/service in post-inst on first revision of package, that introduced runscript. (Closes: #923233) --- dh_runit | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'dh_runit') diff --git a/dh_runit b/dh_runit index 5b345d6..f7c81a2 100755 --- a/dh_runit +++ b/dh_runit @@ -10,11 +10,12 @@ use feature 'signatures'; no warnings 'experimental'; sub parse_options($opts) { - my $conf = { enable => 1 }; + my $conf = { enable => 1, since => '0.0-0' }; for my $opt (split(/,/, $opts)) { given($opt) { when (/^disable$/) { $conf->{enable} = 0; }; when (/^name=(.*)$/) { $conf->{name} = $1; }; + when (/^since=(.*)$/) { $conf->{since} = $1; }; when (/^logscript$/) { $conf->{logscript} = 1}; when (/^defaults$/) { "do nothing"; }; default { error("unknown option `$opt'"); } @@ -73,7 +74,8 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) { my $substitutions = { NAME => $name, - ENABLE => $conf->{enable} ? "yes" : "no" + ENABLE => $conf->{enable} ? "yes" : "no", + SINCE => $conf->{since} }; runit_autoscript($pkg, 'postrm', $substitutions); @@ -166,6 +168,17 @@ the rights of the dedicated user. Specifying this option produces an error if the path argument names a directory that already contains a F script. +=item I + +Specify what version of package introduced runscript. Correct +installation of symlinks in F requires this information to +correctly distinguish cases, when system administrator deliberately +disabled service and case, when runscript was not provided in previous +version of package. See #923233. + +If this option is not specified, it means that runscript was provided +all history of package. + =item I If you don't need other options, specify this one. -- cgit v1.2.3