commit: 0bf775500d26e7ed9ef3a5b0d68d68deca70fcbb
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri May 25 19:44:06 2018 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri May 25 19:44:06 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0bf77550
travis.sh: add helper script to run tests
travis.sh | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/travis.sh b/travis.sh
new file mode 100755
index 000000000..3c03149e6
--- /dev/null
+++ b/travis.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+# this script runs the tests as Travis would do (.travis.yml) and can be
+# used to test the Prefix branch of portage on a non-Prefix system
+
+: ${TMPDIR=/var/tmp}
+
+HERE=$(dirname $(realpath ${BASH_SOURCE[0]}))
+REPO=${HERE##*/}.$$
+
+cd ${TMPDIR}
+git clone ${HERE} ${REPO}
+
+cd ${REPO}
+printf "[build_ext]\nportage-ext-modules=true" >> setup.cfg
+find . -type f -exec \
+ sed -e "s|@PORTAGE_EPREFIX@||" \
+ -e "s|@PORTAGE_BASE@|${PWD}|" \
+ -e "s|@PORTAGE_MV@|$(type -P mv)|" \
+ -e "s|@PORTAGE_BASH@|$(type -P bash)|" \
+ -e "s|@PREFIX_PORTAGE_PYTHON@|$(type -P python)|" \
+ -e "s|@DEFAULT_PATH@|${EPREFIX}/usr/bin:${EPREFIX}/bin|" \
+ -e "s|@EXTRA_PATH@|${EPREFIX}/usr/sbin:${EPREFIX}/sbin|" \
+ -e "s|@portagegroup@|$(id -gn)|" \
+ -e "s|@portageuser@|$(id -un)|" \
+ -e "s|@rootuser@|$(id -un)|" \
+ -e "s|@rootuid@|$(id -u)|" \
+ -e "s|@rootgid@|$(id -g)|" \
+ -e "s|@sysconfdir@|${EPREFIX}/etc|" \
+ -i '{}' +
+unset EPREFIX
+./setup.py test