Skip to content

Commit cb4e82a

Browse files
committed
adapt makedist to git
1 parent f7b10ab commit cb4e82a

File tree

1 file changed

+26
-45
lines changed

1 file changed

+26
-45
lines changed

makedist

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,41 @@
11
#!/bin/sh
22
#
3-
# Distribution generator for SVN based packages.
4-
# To work, this script needs a consistent tagging of all releases.
5-
# Each release of a package should have a tag of the form
3+
# Distribution generator for git
64
#
7-
# <package>_<version>
5+
# Usage: makedist version
6+
# Example: makedist 5.4.1
7+
# Example: makedist 5.3.5-RC1
88
#
9-
# where <package> is the package name and the SVN module
10-
# and <version> s the version number with underscores instead of dots.
9+
# To work, this script needs a consistent tagging of all releases.
10+
# Each release of a package should have a tag of the form
1111
#
12-
# For example: svn cp $PHPROOT/php/php-src/trunk $PHPROOT/php/php-src/tags/php_5_0_1
12+
# PHP-X.Y.Z[-sub]
1313
#
1414
# The distribution ends up in a .tar.gz file that contains the distribution
15-
# in a directory called <package>-<version>. The distribution contains all
16-
# directories from the SVN module except the one called "nodist", but only
17-
# the files INSTALL, README and config* are included.
15+
# in a directory called php-<version>.
1816
# A .tar.bz2 file is also created.
19-
#
20-
# Usage: makedist <package> <version>
21-
#
17+
#
2218
# Written by Stig Bakken <ssb@guardian.no> 1997-05-28.
23-
#
24-
# $Id$
25-
#
19+
# Adapted to git by Stanislav Malyshev <stas@php.net>
2620

27-
if test "$#" != "2"; then
28-
echo "Usage: makedist <package> <version>" >&2
21+
22+
if test "$#" != "1"; then
23+
echo "Usage: makedist <version>" >&2
2924
exit 1
3025
fi
3126

32-
PKG=$1 ; shift
3327
VER=$1 ; shift
3428

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

44-
PHPROOT=http://svn.php.net/repository
45-
PHPMOD=php/php-src
38+
PHPROOT=git@git.php.net:php-src.git
4639
LT_TARGETS='ltconfig ltmain.sh config.guess config.sub'
4740

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

5952
# the destination .tar.gz file
60-
ARCHIVE=$MY_OLDPWD/$PKG-$VER.tar
53+
ARCHIVE=$MY_OLDPWD/php-$VER.tar
6154

6255
# temporary directory used to check out files from SVN
63-
DIR=$PKG-$VER
56+
DIR=php-$VER
6457
DIRPATH=$MY_OLDPWD/$DIR
6558

6659
if test -d "$DIRPATH"; then
@@ -69,28 +62,12 @@ if test -d "$DIRPATH"; then
6962
exit 1
7063
fi
7164

72-
# version part of the SVN release tag
73-
SVNVER=`echo $VER | sed -e 's/[\.\-]/_/g'`
74-
75-
# SVN release tag
76-
if test "$VER" != "HEAD" -a "$VER" != "trunk"; then
77-
SVNTAG=tags/${PKG}_$SVNVER
78-
else
79-
SVNTAG=trunk
80-
fi
81-
82-
#if test ! -d $DIRPATH; then
83-
# mkdir -p $DIRPATH || exit 2
84-
#fi
85-
8665
# Export PHP
87-
$ECHO_N "makedist: exporting tag '$SVNTAG' from '$PHPMOD'...$ECHO_C"
88-
svn export $PHPROOT/$PHPMOD/$SVNTAG $DIRPATH || exit 4
66+
$ECHO_N "makedist: exporting tag 'PHP-$VER' from '$PHPROOT'...$ECHO_C"
67+
git archive --format=tar --remote=$PHPROOT refs/tags/PHP-$VER --prefix=php-$VER/ | (cd $MY_OLDPWD; tar xvf -) || exit 4
8968
echo ""
9069

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

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

99+
# removing junk files
100+
find . -name \*.orig -print0 | xargs -0 rm
101+
rm -fr autom4te.cache/
102+
122103
# download pear
123104
$ECHO_N "makedist: Attempting to download PEAR's phar archive"
124105
if test ! -x wget; then
125106
wget http://pear.php.net/install-pear-nozlib.phar -nd -P pear/
126107
else
127108
$ECHO_N "Missing wget binary needed for pear download";
128-
exit 0;
109+
exit 7
129110
fi
130111

131112
cd $MY_OLDPWD
132113
$ECHO_N "makedist: making gzipped tar archive...$ECHO_C"
133114
rm -f $ARCHIVE.gz
134-
tar cf $ARCHIVE $PKG-$VER || exit 8
115+
tar cf $ARCHIVE php-$VER || exit 8
135116
gzip -9 $ARCHIVE || exit 9
136117
echo ""
137118

138119
$ECHO_N "makedist: making bz2zipped tar archive...$ECHO_C"
139120
rm -f $ARCHIVE.bz2
140-
tar cf $ARCHIVE $PKG-$VER || exit 10
121+
tar cf $ARCHIVE php-$VER || exit 10
141122
bzip2 -9 $ARCHIVE || exit 11
142123
echo ""
143124

0 commit comments

Comments
 (0)