X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=build.common;h=08b8feae7ef2106f63a3e2aa351c6365616be2e7;hb=8e35c394f7bdbfc14e24c0a56d5b90373e65a6bc;hp=527d222e9534ef328b4a16538eb398007a2e6912;hpb=f47278cb82f983de9b7f79aa8dbd86b84cf77cf0;p=build.git diff --git a/build.common b/build.common index 527d222e..08b8feae 100644 --- a/build.common +++ b/build.common @@ -7,11 +7,27 @@ # Copyright (C) 2007 The Trustees of Princeton University # Thierry Parmentelat INRIA # -# supported distros f8, f12, f14, f16, f18, centos5, sl6 +# supported distros f12 f14 f16 f18 f20 +# and debians/ubuntus to a lesser extent # # for locating pkgs.py export PATH=.:$PATH +# 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,:, ); 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 +} + # returns 'Fedora' or 'CentOS' for now function pl_getDistro() { if [ -f "/etc/redhat-release" ] ; then