unset APT_CONFIG env var when running hook
This commit is contained in:
parent
d29bdafb89
commit
8d04ffee64
1 changed files with 3 additions and 2 deletions
|
@ -1141,13 +1141,14 @@ sub run_hooks {
|
||||||
# execute it directly if it's an executable file
|
# execute it directly if it's an executable file
|
||||||
# or if it there are no shell metacharacters
|
# or if it there are no shell metacharacters
|
||||||
# (the /a regex modifier makes \w match only ASCII)
|
# (the /a regex modifier makes \w match only ASCII)
|
||||||
0 == system('env', '--unset=TMPDIR', $script, $options->{root})
|
0 == system('env', '--unset=TMPDIR', '--unset=APT_CONFIG',
|
||||||
|
$script, $options->{root})
|
||||||
or error "command failed: $script";
|
or error "command failed: $script";
|
||||||
} else {
|
} else {
|
||||||
info "running --$name-hook in shell: sh -c '$script' exec"
|
info "running --$name-hook in shell: sh -c '$script' exec"
|
||||||
. " $options->{root}";
|
. " $options->{root}";
|
||||||
# otherwise, wrap everything in sh -c
|
# otherwise, wrap everything in sh -c
|
||||||
0 == system('env', '--unset=TMPDIR',
|
0 == system('env', '--unset=TMPDIR', '--unset=APT_CONFIG',
|
||||||
'sh', '-c', $script, 'exec', $options->{root})
|
'sh', '-c', $script, 'exec', $options->{root})
|
||||||
or error "command failed: $script";
|
or error "command failed: $script";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue