Trent W. Buck wrote:
> I want check-support-status to be happy, but I need needrestart:
>
>     bash5$ check-support-status
>     ⋮
>     * Source:binutils
>       Details: Only suitable for trusted content; see 
> https://lists.debian.org/msgid-search/87lfqsomtg....@mid.deneb.enyo.de
>     ⋮
>
>     bash5$ aptitude why binutils
>     i   needrestart Depends binutils

This annoyed me again today.
I noticed an even simple patch is to use "grep -ao".
This is working for me.

You are already using "grep -a" elsewhere in the script, so
this is only assuming grep supports -o.
GNU grep supports both; busybox grep supports neither.
diff --git i/debian/control w/debian/control
index 8a569b6..62fbddb 100644
--- i/debian/control
+++ w/debian/control
@@ -21,7 +21,6 @@ Depends: ${misc:Depends},
  libmodule-scandeps-perl,
  libterm-readkey-perl,
  libmodule-find-perl,
- binutils,
  xz-utils
 Recommends: libpam-systemd | sysvinit-core
 Suggests: needrestart-session | libnotify-bin,
diff --git i/lib/vmlinuz-get-version w/lib/vmlinuz-get-version
index 22a4365..ad3152e 100755
--- i/lib/vmlinuz-get-version
+++ w/lib/vmlinuz-get-version
@@ -20,7 +20,7 @@
 get_version()
 {
     # search and output version string pattern
-    strings "$1" | grep -m 1 '^Linux version ' && exit 0
+    grep -aom1 'Linux version .*' "$1" && exit 0
 }
 
 try_decompress()

Reply via email to