zip: add external detection (#28434)
This commit is contained in:
parent
dbb36ef8b1
commit
5e595586a7
1 changed files with 10 additions and 0 deletions
|
@ -3,6 +3,8 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
class Zip(MakefilePackage):
|
class Zip(MakefilePackage):
|
||||||
"""Zip is a compression and file packaging/archive utility."""
|
"""Zip is a compression and file packaging/archive utility."""
|
||||||
|
@ -27,6 +29,14 @@ class Zip(MakefilePackage):
|
||||||
patch('09-hardening-build-fix-2.patch')
|
patch('09-hardening-build-fix-2.patch')
|
||||||
patch('10-remove-build-date.patch')
|
patch('10-remove-build-date.patch')
|
||||||
|
|
||||||
|
executables = ['^zip$']
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def determine_version(cls, exe):
|
||||||
|
output = Executable(exe)('--version', output=str, error=str)
|
||||||
|
match = re.search(r'This is Zip (\S+)', output)
|
||||||
|
return match.group(1) if match else None
|
||||||
|
|
||||||
def url_for_version(self, version):
|
def url_for_version(self, version):
|
||||||
return 'http://downloads.sourceforge.net/infozip/zip{0}.tar.gz'.format(version.joined)
|
return 'http://downloads.sourceforge.net/infozip/zip{0}.tar.gz'.format(version.joined)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue