summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-05-13 18:41:17 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-05-13 18:41:17 +0400
commite1dcd7e330de580b410722615cb3f05a23466bf8 (patch)
tree3ac2561debd7b40a79cd802fb7b311b877eff5f3
parenta51aa9741020d41009c462f906505f9d322f636d (diff)
downloadinit-system-helpers-e1dcd7e330de580b410722615cb3f05a23466bf8.tar.gz
init-system-helpers (1.18+dyson1) unstable; urgency=mediumHEADdyson/1.18+dyson1master
* Package for Dyson * deb-systemd-helper and deb-systemd-invoke work only on Linux; on other archs they do nothing and return 0 * dh_systemd_enable and dh_systemd_start work only for Linux; for other archs they do nothing and return 0
-rw-r--r--debian/changelog10
-rwxr-xr-xscript/deb-systemd-helper11
-rwxr-xr-xscript/deb-systemd-invoke11
-rwxr-xr-xscript/dh_systemd_enable10
-rwxr-xr-xscript/dh_systemd_start10
5 files changed, 52 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 21f4fdb..4c5460e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+init-system-helpers (1.18+dyson1) unstable; urgency=medium
+
+ * Package for Dyson
+ * deb-systemd-helper and deb-systemd-invoke work only on Linux; on
+ other archs they do nothing and return 0
+ * dh_systemd_enable and dh_systemd_start work only for Linux; for
+ other archs they do nothing and return 0
+
+ -- Igor Pashev <pashev.igor@gmail.com> Tue, 13 May 2014 18:35:11 +0400
+
init-system-helpers (1.18) unstable; urgency=low
* d-s-h: add “purge” verb, use it in autoscripts. (Closes: #721244)
diff --git a/script/deb-systemd-helper b/script/deb-systemd-helper
index 59e76a0..8ab1ad8 100755
--- a/script/deb-systemd-helper
+++ b/script/deb-systemd-helper
@@ -78,6 +78,11 @@ filing a bugreport.
=back
+=head1 NOTES
+
+This command currently works on Linux only, on other Debian archs
+it does nothing and returns 0;
+
=cut
use strict;
@@ -444,6 +449,12 @@ if (!$ENV{DPKG_MAINTSCRIPT_PACKAGE}) {
exit 1;
}
+my $deb_host_arch_os = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
+if ($deb_host_arch_os !~ /linux/) {
+ debug "systemd is unsupported on $deb_host_arch_os";
+ exit(0);
+}
+
if ($action eq 'purge') {
$ENV{_DEB_SYSTEMD_HELPER_PURGE} = 1;
$action = 'disable';
diff --git a/script/deb-systemd-invoke b/script/deb-systemd-invoke
index fbc5aea..c9254ce 100755
--- a/script/deb-systemd-invoke
+++ b/script/deb-systemd-invoke
@@ -47,6 +47,11 @@ systemd unit files. It is specifically NOT intended to be used interactively by
users. Instead, users should run systemd and use systemctl, or not bother about
the systemd enabled state in case they are not running systemd.
+=head1 NOTES
+
+This command currently works on Linux only, on other Debian archs
+it does nothing and returns 0;
+
=cut
use strict;
@@ -57,6 +62,12 @@ if (@ARGV < 2) {
exit 1;
}
+my $deb_host_arch_os = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
+if ($deb_host_arch_os !~ /linux/) {
+ print STDERR "systemd is unsupported on $deb_host_arch_os\n";
+ exit(0);
+}
+
my $policyhelper = '/usr/sbin/policy-rc.d';
my @units = @ARGV;
my $action = shift @units;
diff --git a/script/dh_systemd_enable b/script/dh_systemd_enable
index 564dce3..e2948df 100755
--- a/script/dh_systemd_enable
+++ b/script/dh_systemd_enable
@@ -11,6 +11,13 @@ use Debian::Debhelper::Dh_Lib;
use File::Find;
use Text::ParseWords qw(shellwords); # in core since Perl 5
+my $deb_host_arch_os = dpkg_architecture_value('DEB_HOST_ARCH_OS');
+if ($deb_host_arch_os ne 'linux')
+{
+ warning("systemd is unsupported on $deb_host_arch_os, doing nothing");
+ exit(0);
+}
+
=head1 SYNOPSIS
B<dh_systemd_enable> [S<I<debhelper options>>] [B<--no-enable>] [S<I<unit file> ...>]
@@ -70,6 +77,9 @@ Note that B<dh_systemd_enable> should be run before B<dh_installinit>.
The default sequence in B<dh> does the right thing, this note is only relevant
when you are calling B<dh_systemd_enable> manually.
+This command currently works for Linux only, for other Debian archs
+it does nothing and returns 0;
+
=cut
init(options => {
diff --git a/script/dh_systemd_start b/script/dh_systemd_start
index bd02d92..ccd6c1d 100755
--- a/script/dh_systemd_start
+++ b/script/dh_systemd_start
@@ -12,6 +12,13 @@ use File::Find;
use Text::ParseWords qw(shellwords); # in core since Perl 5
use Cwd qw(getcwd abs_path);
+my $deb_host_arch_os = dpkg_architecture_value('DEB_HOST_ARCH_OS');
+if ($deb_host_arch_os ne 'linux')
+{
+ warning("systemd is unsupported on $deb_host_arch_os, doing nothing");
+ exit(0);
+}
+
=head1 SYNOPSIS
B<dh_systemd_start> [S<I<debhelper options>>] [B<--restart-after-upgrade>] [B<--no-restart-on-upgrade>] [S<I<unit file> ...>]
@@ -66,6 +73,9 @@ can detect corresponding SysV init scripts. The default sequence in B<dh> does
the right thing, this note is only relevant when you are calling
B<dh_systemd_start> manually.
+This command currently works for Linux only, for other Debian archs
+it does nothing and returns 0;
+
=cut
init(options => {