Skip to contentSkip to conversation

Fix power checking on OS X

PATCH In review Panagiotis Astithas 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix power checking on OS X

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.

---
 contrib/hooks/pre-auto-gc-battery | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/hooks/pre-auto-gc-battery +1 -1
index 9d0c2d1..6a2cdeb 100755
@@ -33,7 +33,7 @@ elif grep -q "AC Power \+: 1" /proc/pmu/info 2>/dev/null
 then
 	exit 0
 elif test -x /usr/bin/pmset && /usr/bin/pmset -g batt |
-	grep -q "Currently drawing from 'AC Power'"
+	grep -q "drawing from 'AC Power'"
 then
 	exit 0
 fi
Signature · 1 line
2.4.1
#1 lore raw
Quoted 7 lines · Panagiotis Astithas

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.

---

Hmph, is there any difference between this one and the original one that I already queued several days ago?

Quoted 16 lines
 contrib/hooks/pre-auto-gc-battery | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/hooks/pre-auto-gc-battery +1 -1
index 9d0c2d1..6a2cdeb 100755
@@ -33,7 +33,7 @@ elif grep -q "AC Power \+: 1" /proc/pmu/info 2>/dev/null
 then
 	exit 0
 elif test -x /usr/bin/pmset && /usr/bin/pmset -g batt |
-	grep -q "Currently drawing from 'AC Power'"
+	grep -q "drawing from 'AC Power'"
 then
 	exit 0
 fi
#2 lore raw
Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Panagiotis Astithas

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.

Quoted 5 lines
Quoted 2 lines

---

Hmph, is there any difference between this one and the original one that I already queued several days ago?

None, I was just following the process outlined in SubmittingPatches that mentions a separate email after the discussion is over.

#3 lore raw

Ah, thanks. Not many people do that, so I was wondering what was going on ;-).

Quoted 16 lines · Panagiotis Astithas
Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Panagiotis Astithas

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.

Quoted 5 lines
Quoted 2 lines

---

Hmph, is there any difference between this one and the original one that I already queued several days ago?

None, I was just following the process outlined in SubmittingPatches that mentions a separate email after the discussion is over.