Package: i3blocks
Version: 1.4-3+b1
Severity: normal

Dear Maintainer,

Not sure when this happened but the regexp in cpu_usage cannot parse the
output of mpstat anymore. Patch attached.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.12.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IN.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8),
LANGUAGE=en_IN:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages i3blocks depends on:
ii  libc6  2.24-15
ii  perl   5.26.0-5

Versions of packages i3blocks recommends:
ii  acpi        1.7-1+b1
pn  alsa-utils  <none>
pn  gawk        <none>
ii  i3-wm       4.13-1
ii  sysstat     11.5.7-1

i3blocks suggests no packages.

-- no debconf information

-- 
Alok
--- cpu_usage	2017-08-21 17:36:30.375729312 +0700
+++ cpu_usage.orig	2017-08-21 15:27:23.603195839 +0700
@@ -31,7 +31,7 @@
 $ENV{LC_ALL}="en_US"; # if mpstat is not run under en_US locale, things may break, so make sure it is
 open (MPSTAT, 'mpstat 1 1 |') or die;
 while (<MPSTAT>) {
-    if (/^Average.*\s+(\d+\.\d+)/) {
+    if (/^.*\s+(\d+\.\d+)\s+$/) {
         $cpu_usage = 100 - $1; # 100% - %idle
         last;
     }

Reply via email to