Skip to content

Commit

Permalink
release 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Joungkyun committed Mar 27, 2021
1 parent 314cdcd commit 82c0350
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 11 deletions.
74 changes: 63 additions & 11 deletions manage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ usage () {
exit 1
}

normal="$( tput sgr0 )"
bold="$( tput bold )"
black="$( tput setaf 0 )"
red="$( tput setaf 1 )"
green="$( tput setaf 2 )"
yellow="$( tput setaf 3 )"
blue="$( tput setaf 4 )"
megenta="$( tput setaf 5 )"
cyan="$( tput setaf 6 )"
white="$( tput setaf 7 )"
bblack="${bold}${black}"
bred="${bold}${red}"
bgreen="${bold}${green}"
byellow="${bold}${yellow}"
bblue="${bold}${blue}"
bmegenta="${bold}${megenta}"
bcyan="${bold}${cyan}"
bwhite="${bold}${white}"
tcolor="${bblack}$( tput setab 7 )"

opts=$(getopt -u -o h -l help -- "$@")
[ $? != 0 ] && usage

Expand All @@ -34,15 +54,15 @@ mode="${1}"
case "${mode}" in
clean)
cat <<-EOL
[ -f Makefile ] && make distclean
${bwhite}[ -f Makefile ] && make distclean
rm -rf autom4te.cache build include modules
rm -f .deps Makefile* ac*.m4 compile
rm -f config.h* config.nice configure* config.sub config.guess
rm -f install-sh ltmain.sh missing mkinstalldirs run-tests.php
rm -f package.xml
find ./tests ! -name '*.phpt' -a ! -name '*.txt' -a -type f
rm -f magic_arginfo.h && git checkout -- magic_arginfo.h
rm -f magic_arginfo.h && git checkout -- magic_arginfo.h${normal}
----->
EOL

Expand Down Expand Up @@ -74,21 +94,53 @@ case "${mode}" in
rm -f package.xml
;;
test)
PHPBIN=/opt/php-qa/php${2}/bin/php
PHPIZE=/opt/php-qa/php${2}/bin/phpize
PHPCONFIG=/opt/php-qa/php${2}/bin/php-config
PHP_OPT=""

if [[ $# == 2 ]]; then
./manage.sh clean
echo "${PHPIZE} && ./configure"
${PHPIZE} && ./configure && make -j8 || exit 0
fi

PHP_OPT+=" -d 'track_errors=1' -d 'extension_dir=./modules/' -d 'extension=magic.so'"

if [[ -f tests/${3}.php ]]; then
/usr/bin/php${2} -d "extension_dir=./modules/" -d "extension=magic" tests/${3}.php
cat <<-EOL
${bgreen}------------------------------------------------------------------------
Sample code execution:
${bcyan}${PHPBIN} ${PHP_OPT} test/${3}.php
${bgreen}------------------------------------------------------------------------${normal}
EOL
${PHPBIN} ${PHP_OPT} test/${3}.php
exit $?
elif [[ -f ${3} ]]; then
/usr/bin/php${2} -d "extension_dir=./modules/" -d "extension=magic" ${3}
cat <<-EOL
${bgreen}------------------------------------------------------------------------
Sample code execution:
${bcyan}${PHPBIN} ${PHP_OPT} ${3}
${bgreen}------------------------------------------------------------------------${normal}
EOL
eval "${PHPBIN} ${PHP_OPT} ${3}"
exit $?
fi

if [[ -z $3 ]]; then
./manage.sh clean
echo "phpize${2} ./configure"
phpize${2} && ./configure && make -j8 || exit 0
fi
echo "make test PHP_EXECUTABLE=/usr/bin/php${2}"
make test PHP_EXECUTABLE=/usr/bin/php${2} <<< n
cat <<-EOL
${bwhite}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
${tcolor}** MAKE test:: ${normal}
${bwhite}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
${bcyan}make test PHP_EXECUTABLE=${PHPBIN}
${bwhite}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~${normal}
EOL
make test PHP_EXECUTABLE=${PHPBIN} <<< n
;;
stub)
# stub tagging
Expand Down
5 changes: 5 additions & 0 deletions package.xml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<file md5sum="@LICENSE@" name="LICENSE" role="doc" />
<file md5sum="@config.m4@" name="config.m4" role="src" />
<file md5sum="@magic.c@" name="magic.c" role="src" />
<file md5sum="@magic_arginfo.h@" name="magic_arginfo.h" role="src" />
<file md5sum="@php_magic.h@" name="php_magic.h" role="src" />
<file md5sum="@sample.php@" name="sample.php" role="src" />
<dir name="tests">
Expand All @@ -47,6 +48,10 @@
<file md5sum="@tests/003-user-magicfile.phpt@" name="003-user-magicfile.phpt" role="test" />
<file md5sum="@tests/004-with-flag.phpt@" name="004-with-flag.phpt" role="test" />
<file md5sum="@tests/005-flag-magicfile.phpt@" name="005-flag-magicfile.phpt" role="test" />
<file md5sum="@tests/006-magicfile-flag.phpt@" name="006-magicfile-flag.phpt" role="test" />
<file md5sum="@tests/007-php-errormsg.phpt@" name="007-php-errormsg.phpt" role="test" />
<file md5sum="@tests/008-error-get-last.phpt@" name="008-error-get-last.phpt" role="test" />
<file md5sum="@tests/009-data-control.phpt@" name="009-data-control.phpt" role="test" />
</dir>
</dir> <!-- / -->
</contents>
Expand Down

0 comments on commit 82c0350

Please sign in to comment.