Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] [WIP] runit: respect SVDIR env variable in completion
@ 2021-02-16 11:55 crater2150
  2021-02-16 15:55 ` ericonr
  2021-02-16 15:55 ` [PR PATCH] [Closed]: " ericonr
  0 siblings, 2 replies; 3+ messages in thread
From: crater2150 @ 2021-02-16 11:55 UTC (permalink / raw)
  To: ml

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

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

https://github.com/crater2150/void-packages sv_completion
https://github.com/void-linux/void-packages/pull/28790

[RFC] [WIP] runit: respect SVDIR env variable in completion
Allows sv's completion to complete other service directories, e.g. for per-user services.
If the `$SVDIR` environment variable is set *and* `sv` isn't used with `sudo`, the completion is changed to complete services from `$SVDIR`. Otherwise behaviour is unchanged.

I currently have only implemented the change for `zsh`. In bash, the `sudo` completion modifies variables so that the completion of the following command doesn't "see" the `sudo` in the beginning. If there is interest in merging this, I'd check for a bash solution too.

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

[skip CI]
Does not change any compiled files

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sv_completion-28790.patch --]
[-- Type: text/x-diff, Size: 934 bytes --]

From 2bb3c364edf056c12a07cc11d7f3cafe3bc4a114 Mon Sep 17 00:00:00 2001
From: Alexander Gehrke <github@qwertyuiop.de>
Date: Tue, 16 Feb 2021 12:44:58 +0100
Subject: [PATCH] runit: respect SVDIR env variable in completion

Allows sv's completion to complete other service directories, e.g. for
per-user services.
---
 srcpkgs/runit/files/_sv | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/runit/files/_sv b/srcpkgs/runit/files/_sv
index 465fbfde640..551beaa5ae8 100644
--- a/srcpkgs/runit/files/_sv
+++ b/srcpkgs/runit/files/_sv
@@ -35,7 +35,11 @@ cmds)
         check
     ret=0;;
 args)
-    services=( /var/service/*(-/N:t) )
+    if [[ $BUFFER == sudo* ]] then
+	    services=( /var/service/*(-/N:t) )
+    else
+	    services=( ${SVDIR:-/var/service}/*(-/N:t) )
+    fi
     (( $#services )) && _values services $services && ret=0
     [[ $words[CURRENT] = */* ]] && _directories && ret=0
     ;;

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

* Re: [RFC] [WIP] runit: respect SVDIR env variable in completion
  2021-02-16 11:55 [PR PATCH] [RFC] [WIP] runit: respect SVDIR env variable in completion crater2150
@ 2021-02-16 15:55 ` ericonr
  2021-02-16 15:55 ` [PR PATCH] [Closed]: " ericonr
  1 sibling, 0 replies; 3+ messages in thread
From: ericonr @ 2021-02-16 15:55 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/28790#issuecomment-779929697

Comment:
Please open this in https://github.com/void-linux/runit instead.

CI is cheap for runit, there's really no reason to skip it :)

I think the change makes sense, so please do reopen this in that repo :)

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

* Re: [PR PATCH] [Closed]: [RFC] [WIP] runit: respect SVDIR env variable in completion
  2021-02-16 11:55 [PR PATCH] [RFC] [WIP] runit: respect SVDIR env variable in completion crater2150
  2021-02-16 15:55 ` ericonr
@ 2021-02-16 15:55 ` ericonr
  1 sibling, 0 replies; 3+ messages in thread
From: ericonr @ 2021-02-16 15:55 UTC (permalink / raw)
  To: ml

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

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

[RFC] [WIP] runit: respect SVDIR env variable in completion
https://github.com/void-linux/void-packages/pull/28790

Description:
Allows sv's completion to complete other service directories, e.g. for per-user services.
If the `$SVDIR` environment variable is set *and* `sv` isn't used with `sudo`, the completion is changed to complete services from `$SVDIR`. Otherwise behaviour is unchanged.

I currently have only implemented the change for `zsh`. In bash, the `sudo` completion modifies variables so that the completion of the following command doesn't "see" the `sudo` in the beginning. If there is interest in merging this, I'd check for a bash solution too.

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

[skip CI]
Does not change any compiled files

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

end of thread, other threads:[~2021-02-16 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 11:55 [PR PATCH] [RFC] [WIP] runit: respect SVDIR env variable in completion crater2150
2021-02-16 15:55 ` ericonr
2021-02-16 15:55 ` [PR PATCH] [Closed]: " ericonr

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).