summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2017-10-14 11:19:38 +0000
committerNiels Thykier <niels@thykier.net>2017-10-14 11:19:38 +0000
commite29afec31f2923b15ae526ce35a518a96c589ff6 (patch)
tree7edc905d86a0fc0571fcf75030e19c140fb035a5
parentea8399807066aac1dbc96a851faf5b792e666075 (diff)
downloaddebhelper-e29afec31f2923b15ae526ce35a518a96c589ff6.tar.gz
Include $! in error messages
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--debian/changelog9
-rwxr-xr-xdh_installsystemd4
-rwxr-xr-xdh_systemd_enable2
-rwxr-xr-xdh_systemd_start2
4 files changed, 13 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index 1c3c74dc..98a9d4a1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+debhelper (10.9.3) UNRELEASED; urgency=medium
+
+ * dh_installsystemd: Improve error messages to include the actual
+ error caused by attempted to open the file.
+ * dh_systemd_enable: Ditto.
+ * dh_systemd_start: Ditto.
+
+ -- Niels Thykier <niels@thykier.net> Sat, 14 Oct 2017 11:18:19 +0000
+
debhelper (10.9.2) unstable; urgency=medium
[ Niels Thykier ]
diff --git a/dh_installsystemd b/dh_installsystemd
index 29c60db4..8cd826b9 100755
--- a/dh_installsystemd
+++ b/dh_installsystemd
@@ -156,7 +156,7 @@ init(options => {
sub contains_install_section {
my ($unit_path) = @_;
- open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) for extracting the Also= line(s)");
+ open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) to check for [Install]: $!");
while (my $line = <$fh>) {
chomp($line);
@@ -185,7 +185,7 @@ sub extract_key {
return @values if $dh{NO_ALSO};
- open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) for extracting the Also= line(s)");
+ open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) for extracting the Also= line(s): $!");
while (my $line = <$fh>) {
chomp($line);
diff --git a/dh_systemd_enable b/dh_systemd_enable
index a05aab1e..e2e5add6 100755
--- a/dh_systemd_enable
+++ b/dh_systemd_enable
@@ -124,7 +124,7 @@ init(options => {
sub contains_install_section {
my ($unit_path) = @_;
- open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) to check for [Install]");
+ open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) to check for [Install]: $!");
while (my $line = <$fh>) {
chomp($line);
return 1 if $line =~ /^\s*\[Install\]$/i;
diff --git a/dh_systemd_start b/dh_systemd_start
index 0c3a51d8..362d00ab 100755
--- a/dh_systemd_start
+++ b/dh_systemd_start
@@ -104,7 +104,7 @@ sub extract_key {
return if $dh{NO_ALSO};
- open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) for extracting the Also= line(s)");
+ open(my $fh, '<', $unit_path) or error("Cannot open($unit_path) for extracting the Also= line(s): $!");
while (my $line = <$fh>) {
chomp($line);