Skip to content

Commit

Permalink
Merge branch 'PHP-5.4'
Browse files Browse the repository at this point in the history
* PHP-5.4:
  Use newdoc instead of escape char
  adapt makedist to git
  • Loading branch information
laruence committed Mar 20, 2012
2 parents eda790d + 30bd249 commit a0d149b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 49 deletions.
71 changes: 26 additions & 45 deletions makedist
Original file line number Diff line number Diff line change
@@ -1,48 +1,41 @@
#!/bin/sh
#
# Distribution generator for SVN based packages.
# To work, this script needs a consistent tagging of all releases.
# Each release of a package should have a tag of the form
# Distribution generator for git
#
# <package>_<version>
# Usage: makedist version
# Example: makedist 5.4.1
# Example: makedist 5.3.5-RC1
#
# where <package> is the package name and the SVN module
# and <version> s the version number with underscores instead of dots.
# To work, this script needs a consistent tagging of all releases.
# Each release of a package should have a tag of the form
#
# For example: svn cp $PHPROOT/php/php-src/trunk $PHPROOT/php/php-src/tags/php_5_0_1
# PHP-X.Y.Z[-sub]
#
# The distribution ends up in a .tar.gz file that contains the distribution
# in a directory called <package>-<version>. The distribution contains all
# directories from the SVN module except the one called "nodist", but only
# the files INSTALL, README and config* are included.
# in a directory called php-<version>.
# A .tar.bz2 file is also created.
#
# Usage: makedist <package> <version>
#
#
# Written by Stig Bakken <[email protected]> 1997-05-28.
#
# $Id$
#
# Adapted to git by Stanislav Malyshev <[email protected]>

if test "$#" != "2"; then
echo "Usage: makedist <package> <version>" >&2

if test "$#" != "1"; then
echo "Usage: makedist <version>" >&2
exit 1
fi

PKG=$1 ; shift
VER=$1 ; shift

old_IFS="$IFS"
IFS=.
eval set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'`
if test "${1}" = "1" -a "${2}" -lt "28"; then
echo "You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)"
exit 10
exit 2
fi
IFS="$old_IFS"

PHPROOT=http://svn.php.net/repository
PHPMOD=php/php-src
[email protected]:php-src.git
LT_TARGETS='ltconfig ltmain.sh config.guess config.sub'

if echo '\c' | grep -s c >/dev/null 2>&1
Expand All @@ -57,10 +50,10 @@ fi
MY_OLDPWD=`pwd`

# the destination .tar.gz file
ARCHIVE=$MY_OLDPWD/$PKG-$VER.tar
ARCHIVE=$MY_OLDPWD/php-$VER.tar

# temporary directory used to check out files from SVN
DIR=$PKG-$VER
DIR=php-$VER
DIRPATH=$MY_OLDPWD/$DIR

if test -d "$DIRPATH"; then
Expand All @@ -69,28 +62,12 @@ if test -d "$DIRPATH"; then
exit 1
fi

# version part of the SVN release tag
SVNVER=`echo $VER | sed -e 's/[\.\-]/_/g'`

# SVN release tag
if test "$VER" != "HEAD" -a "$VER" != "trunk"; then
SVNTAG=tags/${PKG}_$SVNVER
else
SVNTAG=trunk
fi

#if test ! -d $DIRPATH; then
# mkdir -p $DIRPATH || exit 2
#fi

# Export PHP
$ECHO_N "makedist: exporting tag '$SVNTAG' from '$PHPMOD'...$ECHO_C"
svn export $PHPROOT/$PHPMOD/$SVNTAG $DIRPATH || exit 4
$ECHO_N "makedist: exporting tag 'PHP-$VER' from '$PHPROOT'...$ECHO_C"
git archive --format=tar --remote=$PHPROOT refs/tags/PHP-$VER --prefix=php-$VER/ | (cd $MY_OLDPWD; tar xvf -) || exit 4
echo ""

# remove SVN stuff...
cd $DIR || exit 5
find . \( -name .svn -type d \) -exec rm -rf {} \;

# The full ChangeLog is available separately from lxr.php.net
rm -f ChangeLog*
Expand Down Expand Up @@ -119,25 +96,29 @@ for i in $LT_TARGETS; do
test -f "$i" && mv $i.bak $i
done

# removing junk files
find . -name \*.orig -print0 | xargs -0 rm
rm -fr autom4te.cache/

# download pear
$ECHO_N "makedist: Attempting to download PEAR's phar archive"
if test ! -x wget; then
wget http://pear.php.net/install-pear-nozlib.phar -nd -P pear/
else
$ECHO_N "Missing wget binary needed for pear download";
exit 0;
exit 7
fi

cd $MY_OLDPWD
$ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
rm -f $ARCHIVE.gz
tar cf $ARCHIVE $PKG-$VER || exit 8
tar cf $ARCHIVE php-$VER || exit 8
gzip -9 $ARCHIVE || exit 9
echo ""

$ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C"
rm -f $ARCHIVE.bz2
tar cf $ARCHIVE $PKG-$VER || exit 10
tar cf $ARCHIVE php-$VER || exit 10
bzip2 -9 $ARCHIVE || exit 11
echo ""

Expand Down
4 changes: 2 additions & 2 deletions sapi/cli/tests/php_cli_server_016.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ include "skipif.inc";
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start(<<<PHP
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', \$_SERVER["REQUEST_URI"]))
php_cli_server_start(<<<'PHP'
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"]))
return false; // serve the requested resource as-is.
else {
echo "here";
Expand Down
4 changes: 2 additions & 2 deletions sapi/cli/tests/php_cli_server_017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ include "skipif.inc";
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start(<<<PHP
var_dump(\$_SERVER['SCRIPT_FILENAME']);
php_cli_server_start(<<<'PHP'
var_dump($_SERVER['SCRIPT_FILENAME']);
PHP
);

Expand Down

0 comments on commit a0d149b

Please sign in to comment.