#!/bin/sh

set -e
set -u

recommends=""
for lib in "$@"
do
    rec=$(dpkg-query -S $(readlink -f /usr/lib/${DEB_HOST_MULTIARCH}/${lib}) | cut -d':' -f1)
    recommends="${recommends}${rec}, "
done

echo "waypipe:Recommends=${recommends%, }" >> debian/waypipe.substvars
