mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
31a21bb0a1
- Shebang added so it can be called with ./generate_patch.sh - Script changes its working directory to ext/fileinfo (where it is located) so it can be also called as ./ext/fileinfo/generate_patch.sh - Syntax adjusted a bit for using Bourne or a compatible shell (/bin/sh) - Downloaded files added to .gitignore
17 lines
511 B
Bash
Executable File
17 lines
511 B
Bash
Executable File
#!/bin/sh
|
|
|
|
VERSION=5.45
|
|
|
|
# Go to fileinfo extension directory.
|
|
cd $(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
|
|
|
|
if [ ! -d libmagic.orig ]; then
|
|
mkdir libmagic.orig
|
|
wget -O - ftp://ftp.astron.com/pub/file/file-$VERSION.tar.gz \
|
|
| tar -xz --strip-components=2 -C libmagic.orig file-$VERSION/src
|
|
fi
|
|
|
|
version_number=$(echo "$VERSION" | sed 's/\.//g')
|
|
sed -e "s/X\.YY/$version_number/g" libmagic.orig/magic.h.in > libmagic.orig/magic.h
|
|
diff -u libmagic.orig libmagic | grep -v '^Only in' > libmagic.patch
|