We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
spack find : always prompt 0 installed packages
On a clean `develop` checkout : 

```
$ git clone https://github.com/LLNL/spack.git
Cloning into 'spack'...
remote: Counting objects: 25613, done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 25613 (delta 12), reused 3 (delta 3), pack-reused 25557
Receiving objects: 100% (25613/25613), 6.65 MiB | 6.46 MiB/s, done.
Resolving deltas: 100% (13031/13031), done.
Checking connectivity... done.

$ cd spack
$ . share/spack/setup-env.sh 
$ spack compilers
==> Available compilers
-- gcc ----------------------------------------------------------
gcc@4.8

$ spack install zlib
==> Installing zlib
==> Trying to fetch from file:///home/mculpo/production/spack-mirror/zlib/zlib-1.2.8.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/mculpo/tmp/spack/var/spack/stage/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix/zlib-1.2.8.tar.gz
==> Created stage in /home/mculpo/tmp/spack/var/spack/stage/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix
==> No patches needed for zlib
==> Building zlib
==> Successfully installed zlib
  Fetch: 0.01s.  Build: 3.69s.  Total: 3.70s.
[+] /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix

$ spack find
==> 0 installed packages.

$ spack install szip
==> Installing szip
==> Trying to fetch from file:///home/mculpo/production/spack-mirror/szip/szip-2.1.tar.gz
######################################################################## 100,0%
==> Staging archive: /home/mculpo/tmp/spack/var/spack/stage/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq/szip-2.1.tar.gz
==> Created stage in /home/mculpo/tmp/spack/var/spack/stage/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq
==> No patches needed for szip
==> Building szip
==> Successfully installed szip
  Fetch: 0.01s.  Build: 8.09s.  Total: 8.10s.
[+] /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq

$ spack find 
==> 0 installed packages.
```

The db seems to be written correctly : 

```
database:
  installs:
    d6pdl6xvnvap6ihrqcqtgvweghbszmix:
      explicit: true
      installed: true
      path: /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix
      ref_count: 0
      spec:
        zlib:
          arch: linux-x86_64
          compiler:
            name: gcc
            version: '4.8'
          dependencies: {}
          namespace: builtin
          parameters:
            cflags: []
            cppflags: []
            cxxflags: []
            fflags: []
            ldflags: []
            ldlibs: []
          version: 1.2.8
    esfmhl54wbdb7nnnip6y6jbxlbmxs2jq:
      explicit: true
      installed: true
      path: /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq
      ref_count: 0
      spec:
        szip:
          arch: linux-x86_64
          compiler:
            name: gcc
            version: '4.8'
          dependencies: {}
          namespace: builtin
          parameters:
            cflags: []
            cppflags: []
            cxxflags: []
            fflags: []
            ldflags: []
            ldlibs: []
          version: '2.1'
  version: 0.9.1
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `var/spack/repos/builtin/packages/mgis/package.py`
Content:
```
1 # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
2 # Spack Project Developers. See the top-level COPYRIGHT file for details.
3 #
4 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
5 
6 from spack import *
7 
8 
9 class Mgis(CMakePackage):
10     """
11     The MFrontGenericInterfaceSupport project (MGIS) provides helper
12     functions for various solvers to interact with behaviour written
13     using MFront generic interface.
14 
15     MGIS is written in C++.
16     Bindings are provided for C and fortran (2003).
17     A FEniCS binding is also available.
18     """
19 
20     homepage = "https://thelfer.github.io/mgis/web/index.html"
21     url      = "https://github.com/thelfer/MFrontGenericInterfaceSupport/archive/MFrontGenericInterfaceSupport-1.0.tar.gz"
22     git      = "https://github.com/thelfer/MFrontGenericInterfaceSupport.git"
23     maintainers = ['thelfer']
24 
25     # development branches
26     version("master", branch="master")
27     version("rliv-1.0", branch="rliv-1.0")
28 
29     # released version
30     version('1.0.1', sha256='6102621455bc5d9b1591cd33e93b2e15a9572d2ce59ca6dfa30ba57ae1265c08')
31     version('1.0', sha256='279c98da00fa6855edf29c2b8f8bad6e7732298dc62ef67d028d6bbeaac043b3')
32 
33     # variants
34     variant('c', default=True,
35             description='Enables c bindings')
36     variant('fortran', default=True,
37             description='Enables fortran bindings')
38     variant('python', default=True,
39             description='Enables python bindings')
40     variant('build_type', default='Release',
41             description='The build type to build',
42             values=('Debug', 'Release'))
43 
44     # dependencies
45     depends_on('tfel@3.2.0', when="@1.0")
46     depends_on('tfel@3.2.1', when="@1.0.1")
47     depends_on('tfel@rliv-3.2', when="@rliv-1.0")
48     depends_on('tfel@master', when="@master")
49     depends_on('boost+python', when='+python')
50     extends('python', when='+python')
51 
52     def cmake_args(self):
53 
54         args = []
55 
56         for i in ['c', 'fortran', 'python']:
57             if '+' + i  in self.spec:
58                 args.append("-Denable-{0}-bindings=ON".format(i))
59             else:
60                 args.append("-Denable-{0}-bindings=OFF".format(i))
61 
62         if '+python' in self.spec:
63             # adding path to python
64             python = self.spec['python']
65             args.append('-DPYTHON_LIBRARY={0}'.
66                         format(python.libs[0]))
67             args.append('-DPYTHON_INCLUDE_DIR={0}'.
68                         format(python.headers.directories[0]))
69             args.append('-DPython_ADDITIONAL_VERSIONS={0}'.
70                         format(python.version.up_to(2)))
71             # adding path to boost
72             args.append('-DBOOST_ROOT={0}'.
73                         format(self.spec['boost'].prefix))
74 
75         return args
76
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/var/spack/repos/builtin/packages/mgis/package.py b/var/spack/repos/builtin/packages/mgis/package.py
--- a/var/spack/repos/builtin/packages/mgis/package.py
+++ b/var/spack/repos/builtin/packages/mgis/package.py
@@ -46,7 +46,7 @@
     depends_on('tfel@3.2.1', when="@1.0.1")
     depends_on('tfel@rliv-3.2', when="@rliv-1.0")
     depends_on('tfel@master', when="@master")
