forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ext/fileinfo/generate_patch.sh simpler to use (php#14941)
- 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
- Loading branch information
Showing
2 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
#!/bin/sh | ||
|
||
VERSION=5.45 | ||
if [[ ! -d libmagic.orig ]]; then | ||
|
||
# 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 | ||
sed -e "s/X\.YY/${VERSION//.}/g" libmagic.orig/magic.h.in > libmagic.orig/magic.h | ||
|
||
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 |