Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/vanilla-kernel-bin/
Date: Sat, 28 Dec 2019 20:34:44
Message-Id: 1577565274.63aed098518786d1b135a6c8665d84483be2f829.mgorny@gentoo
1 commit: 63aed098518786d1b135a6c8665d84483be2f829
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 28 20:30:57 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 28 20:34:34 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63aed098
7
8 sys-kernel/vanilla-kernel-bin: Verify version passed to has_version
9
10 Verify the version read from /usr/src/linux symlink and make sure
11 that it consists of plain [0-9.] before passing it to has_version.
12 If it doesn't conform, it isn't our symlink anyway.
13
14 Closes: https://bugs.gentoo.org/703822
15 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
16
17 sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild | 5 +++--
18 1 file changed, 3 insertions(+), 2 deletions(-)
19
20 diff --git a/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild
21 index fa1b7e994f2..4908786bffb 100644
22 --- a/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild
23 +++ b/sys-kernel/vanilla-kernel-bin/vanilla-kernel-bin-5.4.6.ebuild
24 @@ -81,8 +81,9 @@ pkg_postinst() {
25 fi
26
27 local symlink_target=$(readlink "${EROOT}"/usr/src/linux)
28 - if [[ ${symlink_target} == linux-[0-9]* ]]; then
29 - local symlink_ver=${symlink_target#linux-}
30 + local symlink_ver=${symlink_target#linux-}
31 + if [[ ${symlink_target} == linux-* && -z ${symlink_ver//[0-9.]/} ]]
32 + then
33 local symlink_pkg=${CATEGORY}/${PN}-${symlink_ver}
34 # if the current target is either being replaced, or still
35 # installed (probably depclean candidate), update the symlink