dos2unix: add the external find feature (#29335)
This commit is contained in:
parent
8665ccb661
commit
6bc2e660e8
@ -3,6 +3,8 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
@ -19,6 +21,8 @@ class Dos2unix(MakefilePackage):
|
|||||||
|
|
||||||
depends_on('gettext')
|
depends_on('gettext')
|
||||||
|
|
||||||
|
executables = [r'^dos2unix$']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def build_targets(self):
|
def build_targets(self):
|
||||||
targets = [
|
targets = [
|
||||||
@ -29,3 +33,9 @@ def build_targets(self):
|
|||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
make('prefix={0}'.format(prefix), 'install')
|
make('prefix={0}'.format(prefix), 'install')
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def determine_version(cls, exe):
|
||||||
|
output = Executable(exe)('--version', output=str, error=str)
|
||||||
|
match = re.search(r'^dos2unix\s+([\d\.]+)', output)
|
||||||
|
return match.group(1) if match else None
|
||||||
|
Loading…
Reference in New Issue
Block a user