ack: Fix install modifying download cache (#13836)

This makes several installs from the same download cache impossible once
the hash of the used perl-install changes.

Fixes: #13824

Change-Id: I5f10d9d54ae999d0ca7e4171f989dfca2e6a7169
This commit is contained in:
Oliver Breitwieser 2019-11-25 00:33:49 +01:00 committed by Adam J. Stewart
parent 959f52dbf5
commit 4c4aba5f9e

View File

@ -25,11 +25,13 @@ class Ack(Package):
def install(self, spec, prefix):
mkdirp(prefix.bin)
ack = 'ack-{0}-single-file'.format(self.version)
ack_source = 'ack-{0}-single-file'.format(self.version)
ack_installed = join_path(prefix.bin, "ack")
# install source
install(ack_source, ack_installed)
set_executable(ack_installed)
# rewrite the script's #! line to call the perl dependency
shbang = '#!' + spec['perl'].command.path
filter_file(r'^#!/usr/bin/env perl', shbang, ack)
install(ack, join_path(prefix.bin, "ack"))
set_executable(join_path(prefix.bin, "ack"))
filter_file(r'^#!/usr/bin/env perl', shbang, ack_installed)