ubuntu-mainline-kernel.sh icon indicating copy to clipboard operation
ubuntu-mainline-kernel.sh copied to clipboard

Minor bug fix: on requesting uninstall permission, print each package on a new line

Open robinpaulson opened this issue 5 years ago • 2 comments

Currently when i use the "umk -u" option, i'm asked if i want to uninstall a series of packages, listed as below:

linux-headers-5.7.5-050705:amd64 linux-headers-5.7.5-050705:all linux-headers-5.7.5-050705-generic:amd64 linux-headers-5.7.5-050705-generic:all linux-image-5.7.5-050705-generic:amd64 linux-image-unsigned-5.7.5-050705-generic:amd64 linux-modules-5.7.5-050705-generic:amd64

This is not so easy to read, it would be much easier to do so if each package were printed on a new line, like so: linux-headers-5.7.5-050705:amd64 linux-headers-5.7.5-050705:all linux-headers-5.7.5-050705-generic:amd64 linux-headers-5.7.5-050705-generic:all linux-image-5.7.5-050705-generic:amd64 linux-image-unsigned-5.7.5-050705-generic:amd64 linux-modules-5.7.5-050705-generic:amd64

Thanks

robinpaulson avatar Jun 25 '20 04:06 robinpaulson

As an aside, only four of those seven packages are installed. Why does it list the others?

robinpaulson avatar Jun 25 '20 12:06 robinpaulson

I took a look through the script, plus did some Bash learning. From what I gather, when using the "$@" parameter, setting "IFS" to a character will separate the instances of the list (the packages to be uninstalled) with that character. In the script, you set "IFS" to "$'\n'" on line 799, which should thus split the list of packages to be installed, using the newline character. But it doesn't and I'm not sure why.

I think it's related to the form of the "cut" command on line 802, using " " as a delimiter may be removing the newline character

robinpaulson avatar May 11 '21 00:05 robinpaulson