#!/bin/sh
# Stub for the rmadison command, used by the pkgos-modernize unit tests
# so that they never touch the network. The test sets what it prints and
# its exit code through the PKGOS_TEST_RMADISON_* variables.

if [ -n "${PKGOS_TEST_RMADISON_RC}" ] && [ "${PKGOS_TEST_RMADISON_RC}" != 0 ] ; then
	exit "${PKGOS_TEST_RMADISON_RC}"
fi
printf '%s' "${PKGOS_TEST_RMADISON_OUTPUT}"
exit 0
