From owner-svn-ports-all@freebsd.org Thu Aug 11 15:20:50 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F57BBB5A67; Thu, 11 Aug 2016 15:20:50 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25BED11D9; Thu, 11 Aug 2016 15:20:50 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7BFKnVb051411; Thu, 11 Aug 2016 15:20:49 GMT (envelope-from lme@FreeBSD.org) Received: (from lme@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7BFKnTU051276; Thu, 11 Aug 2016 15:20:49 GMT (envelope-from lme@FreeBSD.org) Message-Id: <201608111520.u7BFKnTU051276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lme set sender to lme@FreeBSD.org using -f From: Lars Engels Date: Thu, 11 Aug 2016 15:20:49 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r420079 - in head/sysutils/rainbarf: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2016 15:20:50 -0000 Author: lme Date: Thu Aug 11 15:20:49 2016 New Revision: 420079 URL: https://svnweb.freebsd.org/changeset/ports/420079 Log: - Add battery support for FreeBSD - Bump PORTREVISION - Upstream PR: https://github.com/creaktive/rainbarf/pull/29 Approved by: maintainer (adamw) Added: head/sysutils/rainbarf/files/ head/sysutils/rainbarf/files/patch-rainbarf (contents, props changed) Modified: head/sysutils/rainbarf/Makefile Modified: head/sysutils/rainbarf/Makefile ============================================================================== --- head/sysutils/rainbarf/Makefile Thu Aug 11 15:17:21 2016 (r420078) +++ head/sysutils/rainbarf/Makefile Thu Aug 11 15:20:49 2016 (r420079) @@ -3,6 +3,7 @@ PORTNAME= rainbarf PORTVERSION= 1.3 +PORTREVISION= 1 CATEGORIES= sysutils perl5 MASTER_SITES= CPAN MASTER_SITE_SUBDIR= CPAN:SYP Added: head/sysutils/rainbarf/files/patch-rainbarf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/rainbarf/files/patch-rainbarf Thu Aug 11 15:20:49 2016 (r420079) @@ -0,0 +1,36 @@ +--- rainbarf.orig 2015-06-22 11:01:32 UTC ++++ rainbarf +@@ -430,6 +430,24 @@ sub battery_sys { + return ($battery, $charging, $time); + } + ++sub battery_freebsd { ++ my $battery = qx{/sbin/sysctl -n hw.acpi.battery.life 2>/dev/null} or return; ++ my $charging = qx,/sbin/sysctl -n hw.acpi.battery.state,; ++ my $time = qx,/sbin/sysctl -n hw.acpi.battery.time,; ++ ++ $battery /= 100; ++ ++ if ($charging == 2) { ++ $charging = 1; ++ } elsif ($charging == 7) { # Battery absent ++ return; ++ } else { ++ $charging = 0; ++ } ++ ++ return ($battery, $charging, $time); ++} ++ + sub battery { + my @battery; + if (-x q{/usr/sbin/ioreg}) { +@@ -438,6 +456,8 @@ sub battery { + @battery = battery_acpi(); + } elsif (-d q(/sys/class/power_supply)) { + @battery = battery_sys(); ++ } elsif ($^O eq q(freebsd)) { ++ @battery = battery_freebsd(); + } + + battery_print(@battery);