Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels()
@ 2020-08-15 19:51 avoidr
  2020-08-15 19:58 ` ericonr
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: avoidr @ 2020-08-15 19:51 UTC (permalink / raw)
  To: ml

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

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

https://github.com/avoidr/void-packages vkpurge
https://github.com/void-linux/void-packages/pull/24298

base-files: vkpurge: fix parameter expansion in list_kernels()
This fixes next-kernels from having too much string of their versions
stripped.

Next-kernel versions have the format "vmlinu[xz]-<ver>-next-<date>".
Thus, the string was wrongly shortened to "<date>", instead of the
correct "<ver>-next-<date>".

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

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

From 24aac5d8aacbf79a7926ff7d0f5f0d32b2503a4e Mon Sep 17 00:00:00 2001
From: avoidr <avoidr@posteo.de>
Date: Sat, 15 Aug 2020 21:10:54 +0200
Subject: [PATCH] base-files: vkpurge: fix parameter expansion in
 list_kernels()

This fixes next-kernels from having too much string of their versions
stripped.

Next-kernel versions have the format "vmlinu[xz]-<ver>-next-<date>".
Thus, the string was wrongly shortened to "<date>", instead of the
correct "<ver>-next-<date>".
---
 srcpkgs/base-files/files/vkpurge | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/base-files/files/vkpurge b/srcpkgs/base-files/files/vkpurge
index 5519147b905..131587e5af6 100644
--- a/srcpkgs/base-files/files/vkpurge
+++ b/srcpkgs/base-files/files/vkpurge
@@ -26,7 +26,7 @@ list_kernels() {
 			case "$installed" in
 				*"$k"*) continue ;;
 			esac
-			kver=${k##*-}
+			kver=${k#*-}
 			case "$kver" in
 				"$running") ;;
 				"*") ;; # /boot isn't mounted -> no vmlinu[xz]

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

* Re: base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
@ 2020-08-15 19:58 ` ericonr
  2020-08-15 21:12 ` avoidr
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ericonr @ 2020-08-15 19:58 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/24298#issuecomment-674441375

Comment:
You need to change the version or revision or the template in order to get it rebuilt.

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

* Re: base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
  2020-08-15 19:58 ` ericonr
@ 2020-08-15 21:12 ` avoidr
  2020-08-15 21:15 ` [PR PATCH] [Updated] " avoidr
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: avoidr @ 2020-08-15 21:12 UTC (permalink / raw)
  To: ml

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

New comment by avoidr on void-packages repository

https://github.com/void-linux/void-packages/pull/24298#issuecomment-674447717

Comment:
Oh, right! Forgot.

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

* Re: [PR PATCH] [Updated] base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
  2020-08-15 19:58 ` ericonr
  2020-08-15 21:12 ` avoidr
@ 2020-08-15 21:15 ` avoidr
  2020-08-17  0:46 ` ahesford
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: avoidr @ 2020-08-15 21:15 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by avoidr against master on the void-packages repository

https://github.com/avoidr/void-packages vkpurge
https://github.com/void-linux/void-packages/pull/24298

base-files: vkpurge: fix parameter expansion in list_kernels()
This fixes next-kernels from having too much string of their versions
stripped.

Next-kernel versions have the format "vmlinu[xz]-<ver>-next-<date>".
Thus, the string was wrongly shortened to "<date>", instead of the
correct "<ver>-next-<date>".

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

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

From 5a3eba37f8cf31a138f4e482c527474bbb2998d7 Mon Sep 17 00:00:00 2001
From: avoidr <avoidr@posteo.de>
Date: Sat, 15 Aug 2020 21:10:54 +0200
Subject: [PATCH] base-files: vkpurge: fix parameter expansion in
 list_kernels()

This fixes next-kernels from having too much string of their versions
stripped.

Next-kernel versions have the format "vmlinu[xz]-<ver>-next-<date>".
Thus, the string was wrongly shortened to "<date>", instead of the
correct "<ver>-next-<date>".
---
 srcpkgs/base-files/files/vkpurge | 2 +-
 srcpkgs/base-files/template      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-files/files/vkpurge b/srcpkgs/base-files/files/vkpurge
index 5519147b905..131587e5af6 100644
--- a/srcpkgs/base-files/files/vkpurge
+++ b/srcpkgs/base-files/files/vkpurge
@@ -26,7 +26,7 @@ list_kernels() {
 			case "$installed" in
 				*"$k"*) continue ;;
 			esac
-			kver=${k##*-}
+			kver=${k#*-}
 			case "$kver" in
 				"$running") ;;
 				"*") ;; # /boot isn't mounted -> no vmlinu[xz]
diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template
index 6b503690606..b34c40c697a 100644
--- a/srcpkgs/base-files/template
+++ b/srcpkgs/base-files/template
@@ -1,7 +1,7 @@
 # Template file for 'base-files'
 pkgname=base-files
 version=0.141
-revision=2
+revision=3
 bootstrap=yes
 depends="xbps-triggers"
 short_desc="Void Linux base system files"

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

* Re: base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
                   ` (2 preceding siblings ...)
  2020-08-15 21:15 ` [PR PATCH] [Updated] " avoidr
@ 2020-08-17  0:46 ` ahesford
  2020-08-18 20:33 ` q66
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ahesford @ 2020-08-17  0:46 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/24298#issuecomment-674603122

Comment:
The `vkpurge` script exists to remove files orphaned by official Void kernel packages. What Void kernel ships with names of the form `vmlinu[xz]--next-`?

