#!/bin/bash set -e # Don't inherit the -x from the testsuite set +x DIR=`mktemp -d` REPO=$1 shift ID=$1 shift BRANCH=$1 shift COLLECTION_ID=$1 shift EXTRA="${1-}" shift mkdir ${DIR}/files mkdir ${DIR}/usr cat > ${DIR}/metadata <> $BINS # Add library dependencies (ldd "${f}" | sed "s/.* => //" | awk '{ print $1}' | grep ^/ | sort -u -o $LIBS $LIBS -) || true local shebang=$(sed -n '1s/^#!\([^ ]*\).*/\1/p' "${f}") if [ x$shebang != x ]; then add_bin "$shebang" fi } for i in $@ bash ls cat echo readlink socat; do I=`which $i` add_bin $I done for i in `cat $BINS`; do #echo Adding binary $i 1>&2 cp "$i" ${DIR}/usr/bin/ done for i in `cat $LIBS`; do #echo Adding library $i 1>&2 cp "$i" ${DIR}/usr/lib/ done ln -s bash ${DIR}/usr/bin/sh # This only exists so we can update the runtime cat > ${DIR}/usr/bin/runtime_hello.sh <