From 0a1ebbc9589b5ce477606d2e691b8e72303ce671 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 23 Jan 2014 13:18:37 +0100 Subject: [PATCH] have to duplicate bin_in_container.. --- build.common | 2 +- lbuild-nightly.sh | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/build.common b/build.common index 08b8feae..e0325c1b 100644 --- a/build.common +++ b/build.common @@ -21,7 +21,7 @@ export PATH=$PATH:/bin:/sbin function bin_in_container () { lxc=$1; shift binary=$1; shift - for path in $(echo $PATH | sed -e s,:, ); do + for path in $(echo $PATH | sed -e 's,:, ,g' ); do [ -f /vservers/$lxc/$path/$binary ] && { echo $path/$binary; return; } [ -f /vservers/$lxc/rootfs/$path/$binary ] && { echo $path/$binary; return; } done diff --git a/lbuild-nightly.sh b/lbuild-nightly.sh index 2b2f2c48..8e76954d 100755 --- a/lbuild-nightly.sh +++ b/lbuild-nightly.sh @@ -3,9 +3,6 @@ COMMANDPATH=$0 COMMAND=$(basename $0) -# needed only so we can share bin_in_container -. build.common - # default values, tunable with command-line options DEFAULT_FCDISTRO=f20 DEFAULT_PLDISTRO=planetlab @@ -217,6 +214,23 @@ function in_root_context () { rpm -q libvirt > /dev/null } +# copied from build.common because this cannot have deps. +# (when pulled from infrastructure/scripts/lbuild-nightly.sh) +# old guests have e.g. mount in /bin but this is no longer part of +# the standard PATH in recent hosts after usrmove, so let's keep it simple +export PATH=$PATH:/bin:/sbin + +# would be much simpler if enter-lxc-namespace was looking along a PATH... +function bin_in_container () { + lxc=$1; shift + binary=$1; shift + for path in $(echo $PATH | sed -e 's,:, ,g' ); do + [ -f /vservers/$lxc/$path/$binary ] && { echo $path/$binary; return; } + [ -f /vservers/$lxc/rootfs/$path/$binary ] && { echo $path/$binary; return; } + done + echo bin_in_container_cannot_find_$binary +} + # run in the vm - do not manage success/failure, will be done from the root ctx function build () { set -x -- 2.43.0