mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
use POSIX regex in libpathrs build
word boundary anchor \> is present only in GNU awk implementation. This will not work if we are building libpathrs inside a container like debian/ubuntu which uses mawk. Therefore switch to a POSIX compatible regex that can be used with all implementations of awk to find the system libc path Signed-off-by: Akhil Mohan <akhilerm@gmail.com> Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This commit is contained in:
committed by
Aleksa Sarai
parent
132498f869
commit
28d5ffbab0
@@ -99,7 +99,7 @@ function build_libpathrs() {
|
|||||||
# /proc/self/maps and parse out the parent directory of the libc.so being
|
# /proc/self/maps and parse out the parent directory of the libc.so being
|
||||||
# used.
|
# used.
|
||||||
local native_libdir libdir=
|
local native_libdir libdir=
|
||||||
native_libdir="$(awk '$NF ~ /\/libc\>.*\.so/ { print $NF; }' /proc/self/maps |
|
native_libdir="$(awk '$NF ~ /\/libc([.-].*)?\.so/ { print $NF }' /proc/self/maps |
|
||||||
sort -u | head -n1 | xargs dirname)"
|
sort -u | head -n1 | xargs dirname)"
|
||||||
if [[ "$native_libdir" == "$dest/"* ]]; then
|
if [[ "$native_libdir" == "$dest/"* ]]; then
|
||||||
libdir="$native_libdir"
|
libdir="$native_libdir"
|
||||||
|
|||||||
Reference in New Issue
Block a user