-    depends_on('boost+python', when='+python')
+    depends_on('boost+python+numpy', when='+python')
     extends('python', when='+python')
 
     def cmake_args(self):

{"golden_diff": "diff --git a/var/spack/repos/builtin/packages/mgis/package.py b/var/spack/repos/builtin/packages/mgis/package.py\n--- a/var/spack/repos/builtin/packages/mgis/package.py\n+++ b/var/spack/repos/builtin/packages/mgis/package.py\n@@ -46,7 +46,7 @@\n     depends_on('tfel@3.2.1', when=\"@1.0.1\")\n     depends_on('tfel@rliv-3.2', when=\"@rliv-1.0\")\n     depends_on('tfel@master', when=\"@master\")\n-    depends_on('boost+python', when='+python')\n+    depends_on('boost+python+numpy', when='+python')\n     extends('python', when='+python')\n \n     def cmake_args(self):\n", "issue": "spack find : always prompt 0 installed packages\nOn a clean `develop` checkout : \n\n```\n$ git clone https://github.com/LLNL/spack.git\nCloning into 'spack'...\nremote: Counting objects: 25613, done.\nremote: Compressing objects: 100% (42/42), done.\nremote: Total 25613 (delta 12), reused 3 (delta 3), pack-reused 25557\nReceiving objects: 100% (25613/25613), 6.65 MiB | 6.46 MiB/s, done.\nResolving deltas: 100% (13031/13031), done.\nChecking connectivity... done.\n\n$ cd spack\n$ . share/spack/setup-env.sh \n$ spack compilers\n==> Available compilers\n-- gcc ----------------------------------------------------------\ngcc@4.8\n\n$ spack install zlib\n==> Installing zlib\n==> Trying to fetch from file:///home/mculpo/production/spack-mirror/zlib/zlib-1.2.8.tar.gz\n######################################################################## 100,0%\n==> Staging archive: /home/mculpo/tmp/spack/var/spack/stage/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix/zlib-1.2.8.tar.gz\n==> Created stage in /home/mculpo/tmp/spack/var/spack/stage/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix\n==> No patches needed for zlib\n==> Building zlib\n==> Successfully installed zlib\n  Fetch: 0.01s.  Build: 3.69s.  Total: 3.70s.\n[+] /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix\n\n$ spack find\n==> 0 installed packages.\n\n$ spack install szip\n==> Installing szip\n==> Trying to fetch from file:///home/mculpo/production/spack-mirror/szip/szip-2.1.tar.gz\n######################################################################## 100,0%\n==> Staging archive: /home/mculpo/tmp/spack/var/spack/stage/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq/szip-2.1.tar.gz\n==> Created stage in /home/mculpo/tmp/spack/var/spack/stage/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq\n==> No patches needed for szip\n==> Building szip\n==> Successfully installed szip\n  Fetch: 0.01s.  Build: 8.09s.  Total: 8.10s.\n[+] /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq\n\n$ spack find \n==> 0 installed packages.\n```\n\nThe db seems to be written correctly : \n\n```\ndatabase:\n  installs:\n    d6pdl6xvnvap6ihrqcqtgvweghbszmix:\n      explicit: true\n      installed: true\n      path: /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/zlib-1.2.8-d6pdl6xvnvap6ihrqcqtgvweghbszmix\n      ref_count: 0\n      spec:\n        zlib:\n          arch: linux-x86_64\n          compiler:\n            name: gcc\n            version: '4.8'\n          dependencies: {}\n          namespace: builtin\n          parameters:\n            cflags: []\n            cppflags: []\n            cxxflags: []\n            fflags: []\n            ldflags: []\n            ldlibs: []\n          version: 1.2.8\n    esfmhl54wbdb7nnnip6y6jbxlbmxs2jq:\n      explicit: true\n      installed: true\n      path: /home/mculpo/tmp/spack/opt/spack/linux-x86_64/gcc-4.8/szip-2.1-esfmhl54wbdb7nnnip6y6jbxlbmxs2jq\n      ref_count: 0\n      spec:\n        szip:\n          arch: linux-x86_64\n          compiler:\n            name: gcc\n            version: '4.8'\n          dependencies: {}\n          namespace: builtin\n          parameters:\n            cflags: []\n            cppflags: []\n            cxxflags: []\n            fflags: []\n            ldflags: []\n            ldlibs: []\n          version: '2.1'\n  version: 0.9.1\n```\n\n", "before_files": [{"content": "# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nfrom spack import *\n\n\nclass Mgis(CMakePackage):\n    \"\"\"\n    The MFrontGenericInterfaceSupport project (MGIS) provides helper\n    functions for various solvers to interact with behaviour written\n    using MFront generic interface.\n\n    MGIS is written in C++.\n    Bindings are provided for C and fortran (2003).\n    A FEniCS binding is also available.\n    \"\"\"\n\n    homepage = \"https://thelfer.github.io/mgis/web/index.html\"\n    url      = \"https://github.com/thelfer/MFrontGenericInterfaceSupport/archive/MFrontGenericInterfaceSupport-1.0.tar.gz\"\n    git      = \"https://github.com/thelfer/MFrontGenericInterfaceSupport.git\"\n    maintainers = ['thelfer']\n\n    # development branches\n    version(\"master\", branch=\"master\")\n    version(\"rliv-1.0\", branch=\"rliv-1.0\")\n\n    # released version\n    version('1.0.1', sha256='6102621455bc5d9b1591cd33e93b2e15a9572d2ce59ca6dfa30ba57ae1265c08')\n    version('1.0', sha256='279c98da00fa6855edf29c2b8f8bad6e7732298dc62ef67d028d6bbeaac043b3')\n\n    # variants\n    variant('c', default=True,\n            description='Enables c bindings')\n    variant('fortran', default=True,\n            description='Enables fortran bindings')\n    variant('python', default=True,\n            description='Enables python bindings')\n    variant('build_type', default='Release',\n            description='The build type to build',\n            values=('Debug', 'Release'))\n\n    # dependencies\n    depends_on('tfel@3.2.0', when=\"@1.0\")\n    depends_on('tfel@3.2.1', when=\"@1.0.1\")\n    depends_on('tfel@rliv-3.2', when=\"@rliv-1.0\")\n    depends_on('tfel@master', when=\"@master\")\n    depends_on('boost+python', when='+python')\n    extends('python', when='+python')\n\n    def cmake_args(self):\n\n        args = []\n\n        for i in ['c', 'fortran', 'python']:\n            if '+' + i  in self.spec:\n                args.append(\"-Denable-{0}-bindings=ON\".format(i))\n            else:\n                args.append(\"-Denable-{0}-bindings=OFF\".format(i))\n\n        if '+python' in self.spec:\n            # adding path to python\n            python = self.spec['python']\n            args.append('-DPYTHON_LIBRARY={0}'.\n                        format(python.libs[0]))\n            args.append('-DPYTHON_INCLUDE_DIR={0}'.\n                        format(python.headers.directories[0]))\n            args.append('-DPython_ADDITIONAL_VERSIONS={0}'.\n                        format(python.version.up_to(2)))\n            # adding path to boost\n            args.append('-DBOOST_ROOT={0}'.\n                        format(self.spec['boost'].prefix))\n\n        return args\n", "path": "var/spack/repos/builtin/packages/mgis/package.py"}], "after_files": [{"content": "# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nfrom spack import *\n\n\nclass Mgis(CMakePackage):\n    \"\"\"\n    The MFrontGenericInterfaceSupport project (MGIS) provides helper\n    functions for various solvers to interact with behaviour written\n    using MFront generic interface.\n\n    MGIS is written in C++.\n    Bindings are provided for C and fortran (2003).\n    A FEniCS binding is also available.\n    \"\"\"\n\n    homepage = \"https://thelfer.github.io/mgis/web/index.html\"\n    url      = \"https://github.com/thelfer/MFrontGenericInterfaceSupport/archive/MFrontGenericInterfaceSupport-1.0.tar.gz\"\n    git      = \"https://github.com/thelfer/MFrontGenericInterfaceSupport.git\"\n    maintainers = ['thelfer']\n\n    # development branches\n    version(\"master\", branch=\"master\")\n    version(\"rliv-1.0\", branch=\"rliv-1.0\")\n\n    # released version\n    version('1.0.1', sha256='6102621455bc5d9b1591cd33e93b2e15a9572d2ce59ca6dfa30ba57ae1265c08')\n    version('1.0', sha256='279c98da00fa6855edf29c2b8f8bad6e7732298dc62ef67d028d6bbeaac043b3')\n\n    # variants\n    variant('c', default=True,\n            description='Enables c bindings')\n    variant('fortran', default=True,\n            description='Enables fortran bindings')\n    variant('python', default=True,\n            description='Enables python bindings')\n    variant('build_type', default='Release',\n            description='The build type to build',\n            values=('Debug', 'Release'))\n\n    # dependencies\n    depends_on('tfel@3.2.0', when=\"@1.0\")\n    depends_on('tfel@3.2.1', when=\"@1.0.1\")\n    depends_on('tfel@rliv-3.2', when=\"@rliv-1.0\")\n    depends_on('tfel@master', when=\"@master\")\n    depends_on('boost+python+numpy', when='+python')\n    extends('python', when='+python')\n\n    def cmake_args(self):\n\n        args = []\n\n        for i in ['c', 'fortran', 'python']:\n            if '+' + i  in self.spec:\n                args.append(\"-Denable-{0}-bindings=ON\".format(i))\n            else:\n                args.append(\"-Denable-{0}-bindings=OFF\".format(i))\n\n        if '+python' in self.spec:\n            # adding path to python\n            python = self.spec['python']\n            args.append('-DPYTHON_LIBRARY={0}'.\n                        format(python.libs[0]))\n            args.append('-DPYTHON_INCLUDE_DIR={0}'.\n                        format(python.headers.directories[0]))\n            args.append('-DPython_ADDITIONAL_VERSIONS={0}'.\n                        format(python.version.up_to(2)))\n            # adding path to boost\n            args.append('-DBOOST_ROOT={0}'.\n                        format(self.spec['boost'].prefix))\n\n        return args\n", "path": "var/spack/repos/builtin/packages/mgis/package.py"}]}