Skip to content

Commit a8675e7

Browse files
authored
Fix #647 (#648)
* Fix #647 * Fix read/echo issue in configure
1 parent c433444 commit a8675e7

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

package/kernelctl/kernelctl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ get_kernel_names() {
6767

6868
# get current kernel
6969
get_current_kernel_name() {
70-
current_kernel_name=$(find "$kernelctl_dir" -samefile "$kernelctl_dir"/current.tar.bz2 ! -name current.tar.bz2 -print0 | xargs -0 -I"{}" basename {} .tar.bz2)
70+
if [[ -e "$kernelctl_dir"/current.tar.bz2 ]]; then
71+
current_kernel_name=$(find "$kernelctl_dir" -samefile "$kernelctl_dir"/current.tar.bz2 ! -name current.tar.bz2 -print0 | xargs -0 -I"{}" basename {} .tar.bz2)
72+
else
73+
current_kernel_name=''
74+
fi
7175
}
7276

7377
# translate input into a kernel name
@@ -104,8 +108,12 @@ list() {
104108
# show the current configured kernel
105109
show() {
106110
get_current_kernel_name
107-
echo -e "${gr}Current kernel:${sf}"
108-
echo -e " ${bf}${current_kernel_name}${sf}"
111+
if [[ "$current_kernel_name" = "" ]]; then
112+
echo -e "${bf}There is no link to the current running kernel in the staging area.${sf}"
113+
else
114+
echo -e "${gr}Current kernel:${sf}"
115+
echo -e " ${bf}${current_kernel_name}${sf}"
116+
fi
109117
}
110118

111119
# actually switch kernels

package/kernelctl/package

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
pkgnames=(kernelctl)
66
pkgdesc="Manage aftermarket kernels"
77
url=https://toltec-dev.org/
8-
pkgver=0.1-4
9-
timestamp=2022-03-14T00:00Z
8+
pkgver=0.1-5
9+
timestamp=2022-11-12T00:00Z
1010
section="utils"
1111
maintainer="Salvatore Stella <etn45p4m@gmail.com>"
1212
license=MIT
@@ -27,14 +27,7 @@ package() {
2727

2828
configure() {
2929
if [[ "$(kernelctl list | tail -n +2 | awk '{print $2}' | grep "vanilla-$(< /etc/version)")" == "" ]]; then
30-
read -r -d '' msg <<- EOM
31-
It looks like there is no backup of the upstream kernel for the
32-
installed version of codex.
33-
34-
Please standby while one is produced (assuming that the
35-
currently running kernel is upstream).
36-
EOM
37-
echo -e "$msg"
30+
echo "Creating a backup of the currently running kernel."
3831
kernelctl backup vanilla
3932
fi
4033
}

0 commit comments

Comments
 (0)