File: LSB-gracefully-handle-missing-insserv.patch

package info (click to toggle)
unit-translator 0.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: sh: 816; makefile: 23
file content (16 lines) | stat: -rw-r--r-- 794 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- a/backends/lsb
+++ b/backends/lsb
@@ -32,7 +32,12 @@
 }
 
 munge_deps() {
-    self=$(local -; set +o noglob; find /etc/insserv.conf* -type f -exec  awk "/$(basename "$lsb_init_script")/ {print \$1}" '{}' ';')
+    # In normal usage insserv will be installed. However, to pass autopkgtests
+    # on Debian infra the dependency on sysv-rc (pulling in insserv) has been
+    # reduced to Recommends, so we need to handle missing /etc/insserv.conf gracefully.
+    self=$(set +o noglob
+	   { [ ! -f /etc/insserv.conf ] && [ ! -d /etc/insserv.conf.d ] ; } ||
+	       find /etc/insserv.conf* -type f -exec  awk "/$(basename "$lsb_init_script")/ {print \$1}" '{}' ';')
     for key in Requires Wants After Before; do
 	for dep in ${depends[$key]:-}; do
 	    if [[ "$dep" == "$self" ]] ; then