#! /usr/bin/env atf-sh atf_test_case pkg_phpextensions pkg_phpextensions_head() { atf_set "descr" "testing pkg -- install php module wich dep on newer php version even with upgrade" } pkg_phpextensions_body() { touch php53.file touch php53extension.file touch php53gd.file touch php53fileinfo.file cat << EOF > php53.ucl name: php53 origin: lang/php53 version: "5.3.27" maintainer: test categories: [test] comment: a test www: http://test prefix: /usr/local desc: < php53extension.ucl name: php53-extensions origin: lang/php53-extensions version: "1.6" maintainer: test categories: [test] comment: a test www: http://test prefix: /usr/local desc: < php53gd.ucl name: php53-gd origin: graphics/php53-gd version: "5.3.27" maintainer: test categories: [test] comment: a test www: http://test prefix: /usr/local desc: < repo1.conf local1: { url: file://${TMPDIR}, enabled: true } EOF for p in php53 php53extension php53gd; do atf_check \ -o ignore \ -e empty \ -s exit:0 \ pkg create -M ./${p}.ucl done atf_check \ -o inline:"Creating repository in .... done\nPacking files for repository... done\n" \ -e empty \ -s exit:0 \ pkg repo . atf_check \ -o ignore \ -e empty \ -s exit:0 \ pkg -o REPOS_DIR="${TMPDIR}" -o PKG_CACHEDIR="${TMPDIR}" install -y php53-extensions #### NEW rm repo1.conf rm -f *.ucl rm *.txz cat << EOF > php53.new.ucl name: php53 origin: lang/php53 version: "5.3.40" maintainer: test categories: [test] comment: a test www: http://test prefix: /usr/local desc: <> php53extension.new.ucl name: php53-extensions origin: lang/php53-extensions version: "1.6" maintainer: test categories: [test] comment: a test www: http://test prefix: /usr/local desc: <> php53gd.new.ucl name: php53-gd origin: graphics/php53-gd version: "5.3.40" maintainer: test categories: [test] comment: a test www: http://test prefix: /usr/local desc: <> php53fileinfo.new.ucl name: php53-fileinfo origin: sysutils/php53-fileinfo version: "5.3.40" maintainer: test categories: [test] comment: a test www: http://test prefix: /usr/local desc: <> repo.conf local: { url: file://${TMPDIR}/, enabled: true } EOF OUTPUT="php53-5.3.40 php53-extensions-1.6 php53-fileinfo-5.3.40 php53-gd-5.3.27 " atf_check \ -o empty \ -e empty \ -s exit:0 \ pkg -o REPOS_DIR="${TMPDIR}" -o PKG_CACHEDIR="${TMPDIR}" install -y php53-fileinfo # atf_check \ # -o empty \ # -e empty \ # -s exit:0 \ # pkg -o REPOS_DIR="${TMPDIR}" -o PKG_CACHEDIR="${TMPDIR}" upgrade -n #atf_check \ # -o not-inline:"${OUTPUT}" \ # -e empty \ # -s exit:0 \ # pkg -o REPOS_DIR="${TMPDIR}" -o PKG_CACHEDIR="${TMPDIR}" info -q } atf_init_test_cases() { . $(atf_get_srcdir)/test_environment.sh atf_add_test_case pkg_phpextensions }