aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Lucas Porcellis <porcellis@eletrotupi.com>2023-09-15 16:05:40 -0300
committerKevin Daudt <kdaudt@alpinelinux.org>2023-09-19 05:33:07 +0000
commit49c5b2879585857ee394215a7fc035187de4866a (patch)
treee5ec73069111f3976349637d74e57313b367351b
parent3aea838c2181eaa3b4213b665b6fdd6bd1854524 (diff)
testing/powerctl: adopt
-rw-r--r--testing/powerctl/APKBUILD10
-rw-r--r--testing/powerctl/getopts-fs-flags.patch79
-rw-r--r--testing/powerctl/new-hare-strings.patch (renamed from testing/powerctl/new-hare.patch)0
3 files changed, 85 insertions, 4 deletions
diff --git a/testing/powerctl/APKBUILD b/testing/powerctl/APKBUILD
index 7a69c8160af..dfcc8b088c3 100644
--- a/testing/powerctl/APKBUILD
+++ b/testing/powerctl/APKBUILD
@@ -1,7 +1,7 @@
-# Maintainer:
+# Maintainer: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
pkgname=powerctl
pkgver=1.1
-pkgrel=2
+pkgrel=3
pkgdesc="CLI tool to manage Linux power management states"
url="https://sr.ht/~sircmpwn/powerctl/"
arch="x86_64 aarch64" # Hare
@@ -10,7 +10,8 @@ makedepends="hare scdoc"
subpackages="$pkgname-doc"
source="
$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz
- new-hare.patch
+ new-hare-strings.patch
+ getopts-fs-flags.patch
"
install="$pkgname.post-install"
# Hare does not support PIE
@@ -26,5 +27,6 @@ package() {
sha512sums="
02fec6e8bab802cbb7436cb1ea378cba2ddf84ac1dc129f10ccb5ccad91f5d44d56373871ff14b23cc81eddf22abfdc2f92c87baece94fbba7aaf91f1654dc1a powerctl-1.1.tar.gz
-123c185190a1b8cd96d4d4edb6d3e5101f4884cbf2f83fc00bc3218bccc101733c1068e77579c942f5acb3e5573071257b76d38b1594d066def3c1c2febb9b2d new-hare.patch
+123c185190a1b8cd96d4d4edb6d3e5101f4884cbf2f83fc00bc3218bccc101733c1068e77579c942f5acb3e5573071257b76d38b1594d066def3c1c2febb9b2d new-hare-strings.patch
+db6c2331256aca10908cc43cc08f17ca45c3a6f4966315a95ba99652ff09d8d62f632312e8c3b985fd95eb96509efbce45e89fe10a8f9f279bde509c4d9bc31d getopts-fs-flags.patch
"
diff --git a/testing/powerctl/getopts-fs-flags.patch b/testing/powerctl/getopts-fs-flags.patch
new file mode 100644
index 00000000000..847c39314cd
--- /dev/null
+++ b/testing/powerctl/getopts-fs-flags.patch
@@ -0,0 +1,79 @@
+From: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
+Subject: [PATCH] Fix getopts and fs::flag to match latest Hare changes
+Date: Fri, 15 Sep 2023 15:36:19 -0300
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+
+---
+It would be nice if you could release a new version containing
+these fixes, so I could package downstream.
+
+ main.ha | 10 +++++-----
+ sysfs.ha | 2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/main.ha b/main.ha
+index 9e80e9a..0a59752 100644
+--- a/main.ha
++++ b/main.ha
+@@ -44,7 +44,7 @@ export fn main() void = {
+
+ if (op == operation::QUERY) {
+ if (len(cmd.args) != 0) {
+- getopt::printhelp(os::stderr, "powerctl", help...);
++ getopt::printhelp(os::stderr, "powerctl", help...)!;
+ os::exit(1);
+ };
+
+@@ -64,7 +64,7 @@ export fn main() void = {
+ };
+
+ if (len(cmd.args) != 1) {
+- getopt::printhelp(os::stderr, "powerctl", help...);
++ getopt::printhelp(os::stderr, "powerctl", help...)!;
+ os::exit(1);
+ };
+
+@@ -76,7 +76,7 @@ export fn main() void = {
+ case let state: disk_state =>
+ yield state;
+ case errors::invalid =>
+- getopt::printhelp(os::stderr, "powerctl", help...);
++ getopt::printhelp(os::stderr, "powerctl", help...)!;
+ os::exit(1);
+ };
+ const result = set_disk_state(state);
+@@ -95,7 +95,7 @@ export fn main() void = {
+ case let state: mem_state =>
+ yield state;
+ case errors::invalid =>
+- getopt::printhelp(os::stderr, "powerctl", help...);
++ getopt::printhelp(os::stderr, "powerctl", help...)!;
+ os::exit(1);
+ };
+ const result = set_mem_state(state);
+@@ -105,7 +105,7 @@ export fn main() void = {
+ case let state: sleep_state =>
+ yield state;
+ case errors::invalid =>
+- getopt::printhelp(os::stderr, "powerctl", help...);
++ getopt::printhelp(os::stderr, "powerctl", help...)!;
+ os::exit(1);
+ };
+ const result = set_sleep_state(state);
+diff --git a/sysfs.ha b/sysfs.ha
+index 3473086..df7f373 100644
+--- a/sysfs.ha
++++ b/sysfs.ha
+@@ -46,7 +46,7 @@ fn read_states(path: str) (strings::tokenizer | fs::error | io::error) = {
+ };
+
+ fn write_sysfs_file(path: str, content: str) (void | fs::error | io::error) = {
+- const file = os::open(path, fs::flags::WRONLY | fs::flags::TRUNC)?;
++ const file = os::open(path, fs::flag::WRONLY | fs::flag::TRUNC)?;
+ defer io::close(file)!;
+ io::write(file, strings::toutf8(content))?;
+ };
+--
+2.42.0
+
diff --git a/testing/powerctl/new-hare.patch b/testing/powerctl/new-hare-strings.patch
index 9fdcb4dd919..9fdcb4dd919 100644
--- a/testing/powerctl/new-hare.patch
+++ b/testing/powerctl/new-hare-strings.patch