Correct functionality requires that kernel names take the form `/boot/vmlinu[xz]-$(uname -r)` and that `uname -r` also have the same form as `${k##*-}`. In practice, Void only ships kernels where `$(uname -r)` does not contain hyphens, so `vkpurge` works as expected in its current form. If Void were ever to ship kernels with a `LOCALVERSION` that contained a hyphenated suffix, your change would probably be sufficient to handle those kernels. If Void were to differentiate kernels based on some prefix that does not get incorporated into kernel versioning (for example, `vmlinuz-lts-5.7.15_1` for `$(uname -r) = 5.7.15_1`, the entire `vkpurge` behavior would need to be rethought.

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

* Re: base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
                   ` (3 preceding siblings ...)
  2020-08-17  0:46 ` ahesford
@ 2020-08-18 20:33 ` q66
  2020-08-18 20:46 ` ahesford
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: q66 @ 2020-08-18 20:33 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/24298#issuecomment-675698218

Comment:
there are no next-kernels in void, so what do you mean?

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

* Re: base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
                   ` (4 preceding siblings ...)
  2020-08-18 20:33 ` q66
@ 2020-08-18 20:46 ` ahesford
  2020-08-19  0:32 ` avoidr
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ahesford @ 2020-08-18 20:46 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/24298#issuecomment-675711533

Comment:
I think this is more consistent even if official Void kernels don't ship with anything more than a single hyphen. Let's say a local package (or unpackaged kernel build) modifies LOCALVERSION to be `-test_${revision}`. We have two kernels:
```
/boot/vmlinuz-5.7.14_1
/boot/vmlinuz-5.7.14-test_1
```
Running `vkpurge list` before this patch is applied, if you are on `5.7.14_1`, will show
```
test_1
```
and attempting to `vkpurge rm all` will look for `/boot/vmlinuz-test_1`, which is clearly not correct.

After the patch, `vkpurge list` will show
```
5.7.14-test_1
```
and `vkpurge rm all` will look for and successfully delete `/boot/vmlinuz-5.7.14-test_1`.

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

* Re: base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
                   ` (5 preceding siblings ...)
  2020-08-18 20:46 ` ahesford
@ 2020-08-19  0:32 ` avoidr
  2020-08-19  0:52 ` ahesford
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: avoidr @ 2020-08-19  0:32 UTC (permalink / raw)
  To: ml

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

New comment by avoidr on void-packages repository

https://github.com/void-linux/void-packages/pull/24298#issuecomment-675784741

Comment:
The problem I found was that vkpurge listed my kernel with the -next- part stripped, and that string couldn't be used to remove the kernel with vkpurge.
In the script I saw that the files are matched against "vmlinu[xz]-*", with no mention of any other hyphens. So ${k##*-} seemed problematic, because it might expand to further hyphens that we don't know of. It simply seemed like an oversight to me.

Void doesn't currently prefix any kernels with anything, so this change doesn't affect "official" kernels, but it expands to manually installed kernels. Or is that not right?


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

* Re: base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
                   ` (6 preceding siblings ...)
  2020-08-19  0:32 ` avoidr
@ 2020-08-19  0:52 ` ahesford
  2020-08-19  1:02 ` [PR PATCH] [Closed]: " ahesford
  2020-08-19  1:45 ` avoidr
  9 siblings, 0 replies; 11+ messages in thread
From: ahesford @ 2020-08-19  0:52 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/24298#issuecomment-675789899

Comment:
Merging because this should have no change in behavior for current official Void kernels but, if anybody customizes the kernel LOCALVERSION, this should provide more consistent behavior. This **almost certainly will not work** with your strange "-next-" kernel because I doubt that `uname -r` returns "-next-". If that "-next-" kernel does not belong to any installed kernel package, this new `vkpurge` will want to remove the kernel **even if it is the currently running kernel**.

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

* Re: [PR PATCH] [Closed]: base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
                   ` (7 preceding siblings ...)
  2020-08-19  0:52 ` ahesford
@ 2020-08-19  1:02 ` ahesford
  2020-08-19  1:45 ` avoidr
  9 siblings, 0 replies; 11+ messages in thread
From: ahesford @ 2020-08-19  1:02 UTC (permalink / raw)
  To: ml

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

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

base-files: vkpurge: fix parameter expansion in list_kernels()
https://github.com/void-linux/void-packages/pull/24298

Description:
This fixes next-kernels from having too much string of their versions
stripped.

Next-kernel versions have the format "vmlinu[xz]-<ver>-next-<date>".
Thus, the string was wrongly shortened to "<date>", instead of the
correct "<ver>-next-<date>".

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

* Re: base-files: vkpurge: fix parameter expansion in list_kernels()
  2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
                   ` (8 preceding siblings ...)
  2020-08-19  1:02 ` [PR PATCH] [Closed]: " ahesford
@ 2020-08-19  1:45 ` avoidr
  9 siblings, 0 replies; 11+ messages in thread
From: avoidr @ 2020-08-19  1:45 UTC (permalink / raw)
  To: ml

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

New comment by avoidr on void-packages repository

https://github.com/void-linux/void-packages/pull/24298#issuecomment-675803605

Comment:
Thanks!


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

end of thread, other threads:[~2020-08-19  1:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-15 19:51 [PR PATCH] base-files: vkpurge: fix parameter expansion in list_kernels() avoidr
2020-08-15 19:58 ` ericonr
2020-08-15 21:12 ` avoidr
2020-08-15 21:15 ` [PR PATCH] [Updated] " avoidr
2020-08-17  0:46 ` ahesford
2020-08-18 20:33 ` q66
2020-08-18 20:46 ` ahesford
2020-08-19  0:32 ` avoidr
2020-08-19  0:52 ` ahesford
2020-08-19  1:02 ` [PR PATCH] [Closed]: " ahesford
2020-08-19  1:45 ` avoidr

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