mirror of
https://github.com/SCST-project/scst.git
synced 2026-07-25 17:42:38 +00:00
svn merge -r3389:3974 https://scst.svn.sourceforge.net/svnroot/scst/trunk/scripts
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.1.0.x@3975 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# -*- mode: shell-script -*-
|
||||
# Shell functions for parsing the Linux kernel version.
|
||||
|
||||
# Kernel version number.
|
||||
function kernel_version {
|
||||
if [ "${1#2.}" != "$1" ]; then
|
||||
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/p'
|
||||
else
|
||||
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\).*$/\1/p'
|
||||
fi
|
||||
}
|
||||
|
||||
# Last component of the kernel version, or the empty string if $1 does
|
||||
# not contain a patchlevel.
|
||||
function patchlevel {
|
||||
if [ "${1#2.}" != "$1" ]; then
|
||||
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\.[0-9]*\)[.-]\(.*\)$/\2/p'
|
||||
else
|
||||
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\)[.-]\(.*\)$/\2/p'
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user