mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
Make the new chroot environment creation infrastructure more flexible about
non-absolute paths.
This commit is contained in:
parent
dcb2122e85
commit
6bc10635f8
@ -110,13 +110,16 @@ function mkchroot
|
|||||||
shift
|
shift
|
||||||
for i in "$@"
|
for i in "$@"
|
||||||
do
|
do
|
||||||
if [ "${i:0:1}" == "/" ]
|
[ "${i:0:1}" == "/" ] || i=$(which $i)
|
||||||
then
|
|
||||||
[ -f "$dest/$i" ] && continue
|
[ -f "$dest/$i" ] && continue
|
||||||
|
if [ -e "$i" ]
|
||||||
|
then
|
||||||
d=`echo "$i" | grep -o '.*/'` &&
|
d=`echo "$i" | grep -o '.*/'` &&
|
||||||
mkdir -p "$dest/$d" &&
|
mkdir -p "$dest/$d" &&
|
||||||
cat "$i" > "$dest/$i" &&
|
cat "$i" > "$dest/$i" &&
|
||||||
chmod +x "$dest/$i"
|
chmod +x "$dest/$i"
|
||||||
|
else
|
||||||
|
echo "Not found: $i"
|
||||||
fi
|
fi
|
||||||
mkchroot "$dest" $(ldd "$i" | egrep -o '/.* ')
|
mkchroot "$dest" $(ldd "$i" | egrep -o '/.* ')
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user