git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix power checking on OS X

From
Panagiotis Astithas <pastith@gmail.com>
Date
Jun 12, 2015, 08:53 UTC
Message-ID
<CACvVhd7sKiz+gTDY_RVjFf1i3Rt2pYWVsgjewyPHL1ajS5LTcQ@mail.gmail.com>
In-Reply-To
<CAPig+cRzKpCePO0gXy7Rok4X7=r6tas28tv48g92YzP9tVP2AA@mail.gmail.com>
On Fri, Jun 12, 2015 at 6:46 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 11 quoted lines
> On Thu, Jun 11, 2015 at 10:37 AM, Panagiotis Astithas <pastith@gmail.com> wrote:
>> The output of "pmset -g batt" changed at some point from
>> "Currently drawing from 'AC Power'" to the slightly different
>> "Now drawing from 'AC Power'". Starting the match from "drawing"
>> makes the check work in both old and new versions of OS X.
>
> Would it make sense to try to future-proof this further by searching
> only for "'AC" (including the leading single-quote) or just "AC"
> (without the leading quote)?
>
> (Genuine question. I don't have a strong feeling about it.)

It's a reasonable idea, although I'm wondering what are the odds of pmset changing to output a string when running on battery in the future, containing something like "no longer on 'AC Power'". That's probably too far out though.

Previous: Eric SunshineNext: Junio C Hamano
Message 3 of 5 in “Fix power checking on OS X”
  1. Fix power checking on OS XPanagiotis Astithas, Jun 11, 2015
  2. Eric SunshineJun 12, 2015
  3. Panagiotis AstithasJun 12, 2015
  4. Junio C HamanoJun 12, 2015
  5. Eric SunshineJun 12, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.