From ccdc145b40fd4348eceeaf216e7d3f5f53fc9743 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 Jan 2020 16:55:03 +0100 Subject: update to 2.2.2 rename to php-laminas-diactoros2 install to /usr/share/php/Laminas/Diactoros2 raise dependency on PHP 7.1 add dependency on psr/http-factory switch to phpunit7 --- php-http-interop-http-factory-tests-get-source.sh | 70 +++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100755 php-http-interop-http-factory-tests-get-source.sh (limited to 'php-http-interop-http-factory-tests-get-source.sh') diff --git a/php-http-interop-http-factory-tests-get-source.sh b/php-http-interop-http-factory-tests-get-source.sh new file mode 100755 index 0000000..9bccafb --- /dev/null +++ b/php-http-interop-http-factory-tests-get-source.sh @@ -0,0 +1,70 @@ +#/bin/sh + +GIT=`which git` +RPM=`which rpm` + +if [ -z "$GIT" ] +then + echo "ERROR: 'git' command not found" 1>&2 + exit 1 +elif [ -z "$RPM" ] +then + echo "ERROR: 'rpm' command not found" 1>&2 + exit 1 +fi + +function print { + echo -e "\e[0;33m>>>>> ${1}\e[0m" +} + +if [ -x "$1" ] +then + SPEC=$1 +else + SPEC=`ls *.spec | head -1` +fi + +VERSION=`egrep '%global\s*gh_factory_version' $SPEC | awk '{print $3}'` + +GIT_OWNER=`egrep '%global\s*gh_factory_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*gh_factory_name' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*gh_factory_commit' $SPEC | awk '{print $3}'` +GIT_REPO=https://github.com/${GIT_OWNER}/${GIT_NAME} +GIT_DIR=`echo $GIT_REPO | sed 's#.*/##'` +NAME="php-$GIT_OWNER-$GIT_NAME" + +print "SPEC = $SPEC" +print "NAME = $NAME" +print "GIT_OWNER = $GIT_OWNER" +print "GIT_NAME = $GIT_NAME" +print "GIT_COMMIT = $GIT_COMMIT" +print "GIT_REPO = $GIT_REPO" +print "GIT_DIR = $GIT_DIR" + +TEMP_DIR=$(mktemp --dir) +TAR_FILE=$PWD/${NAME}-${VERSION}-${GIT_COMMIT:0:7}.tgz +CMP_FILE=$PWD/composer-factory.json + +pushd $TEMP_DIR + print "Cloning git repo..." + $GIT clone $GIT_REPO + + pushd $GIT_DIR + print "Checking out commit..." + $GIT checkout $GIT_COMMIT + cp composer.json $CMP_FILE + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + print "TAR_FILE = $TAR_FILE" + + [ -e $TAR_FILE ] && rm -f $TAR_FILE + tar --exclude-vcs -czf $TAR_FILE $TAR_DIR + chmod 0644 $TAR_FILE +popd + +rm -rf $TEMP_DIR -- cgit