PATH="${abs_builddir}/testing@rpmbindir@:${abs_builddir}/testing@usrbindir@:$PATH"
export PATH
+RPMTEST="${abs_builddir}/testing"
+RPMDATA="${abs_srcdir}/data/"
+
# Popt looks into $HOME
-HOME="${abs_builddir}/testing"
+HOME="${RPMTEST}"
export HOME
-RPMRC="${abs_builddir}/testing@RPMCONFIGDIR@/rpmrc"
-TOPDIR="${abs_builddir}/testing/build"
+RPMRC="${RPMTEST}@RPMCONFIGDIR@/rpmrc"
+TOPDIR="${RPMTEST}/build"
RPM_XFAIL=${RPM_XFAIL-1}
{
cmd="$1"
shift
- "${cmd}" --rcfile="${RPMRC}" --define "_topdir ${TOPDIR}" $*
+ "${cmd}" --rcfile="${RPMRC}" --define "_topdir ${TOPDIR}" $@
+}
+
+function runroot()
+{
+ cmd="$1"
+ shift
+ (cd ${RPMTEST} && \
+ mkdir -p etc && touch etc/mtab &&
+ FAKECHROOT_BASE="${RPMTEST}" fakechroot "${cmd}" --rcfile="${RPMRC}" --define "_topdir ${TOPDIR}" $@
+ )
}
AT_CHECK([
RPMDB_CLEAR
RPMDB_INIT
-run rpm \
- --root="${abs_builddir}"/testing \
+runroot rpm \
-qa
],
[0])
RPMDB_CLEAR
RPMDB_INIT
-run rpm -i \
- --root="${abs_builddir}"/testing \
- "${abs_srcdir}"/data/RPMS/foo-1.0-1.noarch.rpm
+tpkg="foo-1.0-1.noarch.rpm"
+cp "${RPMDATA}/RPMS/${tpkg}" "${RPMTEST}"
+
+runroot rpm -i \
+ "${tpkg}"
],
[0])
RPMDB_CLEAR
RPMDB_INIT
-run rpm -i \
- --root="${abs_builddir}"/testing \
- --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
- "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm
+tpkg="hello-1.0-1.i386.rpm"
+cp "${RPMDATA}/RPMS/${tpkg}" "${RPMTEST}"
+
+runroot rpm -i \
+ --noscripts --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
+ "${tpkg}"
],
[0])
RPMDB_CLEAR
RPMDB_INIT
-run rpm -i \
- --root="${abs_builddir}"/testing \
- --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
- "${abs_srcdir}"/data/RPMS/hello-1.0-1.ppc64.rpm
+tpkg="hello-1.0-1.ppc64.rpm"
+cp "${RPMDATA}/RPMS/${tpkg}" "${RPMTEST}"
+
+runroot rpm -i \
+ --noscripts --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
+ "${tpkg}"
],
[0],
[ignore],
RPMDB_CLEAR
RPMDB_INIT
-run rpm \
- --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
- -i "${abs_srcdir}"/data/RPMS/hello-1.0-1.ppc64.rpm
+tpkg="hello-1.0-1.ppc64.rpm"
+cp "${RPMDATA}/RPMS/$tpkg" "${RPMTEST}"
+
+runroot rpm \
+ --noscripts --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
+ -i "${tpkg}"
],
[0])
AT_CHECK([
-run rpm \
- --root="${abs_builddir}"/testing \
+runroot rpm \
-q hello
],
[0],
_ATEOF
AT_CHECK([
-rpm \
- --root="${abs_builddir}"/testing \
+runroot rpm \
-ql hello
],
[0],