runtests: make sure we are in the right dir
authorMike Frysinger <vapier@gentoo.org>
Sun, 9 Oct 2011 18:38:10 +0000 (14:38 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sun, 9 Oct 2011 20:40:43 +0000 (16:40 -0400)
The code assumes we're in the top of the tree (when it tries to run with
the full path "pym/portage/tests/runTests"), so try to make sure we are
in the right place to allow things like `../runtests.sh` to "just work".

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
runtests.sh

index 981fa1ec2ebad9b507ad2141d3b3a74b47133fb6..d55860af05d014095d7ad68bfcdf28e520589b9a 100755 (executable)
@@ -4,6 +4,9 @@
 
 PYTHON_VERSIONS="2.6 2.7 3.1 3.2 3.3"
 
+# has to be run from portage root dir
+cd "${0%/*}" || exit 1
+
 case "${NOCOLOR:-false}" in
        yes|true)
                GOOD=