Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xbps-triggers: exit kernel hook on error
@ 2023-05-12  9:06 g4s8
  2023-05-19  8:36 ` g4s8
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: g4s8 @ 2023-05-12  9:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

There is a new pull request by g4s8 against master on the void-packages repository

https://github.com/g4s8/void-packages exit-trigger-kernel-hook
https://github.com/void-linux/void-packages/pull/43852

xbps-triggers: exit kernel hook on error
Exit kernel-hook scripts with error in case of error in hook.

Ticket: #42047

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64)



A patch file from https://github.com/void-linux/void-packages/pull/43852.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-exit-trigger-kernel-hook-43852.patch --]
[-- Type: text/x-diff, Size: 1558 bytes --]

From 7f37157f24c8e9f150ae747efaa4cf8c9e9518e2 Mon Sep 17 00:00:00 2001
From: Kirill <g4s8.public@gmail.com>
Date: Fri, 12 May 2023 12:55:03 +0400
Subject: [PATCH] xbps-triggers: exit kernel hook on error

Exit kernel-hook scripts with error in case of error in hook.
Ticket: 42047
---
 srcpkgs/xbps-triggers/files/kernel-hooks | 7 +++----
 srcpkgs/xbps-triggers/template           | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/kernel-hooks b/srcpkgs/xbps-triggers/files/kernel-hooks
index 61574e90843e..8741e14ddb97 100755
--- a/srcpkgs/xbps-triggers/files/kernel-hooks
+++ b/srcpkgs/xbps-triggers/files/kernel-hooks
@@ -38,11 +38,10 @@ run)
 
 		# A package may export "kernel_hooks_version" as a hint
 		# to pass this version to the hooks.
-		if [ -n "${kernel_hooks_version}" ]; then
-			env ROOTDIR="." ${_file_} ${PKGNAME} ${kernel_hooks_version}
-		else
-			env ROOTDIR="." ${_file_} ${PKGNAME} ${VERSION}
+		if [ -z "${kernel_hooks_version}" ]; then
+			kernel_hooks_version="${VERSION}"
 		fi
+		env ROOTDIR="." ${_file_} ${PKGNAME} ${kernel_hooks_version} || exit 1
 	done
 	;;
 *)
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index aa62e0902528..b3ebff2be147 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,7 +1,7 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
 version=0.124
-revision=1
+revision=2
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: xbps-triggers: exit kernel hook on error
  2023-05-12  9:06 [PR PATCH] xbps-triggers: exit kernel hook on error g4s8
@ 2023-05-19  8:36 ` g4s8
  2023-05-25 18:40 ` ahesford
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: g4s8 @ 2023-05-19  8:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

New comment by g4s8 on void-packages repository

https://github.com/void-linux/void-packages/pull/43852#issuecomment-1554235690

Comment:
@classabbyamp hi, any chance to review this PR? I'm already using this new script for kernel configuration, and it's working fine for me.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: xbps-triggers: exit kernel hook on error
  2023-05-12  9:06 [PR PATCH] xbps-triggers: exit kernel hook on error g4s8
  2023-05-19  8:36 ` g4s8
@ 2023-05-25 18:40 ` ahesford
  2023-06-27 22:27 ` classabbyamp
  2023-06-27 23:26 ` [PR PATCH] [Closed]: " ahesford
  3 siblings, 0 replies; 5+ messages in thread
From: ahesford @ 2023-05-25 18:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43852#issuecomment-1563343499

Comment:
I don't believe this is desirable. There may be any number of kernel hooks that might be effectively independent, and preventing some from running just because one failed could have unintended consequences. This is especially true because this represents a change in behavior. If one hook depends on the success of another, *e.g.* by acting on its outputs, the right thing to do is confirm in the dependant hook that all expected inputs are present and fail gracefully if not.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: xbps-triggers: exit kernel hook on error
  2023-05-12  9:06 [PR PATCH] xbps-triggers: exit kernel hook on error g4s8
  2023-05-19  8:36 ` g4s8
  2023-05-25 18:40 ` ahesford
@ 2023-06-27 22:27 ` classabbyamp
  2023-06-27 23:26 ` [PR PATCH] [Closed]: " ahesford
  3 siblings, 0 replies; 5+ messages in thread
From: classabbyamp @ 2023-06-27 22:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/43852#issuecomment-1610304862

Comment:
+1 to ahesford. I don't think this is the right approach.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Closed]: xbps-triggers: exit kernel hook on error
  2023-05-12  9:06 [PR PATCH] xbps-triggers: exit kernel hook on error g4s8
                   ` (2 preceding siblings ...)
  2023-06-27 22:27 ` classabbyamp
@ 2023-06-27 23:26 ` ahesford
  3 siblings, 0 replies; 5+ messages in thread
From: ahesford @ 2023-06-27 23:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

There's a closed pull request on the void-packages repository

xbps-triggers: exit kernel hook on error
https://github.com/void-linux/void-packages/pull/43852

Description:
Exit kernel-hook scripts with error in case of error in hook.

Close: #42047

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64)



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-27 23:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12  9:06 [PR PATCH] xbps-triggers: exit kernel hook on error g4s8
2023-05-19  8:36 ` g4s8
2023-05-25 18:40 ` ahesford
2023-06-27 22:27 ` classabbyamp
2023-06-27 23:26 ` [PR PATCH] [Closed]: " ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).