diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2022-03-18 21:01:55 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2022-03-21 12:10:23 +0300 |
commit | df79f83187ecb91569b254ecbd90f46edabe8826 (patch) | |
tree | f36c378bb61745ea58f34d0823dec17e95f746aa /tests | |
parent | 01fbbe565ce8eb7afc91c51821dfd96235491a7b (diff) |
Fix pkg-build to re-evaluate buildfile clauses in dependencies if configuration variables are specified for dependent
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common/dependency-alternatives/t8a/fux-1.0.0.tar.gz | bin | 0 -> 466 bytes | |||
-rw-r--r-- | tests/common/dependency-alternatives/t8a/libbiz-0.1.0.tar.gz | bin | 0 -> 350 bytes | |||
-rw-r--r-- | tests/pkg-build.testscript | 121 |
3 files changed, 121 insertions, 0 deletions
diff --git a/tests/common/dependency-alternatives/t8a/fux-1.0.0.tar.gz b/tests/common/dependency-alternatives/t8a/fux-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..7764719 --- /dev/null +++ b/tests/common/dependency-alternatives/t8a/fux-1.0.0.tar.gz diff --git a/tests/common/dependency-alternatives/t8a/libbiz-0.1.0.tar.gz b/tests/common/dependency-alternatives/t8a/libbiz-0.1.0.tar.gz Binary files differnew file mode 100644 index 0000000..575e346 --- /dev/null +++ b/tests/common/dependency-alternatives/t8a/libbiz-0.1.0.tar.gz diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript index 30bbe96..36ffb9d 100644 --- a/tests/pkg-build.testscript +++ b/tests/pkg-build.testscript @@ -140,6 +140,7 @@ # | |-- libbar-1.0.0.tar.gz # | |-- libbaz-1.0.0.tar.gz # | |-- libbaz-1.1.0.tar.gz +# | |-- libbiz-0.1.0.tar.gz # | |-- libbiz-1.0.0.tar.gz # | |-- libbox-1.0.0.tar.gz # | |-- foo-1.0.0.tar.gz -> {libbar libbaz} ^1.0.0 @@ -149,6 +150,7 @@ # | | libbaz ^1.0.0 ? ($cxx.target.class != 'windows') config.fax.backend=libbaz, # | | libbiz ? ($config.fax.libbiz) config.fax.extras='[b\i$z]', # | | libbox ? ($config.fax.libbox && $config.fax.backend == libbaz && $config.fax.extras == '[b\i$z]') +# | |-- fux -> libbiz ? (!$config.fux.libbiz_old) | libbiz ^0.1.0 ? ($config.fux.libbiz_old) # | `-- repositories.manifest # | # |-- t9 @@ -3670,6 +3672,125 @@ test.options += --no-progress $pkg_drop fax } + : reevaluate-alternatives + : + { + +$clone_cfg + + : add-dependency + : + { + $clone_cfg; + + $* fax 2>!; + + $pkg_status -r >>"EOO"; + !fax configured 1.0.0 + $backend_configured + EOO + + $* config.fax.libbiz=true -- fax 2>>~%EOE%; + disfigured fax/1.0.0 + fetched libbiz/1.0.0 + unpacked libbiz/1.0.0 + configured libbiz/1.0.0 + configured fax/1.0.0 + %info: .+fax-1.0.0.+ is up to date% + updated fax/1.0.0 + EOE + + $pkg_status -r >>"EOO"; + !fax configured 1.0.0 + $backend_configured + libbiz configured 1.0.0 + EOO + + # While at it, tests that the dependency is properly removed. + # + $* config.fax.libbiz=false -- fax 2>>~%EOE%; + disfigured fax/1.0.0 + disfigured libbiz/1.0.0 + purged libbiz/1.0.0 + configured fax/1.0.0 + %info: .+fax-1.0.0.+ is up to date% + updated fax/1.0.0 + EOE + + $pkg_status -r >>"EOO"; + !fax configured 1.0.0 + $backend_configured + EOO + + $pkg_drop fax + } + + : downgrade-dependency + : + { + $clone_cfg; + + $* fux 2>!; + + $pkg_status -r >>"EOO"; + !fux configured 1.0.0 + libbiz configured 1.0.0 + EOO + + $* config.fux.libbiz_old=true -- fux 2>>~%EOE%; + disfigured fux/1.0.0 + disfigured libbiz/1.0.0 + fetched libbiz/0.1.0 + unpacked libbiz/0.1.0 + configured libbiz/0.1.0 + configured fux/1.0.0 + %info: .+fux-1.0.0.+ is up to date% + updated fux/1.0.0 + EOE + + $pkg_status -r >>"EOO"; + !fux configured 1.0.0 + libbiz configured 0.1.0 available 1.0.0 + EOO + + # While at it, test that the dependency is properly upgraded. + # + # Note that, unless requested, libbiz is not upgraded, since 0.1.0 + # is still good for the selected alternative. + # + $* config.fux.libbiz_old=false -- fux 2>>~%EOE%; + disfigured fux/1.0.0 + configured fux/1.0.0 + %info: .+fux-1.0.0.+ is up to date% + updated fux/1.0.0 + EOE + + $pkg_status -r >>"EOO"; + !fux configured 1.0.0 + libbiz configured 0.1.0 available 1.0.0 + EOO + + $* fux +{ config.fux.libbiz_old=false } ?libbiz 2>>~%EOE%; + disfigured fux/1.0.0 + disfigured libbiz/0.1.0 + fetched libbiz/1.0.0 + unpacked libbiz/1.0.0 + configured libbiz/1.0.0 + configured fux/1.0.0 + %info: .+libbiz-1.0.0.+ is up to date% + %info: .+fux-1.0.0.+ is up to date% + updated libbiz/1.0.0 + updated fux/1.0.0 + EOE + + $pkg_status -r >>"EOO"; + !fux configured 1.0.0 + libbiz configured 1.0.0 + EOO + + $pkg_drop fux + } + } + : external-package : if! $remote |