> > It's using /usr/lib/pypy/ns/ the same way as we do in Python 2.
> 
> It's in /usr/lib/ not /usr/share/
> 
> I couldn't reasonably make pypy use /usr/ as it's prefix, without it
> finding cPython libraries. So the whole of pypy is in /usr/lib/pypy/.

pypy can be in /usr/lib/ and ns files in /usr/share/.
Why do you want them both in /usr/lib? I'm sorry I didn't double check
where /usr/bin/pypycompile searches for these files and assumed it's in
/usr/share, but could you follow other interpreters and read it from
/usr/share? This seems a better choice (FHS wise).
Note that there's already /usr/share/pypy/dist/ dir with pydist files…

patch attached :)
diff --git a/debian/changelog b/debian/changelog
index 6bade0b3..69248c65 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,12 @@
 pypy (7.0.0+dfsg-3) UNRELEASED; urgency=medium
 
+  [ Stefano Rivera ]
   * Update watch file regex, upstream calls it pypy2.7 now.
 
+  [ Piotr Ożarowski ]
+  * pypycompile and pypyclean now read namespaces from /usr/share/pypy/ns
+    (to follow dh_pypy's suggested location)
+
  -- Stefano Rivera <stefa...@debian.org>  Tue, 26 Feb 2019 16:38:55 -0800
 
 pypy (7.0.0+dfsg-2) unstable; urgency=medium
diff --git a/debian/scripts/pypyclean b/debian/scripts/pypyclean
index eaba24bd..83c89070 100755
--- a/debian/scripts/pypyclean
+++ b/debian/scripts/pypyclean
@@ -31,7 +31,7 @@ def package_modules(package):
 
 def installed_namespaces():
     '''Return a dictionary of package: frozenset(namespaces)'''
-    ns_dir = '/usr/lib/pypy/ns'
+    ns_dir = '/usr/share/pypy/ns'
     ns_by_pkg = {}
     for pkg in os.listdir(ns_dir):
         ns_file = os.path.join(ns_dir, pkg)
diff --git a/debian/scripts/pypycompile b/debian/scripts/pypycompile
index 42af3264..31abe2df 100755
--- a/debian/scripts/pypycompile
+++ b/debian/scripts/pypycompile
@@ -45,7 +45,7 @@ def generate_namespace_init(package, verbose):
     '''Iterate through a package's ns file.
     Create all necessary__init__.pys, and yield them.
     '''
-    ns_file = os.path.join('/usr/lib/pypy/ns', package)
+    ns_file = os.path.join('/usr/share/pypy/ns', package)
     if not os.path.exists(ns_file):
         return
     with open(ns_file) as f:

Reply via email to