summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name2021-04-17 21:55:03 +0200
committerYour Name2021-04-17 21:55:03 +0200
commit8917e458ff1398db46625f81d3b775703ee7cf1f (patch)
tree7c65791263a51a8fa5ba7dc5087c58b2d17bf5f1
parentf1202623e86215d460796f338a216897dc430b5f (diff)
downloadaur-8917e458ff1398db46625f81d3b775703ee7cf1f.tar.gz
Added patch to migrate to python 3, taken from https://github.com/ryran/reboot-guard/pull/11/commits/34d5df49d9fb914ab74d9b85d726aaa503b972a9, thanks to Stephan Ritscher <no3pam@gmail.com>
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD9
-rw-r--r--reboot-guard-python3.patch17
3 files changed, 26 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2f79f89bd78..f25dbd32157 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = reboot-guard
pkgdesc = Block systemd-initiated poweroff/reboot/halt until configurable condition checks pass
pkgver = 1.0.1
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/ryran/reboot-guard
arch = any
license = GPL
@@ -9,7 +9,9 @@ pkgbase = reboot-guard
depends = systemd
provides = rguard
source = reboot-guard-1.0.1.tar.gz::https://github.com/ryran/reboot-guard/archive/v1.0.1.tar.gz
+ source = reboot-guard-python3.patch
md5sums = 75e2fcf51057b043163efcc0e35cbfbd
+ md5sums = abdfb0be41bd2fad42bc4fc3040c573a
pkgname = reboot-guard
diff --git a/PKGBUILD b/PKGBUILD
index ed560b062ec..82a250cecae 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,19 +2,22 @@
pkgname=reboot-guard
pkgver=1.0.1
-pkgrel=1
+pkgrel=2
pkgdesc="Block systemd-initiated poweroff/reboot/halt until configurable condition checks pass"
arch=('any')
url="https://github.com/ryran/reboot-guard"
license=('GPL')
depends=('python' 'systemd')
provides=('rguard')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/ryran/$pkgname/archive/v$pkgver.tar.gz")
-md5sums=('75e2fcf51057b043163efcc0e35cbfbd')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/ryran/$pkgname/archive/v$pkgver.tar.gz"
+ "reboot-guard-python3.patch")
+md5sums=('75e2fcf51057b043163efcc0e35cbfbd'
+ 'abdfb0be41bd2fad42bc4fc3040c573a')
prepare() {
cd "$pkgname-$pkgver"
sed -ie 's#/usr/sbin/#/usr/bin/#' rguard.service
+ patch -i "reboot-guard-python3.patch"
}
package() {
diff --git a/reboot-guard-python3.patch b/reboot-guard-python3.patch
new file mode 100644
index 00000000000..bd3b3606a2b
--- /dev/null
+++ b/reboot-guard-python3.patch
@@ -0,0 +1,17 @@
+--- a/rguard
++++ b/rguard
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2
++#!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ # Copyright 2015, 2017 Ryan Sawhill Aroha <rsaw@redhat.com>
+ #
+@@ -107,7 +107,7 @@ class RebootGuard:
+ """Return True if systemd *unit* is configured with RefuseManualStart=yes"""
+ cmd = ['systemctl', 'show', unit, '-p', 'RefuseManualStart']
+ try:
+- out = subprocess.check_output(cmd)
++ out = subprocess.check_output(cmd, encoding='utf-8')
+ except:
+ logging.error("Unexpected error running: {}".format(' '.join(cmd)))
+ return