Public bug reported:

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
powermgmt-base: 1.33

on_ac_power fails if the path contains a whitespace, solution is
attached as patch.

before patch:
~# sh -x /usr/bin/on_ac_power; echo $?
+ set -e
+ OFF_LINE_P=no
+ [ -d /sys/class/power_supply/ ]
+ test -d /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery
+ test -r /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery/type
+ cat /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery/type
cat: '/sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA': No 
such file or directory
cat: 'Rev:PAACFS00-002-R003-battery/type': No such file or directory
+ type=
1

after patch:
~# sh -x /usr/bin/on_ac_power; echo $?
+ set -e
+ OFF_LINE_P=no
+ [ -d /sys/class/power_supply/ ]
+ test -d /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery
+ test -r /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery/type
+ cat /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery/type
+ type=Battery
+ [ no = yes ]
+ [ -d /proc/acpi/ac_adapter ]
+ [ -r /proc/pmu/info ]
+ [ -r /proc/apm ]
+ exit 255
255

** Affects: powermgmt-base (Ubuntu)
     Importance: Undecided
         Status: Confirmed


** Tags: patch

** Patch added: "whitespace.patch"
   
https://bugs.launchpad.net/bugs/1816404/+attachment/5239496/+files/whitespace.patch

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to powermgmt-base in Ubuntu.
https://bugs.launchpad.net/bugs/1816404

Title:
  on_ac_power fails if the path contains a whitespace

Status in powermgmt-base package in Ubuntu:
  Confirmed

Bug description:
  Distributor ID: Ubuntu
  Description: Ubuntu 18.04.1 LTS
  Release: 18.04
  Codename: bionic
  powermgmt-base: 1.33

  on_ac_power fails if the path contains a whitespace, solution is
  attached as patch.

  before patch:
  ~# sh -x /usr/bin/on_ac_power; echo $?
  + set -e
  + OFF_LINE_P=no
  + [ -d /sys/class/power_supply/ ]
  + test -d /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery
  + test -r /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery/type
  + cat /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery/type
  cat: '/sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA': No 
such file or directory
  cat: 'Rev:PAACFS00-002-R003-battery/type': No such file or directory
  + type=
  1

  after patch:
  ~# sh -x /usr/bin/on_ac_power; echo $?
  + set -e
  + OFF_LINE_P=no
  + [ -d /sys/class/power_supply/ ]
  + test -d /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery
  + test -r /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery/type
  + cat /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA 
Rev:PAACFS00-002-R003-battery/type
  + type=Battery
  + [ no = yes ]
  + [ -d /proc/acpi/ac_adapter ]
  + [ -r /proc/pmu/info ]
  + [ -r /proc/apm ]
  + exit 255
  255

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/powermgmt-base/+bug/1816404/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to