summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index dc23f6351f..1223fce178 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -58,6 +58,7 @@ import spack.mirror
import spack.repository
import spack.url
import spack.util.web
+import spack.multimethod
from llnl.util.filesystem import *
from llnl.util.lang import *
@@ -939,10 +940,6 @@ class PackageBase(with_metaclass(PackageMeta, object)):
self.stage.expand_archive()
self.stage.chdir_to_source()
- def patch(self):
- """Default patch implementation is a no-op."""
- pass
-
def do_patch(self):
"""Calls do_stage(), then applied patches to the expanded tarball if they
haven't been applied already."""
@@ -1003,6 +1000,10 @@ class PackageBase(with_metaclass(PackageMeta, object)):
self.patch()
tty.msg("Ran patch() for %s" % self.name)
patched = True
+ except spack.multimethod.NoSuchMethodError:
+ # We are running a multimethod without a default case.
+ # If there's no default it means we don't need to patch.
+ tty.msg("No patches needed for %s" % self.name)
except:
tty.msg("patch() function failed for %s" % self.name)
touch(bad_file)