summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-04-16 00:01:10 -0700
committerEric S. Raymond <esr@thyrsus.com>2016-04-16 04:25:57 -0400
commit0631b9e3a24a9215f3d10d9434bf42e0c50c2408 (patch)
treee5299311d9b2de996fc1c6edea40d132f340f790 /SConstruct
parent22c3fafb25b742973d7122edc626b30d03bdb36c (diff)
downloadgpsd-0631b9e3a24a9215f3d10d9434bf42e0c50c2408.tar.gz
Fixes uninstall to remove Python package directory.
Uninstall was removing the contents of the Python package directory, but not the directory itself. There's an asymmetry where an unmentioned directory is created automatically when needed, but not removed when it's rendered empty. In Python 2, this is a fairly harmless error, albeit slightly unclean, since directories lacking an __init__.py file are ignored by the import logic. But in Python 3, which allows the init file to be omitted, leaving the empty directory around causes "import gps" to apparently succeed and create an empty "namespace" module. Not only does this confuse programs attempting to detect import failures, but it also prevents a future import from working even after adjusting sys.path, since reimporting an already imported module is a NOP. The fix is simply to include the directory explicitly in the list for python_install. This has no actual effect on the install, but includes the directory in the uninstall. TESTED: Ran install/uninstall and verified that the directory is now removed by the uninstall.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct5
1 files changed, 4 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 2740e118..3bfb95ab 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1535,7 +1535,10 @@ else:
python_install = [python_extensions_install,
python_modules_install,
python_progs_install,
- python_egg_info_install]
+ python_egg_info_install,
+ # We don't need the directory explicitly for the
+ # install, but we do need it for the uninstall
+ Dir(DESTDIR + python_module_dir)]
pc_install = [env.Install(installdir('pkgconfig'), 'libgps.pc')]
if qt_env: