From 0db4badc02c172212386834b2d4b7fcf00bace00 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 20 Mar 2016 13:34:31 -0400 Subject: Steps towards working under Python 3. --- test/Makefile | 3 +++ test/setpython | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 test/setpython (limited to 'test') diff --git a/test/Makefile b/test/Makefile index 0e1d5bd..3841041 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,10 +1,13 @@ +PATH := ..:.:${PATH} SOURCES = $(shell ls *.c) regress: @echo "Testing deheader: no output is good news." + @setpython python2 @deheader -v -v . >/tmp/regress @diff -u regress.chk /tmp/regress + @setpython python @rm /tmp/regress makeregress: @deheader -v -v . >regress.chk diff --git a/test/setpython b/test/setpython new file mode 100755 index 0000000..8d8d2fc --- /dev/null +++ b/test/setpython @@ -0,0 +1,24 @@ +#!/bin/sh +# +# setpython - create a local link from 'python' to a specified version +# +# This script is used to to redirect the 'python' in reposurgeon's +# shebang line to a specified version when running regression tests. + +if [ -z "$1" ] +then + ls -l python +elif [ $1 = "python" ] +then + rm -f ./python +elif [ $1 = python2 -o $1 = python3 ] +then + set -- `whereis $1` + shift + case $1 in + */bin/*) ln -sf $1 ./python; echo "python -> $1";; + *) echo "setpython: no python binary" >&2;; + esac +else + echo "setpython: unrecognized python version" >&2 +fi -- cgit v1.2.3-70-g09d2