Skip to content

Commit 92a1db7

Browse files
committed
Add ability to patch the distributed PHP.
This can be useful for debugging crashes deep inside PHP.
1 parent 6c9d239 commit 92a1db7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

deps/extract.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import sys
22
import tarfile
33
import os
4+
import subprocess
45

56
tarball = os.path.abspath(sys.argv[1])
67
dirname = os.path.abspath(sys.argv[2])
78
print "Extracting", tarball, "to", dirname
89
tfile = tarfile.open(tarball,'r:gz');
910
tfile.extractall(dirname)
11+
# Optionally, apply a patch. This can be useful when debugging
12+
# crashes deep inside php.
13+
if os.path.isfile(tarball + '.patch'):
14+
subprocess.check_call(['patch', '-d', dirname, '-i', tarball + '.patch', '-p', '0']);
1015
os.utime(os.path.join(dirname, sys.argv[3]), None) # touch
1116
sys.exit(0)

0 commit comments

Comments
 (0)