From 8859a09cd267f626dfe79da01ac88c245261ccbb Mon Sep 17 00:00:00 2001
From: Tom Scogland <scogland1@llnl.gov>
Date: Mon, 16 May 2016 07:58:34 -0700
Subject: [PATCH] handle explicit when requesting to install already installed
 packages

---
 lib/spack/spack/package.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index d1c36d0670..2e7d8a7709 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -888,6 +888,11 @@ def do_install(self,
         # Ensure package is not already installed
         if spack.install_layout.check_installed(self.spec):
             tty.msg("%s is already installed in %s" % (self.name, self.prefix))
+            rec = spack.installed_db.get_record(self.spec)
+            if (not rec.explicit) and explicit:
+                with spack.installed_db.write_transaction():
+                    rec = spack.installed_db.get_record(self.spec)
+                    rec.explicit = True
             return
 
         tty.msg("Installing %s" % self.name)
-- 
GitLab