package: removed default no-op patch (#4103)
* package: removed default no-op patch fixes #4085 * do_patch: handles NoSuchMethodError nicely
This commit is contained in:
parent
6b2d75a0a6
commit
5a1ee22575
@ -58,6 +58,7 @@
|
||||
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 @@ def do_stage(self, mirror_only=False):
|
||||
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 @@ def do_patch(self):
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user