Commit 403bc00a authored by Oskar Skog's avatar Oskar Skog

Pre 0.5.8: Python 2 is faster

parent 6a2b60f1
......@@ -15,7 +15,7 @@
NAME := anonymine
NAME_C := Anonymine
DESCRIPTION = Minesweeper without guessing
VERSION := 0.5.7
VERSION := pre-0.5.8
# Four more variables are required: sysconfdir, vargamesdir, EXECUTABLES and
# MODULES
......
......@@ -18,7 +18,7 @@ if [ $# -eq 1 ]; then
done
fi
for python_version in pypy3 pypy pypy2 python3 python python2; do
for python_version in pypy2 pypy pypy3 python2 python python3; do
"$python_version" -c '' 2>/dev/null || continue
"$python_version" configure.py "$@"
exit 0
......
......@@ -14,6 +14,7 @@ builddir = sys.argv[6]
out = r'''#!/usr/bin/python
import sys
import os
import errno
# Stop funny things from happening.
def usage():
......@@ -44,13 +45,13 @@ if configure.expand('MODULES', Makefile) == $modules_dir$:
files = ("anonymine_engine.py", "anonymine_fields.py", "anonymine_solver.py")
for file in files:
srcfile = '{}/{}'.format($modules_dir$, file)
destfile = '{}{}/{}'.format(
srcfile = '{0}/{1}'.format($modules_dir$, file)
destfile = '{0}{1}/{2}'.format(
$destdir$,
configure.expand('MODULES', Makefile),
file
)
# Don't remove real files.
# Don't remove the installed version.
# Only create links to real files.
# Real files are not symlinks.
if sys.argv[1] == "install":
......@@ -58,8 +59,11 @@ for file in files:
if not os.path.islink(srcfile):
try:
os.unlink(destfile)
except:
pass
except OSError as e:
if e.errno == errno.ENOENT:
pass
else:
raise
os.symlink(srcfile, destfile)
else:
sys.stderr.write("Source file is a symlink.\n")
......@@ -71,10 +75,10 @@ for file in files:
except:
sys.stderr.write("Destination file does not exist.\n")
continue
if os.path.islink(destfile):
if destfile != srcfile:
os.unlink(destfile)
else:
sys.stderr.write("Destination file is not a symlink.\n")
sys.stderr.write("Destination file is used by the installation.\n")
sys.exit(1)
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment