diff options
author | Nicolás Reynolds <fauno@endefensadelsl.org> | 2013-11-06 20:10:41 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@endefensadelsl.org> | 2013-11-06 20:10:41 -0300 |
commit | 385fda403f286573a778ee525fe56a86d11fc967 (patch) | |
tree | 1aabb3a26d366ffa745a559409bcbe91b04dc240 /extra/upower | |
parent | 922fd0a3c35beb57adbef0b4c4c122dd29563c97 (diff) | |
parent | fbe5d27eadf86b85244a5ffff62c132cb9a4a158 (diff) |
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts:
community/adns/PKGBUILD
community/afpfs-ng/PKGBUILD
community/aqbanking/PKGBUILD
community/arp-scan/PKGBUILD
community/arpack/PKGBUILD
community/bind/PKGBUILD
community/bird/PKGBUILD
community/cairo-dock/PKGBUILD
community/cinnamon-control-center/PKGBUILD
community/commoncpp2/PKGBUILD
community/cuetools/PKGBUILD
community/erlang/PKGBUILD
community/fxdesktop/PKGBUILD
community/gavl/PKGBUILD
community/google-gadgets/PKGBUILD
community/gpicview/PKGBUILD
community/gtk-aurora-engine/PKGBUILD
community/icewm-utils/PKGBUILD
community/inotify-tools/PKGBUILD
community/jack2/PKGBUILD
community/judy/PKGBUILD
community/lash/PKGBUILD
community/libdlna/PKGBUILD
community/libgexiv2/PKGBUILD
community/libgig/PKGBUILD
community/liblinebreak/PKGBUILD
community/liblockfile/PKGBUILD
community/libopenraw/PKGBUILD
community/librcd/PKGBUILD
community/librsync/PKGBUILD
community/libvirt/PKGBUILD
community/libyaml/PKGBUILD
community/linux-tools/PKGBUILD
community/lomoco/PKGBUILD
community/luasec/PKGBUILD
community/luasocket/PKGBUILD
community/lwp/PKGBUILD
community/lxappearance-obconf/PKGBUILD
community/lxappearance/PKGBUILD
community/lxsplit/PKGBUILD
community/metamail/PKGBUILD
community/mg/PKGBUILD
community/nemo-fileroller/PKGBUILD
community/nsd/PKGBUILD
community/obby/PKGBUILD
community/openarena/PKGBUILD
community/opensc/PKGBUILD
community/osmo/PKGBUILD
community/perl-json-xs/PKGBUILD
community/pyqt3/PKGBUILD
community/python-pymongo/PKGBUILD
community/python-pytables/PKGBUILD
community/qscintilla-qt3/PKGBUILD
community/qtcurve-gtk2/PKGBUILD
community/qtcurve-kde4/PKGBUILD
community/rxvt-unicode/PKGBUILD
community/smalltalk/PKGBUILD
community/xmlrpc-c/PKGBUILD
community/xpad/PKGBUILD
community/xsettings-client/PKGBUILD
community/yaws/PKGBUILD
core/bzip2/PKGBUILD
core/gcc/PKGBUILD
core/glibc/PKGBUILD
core/keyutils/PKGBUILD
core/ldns/PKGBUILD
core/libmpc/PKGBUILD
core/librpcsecgss/PKGBUILD
core/libtool/PKGBUILD
core/lvm2/PKGBUILD
core/lzo2/PKGBUILD
core/openssl/PKGBUILD
core/systemd/PKGBUILD
core/sysvinit-tools/PKGBUILD
cross/mips64el-unknown-linux-gnu-linux-libre-api-headers/PKGBUILD
extra/aalib/PKGBUILD
extra/aiksaurus/PKGBUILD
extra/alsa-oss/PKGBUILD
extra/alsa-tools/PKGBUILD
extra/apache/PKGBUILD
extra/autopano-sift-c/PKGBUILD
extra/avahi/PKGBUILD
extra/cfitsio/PKGBUILD
extra/clamav/PKGBUILD
extra/compface/PKGBUILD
extra/dotconf/PKGBUILD
extra/enca/PKGBUILD
extra/eventlog/PKGBUILD
extra/exiv2/PKGBUILD
extra/faad2/PKGBUILD
extra/fcgi/PKGBUILD
extra/ffcall/PKGBUILD
extra/ffmpeg/PKGBUILD
extra/flac/PKGBUILD
extra/fltk/PKGBUILD
extra/freealut/PKGBUILD
extra/freetds/PKGBUILD
extra/gc/PKGBUILD
extra/gdome2/PKGBUILD
extra/giblib/PKGBUILD
extra/gmime/PKGBUILD
extra/gnome-python-desktop/PKGBUILD
extra/gnome-python-extras/PKGBUILD
extra/gnome-speech/PKGBUILD
extra/graphviz/PKGBUILD
extra/gsasl/PKGBUILD
extra/gsl/PKGBUILD
extra/gtkspell/PKGBUILD
extra/gupnp-igd/PKGBUILD
extra/htdig/PKGBUILD
extra/hugin/PKGBUILD
extra/id3lib/PKGBUILD
extra/ilmbase/PKGBUILD
extra/imagemagick/PKGBUILD
extra/iptraf-ng/PKGBUILD
extra/jade/PKGBUILD
extra/jasper/PKGBUILD
extra/kdesdk-thumbnailers/PKGBUILD
extra/kdevelop-php/PKGBUILD
extra/lablgtk/PKGBUILD
extra/lame/PKGBUILD
extra/lcms2/PKGBUILD
extra/lesstif/PKGBUILD
extra/libaio/PKGBUILD
extra/libart-lgpl/PKGBUILD
extra/libass/PKGBUILD
extra/libasyncns/PKGBUILD
extra/libavc1394/PKGBUILD
extra/libbluray/PKGBUILD
extra/libcaca/PKGBUILD
extra/libcddb/PKGBUILD
extra/libchamplain/PKGBUILD
extra/libdca/PKGBUILD
extra/libdv/PKGBUILD
extra/libglade/PKGBUILD
extra/libgtkhtml/PKGBUILD
extra/libice/PKGBUILD
extra/libid3tag/PKGBUILD
extra/libidl2/PKGBUILD
extra/libieee1284/PKGBUILD
extra/libjpeg-turbo/PKGBUILD
extra/liblo/PKGBUILD
extra/libmad/PKGBUILD
extra/libmikmod/PKGBUILD
extra/libmowgli/PKGBUILD
extra/libmpd/PKGBUILD
extra/libmpdclient/PKGBUILD
extra/libofa/PKGBUILD
extra/liboil/PKGBUILD
extra/libotf/PKGBUILD
extra/libpeas/PKGBUILD
extra/libqalculate/PKGBUILD
extra/libraw1394/PKGBUILD
extra/libsndfile/PKGBUILD
extra/libstroke/PKGBUILD
extra/libvncserver/PKGBUILD
extra/libxkbui/PKGBUILD
extra/libxss/PKGBUILD
extra/libytnef/PKGBUILD
extra/libzvt/PKGBUILD
extra/lynx/PKGBUILD
extra/lzo/PKGBUILD
extra/mariadb/PKGBUILD
extra/mesa/PKGBUILD
extra/mhash/PKGBUILD
extra/musicbrainz/PKGBUILD
extra/ocaml/PKGBUILD
extra/openal/PKGBUILD
extra/openmpi/PKGBUILD
extra/pavucontrol/PKGBUILD
extra/perl-dbi/PKGBUILD
extra/phonon-vlc/PKGBUILD
extra/phonon/PKGBUILD
extra/ppl/PKGBUILD
extra/progsreiserfs/PKGBUILD
extra/pulseaudio/PKGBUILD
extra/pycurl/PKGBUILD
extra/pyopenssl/PKGBUILD
extra/pyxml/PKGBUILD
extra/qt4/PKGBUILD
extra/qt5/PKGBUILD
extra/qtwebkit/PKGBUILD
extra/schroedinger/PKGBUILD
extra/sdl_gfx/PKGBUILD
extra/signon/PKGBUILD
extra/slang/PKGBUILD
extra/sofia-sip/PKGBUILD
extra/spandsp/PKGBUILD
extra/speech-dispatcher/PKGBUILD
extra/sqlite/PKGBUILD
extra/t1lib/PKGBUILD
extra/taglib/PKGBUILD
extra/tidyhtml/PKGBUILD
extra/totem/PKGBUILD
extra/unixodbc/PKGBUILD
extra/vigra/PKGBUILD
extra/virtuoso/PKGBUILD
extra/wavpack/PKGBUILD
extra/webkitgtk/PKGBUILD
extra/webrtc-audio-processing/PKGBUILD
extra/xfce4-mailwatch-plugin/PKGBUILD
extra/xine-lib/PKGBUILD
extra/xmms/PKGBUILD
extra/xorg-server/PKGBUILD
extra/yajl/PKGBUILD
extra/yasm/PKGBUILD
extra/zenity/PKGBUILD
extra/zziplib/PKGBUILD
libre/blackbox-libre/PKGBUILD
libre/linux-libre/PKGBUILD
libre/sdl-libre/PKGBUILD
Diffstat (limited to 'extra/upower')
-rw-r--r-- | extra/upower/PKGBUILD | 26 | ||||
-rw-r--r-- | extra/upower/linux-clamp-percentage-for-overfull-batteries.patch | 72 |
2 files changed, 86 insertions, 12 deletions
diff --git a/extra/upower/PKGBUILD b/extra/upower/PKGBUILD index 5daa68aa3..15586e6ad 100644 --- a/extra/upower/PKGBUILD +++ b/extra/upower/PKGBUILD @@ -1,31 +1,33 @@ -# $Id: PKGBUILD 185169 2013-05-11 16:16:34Z tomegun $ +# $Id: PKGBUILD 198471 2013-10-30 15:04:10Z allan $ # Maintainer: Jan de Groot <jgc@archlinux.org> pkgname=upower -pkgver=0.9.20 +pkgver=0.9.23 pkgrel=2 pkgdesc="Abstraction for enumerating power devices, listening to device events and querying history and statistics" arch=('i686' 'x86_64' 'mips64el') url="http://upower.freedesktop.org" license=('GPL') -depends=('systemd-tools' 'libsystemd' 'libusb' 'polkit' 'pm-utils' 'dbus-glib' 'libimobiledevice') +depends=('systemd-tools' 'libsystemd' 'libusb' 'polkit' 'dbus-glib' 'libimobiledevice') makedepends=('intltool' 'docbook-xsl' 'gobject-introspection' 'systemd') -options=('!libtool') -source=($url/releases/$pkgname-$pkgver.tar.xz) -md5sums=('f175984d142dc8d2353a7da609836b69') +backup=('etc/UPower/UPower.conf') +source=($url/releases/$pkgname-$pkgver.tar.xz + linux-clamp-percentage-for-overfull-batteries.patch) +md5sums=('39cfd97bfaf7d30908f20cf937a57634' + 'cd8eeb40c2338d28df46e22529bece62') + +prepare() { + cd $pkgname-$pkgver + patch -Np1 -i ../linux-clamp-percentage-for-overfull-batteries.patch +} build() { cd "$pkgname-$pkgver" - # put udev files in /usr/lib - # should be dropped as of 0.9.21!! - sed -i "/slashlibdir=/s#/lib#/usr/lib#" configure - ./configure --prefix=/usr --sysconfdir=/etc \ --localstatedir=/var \ --libexecdir=/usr/lib/$pkgname \ - --disable-static \ - --enable-deprecated + --disable-static make } diff --git a/extra/upower/linux-clamp-percentage-for-overfull-batteries.patch b/extra/upower/linux-clamp-percentage-for-overfull-batteries.patch new file mode 100644 index 000000000..6e643c42d --- /dev/null +++ b/extra/upower/linux-clamp-percentage-for-overfull-batteries.patch @@ -0,0 +1,72 @@ +From b8fe9902f3c6c50ca6a23e24fcea99582beebc65 Mon Sep 17 00:00:00 2001 +From: Martin Pitt <martinpitt@gnome.org> +Date: Tue, 22 Oct 2013 08:02:51 +0000 +Subject: linux: Clamp percentage for overfull batteries + +Some batteries report energy > energy_full and a percentage ("capacity" +attribute) > 100%. Clamp these within 0 and 100% for both plausibility as well +as to avoid setting an out-of-range property which would then become 0%. + +https://launchpad.net/bugs/1240673 +--- +diff --git a/src/linux/integration-test b/src/linux/integration-test +index 8489bf3..4be1922 100755 +--- a/src/linux/integration-test ++++ b/src/linux/integration-test +@@ -442,6 +442,39 @@ class Tests(unittest.TestCase): + self.assertEqual(self.get_dbus_property('OnLowBattery'), False) + self.stop_daemon() + ++ def test_battery_overfull(self): ++ '''battery which reports a > 100% percentage for a full battery''' ++ ++ self.testbed.add_device('power_supply', 'BAT0', None, ++ ['type', 'Battery', ++ 'present', '1', ++ 'status', 'Full', ++ 'current_now', '1000', ++ 'charge_now', '11000000', ++ 'charge_full', '10000000', ++ 'charge_full_design', '11000000', ++ 'capacity', '110', ++ 'voltage_now', '12000000'], []) ++ ++ self.start_daemon() ++ devs = self.proxy.EnumerateDevices() ++ self.assertEqual(len(devs), 1) ++ bat0_up = devs[0] ++ ++ # should clamp percentage ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Percentage'), 100.0) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'IsPresent'), True) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'State'), ++ UP_DEVICE_STATE_FULLY_CHARGED) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Energy'), 132.0) ++ # should adjust EnergyFull to reality, not what the battery claims ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'EnergyFull'), 132.0) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'EnergyFullDesign'), 132.0) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Voltage'), 12.0) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'PowerSupply'), True) ++ self.assertEqual(self.get_dbus_dev_property(bat0_up, 'Type'), 2) ++ self.stop_daemon() ++ + def test_battery_temperature(self): + '''battery which reports temperature''' + +diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c +index 8020277..b953d65 100644 +--- a/src/linux/up-device-supply.c ++++ b/src/linux/up-device-supply.c +@@ -708,6 +708,10 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply) + /* get a precise percentage */ + if (sysfs_file_exists (native_path, "capacity")) { + percentage = sysfs_get_double (native_path, "capacity"); ++ if (percentage < 0.0f) ++ percentage = 0.0f; ++ if (percentage > 100.0f) ++ percentage = 100.0f; + /* for devices which provide capacity, but not {energy,charge}_now */ + if (energy < 0.1f && energy_full > 0.0f) + energy = energy_full * percentage / 100; +-- +cgit v0.9.0.2-2-gbebe |