callstack context: use delimiter when stack is incomplete
[lttng-modules.git] / abi-fedora-version.sh
CommitLineData
e4838da1
LG
1#!/bin/sh
2
3# First argument is the path to the kernel headers.
4KPATH="$1"
5
6if [ ! -f "${KPATH}/include/generated/utsrelease.h" ]; then
7 echo 0
8 exit 0
9fi
10
11# Assuming KPATH is the target kernel headers directory
12UTS_RELEASE=$(sed -rn 's/^#define UTS_RELEASE "(.*)"/\1/p' "${KPATH}/include/generated/utsrelease.h")
13FEDORA_VERSION=$(echo "${UTS_RELEASE}" | sed -n 's/.*\.fc\([0-9]*\)\..*/\1/p')
14
15if [ "x${FEDORA_VERSION}" = "x" ]; then
16 echo 0
17 exit 0
18fi
19
20FEDORA_REVISION_VERSION=$(echo "${UTS_RELEASE}" | sed -n 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\-\([0-9]*\).*/\4/p')
21echo "${FEDORA_REVISION_VERSION}"
This page took 0.022559 seconds and 4 git commands to generate.