com web/qa: Remove more old stuff.: tools/fetchCVS.pl tools/get-cvs.php tools/phport.sh
| From: | Johannes Schlüter | Date: | Wed, 28 Mar 2012 18:33:23 +0000 |
| Subject: | com web/qa: Remove more old stuff.: tools/fetchCVS.pl tools/get-cvs.php tools/phport.sh | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66191@lists.php.net to get a copy of this message | ||
Commit: 512e89c61f87b652055646372a81a32e96723331
Author: Johannes Schlüter <johannes@php.net> Wed, 28 Mar 2012 20:33:23 +0200
Parents: dd355e27f49b852fc86bdc3c8144ae0dcea4bb07
Branches: master
Link: http://git.php.net/?p=web/qa.git;a=commitdiff;h=512e89c61f87b652055646372a81a32e96723331
Log:
Remove more old stuff.
Changed paths:
D tools/fetchCVS.pl
D tools/get-cvs.php
D tools/phport.sh
512e89c61f87b652055646372a81a32e96723331 diff --git a/tools/fetchCVS.pl b/tools/fetchCVS.pl deleted file mode 100644 index ff636c9..0000000 --- a/tools/fetchCVS.pl +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/perl -w - -# Brendan W. McAdams <bmcadams@php.net> -# PHP QA Team (c) 2000 - -# - fetchCVS - -# grab the latest php4, Zend and TSRM source trees from CVS and set them up to compile. -# Also do some testing to see if essential tools are around. - -# print our header .. - -system("clear"); - -print "PHP QA Team fetchCVS " . '$Revision$' . "\n"; -print '$Id$\n'; -print "-------------------------------------------------------\n"; -print "Brendan W. McAdams <bmcadams\@php.net>\n"; - -# Check for our 3 required tools ... -$autoconf = `which autoconf`; -$automake = `which automake`; -$libtool = `which libtool`; -$cvs = `which cvs`; - -chomp($autoconf); -chomp($automake); -chomp($libtool); -chomp($cvs); - -if (!$autoconf) { - - die "The build process requires GNU autoconf v2.13 or greater, available via ftp from ftp.gnu.org\n Please install this application and ensure that it is in your system path.\n"; - -} elsif (!$automake) { - - die "The build process requires GNU automake v1.4 or greater, available via ftp from ftp.gnu.org\n Please install this application and ensure that it is in your system path.\n"; - -} elsif (!$libtool) { - - die "The build process requires GNU libtool v1.3.3 or greater, available via ftp from ftp.gnu.org\n Please install this application and ensure that it is in your system path.\n"; - -} elsif (!$cvs) { - - die "The build process requires CVS v1.10 or greater, available via web from http://www.cyclic.com\n Please install this application and ensure that it is in your system path.\n"; - -} - -print "Please input the directory you wish to sync the PHP tree into.\n"; -print "(We will sync into <directory>/php4)\n"; - -$directory = <STDIN>; # get the directory - -chomp($directory); - -if (-e $directory) { # if the dir exists - - chdir($directory); # go to the dir - -} else { - - print "Can't find $directory so I'm creating it...\n"; - - mkdir($directory); # make the directory - chdir($directory); # go to the new dir - -} - -print "Please login to the PHP repository (the password is phpfi)\n"; - -system("$cvs -d :pserver:cvsread\@cvs.php.net:/repository login"); - -print "Syncing the PHP4 source in $directory/php4 ...\n"; - -@php_sync = `$cvs -d :pserver:cvsread\@cvs.php.net:/repository checkout php4`; - -foreach $line (@php_sync) { # catch and print each line so we know when the sync is done - - print $line; - -} - -print "Please login to the Zend repository (the password is zend)\n"; - -system("$cvs -d :pserver:cvsread\@cvs.zend.com:/repository login"); - -chdir("$directory/php4"); - -print "Syncing the Zend source in $directory/php4/Zend ...\n"; - -@zend_sync = `$cvs -d :pserver:cvsread\@cvs.zend.com:/repository checkout Zend`; - -foreach $line (@zend_sync) { # catch and print each line so we know when the sync is done - - print $line; - -} - -@tsrm_sync = `$cvs -d :pserver:cvsread\@cvs.zend.com:/repository checkout TSRM`; - -foreach $line (@tsrm_sync) { # catch and print each line so we know when the sync is done - - print $line; - -} - -print "Running buildconf in $directory/php4\n"; - -system("./buildconf"); - - -print "CVS Synced and setup...\n"; - -print "You may now continue the build process on your own in $directory/php4\n"; diff --git a/tools/get-cvs.php b/tools/get-cvs.php deleted file mode 100644 index ab44662..0000000 --- a/tools/get-cvs.php +++ /dev/null @@ -1,224 +0,0 @@ -<?php -/************************************** - * get-cvs.php -- jalal @ gnomedia - * - * a rewrite of Brendan W. McAdams Perl script for fetching - * the cvs tree from cvs.php.net and cvs.zend.com - * - * Description: - * Runs some checks on the system (check for cvs prog etc) - * Asks whether we are doing an update or a checkout. - * Runs the appropriate cvs method. - * - * Notes: - * - * fopen("php://stdin", 'r') can only be called once in a script - * for reasons unknown. - * - * TODO: - * mkdir() does not do recursive makes. - * cwd() gives us the directory the script is in, not where we started it from. - * - **************************************/ -// some constants etc. -define( NL, "\n" ); -define( UNIX, 1 ); -define( WINDOWS, 2 ); - -$cvs_at_php = "-d :pserver:cvsread@cvs.php.net:/repository"; -$cvs_at_zend = "-d :pserver:cvsread@cvs.zend.com:/repository"; -$errors = array(); // only one error at present... - -set_time_limit(0); -register_shutdown_function( "shutdown" ); - -print_header(); - -// system_check will store errors in $errors -system_check(); - -if( count($errors) > 0 ) { - print "System failed checks, aborting.\n"; - print "Following errors were found:\n"; - foreach( $errors as $err ) { - print $err . NL; - } - exit(); -} - -// -// OK, lets do some work. -// -// Is this a checkout or an update? -// -// "Checkout" will create a directory for the check out -// and then proceed to run the cvs checkout -// -// "Update" will check if there is a ./php4 directory -// and, if found, will run cvs update on it. -// -// "Quit" will, er, quit...;-} -// -$s = "Enter " . makebold("C") . "heckout, "; -$s .= makebold("U") ."pdate: " . makebold("Q") . "uit: "; - -$mode = input( $s ); -$mode = chop(strtoupper( $mode )); -switch( $mode ) { - case 'C': - print "Checking out files for php4" . NL; - make_checkout_directory(); // will die() on failure, chdir() on success - php_cvs_checkout(); - break; - case 'U': - // check for a php4 directory. - $dir = chop(`pwd`); - $dir = chop( $dir ) . '/php4'; - $dirhandle = opendir( $dir ); - if( ! $dirhandle ) { // no php4 directory - die("Could not find php4 directory to update, quitting now...\n"); - } - else { closedir( $dirhandle ); } - echo "Updating files in php4" . NL; - php_cvs_update(); - break; - case "Q": - die( "Quitting.\n" ); - break; - default: - die("Unrecognised menu option, quitting..." . NL); -} - -print "Done! Next run ./buildconf; ./configure <options>; make; make install\n"; - -exit(); - -//=========== end of main ============// - -function shutdown() { - if( $fp ) { - fclose( $fp ); - } -} - -// we could use readline for this, but its not compiled in -// by default. -// fopen("php://stdin", 'r'); -// can only be called once in a script, so -// we have to reuse the handle. -function input( $prompt ) { - global $fp; - if( ! $fp ) { - $fp = fopen("php://stdin", 'r'); - } - if( $fp ) { - print $prompt; - $s = fgets($fp, 1024); - return $s; - } - // couldn't open stdin - die( "Error opening stdin for input, aborting...\n"); -} - -function php_cvs_checkout() { - global $cvs_at_php, $cvs_at_zend; - print "Connecting to cvs.php.net, use 'phpfi' as password.\n"; - exec( "cvs " . $cvs_at_php . " login" ); - exec( "cvs " . $cvs_at_php . " checkout php4" ); - exec( "cvs " . $cvs_at_php . " logout" ); - chdir("php4"); - print "Connecting to cvs.zend.com, use 'zend' as password.\n"; - exec( "cvs " . $cvs_at_zend . " login" ); - exec( "cvs " . $cvs_at_zend . " checkout Zend" ); - exec( "cvs " . $cvs_at_zend . " checkout TSRM" ); - exec( "cvs " . $cvs_at_zend . " logout" ); - -} - -function php_cvs_update() { - global $cvs_at_php, $cvs_at_zend; - print "Connecting to cvs.php.net, use 'phpfi' as password.\n"; - exec( "cvs " . $cvs_at_php . " login" ); - exec( "cvs " . $cvs_at_php . " update php4" ); - exec( "cvs " . $cvs_at_php . " logout" ); - chdir("php4"); - print "Connecting to cvs.zend.com, use 'zend' as password.\n"; - exec( "cvs " . $cvs_at_zend . " login" ); - exec( "cvs " . $cvs_at_zend . " update Zend" ); - exec( "cvs " . $cvs_at_zend . " update TSRM" ); - exec( "cvs " . $cvs_at_zend . " logout" ); -} - -function make_checkout_directory() { - $cwd = chop(`pwd`); - $str = makebold("Enter directory to put CVS tree in ($cwd)\n(php4 will be appended): "); - $directory = chop(input( $str )); - if( ! $directory ) { - $directory = $cwd; - } - // does this directory exist? - $dir = is_dir( $directory ); - if( ! $dir ) { // no - $res = input( makebold( "Directory $directory does not exist, create it? [Y/N]" ) ); - if( substr( strtoupper($res), 0, 1 ) === "Y" ) { - unset( $res ); - //TODO mkdir won't do multiple directories. - $res = @mkdir( $directory, 0777 ); // minus umask - if( ! $res ) { - die( "Error creating directory $directory. Must finish now.\n" ); - } - } - else { - die( "OK, I'm quitting then...\n" ); - } - } - chdir( $directory ); - print "Retrieving CVS into " . $directory . NL; -} - -function system_check() { - global $errors, $term_bold, $term_norm, $platform; - // check if we have cvs - print "Checking system... "; - $res = `cvs --version `; - if( strpos( $res, "Concurrent" ) > 0 ) { - print "OK\n"; - } - else { - print "not found.\n"; - $errors[] = "CVS program not found."; - } - // could do some more checks here... - // - // stole this bit from Stig's run-test.php - $term = getenv("TERM"); - if (preg_match('/^(xterm|vt220)/', $term)) { - $term_bold = sprintf("%c%c%c%c", 27, 91, 49, 109); - $term_norm = sprintf("%c%c%c", 27, 91, 109); - } elseif (preg_match('/^vt100/', $term)) { - $term_bold = sprintf("%c%c%c%c", 27, 91, 49, 109); - $term_norm = sprintf("%c%c%c", 27, 91, 109); - } else { - $term_bold = $term_norm = ""; - } -} - -function print_header() { - print "PHP QA Team get-cvs.php " . '$Revision$' . NL; - print '$Id:'; - print "-------------------------------------------------------" . NL; - print " jalal <jalal\@php.net>" . NL . NL; -} - -function makebold( $s ) { - global $term_bold, $term_norm; - return $term_bold . $s . $term_norm; -} -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ - -?> diff --git a/tools/phport.sh b/tools/phport.sh deleted file mode 100644 index cb44999..0000000 --- a/tools/phport.sh +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/sh -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP licience, | -# | that is bundled with this package in the file LICENCE and is | -# | avalible through the world wide web at | -# | http://www.php.net/license/2_02.txt. | -# | If uou did not receive a copy of the PHP license and are unable to | -# | obtain it through the world wide web, please send a note to | -# | license@php.net so we can mail you a copy immediately | -# +----------------------------------------------------------------------+ -# | Authors: Jan Lehnardt <jan@php.net> | -# | Sebastian Nohn <nohn@php.net> | -# +----------------------------------------------------------------------+ -# -# $Id: phport.sh,v 1.25 2003-01-16 17:00:16 nohn Exp $ - -# The PHP Port project should provide the ability to build and test -# any PHP4+ Version with any module/webserver. - -# Variable declaration -USE_BZ2=NO -TRY_ZE2=NO - -PREFIX="/tmp" -DISTFILESDIR="$PREFIX/distfiles" -WRKDIR="$PREFIX/work" -ETCDIR="$PREFIX/etc" -PHPSNAPFILEPREFIX="php5-latest.tar" -PHPSNAPSERVER="http://snaps.php.net/" -PHPCVSSERVER=":pserver:cvsread@cvs.php.net:/repository" -PHPCVSPASS="A:c:E?" -MAKE=${MAKE:=make} - -# functions -usage() { - cat <<EOF - $1 mode [argument] - mode: - - snap Builds from a Snapshot requires remote archive - in argument (http/ftp) - - cvs Builds from CVS - - local Builds from the local sourcetree specified in argument -EOF -} - -makedir() { mkdir "$@" || exit 1 ; } - -# Build directory structure if not available -if ! [ -d "$PREFIX" ] ; then - makedir $PREFIX -fi - -if ! [ -d "$WRKDIR" ] ; then - for i in / /php5-cvs /php5-snap /php5-local ; do - makedir $WRKDIR"$i" - done -fi - -if ! [ -d "$DISTFILESDIR" ] ; then - for i in / /cvs ; do - makedir $DISTFILESDIR"$i" - done -fi - -if ! [ -d $ETCDIR ] ; then - makedir $ETCDIR -fi - - -# Detect mode (snap|cvs|local) -case $1 in - snap|cvs|local) - MODE=$1 - ;; - *) - echo "Invalid Mode" - usage $0 - exit 1 - ;; -esac -echo $MODE - -# Clean $WRKDIR -rm -rf "$WRKDIR/php5-$MODE/*" -# Fetch/extract source to $DISTFILESDIR/$WRKDIR -case $MODE in - snap) # 24h distfile!! - if [ $2 ] ; then - SNAPURI=$2; - PHPSNAPFILE="`echo $SNAPURI | sed 's#.*/##'`" - elif [ "$USE_BZ2" = "NO" ] ; then - PHPSNAPFILE="$PHPSNAPFILEPREFIX"".gz" - SNAPURI=$PHPSNAPSERVER/$PHPSNAPFILE - else - PHPSNAPFILE="$PHPSNAPFILEPREFIX"".bz2" - SNAPURI=$PHPSNAPSERVER/$PHPSNAPFILE - fi - - if [ -s "$PHPSNAPFILE" ] ; then - cp $PHPSNAPFILE "$DISTFILESDIR" - else - if [ -x "`which fetch`" ] ; then - FETCHCMD="fetch -m -o \"$DISTFILESDIR/$PHPSNAPFILE\" $SNAPURI" - elif [ -x "`which wget`"] ; then - FETCHCMD="wget -O \"$DISTFILESDIR/$PHPSNAPFILE\" $SNAPURI" - fi - if ! [ -s "$DISTFILESDIR/$PHPSNAPFILE" ] ; then - echo "$PHPSNAPFILE does not seem to exist in $DISTFILESDIR, downloading..." - $FETCHCMD - fi - fi - echo "Extracting source package..." - - # see if we have gzip or bzip2 - - EXT="`echo $PHPSNAPFILE | sed -e 's/.*\.//'`"; - - # Keep it portable - if [ $EXT = "gz" ] ; then - COMPRESSOR=gzip - elif [ $EXT = "bz2" ] ; then - COMPRESSOR=bzip2 - else - echo "Unknown package format"; - exit 1; - fi - - $COMPRESSOR -cd "$DISTFILESDIR/$PHPSNAPFILE" | (cd "$WRKDIR/php5-$MODE" && tar -xf -) - mv -f "$WRKDIR/php5-$MODE/php*/*" "$WRKDIR/php5-$MODE" - - ;; - - cvs) - if ! [ -f ~/.cvspass ] || [ `grep -c cvsread@cvs.php.net ~/.cvspass` -lt 1 ] ; then - echo $PHPCVSSERVER $PHPCVSPASS>> ~/.cvspass - fi - cd "$DISTFILESDIR/$MODE" || exit 1 - - cvs -d $PHPCVSSERVER co php4 - cd php4 - if [ "$TRY_ZE2" = "NO" ] ; then - # do nothing - it's a "symlink" cvs -d $PHPCVSSERVER co Zend TSRM - # but we need to do something here, otherwise the script would fail... - echo - else - cvs -z3 -d $PHPCVSSERVER co -d Zend ZendEngine2 TSRM - fi - # cpio: command not found - # find . | cpio -pdm "$WRKDIR/php4-$MODE" - tar -cf - . | (cd "$WRKDIR/php5-$MODE" && tar -xf -) - cd ../../.. - - ;; - - local) - if [ -n "$2" ] ; then - cd $2 - tar -cf - . | (cd "$WRKDIR/php5-$MODE" && tar -xf -) - else - echo "No local Path supplied" - exit 1 - fi - ;; -esac - -# Get configure options -if [ -f "$ETCDIR/configure-options" ] ; then - for option in `cat $ETCDIR/configure-options` ; do - options="$options $option" - done -fi -# Check dependencies of configured extensions -# Clean dependencies -# Fetch/extract source into $DISTFILESDIR/$WRKDIR -# Build dependencies -# Install dependencies (Libraries) locally - -# Configure PHP -cd "$WRKDIR/php5-$MODE" -if [ ! -s ./configure ] ; then - ./cvsclean || exit 1 - ./buildconf || exit 1 -fi -./configure $options - -# Clean -$MAKE clean -if [ $? -gt 0 ]; then - echo "Clean had problems. Thing may go down hill from this point on" - sleep 1 -fi -# Build PHP -$MAKE 2>error.log -# Install PHP locally - -# Mail the compile-errors & warnings... -cat error.log | mail -s "PHP Compile Report" $USER - -# Running testcases against the environment -NO_INTERACTION=1 -export NO_INTERACTION -$MAKE test | mail -s "PHP Test Report" $USER - -# vim600: et ts=4 sw=4
512e89c61f87b652055646372a81a32e96723331 diff --git a/tools/fetchCVS.pl b/tools/fetchCVS.pl deleted file mode 100644 index ff636c9..0000000 --- a/tools/fetchCVS.pl +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/perl -w - -# Brendan W. McAdams <bmcadams@php.net> -# PHP QA Team (c) 2000 - -# - fetchCVS - -# grab the latest php4, Zend and TSRM source trees from CVS and set them up to compile. -# Also do some testing to see if essential tools are around. - -# print our header .. - -system("clear"); - -print "PHP QA Team fetchCVS " . '$Revision$' . "\n"; -print '$Id$\n'; -print "-------------------------------------------------------\n"; -print "Brendan W. McAdams <bmcadams\@php.net>\n"; - -# Check for our 3 required tools ... -$autoconf = `which autoconf`; -$automake = `which automake`; -$libtool = `which libtool`; -$cvs = `which cvs`; - -chomp($autoconf); -chomp($automake); -chomp($libtool); -chomp($cvs); - -if (!$autoconf) { - - die "The build process requires GNU autoconf v2.13 or greater, available via ftp from ftp.gnu.org\n Please install this application and ensure that it is in your system path.\n"; - -} elsif (!$automake) { - - die "The build process requires GNU automake v1.4 or greater, available via ftp from ftp.gnu.org\n Please install this application and ensure that it is in your system path.\n"; - -} elsif (!$libtool) { - - die "The build process requires GNU libtool v1.3.3 or greater, available via ftp from ftp.gnu.org\n Please install this application and ensure that it is in your system path.\n"; - -} elsif (!$cvs) { - - die "The build process requires CVS v1.10 or greater, available via web from http://www.cyclic.com\n Please install this application and ensure that it is in your system path.\n"; - -} - -print "Please input the directory you wish to sync the PHP tree into.\n"; -print "(We will sync into <directory>/php4)\n"; - -$directory = <STDIN>; # get the directory - -chomp($directory); - -if (-e $directory) { # if the dir exists - - chdir($directory); # go to the dir - -} else { - - print "Can't find $directory so I'm creating it...\n"; - - mkdir($directory); # make the directory - chdir($directory); # go to the new dir - -} - -print "Please login to the PHP repository (the password is phpfi)\n"; - -system("$cvs -d :pserver:cvsread\@cvs.php.net:/repository login"); - -print "Syncing the PHP4 source in $directory/php4 ...\n"; - -@php_sync = `$cvs -d :pserver:cvsread\@cvs.php.net:/repository checkout php4`; - -foreach $line (@php_sync) { # catch and print each line so we know when the sync is done - - print $line; - -} - -print "Please login to the Zend repository (the password is zend)\n"; - -system("$cvs -d :pserver:cvsread\@cvs.zend.com:/repository login"); - -chdir("$directory/php4"); - -print "Syncing the Zend source in $directory/php4/Zend ...\n"; - -@zend_sync = `$cvs -d :pserver:cvsread\@cvs.zend.com:/repository checkout Zend`; - -foreach $line (@zend_sync) { # catch and print each line so we know when the sync is done - - print $line; - -} - -@tsrm_sync = `$cvs -d :pserver:cvsread\@cvs.zend.com:/repository checkout TSRM`; - -foreach $line (@tsrm_sync) { # catch and print each line so we know when the sync is done - - print $line; - -} - -print "Running buildconf in $directory/php4\n"; - -system("./buildconf"); - - -print "CVS Synced and setup...\n"; - -print "You may now continue the build process on your own in $directory/php4\n"; diff --git a/tools/get-cvs.php b/tools/get-cvs.php deleted file mode 100644 index ab44662..0000000 --- a/tools/get-cvs.php +++ /dev/null @@ -1,224 +0,0 @@ -<?php -/************************************** - * get-cvs.php -- jalal @ gnomedia - * - * a rewrite of Brendan W. McAdams Perl script for fetching - * the cvs tree from cvs.php.net and cvs.zend.com - * - * Description: - * Runs some checks on the system (check for cvs prog etc) - * Asks whether we are doing an update or a checkout. - * Runs the appropriate cvs method. - * - * Notes: - * - * fopen("php://stdin", 'r') can only be called once in a script - * for reasons unknown. - * - * TODO: - * mkdir() does not do recursive makes. - * cwd() gives us the directory the script is in, not where we started it from. - * - **************************************/ -// some constants etc. -define( NL, "\n" ); -define( UNIX, 1 ); -define( WINDOWS, 2 ); - -$cvs_at_php = "-d :pserver:cvsread@cvs.php.net:/repository"; -$cvs_at_zend = "-d :pserver:cvsread@cvs.zend.com:/repository"; -$errors = array(); // only one error at present... - -set_time_limit(0); -register_shutdown_function( "shutdown" ); - -print_header(); - -// system_check will store errors in $errors -system_check(); - -if( count($errors) > 0 ) { - print "System failed checks, aborting.\n"; - print "Following errors were found:\n"; - foreach( $errors as $err ) { - print $err . NL; - } - exit(); -} - -// -// OK, lets do some work. -// -// Is this a checkout or an update? -// -// "Checkout" will create a directory for the check out -// and then proceed to run the cvs checkout -// -// "Update" will check if there is a ./php4 directory -// and, if found, will run cvs update on it. -// -// "Quit" will, er, quit...;-} -// -$s = "Enter " . makebold("C") . "heckout, "; -$s .= makebold("U") ."pdate: " . makebold("Q") . "uit: "; - -$mode = input( $s ); -$mode = chop(strtoupper( $mode )); -switch( $mode ) { - case 'C': - print "Checking out files for php4" . NL; - make_checkout_directory(); // will die() on failure, chdir() on success - php_cvs_checkout(); - break; - case 'U': - // check for a php4 directory. - $dir = chop(`pwd`); - $dir = chop( $dir ) . '/php4'; - $dirhandle = opendir( $dir ); - if( ! $dirhandle ) { // no php4 directory - die("Could not find php4 directory to update, quitting now...\n"); - } - else { closedir( $dirhandle ); } - echo "Updating files in php4" . NL; - php_cvs_update(); - break; - case "Q": - die( "Quitting.\n" ); - break; - default: - die("Unrecognised menu option, quitting..." . NL); -} - -print "Done! Next run ./buildconf; ./configure <options>; make; make install\n"; - -exit(); - -//=========== end of main ============// - -function shutdown() { - if( $fp ) { - fclose( $fp ); - } -} - -// we could use readline for this, but its not compiled in -// by default. -// fopen("php://stdin", 'r'); -// can only be called once in a script, so -// we have to reuse the handle. -function input( $prompt ) { - global $fp; - if( ! $fp ) { - $fp = fopen("php://stdin", 'r'); - } - if( $fp ) { - print $prompt; - $s = fgets($fp, 1024); - return $s; - } - // couldn't open stdin - die( "Error opening stdin for input, aborting...\n"); -} - -function php_cvs_checkout() { - global $cvs_at_php, $cvs_at_zend; - print "Connecting to cvs.php.net, use 'phpfi' as password.\n"; - exec( "cvs " . $cvs_at_php . " login" ); - exec( "cvs " . $cvs_at_php . " checkout php4" ); - exec( "cvs " . $cvs_at_php . " logout" ); - chdir("php4"); - print "Connecting to cvs.zend.com, use 'zend' as password.\n"; - exec( "cvs " . $cvs_at_zend . " login" ); - exec( "cvs " . $cvs_at_zend . " checkout Zend" ); - exec( "cvs " . $cvs_at_zend . " checkout TSRM" ); - exec( "cvs " . $cvs_at_zend . " logout" ); - -} - -function php_cvs_update() { - global $cvs_at_php, $cvs_at_zend; - print "Connecting to cvs.php.net, use 'phpfi' as password.\n"; - exec( "cvs " . $cvs_at_php . " login" ); - exec( "cvs " . $cvs_at_php . " update php4" ); - exec( "cvs " . $cvs_at_php . " logout" ); - chdir("php4"); - print "Connecting to cvs.zend.com, use 'zend' as password.\n"; - exec( "cvs " . $cvs_at_zend . " login" ); - exec( "cvs " . $cvs_at_zend . " update Zend" ); - exec( "cvs " . $cvs_at_zend . " update TSRM" ); - exec( "cvs " . $cvs_at_zend . " logout" ); -} - -function make_checkout_directory() { - $cwd = chop(`pwd`); - $str = makebold("Enter directory to put CVS tree in ($cwd)\n(php4 will be appended): "); - $directory = chop(input( $str )); - if( ! $directory ) { - $directory = $cwd; - } - // does this directory exist? - $dir = is_dir( $directory ); - if( ! $dir ) { // no - $res = input( makebold( "Directory $directory does not exist, create it? [Y/N]" ) ); - if( substr( strtoupper($res), 0, 1 ) === "Y" ) { - unset( $res ); - //TODO mkdir won't do multiple directories. - $res = @mkdir( $directory, 0777 ); // minus umask - if( ! $res ) { - die( "Error creating directory $directory. Must finish now.\n" ); - } - } - else { - die( "OK, I'm quitting then...\n" ); - } - } - chdir( $directory ); - print "Retrieving CVS into " . $directory . NL; -} - -function system_check() { - global $errors, $term_bold, $term_norm, $platform; - // check if we have cvs - print "Checking system... "; - $res = `cvs --version `; - if( strpos( $res, "Concurrent" ) > 0 ) { - print "OK\n"; - } - else { - print "not found.\n"; - $errors[] = "CVS program not found."; - } - // could do some more checks here... - // - // stole this bit from Stig's run-test.php - $term = getenv("TERM"); - if (preg_match('/^(xterm|vt220)/', $term)) { - $term_bold = sprintf("%c%c%c%c", 27, 91, 49, 109); - $term_norm = sprintf("%c%c%c", 27, 91, 109); - } elseif (preg_match('/^vt100/', $term)) { - $term_bold = sprintf("%c%c%c%c", 27, 91, 49, 109); - $term_norm = sprintf("%c%c%c", 27, 91, 109); - } else { - $term_bold = $term_norm = ""; - } -} - -function print_header() { - print "PHP QA Team get-cvs.php " . '$Revision$' . NL; - print '$Id:'; - print "-------------------------------------------------------" . NL; - print " jalal <jalal\@php.net>" . NL . NL; -} - -function makebold( $s ) { - global $term_bold, $term_norm; - return $term_bold . $s . $term_norm; -} -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - */ - -?> diff --git a/tools/phport.sh b/tools/phport.sh deleted file mode 100644 index cb44999..0000000 --- a/tools/phport.sh +++ /dev/null @@ -1,208 +0,0 @@ -#!/bin/sh -# +----------------------------------------------------------------------+ -# | PHP Version 4 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2002 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 2.02 of the PHP licience, | -# | that is bundled with this package in the file LICENCE and is | -# | avalible through the world wide web at | -# | http://www.php.net/license/2_02.txt. | -# | If uou did not receive a copy of the PHP license and are unable to | -# | obtain it through the world wide web, please send a note to | -# | license@php.net so we can mail you a copy immediately | -# +----------------------------------------------------------------------+ -# | Authors: Jan Lehnardt <jan@php.net> | -# | Sebastian Nohn <nohn@php.net> | -# +----------------------------------------------------------------------+ -# -# $Id: phport.sh,v 1.25 2003-01-16 17:00:16 nohn Exp $ - -# The PHP Port project should provide the ability to build and test -# any PHP4+ Version with any module/webserver. - -# Variable declaration -USE_BZ2=NO -TRY_ZE2=NO - -PREFIX="/tmp" -DISTFILESDIR="$PREFIX/distfiles" -WRKDIR="$PREFIX/work" -ETCDIR="$PREFIX/etc" -PHPSNAPFILEPREFIX="php5-latest.tar" -PHPSNAPSERVER="http://snaps.php.net/" -PHPCVSSERVER=":pserver:cvsread@cvs.php.net:/repository" -PHPCVSPASS="A:c:E?" -MAKE=${MAKE:=make} - -# functions -usage() { - cat <<EOF - $1 mode [argument] - mode: - - snap Builds from a Snapshot requires remote archive - in argument (http/ftp) - - cvs Builds from CVS - - local Builds from the local sourcetree specified in argument -EOF -} - -makedir() { mkdir "$@" || exit 1 ; } - -# Build directory structure if not available -if ! [ -d "$PREFIX" ] ; then - makedir $PREFIX -fi - -if ! [ -d "$WRKDIR" ] ; then - for i in / /php5-cvs /php5-snap /php5-local ; do - makedir $WRKDIR"$i" - done -fi - -if ! [ -d "$DISTFILESDIR" ] ; then - for i in / /cvs ; do - makedir $DISTFILESDIR"$i" - done -fi - -if ! [ -d $ETCDIR ] ; then - makedir $ETCDIR -fi - - -# Detect mode (snap|cvs|local) -case $1 in - snap|cvs|local) - MODE=$1 - ;; - *) - echo "Invalid Mode" - usage $0 - exit 1 - ;; -esac -echo $MODE - -# Clean $WRKDIR -rm -rf "$WRKDIR/php5-$MODE/*" -# Fetch/extract source to $DISTFILESDIR/$WRKDIR -case $MODE in - snap) # 24h distfile!! - if [ $2 ] ; then - SNAPURI=$2; - PHPSNAPFILE="`echo $SNAPURI | sed 's#.*/##'`" - elif [ "$USE_BZ2" = "NO" ] ; then - PHPSNAPFILE="$PHPSNAPFILEPREFIX"".gz" - SNAPURI=$PHPSNAPSERVER/$PHPSNAPFILE - else - PHPSNAPFILE="$PHPSNAPFILEPREFIX"".bz2" - SNAPURI=$PHPSNAPSERVER/$PHPSNAPFILE - fi - - if [ -s "$PHPSNAPFILE" ] ; then - cp $PHPSNAPFILE "$DISTFILESDIR" - else - if [ -x "`which fetch`" ] ; then - FETCHCMD="fetch -m -o \"$DISTFILESDIR/$PHPSNAPFILE\" $SNAPURI" - elif [ -x "`which wget`"] ; then - FETCHCMD="wget -O \"$DISTFILESDIR/$PHPSNAPFILE\" $SNAPURI" - fi - if ! [ -s "$DISTFILESDIR/$PHPSNAPFILE" ] ; then - echo "$PHPSNAPFILE does not seem to exist in $DISTFILESDIR, downloading..." - $FETCHCMD - fi - fi - echo "Extracting source package..." - - # see if we have gzip or bzip2 - - EXT="`echo $PHPSNAPFILE | sed -e 's/.*\.//'`"; - - # Keep it portable - if [ $EXT = "gz" ] ; then - COMPRESSOR=gzip - elif [ $EXT = "bz2" ] ; then - COMPRESSOR=bzip2 - else - echo "Unknown package format"; - exit 1; - fi - - $COMPRESSOR -cd "$DISTFILESDIR/$PHPSNAPFILE" | (cd "$WRKDIR/php5-$MODE" && tar -xf -) - mv -f "$WRKDIR/php5-$MODE/php*/*" "$WRKDIR/php5-$MODE" - - ;; - - cvs) - if ! [ -f ~/.cvspass ] || [ `grep -c cvsread@cvs.php.net ~/.cvspass` -lt 1 ] ; then - echo $PHPCVSSERVER $PHPCVSPASS>> ~/.cvspass - fi - cd "$DISTFILESDIR/$MODE" || exit 1 - - cvs -d $PHPCVSSERVER co php4 - cd php4 - if [ "$TRY_ZE2" = "NO" ] ; then - # do nothing - it's a "symlink" cvs -d $PHPCVSSERVER co Zend TSRM - # but we need to do something here, otherwise the script would fail... - echo - else - cvs -z3 -d $PHPCVSSERVER co -d Zend ZendEngine2 TSRM - fi - # cpio: command not found - # find . | cpio -pdm "$WRKDIR/php4-$MODE" - tar -cf - . | (cd "$WRKDIR/php5-$MODE" && tar -xf -) - cd ../../.. - - ;; - - local) - if [ -n "$2" ] ; then - cd $2 - tar -cf - . | (cd "$WRKDIR/php5-$MODE" && tar -xf -) - else - echo "No local Path supplied" - exit 1 - fi - ;; -esac - -# Get configure options -if [ -f "$ETCDIR/configure-options" ] ; then - for option in `cat $ETCDIR/configure-options` ; do - options="$options $option" - done -fi -# Check dependencies of configured extensions -# Clean dependencies -# Fetch/extract source into $DISTFILESDIR/$WRKDIR -# Build dependencies -# Install dependencies (Libraries) locally - -# Configure PHP -cd "$WRKDIR/php5-$MODE" -if [ ! -s ./configure ] ; then - ./cvsclean || exit 1 - ./buildconf || exit 1 -fi -./configure $options - -# Clean -$MAKE clean -if [ $? -gt 0 ]; then - echo "Clean had problems. Thing may go down hill from this point on" - sleep 1 -fi -# Build PHP -$MAKE 2>error.log -# Install PHP locally - -# Mail the compile-errors & warnings... -cat error.log | mail -s "PHP Compile Report" $USER - -# Running testcases against the environment -NO_INTERACTION=1 -export NO_INTERACTION -$MAKE test | mail -s "PHP Test Report" $USER - -# vim600: et ts=4 sw=4