1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
From: Ole Streicher <olebole@debian.org>
Date: Thu, 1 Dec 2016 21:18:56 +0100
Subject: Call python scripts as modules instead of executables
In Debian, the python scripts are not installed in /usr/bin, but are
only accessible as modules. Therefore, we need to replace the direct
call of the script by "python -m astrometry.$(MODULE)".
---
solver/augment-xylist.c | 12 +++++++++---
util/image2pnm.py | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/solver/augment-xylist.c b/solver/augment-xylist.c
index 43ea4f9..59c6aaa 100644
--- a/solver/augment-xylist.c
+++ b/solver/augment-xylist.c
@@ -728,7 +728,9 @@ int augment_xylist(augment_xylist_t* axy,
sl_append_nocopy(tempfiles, pnmfn);
}
- append_executable(cmd, "image2pnm", me);
+ append_executable(cmd, "python3", me);
+ sl_append(cmd, "-m");
+ sl_append(cmd, "astrometry.util.image2pnm");
if (axy->extension) {
sl_append(cmd, "--extension");
sl_appendf(cmd, "%i", axy->extension);
@@ -1054,7 +1056,9 @@ int augment_xylist(augment_xylist_t* axy,
}
logverb("Removing lines of (spurious) sources from xylist \"%s\", writing to \"%s\"\n",
xylsfn, nolinesfn);
- append_executable(cmd, "removelines", me);
+ append_executable(cmd, "python3", me);
+ sl_append(cmd, "-m");
+ sl_append(cmd, "astrometry.util.removelines");
if (axy->xcol)
sl_appendf(cmd, "-X %s", axy->xcol);
if (axy->ycol)
@@ -1113,7 +1117,9 @@ int augment_xylist(augment_xylist_t* axy,
unixylsfn = create_temp_file("uniform", axy->tempdir);
sl_append_nocopy(tempfiles, unixylsfn);
}
- append_executable(cmd, "uniformize", me);
+ append_executable(cmd, "python3", me);
+ sl_append(cmd, "-m");
+ sl_append(cmd, "astrometry.util.uniformize");
sl_appendf(cmd, "-n %i", axy->uniformize);
if (axy->xcol)
sl_appendf(cmd, "-X %s", axy->xcol);
diff --git a/util/image2pnm.py b/util/image2pnm.py
index 9c275af..3ee8fa6 100755
--- a/util/image2pnm.py
+++ b/util/image2pnm.py
@@ -190,7 +190,7 @@ def image2pnm(infile, outfile, force_ppm=False, extension=None, mydir=None):
if ext == fitsext and extension:
cmd = an_fitstopnm_ext_cmd % extension
- if ext == fitsext and mydir:
+ if False and ext == fitsext and mydir:
# an-fitstopnm: add explicit path...
cmd = find_program(mydir, cmd)
if cmd is None:
|