diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-04-22 21:57:13 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-07-09 14:06:57 +0300 |
commit | 5d513688ae07d96910dd1eef83bdad4e9d780373 (patch) | |
tree | 402a87bbdb79a5a2392b714553e567465c3415c1 /tests | |
parent | 50a5c7b14250dab7941e8b0a67dfe6c442d2c5a9 (diff) |
Add support for linked configurations
Diffstat (limited to 'tests')
26 files changed, 2517 insertions, 8 deletions
diff --git a/tests/cfg-create.testscript b/tests/cfg-create.testscript index 9461dad..b96a98f 100644 --- a/tests/cfg-create.testscript +++ b/tests/cfg-create.testscript @@ -5,6 +5,11 @@ config_cxx = config.cxx=$quote($recall($cxx.path) $cxx.config.mode, true) +cfg_create += 2>! + +# @@ To verify the creation result use cfg-list command rather than +# pkg-status, when implemented. +# pkg_status += -d cfg : non-empty @@ -25,6 +30,8 @@ EOE { $* 2>>/~%EOE%; %created new configuration in .+/cfg/% + % info: uuid: .{36}% + info: type: target EOE $pkg_status libfoo >'libfoo unknown' @@ -35,6 +42,8 @@ EOE { $* "config.install.root='$~/opt'" 2>>/~%EOE%; %created new configuration in .+/cfg/% + % info: uuid: .{36}% + info: type: target EOE $pkg_status libfoo >'libfoo unknown'; @@ -51,6 +60,8 @@ EOE { $* cxx $config_cxx 2>>/~%EOE%; %created new configuration in .+/cfg/% + % info: uuid: .{36}% + info: type: target EOE $pkg_status libfoo >'libfoo unknown'; @@ -69,6 +80,8 @@ EOE $* --wipe 2>>/~%EOE%; %created new configuration in .+/cfg/% + % info: uuid: .{36}% + info: type: target EOE $pkg_status libfoo >'libfoo unknown' @@ -81,8 +94,126 @@ EOE $* --existing 2>>/~%EOE%; %initialized existing configuration in .+/cfg/% + % info: uuid: .{36}% + info: type: target + EOE + + $pkg_status libfoo >'libfoo unknown' + } +} + +: name +: +{ + test.arguments += -d cfg + + : valid + : + { + $* --name foo 2>>/~%EOE% &cfg/***; + %created new configuration in .+/cfg/% + % info: uuid: .{36}% + info: type: target + info: name: foo + EOE + + # @@ To verify the result use cfg-list, when implemented. + # + $pkg_status libfoo >'libfoo unknown' + } + + : invalid + : + : Also use the short option. + : + $* --name 123 2>>EOE != 0 + error: invalid --name option value '123': illegal first character (must be alphabetic or underscore) + EOE +} + +: type +: +{ + test.arguments += -d cfg + + : valid + : + { + $* --type host 2>>/~%EOE% &cfg/***; + %created new configuration in .+/cfg/% + % info: uuid: .{36}% + info: type: host EOE $pkg_status libfoo >'libfoo unknown' } + + : invalid + : + : Also use the short option. + : + $* --type '' 2>>EOE != 0 + error: empty --type option value + EOE +} + +: uuid +: +{ + test.arguments += -d cfg + + : valid + : + { + $* --config-uuid '18f48b4b-b5d9-4712-b98c-1930df1c4228' 2>>/~%EOE% &cfg/***; + %created new configuration in .+/cfg/% + info: uuid: 18f48b4b-b5d9-4712-b98c-1930df1c4228 + info: type: target + EOE + + $pkg_status libfoo >'libfoo unknown' + } + + : invalid + : + : Also use the short option. + : + $* --config-uuid '123' 2>>EOE != 0 + error: invalid value '123' for option '--config-uuid' + EOE +} + +: link-config +: +{ + test.arguments += -d cfg + + : valid-type + : + { + $cfg_create -d host --type 'host' &host/***; + $cfg_create -d build2 --type 'build2' &build2/***; + + $* --host-config host --build2-config build2 2>>/~%EOE% &cfg/***; + %created new configuration in .+/cfg/% + % info: uuid: .{36}% + info: type: target + EOE + + $pkg_status libfoo >'libfoo unknown' + } + + : invalid-type + : + { + $cfg_create -d cfg2 &cfg2/***; + + $* --host-config cfg2 2>>/~%EOE% != 0; + %error: host configuration .+/cfg2/ is of 'target' type% + EOE + + $* --build2-config cfg2 2>>/~%EOE% != 0 + %error: build2 configuration .+/cfg2/ is of 'target' type% + EOE + } } diff --git a/tests/cfg-link.testscript b/tests/cfg-link.testscript new file mode 100644 index 0000000..b396c1a --- /dev/null +++ b/tests/cfg-link.testscript @@ -0,0 +1,190 @@ +# file : tests/cfg-link.testscript +# license : MIT; see accompanying LICENSE file + +.include common.testscript + +cfg_create += 2>! + +# @@ To verify the linking result use cfg-list command rather than pkg-status, +# when implemented. +# + +test.arguments += -d cfg + +cfg_uuid = '18f48b4b-b5d9-4712-b98c-1930df1c4228' +acfg_uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228' + +: success +: +{ + $cfg_create -d cfg --name 'main'; + $cfg_create -d acfg --name 'shared' --config-uuid "$acfg_uuid" &acfg/***; + + # Try to link configuration under the same name. + # + $* cfg 2>>/~"%EOE%" != 0; + %error: linking configuration .+/cfg/ with itself% + % info: uuid: .{36}% + EOE + + # Try to link configuration under the same name. + # + $* acfg --name 'main' 2>>/~"%EOE%" != 0; + %error: linking configuration .+/acfg/ using current configuration name 'main'% + info: consider specifying alternative name with --name + EOE + + # Link configuration. + # + $* acfg 2>>/~"%EOE%"; + %linked configuration .+/acfg/% + info: uuid: $acfg_uuid + info: type: target + info: name: shared + info: id: 1 + EOE + + $pkg_status -d cfg libfoo >'libfoo unknown'; + $pkg_status -d acfg libfoo >'libfoo unknown'; + + # Test that the recreated configuration can be implicitly re-linked. + # + rm -r cfg; + $cfg_create -d cfg --name 'test' --config-uuid "$cfg_uuid" &cfg/***; + + $* acfg 2>>/~"%EOE%"; + %warning: current configuration .+/cfg/ is already implicitly linked with .+/acfg/% + %linked configuration .+/acfg/% + info: uuid: $acfg_uuid + info: type: target + info: name: shared + info: id: 1 + EOE + + # Test that the repeated link is reported. + # + $* acfg 2>>/~%EOE% != 0; + %error: configuration with uuid .{36} is already linked as \.\./acfg/% + EOE + + rm -r acfg; + + $cfg_create -d acfg --name 'shared' &acfg/***; + + # Test that the path clash is reported. + # + $* acfg 2>>/~%EOE% != 0; + %error: configuration with path .+/acfg/ is already linked% + EOE + + # Test that the name clash is reported. + # + $cfg_create -d acfg2 --name 'shared' &acfg2/***; + + $* acfg2 --name 'shared' 2>>/EOE != 0; + error: configuration with name shared is already linked as ../acfg/ + info: consider specifying alternative name with --name + EOE + + $* acfg2 2>>/~%EOE%; + warning: configuration with name shared is already linked as ../acfg/, linking as unnamed + %linked configuration .+/acfg2/% + % info: uuid: .{36}% + info: type: target + info: id: 2 + EOE + + # Test that the integrity check fails. + # + $pkg_status -d cfg libfoo 2>>/~"%EOE%" != 0; + error: configuration acfg/ uuid mismatch + % info: uuid .+% + info: linked with cfg/ as $acfg_uuid + EOE + + # Link the second configuration. + # + rm -r acfg; + $cfg_create -d acfg --name 'shared' --config-uuid "$acfg_uuid" &acfg/***; + + $pkg_status -d cfg libfoo >'libfoo unknown'; + $pkg_status -d acfg2 libfoo >'libfoo unknown'; + + # Test that the configuration type mismatch is reported. + # + mv cfg cfg.tmp; + $cfg_create -d cfg --type host --config-uuid "$cfg_uuid"; + + $* -d acfg2 cfg 2>>/EOE != 0; + error: configuration cfg/ type mismatch + info: type host + info: implicitly linked with acfg2/ as target + EOE + + rm -r cfg; + mv cfg.tmp cfg; + + # Make the implicit link explicit. + # + $* -d acfg2 cfg 2>>/~"%EOE%"; + %linked configuration .+/cfg/% + info: uuid: $cfg_uuid + info: type: target + info: name: test + info: id: 1 + EOE + + $pkg_status -d cfg libfoo >'libfoo unknown'; + $pkg_status -d acfg2 libfoo >'libfoo unknown'; + + $* -d acfg2 cfg 2>>/~%EOE% != 0; + %error: configuration with uuid .{36} is already linked as \.\./cfg/% + EOE + + # Test that the implicit link path clash is reported. + # + rm -r cfg; + $cfg_create -d cfg --name 'test' &cfg/***; + + $* acfg2 2>>/~%EOE% != 0; + %error: current configuration .+/cfg/ is already linked with .+/acfg2/% + EOE + + # Test that the repeated implicit link is reported. + # + $cfg_create -d cfg2 --config-uuid "$cfg_uuid"; + + $* -d cfg2 acfg2 2>>/~"%EOE%" != 0; + %error: current configuration $cfg_uuid is already linked with .+/acfg2/% + EOE + + # Make sure that current configuration is implicitly linked as unnamed. + # + # @@ Make sure that's really the case when the cfg-list command is + # implemented. + # + rm -r cfg2; + $cfg_create -d cfg2 --name 'test' &cfg2/***; + + $* -d cfg2 acfg2 2>>/~%EOE%; + %linked configuration .+/acfg2/% + % info: uuid: .{36}% + info: type: target + info: name: shared + info: id: 1 + EOE + + # Test that the integrity check fails. + # + $pkg_status -d cfg2 libfoo 2>>/~"%EOE%" != 0; + error: configuration cfg/ uuid mismatch + % info: uuid .+% + info: linked with acfg2/ as $cfg_uuid + EOE + + rm -r cfg; + $cfg_create -d cfg --name 'test' --config-uuid "$cfg_uuid" &cfg/***; + + $pkg_status -d cfg2 libfoo >'libfoo unknown'; + $pkg_status -d acfg2 libfoo >'libfoo unknown' +} diff --git a/tests/common.testscript b/tests/common.testscript index 5db8c6a..105bf3e 100644 --- a/tests/common.testscript +++ b/tests/common.testscript @@ -33,6 +33,7 @@ test.options += --default-options $options_guard \ # as expected). # cfg_create = $* cfg-create +cfg_link = $* cfg-link pkg_build = $* pkg-build pkg_checkout = $* pkg-checkout pkg_configure = $* pkg-configure diff --git a/tests/common/linked/t7a/foo-1.0.0.tar.gz b/tests/common/linked/t7a/foo-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..100496d --- /dev/null +++ b/tests/common/linked/t7a/foo-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libbar-1.0.0.tar.gz b/tests/common/linked/t7a/libbar-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..21940a3 --- /dev/null +++ b/tests/common/linked/t7a/libbar-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libbaz-1.0.0.tar.gz b/tests/common/linked/t7a/libbaz-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..723ac32 --- /dev/null +++ b/tests/common/linked/t7a/libbaz-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libbix-1.0.0.tar.gz b/tests/common/linked/t7a/libbix-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..67dd873 --- /dev/null +++ b/tests/common/linked/t7a/libbix-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libbiz-1.0.0.tar.gz b/tests/common/linked/t7a/libbiz-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..1214925 --- /dev/null +++ b/tests/common/linked/t7a/libbiz-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libbox-1.0.0.tar.gz b/tests/common/linked/t7a/libbox-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..7c293e0 --- /dev/null +++ b/tests/common/linked/t7a/libbox-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libbuild2-bar-1.0.0.tar.gz b/tests/common/linked/t7a/libbuild2-bar-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..789b4e8 --- /dev/null +++ b/tests/common/linked/t7a/libbuild2-bar-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libbuild2-foo-1.0.0.tar.gz b/tests/common/linked/t7a/libbuild2-foo-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..d7032d0 --- /dev/null +++ b/tests/common/linked/t7a/libbuild2-foo-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libbuz-1.0.0.tar.gz b/tests/common/linked/t7a/libbuz-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..4d0ea38 --- /dev/null +++ b/tests/common/linked/t7a/libbuz-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libfax-1.0.0.tar.gz b/tests/common/linked/t7a/libfax-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..a460e4a --- /dev/null +++ b/tests/common/linked/t7a/libfax-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/libfix-1.0.0.tar.gz b/tests/common/linked/t7a/libfix-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000..fbfadde --- /dev/null +++ b/tests/common/linked/t7a/libfix-1.0.0.tar.gz diff --git a/tests/common/linked/t7a/repositories.manifest b/tests/common/linked/t7a/repositories.manifest new file mode 100644 index 0000000..5b70556 --- /dev/null +++ b/tests/common/linked/t7a/repositories.manifest @@ -0,0 +1 @@ +: 1 diff --git a/tests/common/linked/t7b/foo-1.1.0.tar.gz b/tests/common/linked/t7b/foo-1.1.0.tar.gz Binary files differnew file mode 100644 index 0000000..aa929fb --- /dev/null +++ b/tests/common/linked/t7b/foo-1.1.0.tar.gz diff --git a/tests/common/linked/t7b/libbar-1.1.0.tar.gz b/tests/common/linked/t7b/libbar-1.1.0.tar.gz Binary files differnew file mode 100644 index 0000000..9926348 --- /dev/null +++ b/tests/common/linked/t7b/libbar-1.1.0.tar.gz diff --git a/tests/common/linked/t7b/libbaz-1.1.0.tar.gz b/tests/common/linked/t7b/libbaz-1.1.0.tar.gz Binary files differnew file mode 100644 index 0000000..6b12460 --- /dev/null +++ b/tests/common/linked/t7b/libbaz-1.1.0.tar.gz diff --git a/tests/common/linked/t7b/libbox-1.1.0.tar.gz b/tests/common/linked/t7b/libbox-1.1.0.tar.gz Binary files differnew file mode 100644 index 0000000..698661d --- /dev/null +++ b/tests/common/linked/t7b/libbox-1.1.0.tar.gz diff --git a/tests/common/linked/t7b/repositories.manifest b/tests/common/linked/t7b/repositories.manifest new file mode 100644 index 0000000..aed60ed --- /dev/null +++ b/tests/common/linked/t7b/repositories.manifest @@ -0,0 +1,4 @@ +: 1 +location: ../t7a +role: complement +: diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript index 64e6af8..a632b67 100644 --- a/tests/pkg-build.testscript +++ b/tests/pkg-build.testscript @@ -113,6 +113,30 @@ # | | `-- root.build # | `-- * # | +# |-- t7a +# | |-- libbaz-1.0.0.tar.gz +# | |-- foo-1.0.0.tar.gz -> libbaz ^1.0.0 +# | |-- libbuild2-bar-1.0.0.tar.gz +# | |-- libbuild2-foo-1.0.0.tar.gz -> libbuild2-bar ^1.0.0, * foo ^1.0.0, +# | | libbaz ^1.0.0 +# | |-- libbiz-1.0.0.tar.gz -> * libbuild2-foo ^1.0.0, * foo ^1.0.0, +# | | libbaz ^1.0.0 +# | |-- libbuz-1.0.0.tar.gz -> * libbuild2-foo ^1.0.0, * foo ^1.0.0 +# | |-- libbix-1.0.0.tar.gz -> libbiz ^1.0.0, libbuz ^1.0.0 +# | |-- libbar-1.0.0.tar.gz -> * foo ^1.0.0, libbaz ^1.0.0 +# | |-- libbox-1.0.0.tar.gz -> * foo ^1.0.0, libbaz ^1.0.0 +# | |-- libfax-1.0.0.tar.gz +# | |-- libfix-1.0.0.tar.gz -> libbar ^1.0.0, libbox ^1.0.0, +# | | libfax ^1.0.0 +# | `-- repositories.manifest +# | +# |-- t7b -> t7a (complement repository) +# | |-- libbaz-1.1.0.tar.gz +# | |-- foo-1.1.0.tar.gz -> libbaz ^1.1.0 +# | |-- libbar-1.1.0.tar.gz -> * foo ^1.1.0, libbaz ^1.0.0 +# | |-- libbox-1.1.0.tar.gz -> * foo ^1.0.0 +# | `-- repositories.manifest +# | # `-- git # |-- libbar.git -> style-basic.git (prerequisite repository) # |-- libbaz.git @@ -139,6 +163,8 @@ posix = ($cxx.target.class != 'windows') cp -r $src/t4e $out/t4e && $rep_create $out/t4e &$out/t4e/packages.manifest cp -r $src/t5 $out/t5 && $rep_create $out/t5 &$out/t5/packages.manifest cp -r $src/t6 $out/t6 && $rep_create $out/t6 &$out/t6/packages.manifest + cp -r $src/t7a $out/t7a && $rep_create $out/t7a &$out/t7a/packages.manifest + cp -r $src/t7b $out/t7b && $rep_create $out/t7b &$out/t7b/packages.manifest # Create git repositories. # @@ -149,6 +175,8 @@ end config_cxx = config.cxx=$quote($recall($cxx.path) $cxx.config.mode, true) +cfg_create += 2>! +cfg_link += 2>! pkg_configure += -d cfg $config_cxx 2>! pkg_disfigure += -d cfg pkg_drop += -d cfg --yes 2>! @@ -408,6 +436,18 @@ test.options += --no-progress info: while satisfying libbar/1.0.0 EOE + : unknown-dependency-config + : + : As above but with a linked configuration. + : + $clone_root_cfg; + $cfg_create -d cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + $* $src/libbar-1.0.0.tar.gz +{ --config-id 1 } 2>>~%EOE% != 0 + %error: unknown dependency libfoo of package libbar \[cfg2.\]% + %info: while satisfying libbar/1.0.0 \[cfg2.\]% + EOE + : t2 : { @@ -513,6 +553,21 @@ test.options += --no-progress EOO } + : latest-config + : + : As above but with a linked configuration. + : + { + $clone_cfg; + $cfg_create -d cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + + $* libbar/1.1.0 +{ --config-id 1 } >>~%EOO% + %new libfoo/1.1.0\+1 \[cfg2.\] \(required by libbar \[cfg2.\]\)% + %new libbar/1.1.0 \[cfg2.\]% + EOO + } + : zero : { @@ -755,6 +810,24 @@ test.options += --no-progress info: while satisfying libbaz/1.1.0 EOE + : unable-satisfy-config + : + : As above but with a linked configuration. + : + $clone_cfg; + $cfg_create -d cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + $* libbaz ?libbar +{ --config-id 1 } libfoo/1.0.0 +{ --config-id 1 } 2>>~%EOE% != 0 + error: unable to satisfy constraints on package libfoo + info: command line depends on (libfoo == 1.0.0) + % info: libbar \[cfg2.\] depends on \(libfoo == 1.1.0\)% + info: available libfoo/1.0.0 + info: available libfoo/1.1.0 + info: explicitly specify libfoo version to manually satisfy both constraints + %info: while satisfying libbar/1.1.0 \[cfg2.\]% + info: while satisfying libbaz/1.1.0 + EOE + : not-available : $clone_cfg; @@ -832,6 +905,38 @@ test.options += --no-progress $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; $pkg_purge libfoo 2>'purged libfoo/1.1.0' } + + : unable-downgrade-config + : + : As above but with a linked configuration. + : + { + $clone_cfg; + $cfg_create -d cfg2 &cfg2/***; + $rep_add -d cfg2 $rep/t4c && $rep_fetch -d cfg2; + $cfg_link -d cfg2 cfg; + $pkg_fetch libfoo/1.1.0 && $pkg_unpack libfoo && $pkg_configure libfoo; + $pkg_fetch libbar/1.1.0 && $pkg_unpack libbar && $pkg_configure libbar; + + $* libfoo-1.2.0.tar.gz 2>>EOE != 0; + error: unknown package libfoo-1.2.0.tar.gz + EOE + + $* -d cfg2 libfoo/1.0.0 +{ --config-id 1 } 2>>~%EOE% != 0; + %error: unable to downgrade package libfoo/1.1.0 \[cfg.\] to 1.0.0% + % info: because package libbar \[cfg.\] depends on \(libfoo == 1.1.0\)% + info: explicitly request up/downgrade of package libbar + info: or explicitly specify package libfoo version to manually satisfy these constraints + EOE + + $* libfoo/1.1.0 --keep-unused >'update libfoo/1.1.0'; + + $pkg_disfigure libbar 2>'disfigured libbar/1.1.0'; + $pkg_purge libbar 2>'purged libbar/1.1.0'; + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } } : dependent-reconfiguration @@ -1166,6 +1271,37 @@ test.options += --no-progress $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; $pkg_purge libfoo 2>'purged libfoo/1.0.0' } + + : forcing-upgrade-held-config + : + : As above but with a linked configuration. + : + { + $clone_cfg; + $cfg_create -d cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + + $* libfoo/1.0.0 +{ --config-id 1 } 2>>~%EOE%; + %fetched libfoo/1.0.0 \[cfg2.\]% + %unpacked libfoo/1.0.0 \[cfg2.\]% + %configured libfoo/1.0.0 \[cfg2.\]% + %info: .+ is up to date% + %updated libfoo/1.0.0 \[cfg2.\]% + EOE + + $pkg_status -d cfg2 libfoo >'!libfoo configured !1.0.0'; + + $* libbaz ?libbar +{ --config-id 1 } 2>>~%EOE% != 0; + %error: package libbar \[cfg2.\] dependency on \(libfoo == 1.1.0\) is forcing upgrade of libfoo/1.0.0 \[cfg2.\] to 1.1.0% + % info: package version libfoo/1.0.0 \[cfg2.\] is held% + info: explicitly request version upgrade to continue + %info: while satisfying libbar/1.1.0 \[cfg2.\]% + info: while satisfying libbaz/1.1.0 + EOE + + $pkg_disfigure -d cfg2 libfoo 2>'disfigured libfoo/1.0.0'; + $pkg_purge -d cfg2 libfoo 2>'purged libfoo/1.0.0' + } } : drop-dependencies @@ -2326,6 +2462,32 @@ test.options += --no-progress $pkg_drop libbar } + + : unsatisfied-config + : + : As above but with a linked configuration. + : + { + $clone_cfg; + $cfg_create -d cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + + $* libbar/0.0.1 2>!; + + $pkg_status libbaz >'libbaz configured 0.0.1 available 0.1.0 0.0.4 0.0.3'; + + $* ?libbaz/0.0.3 +{ --config-id 1 } 2>>EOE != 0; + error: unable to satisfy constraints on package libbaz + info: libbar depends on (libbaz == 0.0.1) + info: command line depends on (libbaz == 0.0.3) + info: specify libbaz version to satisfy libbar constraint + info: while satisfying libbar/0.0.1 + EOE + + $pkg_status libbaz >'libbaz configured 0.0.1 available 0.1.0 0.0.4 0.0.3'; + + $pkg_drop libbar + } } : scratch @@ -2480,7 +2642,7 @@ test.options += --no-progress : as a dependency, so it is built incrementally. : { - $cfg_create cxx $config_cxx -d cfg 2>- &cfg/***; + $cfg_create cxx $config_cxx -d cfg &cfg/***; # Add libhello as the dir repository. # @@ -2899,7 +3061,7 @@ test.options += --no-progress { test.arguments += --yes - +$cfg_create cxx $config_cxx -d cfg 2>- &cfg/*** + +$cfg_create cxx $config_cxx -d cfg &cfg/*** : direct : @@ -2918,6 +3080,27 @@ test.options += --no-progress EOE } + : direct-config + : + : As above but with a linked configuration. + : + { + $clone_cfg; + $cfg_create -d cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + + cp -r $src/libfoo-1.1.0/ libfoo; + echo "depends: libfoo" >+ libfoo/manifest; + $rep_add libfoo --type dir; + + $rep_fetch; + + $* libfoo +{ --config-id 1 } 2>>~%EOE% != 0 + %error: dependency cycle detected involving package libfoo \[cfg2.\]% + % info: libfoo/1.1.0 \[cfg2.\] depends on libfoo/1.1.0 \[cfg2.\]% + EOE + } + : indirect : { @@ -2996,7 +3179,7 @@ test.options += --no-progress { test.arguments += --yes - +$cfg_create cxx $config_cxx -d cfg 2>- &cfg/*** + +$cfg_create cxx $config_cxx -d cfg &cfg/*** +cp -r $src/libhello-1.0.0 ./libhello +$rep_add libhello --type dir +$rep_fetch @@ -3472,6 +3655,30 @@ test.options += --no-progress $pkg_drop libfoo } + : no-patch-config + : + : As above but with a linked configuration. + : + { + $clone_root_cfg; + $cfg_create -d cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + + $* "libfoo@$rep/t1" +{ --config-id 1 } --patch 2>>~%EOE%; + %.+ + %configured libfoo/1.0.0 \[cfg2.\]% + %info: .+ is up to date% + %updated libfoo/1.0.0 \[cfg2.\]% + EOE + + $* "libfoo@$rep/t3" +{ --config-id 1 } --patch 2>>~%EOE% != 0; + %.+ + %error: patch version for libfoo/1.0.0 \[cfg2.\] is not found in pkg:build2.org/pkg-build/t3% + EOE + + $pkg_drop -d cfg2 libfoo + } + : package-in-complement : { @@ -3574,7 +3781,7 @@ test.options += --no-progress : keep-out : { - +$cfg_create cxx $config_cxx -d cfg 2>- &cfg/*** + +$cfg_create cxx $config_cxx -d cfg &cfg/*** # Build libhello as an external package. # @@ -3692,7 +3899,7 @@ test.options += --no-progress # Distribute using the dedicated configuration to avoid the 'c and cxx # module toolchain pattern mismatch' warning. # - +$cfg_create cxx $config_cxx -d cfg 2>- &cfg/*** + +$cfg_create cxx $config_cxx -d cfg &cfg/*** +$build 'dist(../../libhello/@./cfg/libhello/)' \ config.dist.root=./ \ @@ -3991,3 +4198,1689 @@ else $pkg_purge style-basic } } + +: linked-configs +: +{ + : 2-configs + : + { + +$clone_root_cfg && $rep_add $rep/t4c && $rep_fetch + + : invalid-cfg + : + { + +$clone_cfg + + : config-id + : + { + $clone_cfg; + $* libbaz --config-id 1 2>>/EOE != 0 + error: no configuration with id 1 is linked with cfg/ + EOE + } + + : config-name + : + { + $clone_cfg; + $* libbaz --config-name foo 2>>/EOE != 0 + error: no configuration with name 'foo' is linked with cfg/ + EOE + } + + : config-uuid + : + { + $clone_cfg; + $* libbaz --config-uuid '18f48b4b-b5d9-4712-b98c-1930df1c4228' 2>>/EOE != 0 + error: no configuration with uuid 18f48b4b-b5d9-4712-b98c-1930df1c4228 is linked with cfg/ + EOE + } + + : multiple + : + { + $clone_cfg; + $* libbaz --config-id 1 --config-name foo 2>>/EOE != 0 + error: multiple --config-* specified + EOE + } + } + + : baz + : + { + $clone_cfg; + $cfg_create -d cfg-bar-foo &cfg-bar-foo/***; + $cfg_link -d cfg cfg-bar-foo; + + $* libbaz ?libbar +{ --config-id 1 } ?libfoo +{ --config-id 1 } 2>>~%EOE%; + %fetched libfoo/1.1.0 \[cfg-bar-foo.\]% + %unpacked libfoo/1.1.0 \[cfg-bar-foo.\]% + %fetched libbar/1.1.0 \[cfg-bar-foo.\]% + %unpacked libbar/1.1.0 \[cfg-bar-foo.\]% + fetched libbaz/1.1.0 + unpacked libbaz/1.1.0 + %configured libfoo/1.1.0 \[cfg-bar-foo.\]% + %configured libbar/1.1.0 \[cfg-bar-foo.\]% + configured libbaz/1.1.0 + %info: cfg-bar-foo.+libfoo-1.1.0.+ is up to date% + %info: cfg-bar-foo.+libbar-1.1.0.+ is up to date% + %info: cfg[^-].+libbaz-1.1.0.+ is up to date% + %updated libfoo/1.1.0 \[cfg-bar-foo.\]% + %updated libbar/1.1.0 \[cfg-bar-foo.\]% + updated libbaz/1.1.0 + EOE + + $pkg_status -r libbaz >>/EOO; + !libbaz configured 1.1.0 + libbar [cfg-bar-foo/] configured 1.1.0 + libfoo [cfg-bar-foo/] configured 1.1.0 + libfoo [cfg-bar-foo/] configured 1.1.0 + EOO + + $pkg_status -d cfg-bar-foo -r libbar >>/EOO; + libbar configured 1.1.0 + libfoo configured 1.1.0 + EOO + + $pkg_status -d cfg-bar-foo libfoo >'libfoo configured 1.1.0'; + + $pkg_drop libbaz; + + $pkg_status libbaz libbar libfoo >>/EOO + libbaz available 1.1.0 + libbar available [1.1.0] + libfoo available [1.1.0] 1.0.0 + EOO + } + } + + : 3-configs + : + { + +$clone_root_cfg && $rep_add $rep/t4c && $rep_fetch + + : baz + : + { + uuid = '28f48b4b-b5d9-4712-b98c-1930df1c4228'; + + $clone_cfg; + $cfg_create -d cfg-bar &cfg-bar/***; + $cfg_create -d cfg-foo --config-uuid $uuid &cfg-foo/***; + + $cfg_link -d cfg cfg-bar; + $cfg_link -d cfg-bar cfg-foo; + + $* libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes 2>>~%EOE%; + added pkg:build2.org/pkg-build/t4b + fetching pkg:build2.org/pkg-build/t4b + fetching pkg:build2.org/pkg-build/t4a (prerequisite of pkg:build2.org/pkg-build/t4b) + %fetched libfoo/1.1.0 \[cfg-foo.\]% + %unpacked libfoo/1.1.0 \[cfg-foo.\]% + fetched libbar/1.1.0 + unpacked libbar/1.1.0 + %configured libfoo/1.1.0 \[cfg-foo.\]% + configured libbar/1.1.0 + %info: cfg-foo.+libfoo-1.1.0.+ is up to date% + %info: cfg-bar.+libbar-1.1.0.+ is up to date% + %updated libfoo/1.1.0 \[cfg-foo.\]% + updated libbar/1.1.0 + EOE + + $* libfoo --config-uuid $uuid 2>>~%EOE%; + %info: cfg-foo.+libfoo-1.1.0.+ is up to date% + %updated libfoo/1.1.0 \[cfg-foo.\]% + EOE + + $* libbaz 2>>~%EOE%; + fetched libbaz/1.1.0 + unpacked libbaz/1.1.0 + configured libbaz/1.1.0 + %info: cfg[^-].+libbaz-1.1.0.+ is up to date% + updated libbaz/1.1.0 + EOE + + $pkg_status -r >>/EOO; + !libbaz configured 1.1.0 + !libbar [cfg-bar/] configured !1.1.0 + !libfoo [cfg-foo/] configured 1.1.0 + !libfoo [cfg-foo/] configured 1.1.0 + !libbar [cfg-bar/] configured !1.1.0 + !libfoo [cfg-foo/] configured 1.1.0 + !libfoo [cfg-foo/] configured 1.1.0 + EOO + + $pkg_drop libbaz; + + $* ?libfoo --config-uuid $uuid; # Unhold. + + $pkg_status libbaz libbar libfoo >>/EOO; + libbaz available 1.1.0 + !libbar [cfg-bar/] configured !1.1.0 + libfoo [cfg-foo/] configured 1.1.0 + EOO + + $* ?libbar +{ --config-id 1 } <'y' 2>>~%EOE%; + % drop libfoo/1.1.0 \[cfg-foo.\] \(unused\)% + % drop libbar/1.1.0 \[cfg-bar.\] \(unused\)% + %continue\? \[Y/n\] disfigured libbar/1.1.0 \[cfg-bar.\]% + %disfigured libfoo/1.1.0 \[cfg-foo.\]% + %purged libfoo/1.1.0 \[cfg-foo.\]% + %purged libbar/1.1.0 \[cfg-bar.\]% + EOE + + $pkg_status libbar libfoo >>/EOO + libbar available [1.1.0] + libfoo available [1.1.0] 1.0.0 + EOO + } + } + + : buildtime-dep + : + { + +$clone_root_cfg && $rep_add $rep/t7a && $rep_fetch + + : external-config + : + { + +$clone_cfg + +$cfg_create -d cfg2 --type host --name cfg2 &cfg2/*** + +$cfg_link -d cfg cfg2 + + : downgrade-dependency + : + { + $clone_cfg; + cp -pr ../cfg2 ./; + + $* libbar <'y' 2>>~%EOE%; + % new libbaz/1.0.0 \[cfg2.\] \(required by foo \[cfg2.\]\)% + % new foo/1.0.0 \[cfg2.\] \(required by libbar\)% + % new libbaz/1.0.0 \(required by libbar\)% + new libbar/1.0.0 + %continue\? \[Y/n\] fetched libbaz/1.0.0 \[cfg2.\]% + %unpacked libbaz/1.0.0 \[cfg2.\]% + %fetched foo/1.0.0 \[cfg2.\]% + %unpacked foo/1.0.0 \[cfg2.\]% + fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched libbar/1.0.0 + unpacked libbar/1.0.0 + %configured libbaz/1.0.0 \[cfg2.\]% + %configured foo/1.0.0 \[cfg2.\]% + configured libbaz/1.0.0 + configured libbar/1.0.0 + %info: .+libbar-1.0.0.+ is up to date% + updated libbar/1.0.0 + EOE + + $pkg_status -r libbar >>/EOO; + !libbar configured 1.0.0 + foo [cfg2/] configured 1.0.0 + libbaz [cfg2/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + # While at it, make sure that from several available host + # configurations the selected package configuration is chosen and we + # don't fail with the 'multiple possible host configurations' + # diagnostics. + # + $cfg_create -d cfg3 --type host &cfg3/***; + $cfg_link -d cfg cfg3; + + $rep_add $rep/t7b && $rep_fetch; + + $* libbar <'y' 2>>~%EOE%; + % upgrade libbaz/1.1.0 \[cfg2.\] \(required by foo \[cfg2.\]\)% + % upgrade foo/1.1.0 \[cfg2.\] \(required by libbar\)% + upgrade libbar/1.1.0 + %continue\? \[Y/n\] disfigured libbar/1.0.0% + %disfigured foo/1.0.0 \[cfg2.\]% + %disfigured libbaz/1.0.0 \[cfg2.\]% + %fetched libbaz/1.1.0 \[cfg2.\]% + %unpacked libbaz/1.1.0 \[cfg2.\]% + %fetched foo/1.1.0 \[cfg2.\]% + %unpacked foo/1.1.0 \[cfg2.\]% + fetched libbar/1.1.0 + unpacked libbar/1.1.0 + %configured libbaz/1.1.0 \[cfg2.\]% + %configured foo/1.1.0 \[cfg2.\]% + configured libbar/1.1.0 + %info: .+libbar-1.1.0.+ is up to date% + updated libbar/1.1.0 + EOE + + $pkg_status -r libbar >>/EOO; + !libbar configured 1.1.0 + foo [cfg2/] configured 1.1.0 + libbaz [cfg2/] configured 1.1.0 + libbaz configured 1.0.0 available 1.1.0 + EOO + + $* libbar/1.0.0 ?foo/1.0.0 +{ --config-name cfg2 } \ + ?libbaz/1.0.0 +{ --config-id 1 } <'y' 2>>~%EOE%; + % downgrade libbaz/1.0.0 \[cfg2.\]% + % downgrade foo/1.0.0 \[cfg2.\]% + downgrade libbar/1.0.0 + continue? [Y/n] disfigured libbar/1.1.0 + %disfigured foo/1.1.0 \[cfg2.\]% + %disfigured libbaz/1.1.0 \[cfg2.\]% + %fetched libbaz/1.0.0 \[cfg2.\]% + %unpacked libbaz/1.0.0 \[cfg2.\]% + %fetched foo/1.0.0 \[cfg2.\]% + %unpacked foo/1.0.0 \[cfg2.\]% + fetched libbar/1.0.0 + unpacked libbar/1.0.0 + %configured libbaz/1.0.0 \[cfg2.\]% + %configured foo/1.0.0 \[cfg2.\]% + configured libbar/1.0.0 + %info: cfg2.+libbaz-1.0.0.+ is up to date% + %info: cfg2.+foo-1.0.0.+ is up to date% + %info: cfg.+libbar-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[cfg2.\]% + %updated foo/1.0.0 \[cfg2.\]% + updated libbar/1.0.0 + EOE + + $pkg_status -r libbar >>/EOO; + !libbar configured !1.0.0 available 1.1.0 + foo [cfg2/] configured !1.0.0 available 1.1.0 + libbaz [cfg2/] configured !1.0.0 available 1.1.0 + libbaz configured 1.0.0 available 1.1.0 + EOO + + $pkg_drop libbar libbaz + } + + : resolve-host-config + : + { + $clone_cfg; + cp -pr ../cfg2 ./; + + $cfg_create -d cfg3 --type host &cfg3/***; + $cfg_link -d cfg cfg3; + + $* libbar 2>>/~%EOE% != 0; + error: multiple possible host configurations for build-time dependency (foo ^1.0.0) + info: cfg2/ + info: cfg3/ + info: use --config-* to select the configuration + %info: while satisfying libbar.1.0.0% + EOE + + $* libbar ?foo +{ --config-id 2 } --yes 2>!; + + $pkg_status -r libbar >>/EOO; + !libbar configured 1.0.0 + foo [cfg3/] configured 1.0.0 + libbaz [cfg3/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $pkg_drop libbar + } + + : 3-configs + : + { + $clone_cfg; + cp -pr ../cfg2 ./; + + $cfg_create -d cfg3 --type host &cfg3/***; + $cfg_link -d cfg2 cfg3; + + $rep_add -d cfg2 $rep/t7a && $rep_fetch -d cfg2; + + $* -d cfg2 libbaz +{ --config-id 2 } 2>!; + + $* libbar --yes 2>>~%EOE%; + %fetched foo/1.0.0 \[cfg2.\]% + %unpacked foo/1.0.0 \[cfg2.\]% + fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched libbar/1.0.0 + unpacked libbar/1.0.0 + %configured foo/1.0.0 \[cfg2.\]% + configured libbaz/1.0.0 + configured libbar/1.0.0 + %info: .+libbar-1.0.0.+ is up to date% + updated libbar/1.0.0 + EOE + + $pkg_status -r libbar >>/EOO; + !libbar configured 1.0.0 + foo [cfg2/] configured 1.0.0 + !libbaz [cfg3/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $pkg_drop libbar + } + } + + : private-config + : + { + $clone_cfg; + + $* libbar <'y' 2>>~%EOE% &cfg/.bpkg/host/***; + % new libbaz/1.0.0 \[cfg..bpkg.host.\] \(required by foo \[cfg..bpkg.host.\]\)% + % new foo/1.0.0 \[cfg..bpkg.host.\] \(required by libbar\)% + % new libbaz/1.0.0 \(required by libbar\)% + new libbar/1.0.0 + %continue\? \[Y/n\] fetched libbaz/1.0.0 \[cfg..bpkg.host.\]% + %unpacked libbaz/1.0.0 \[cfg..bpkg.host.\]% + %fetched foo/1.0.0 \[cfg..bpkg.host.\]% + %unpacked foo/1.0.0 \[cfg..bpkg.host.\]% + fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched libbar/1.0.0 + unpacked libbar/1.0.0 + %configured libbaz/1.0.0 \[cfg..bpkg.host.\]% + %configured foo/1.0.0 \[cfg..bpkg.host.\]% + configured libbaz/1.0.0 + configured libbar/1.0.0 + %info: .+libbar-1.0.0.+ is up to date% + updated libbar/1.0.0 + EOE + + $pkg_status -r libbar >>/EOO; + !libbar configured 1.0.0 + foo [cfg/.bpkg/host/] configured 1.0.0 + libbaz [cfg/.bpkg/host/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $rep_add $rep/t7b && $rep_fetch; + + $* libbar <'y' 2>>~%EOE%; + % upgrade libbaz/1.1.0 \[cfg..bpkg.host.\] \(required by foo \[cfg..bpkg.host.\]\)% + % upgrade foo/1.1.0 \[cfg..bpkg.host.\] \(required by libbar\)% + upgrade libbar/1.1.0 + %continue\? \[Y/n\] disfigured libbar/1.0.0% + %disfigured foo/1.0.0 \[cfg..bpkg.host.\]% + %disfigured libbaz/1.0.0 \[cfg..bpkg.host.\]% + %fetched libbaz/1.1.0 \[cfg..bpkg.host.\]% + %unpacked libbaz/1.1.0 \[cfg..bpkg.host.\]% + %fetched foo/1.1.0 \[cfg..bpkg.host.\]% + %unpacked foo/1.1.0 \[cfg..bpkg.host.\]% + fetched libbar/1.1.0 + unpacked libbar/1.1.0 + %configured libbaz/1.1.0 \[cfg..bpkg.host.\]% + %configured foo/1.1.0 \[cfg..bpkg.host.\]% + configured libbar/1.1.0 + %info: .+libbar-1.1.0.+ is up to date% + updated libbar/1.1.0 + EOE + + $pkg_status -r libbar >>/EOO; + !libbar configured 1.1.0 + foo [cfg/.bpkg/host/] configured 1.1.0 + libbaz [cfg/.bpkg/host/] configured 1.1.0 + libbaz configured 1.0.0 available 1.1.0 + EOO + + $pkg_drop libbar + } + + : self-hosted-config + : + { + $cfg_create -d cfg --type host &cfg/***; + $rep_add $rep/t7a && $rep_fetch; + + $* libbar <'y' 2>>~%EOE%; + new libbaz/1.0.0 (required by foo libbar) + new foo/1.0.0 (required by libbar) + new libbar/1.0.0 + continue? [Y/n] fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched foo/1.0.0 + unpacked foo/1.0.0 + fetched libbar/1.0.0 + unpacked libbar/1.0.0 + configured libbaz/1.0.0 + configured foo/1.0.0 + configured libbar/1.0.0 + %info: .+libbar-1.0.0.+ is up to date% + updated libbar/1.0.0 + EOE + + $pkg_status -r libbar >>/EOO; + !libbar configured 1.0.0 + foo configured 1.0.0 + libbaz configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $rep_add $rep/t7b && $rep_fetch; + + $* libbar <'y' 2>>~%EOE%; + upgrade libbaz/1.1.0 (required by foo libbar) + upgrade foo/1.1.0 (required by libbar) + upgrade libbar/1.1.0 + continue? [Y/n] disfigured libbar/1.0.0 + disfigured foo/1.0.0 + disfigured libbaz/1.0.0 + fetched libbaz/1.1.0 + unpacked libbaz/1.1.0 + fetched foo/1.1.0 + unpacked foo/1.1.0 + fetched libbar/1.1.0 + unpacked libbar/1.1.0 + configured libbaz/1.1.0 + configured foo/1.1.0 + configured libbar/1.1.0 + %info: .+libbar-1.1.0.+ is up to date% + updated libbar/1.1.0 + EOE + + $pkg_status -r libbar >>/EOO; + !libbar configured 1.1.0 + foo configured 1.1.0 + libbaz configured 1.1.0 + libbaz configured 1.1.0 + EOO + + $pkg_drop libbar + } + } + + : verify-dependencies + : + { + +$clone_root_cfg && $rep_add $rep/t7a && $rep_fetch + + : fail + : + { + $cfg_create -d cfg2 &cfg2/***; + $rep_add -d cfg2 $rep/t7a && $rep_fetch -d cfg2; + + $cfg_create -d cfg3 &cfg3/***; + $rep_add -d cfg3 $rep/t7a && $rep_fetch -d cfg3; + + $* -d cfg2 --yes libbar 2>!; + $* -d cfg3 --yes libbox 2>!; + + $clone_cfg; + $cfg_link -d cfg cfg2; + $cfg_link -d cfg cfg3; + + $* libfix --yes 2>>~%EOE% != 0 + error: package libbaz indirectly required by libfix/1.0.0 is configured in multiple configurations + % info: libbaz/1.0.0 \[cfg3.\]% + % info: libbaz/1.0.0 \[cfg2.\]% + EOE + } + + : succeed + : + { + $cfg_create -d cfg2 &cfg2/***; + $rep_add -d cfg2 $rep/t7b && $rep_fetch -d cfg2; + + $cfg_create -d cfg3 &cfg3/***; + $rep_add -d cfg3 $rep/t7b && $rep_fetch -d cfg3; + + $* -d cfg2 --yes libbar 2>!; + $* -d cfg3 --yes libbox 2>!; + + $clone_cfg; + $cfg_link -d cfg cfg2; + $cfg_link -d cfg cfg3; + + $* libfix --yes 2>>~%EOE%; + fetched libfax/1.0.0 + unpacked libfax/1.0.0 + fetched libfix/1.0.0 + unpacked libfix/1.0.0 + configured libfax/1.0.0 + configured libfix/1.0.0 + %info: .+libfix-1.0.0.+ is up to date% + updated libfix/1.0.0 + EOE + + $pkg_drop libfix + } + } + + : change-config + : + { + : copy + : + { + $cfg_create -d t1 --name t1 &t1/***; + $cfg_create -d t2 --name t2 &t2/***; + + $cfg_link -d t1 t2; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 libbaz --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !libbaz configured 1.0.0 + EOO + + $* -d t1 libbaz +{ --config-name t2 } 2>>~%EOE%; + %fetched libbaz/1.0.0 \[t2.\]% + %unpacked libbaz/1.0.0 \[t2.\]% + %configured libbaz/1.0.0 \[t2.\]% + %info: t2.+libbaz-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[t2.\]% + EOE + + $pkg_status -d t1 -r >>/EOO + !libbaz configured 1.0.0 + !libbaz [t2/] configured 1.0.0 + EOO + } + + : copy-unhold + : + { + $cfg_create -d t1 --name t1 &t1/***; + $cfg_create -d t2 --name t2 &t2/***; + + $cfg_link -d t1 t2; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 libbaz --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !libbaz configured 1.0.0 + EOO + + $* -d t1 ?libbaz +{ --config-name t2 }; + + $pkg_status -d t1 -r >>/EOO + !libbaz configured 1.0.0 + EOO + } + + : copy-point + : + { + $cfg_create -d t1 --name t1 &t1/***; + $cfg_create -d t2 --name t2 &t2/***; + + $cfg_link -d t1 t2; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 libbaz --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !libbaz configured 1.0.0 + EOO + + $* -d t1 foo libbaz +{ --config-name t2 } 2>>~%EOE%; + %fetched libbaz/1.0.0 \[t2.\]% + %unpacked libbaz/1.0.0 \[t2.\]% + fetched foo/1.0.0 + unpacked foo/1.0.0 + %configured libbaz/1.0.0 \[t2.\]% + configured foo/1.0.0 + %info: t2.+libbaz-1.0.0.+ is up to date% + %info: t1.+foo-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[t2.\]% + updated foo/1.0.0 + EOE + + $pkg_status -d t1 -r >>/EOO + !libbaz configured 1.0.0 + !foo configured 1.0.0 + !libbaz [t2/] configured 1.0.0 + !libbaz [t2/] configured 1.0.0 + EOO + } + + : copy-unhold-point + : + { + $cfg_create -d t1 --name t1 &t1/***; + $cfg_create -d t2 --name t2 &t2/***; + + $cfg_link -d t1 t2; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 libbaz --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !libbaz configured 1.0.0 + EOO + + $* -d t1 foo ?libbaz +{ --config-name t2 } 2>>~%EOE%; + %fetched libbaz/1.0.0 \[t2.\]% + %unpacked libbaz/1.0.0 \[t2.\]% + fetched foo/1.0.0 + unpacked foo/1.0.0 + %configured libbaz/1.0.0 \[t2.\]% + configured foo/1.0.0 + %info: t2.+libbaz-1.0.0.+ is up to date% + %info: t1.+foo-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[t2.\]% + updated foo/1.0.0 + EOE + + $pkg_status -d t1 -r >>/EOO + !libbaz configured 1.0.0 + !foo configured 1.0.0 + libbaz [t2/] configured 1.0.0 + EOO + } + + : copy-repoint + : + { + $cfg_create -d t1 --name t1 &t1/***; + $cfg_create -d t2 --name t2 &t2/***; + + $cfg_create -d h1 --type host --name h1 &h1/***; + $cfg_create -d h2 --type host --name h2 &h2/***; + + $cfg_link -d t1 h1; + $cfg_link -d t1 h2; + + $cfg_link -d t2 h1; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + $rep_add -d t2 $rep/t7a && $rep_fetch -d t2; + + $* -d t1 libbar ?foo +{ --config-name h1 } <<EOI 2>>~%EOE%; + y + EOI + % new libbaz/1.0.0 \[h1.\] \(required by foo \[h1.\]\)% + % new foo/1.0.0 \[h1.\]% + new libbaz/1.0.0 (required by libbar) + new libbar/1.0.0 + %continue\? \[Y/n\] fetched libbaz/1.0.0 \[h1.\]% + %unpacked libbaz/1.0.0 \[h1.\]% + %fetched foo/1.0.0 \[h1.\]% + %unpacked foo/1.0.0 \[h1.\]% + fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched libbar/1.0.0 + unpacked libbar/1.0.0 + %configured libbaz/1.0.0 \[h1.\]% + %configured foo/1.0.0 \[h1.\]% + configured libbaz/1.0.0 + configured libbar/1.0.0 + %info: h1.+foo-1.0.0.+ is up to date% + %info: t1.+libbar-1.0.0.+ is up to date% + %updated foo/1.0.0 \[h1.\]% + updated libbar/1.0.0 + EOE + + $pkg_status -d t1 -r >>/EOO; + !libbar configured 1.0.0 + foo [h1/] configured 1.0.0 + libbaz [h1/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $* -d t2 libbox ?foo +{ --config-name h1 } <<EOI 2>>~%EOE%; + y + EOI + % update foo/1.0.0 \[h1.\]% + new libbaz/1.0.0 (required by libbox) + new libbox/1.0.0 + continue? [Y/n] fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched libbox/1.0.0 + unpacked libbox/1.0.0 + configured libbaz/1.0.0 + configured libbox/1.0.0 + %info: h1.+foo-1.0.0.+ is up to date% + %info: t2.+libbox-1.0.0.+ is up to date% + %updated foo/1.0.0 \[h1.\]% + updated libbox/1.0.0 + EOE + + $pkg_status -d t2 -r >>/EOO; + !libbox configured 1.0.0 + foo [h1/] configured 1.0.0 + libbaz [h1/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $* -d t1 ?foo +{ --config-name h2 } <<EOI 2>>~%EOE%; + y + y + EOI + % new libbaz/1.0.0 \[h2.\] \(required by foo \[h2.\]\)% + % new foo/1.0.0 \[h2.\]% + % reconfigure libbar/1.0.0 \(dependent of foo \[h2.\]\)% + continue? [Y/n] update dependent packages? [Y/n] disfigured libbar/1.0.0 + %fetched libbaz/1.0.0 \[h2.\]% + %unpacked libbaz/1.0.0 \[h2.\]% + %fetched foo/1.0.0 \[h2.\]% + %unpacked foo/1.0.0 \[h2.\]% + %configured libbaz/1.0.0 \[h2.\]% + %configured foo/1.0.0 \[h2.\]% + configured libbar/1.0.0 + %info: h2.+foo-1.0.0.+ is up to date% + %info: t1.+libbar-1.0.0.+ is up to date% + %updated foo/1.0.0 \[h2.\]% + updated libbar/1.0.0 + EOE + + $pkg_status -d t1 -r >>/EOO; + !libbar configured 1.0.0 + foo [h2/] configured 1.0.0 + libbaz [h2/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $pkg_status -d t2 -r >>/EOO + !libbox configured 1.0.0 + foo [h1/] configured 1.0.0 + libbaz [h1/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + } + + : copy-repoint-drop + : + { + $cfg_create -d t1 --name t1 &t1/***; + $cfg_create -d t2 --name t2 &t2/***; + + $cfg_link -d t1 t2; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 foo --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !foo configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $* -d t1 libbaz +{ --config-name t2 } <<EOI 2>>~%EOE%; + y + y + EOI + % new libbaz/1.0.0 \[t2.\]% + drop libbaz/1.0.0 (unused) + % reconfigure foo/1.0.0 \(dependent of libbaz \[t2.\]\)% + continue? [Y/n] update dependent packages? [Y/n] disfigured foo/1.0.0 + disfigured libbaz/1.0.0 + %fetched libbaz/1.0.0 \[t2.\]% + %unpacked libbaz/1.0.0 \[t2.\]% + purged libbaz/1.0.0 + %configured libbaz/1.0.0 \[t2.\]% + configured foo/1.0.0 + %info: t2.+libbaz-1.0.0.+ is up to date% + %info: t1.+foo-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[t2.\]% + updated foo/1.0.0 + EOE + + $pkg_status -d t1 -r >>/EOO + !foo configured 1.0.0 + !libbaz [t2/] configured 1.0.0 + !libbaz [t2/] configured 1.0.0 + EOO + } + + : drop-repointed + : + { + $cfg_create -d t1 --name t1 &t1/***; + $cfg_create -d t2 --name t2 &t2/***; + + $cfg_link -d t1 t2; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 foo --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !foo configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $* -d t1 ?foo libbaz +{ --config-name t2 } <<EOI 2>>~%EOE%; + y + EOI + % new libbaz/1.0.0 \[t2.\]% + drop libbaz/1.0.0 (unused) + drop foo/1.0.0 (unused) + continue? [Y/n] disfigured foo/1.0.0 + disfigured libbaz/1.0.0 + %fetched libbaz/1.0.0 \[t2.\]% + %unpacked libbaz/1.0.0 \[t2.\]% + purged libbaz/1.0.0 + purged foo/1.0.0 + %configured libbaz/1.0.0 \[t2.\]% + %info: t2.+libbaz-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[t2.\]% + EOE + + $pkg_status -d t1 -r >>/EOO + !libbaz [t2/] configured 1.0.0 + EOO + } + + : dependency-repointed + : + { + $cfg_create -d h1 --type host --name h1 &h1/***; + $cfg_create -d h2 --type host --name h2 &h2/***; + + $cfg_link -d h1 h2; + + $rep_add -d h1 $rep/t7a && $rep_fetch -d h1; + + $* -d h1 foo --yes 2>!; + + $pkg_status -d h1 -r >>/EOO; + !foo configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $* -d h1 libbar libbaz +{ --config-name h2 } <<EOI 2>>~%EOE%; + y + EOI + % new libbaz/1.0.0 \[h2.\]% + drop libbaz/1.0.0 (unused) + reconfigure/update foo/1.0.0 (required by libbar) + new libbar/1.0.0 + continue? [Y/n] disfigured foo/1.0.0 + disfigured libbaz/1.0.0 + %fetched libbaz/1.0.0 \[h2.\]% + %unpacked libbaz/1.0.0 \[h2.\]% + purged libbaz/1.0.0 + fetched libbar/1.0.0 + unpacked libbar/1.0.0 + %configured libbaz/1.0.0 \[h2.\]% + configured foo/1.0.0 + configured libbar/1.0.0 + %info: h2.+libbaz-1.0.0.+ is up to date% + %info: h1.+libbar-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[h2.\]% + updated libbar/1.0.0 + EOE + + $pkg_status -d h1 -r >>/EOO + !foo configured 1.0.0 + !libbaz [h2/] configured 1.0.0 + !libbar configured 1.0.0 + !foo configured 1.0.0 + !libbaz [h2/] configured 1.0.0 + !libbaz [h2/] configured 1.0.0 + !libbaz [h2/] configured 1.0.0 + EOO + } + + : dependency-repointed-system + : + { + $cfg_create -d h1 --type host --name h1 &h1/***; + $cfg_create -d h2 --type host --name h2 &h2/***; + + $cfg_link -d h1 h2; + + $rep_add -d h1 $rep/t7a && $rep_fetch -d h1; + + $* -d h1 foo --yes 2>!; + + $pkg_status -d h1 -r >>/EOO; + !foo configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $* -d h1 libbar '?sys:foo/1.2.0' ?libbaz +{ --config-name h2 } <<EOI 2>>~%EOE%; + y + EOI + % new libbaz/1.0.0 \[h2.\]% + drop libbaz/1.0.0 (unused) + reconfigure/unhold sys:foo/1.2.0 + new libbar/1.0.0 + continue? [Y/n] disfigured foo/1.0.0 + disfigured libbaz/1.0.0 + %fetched libbaz/1.0.0 \[h2.\]% + %unpacked libbaz/1.0.0 \[h2.\]% + purged libbaz/1.0.0 + purged foo/1.0.0 + fetched libbar/1.0.0 + unpacked libbar/1.0.0 + %configured libbaz/1.0.0 \[h2.\]% + configured sys:foo/1.2.0 + configured libbar/1.0.0 + %info: h2.+libbaz-1.0.0.+ is up to date% + %info: h1.+libbar-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[h2.\]% + updated libbar/1.0.0 + EOE + + $pkg_status -d h1 -r >>/EOO; + !libbar configured 1.0.0 + foo configured,system !1.2.0 + libbaz [h2/] configured 1.0.0 + EOO + + $* -d h1 ?foo ?libbaz <<EOI 2>>~%EOE%; + y + y + EOI + % drop libbaz/1.0.0 \[h2.\] \(unused\)% + new libbaz/1.0.0 + downgrade foo/1.0.0 + reconfigure libbar/1.0.0 (dependent of libbaz) + continue? [Y/n] update dependent packages? [Y/n] disfigured libbar/1.0.0 + purged foo/1.2.0 + %disfigured libbaz/1.0.0 \[h2.\]% + %purged libbaz/1.0.0 \[h2.\]% + fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched foo/1.0.0 + unpacked foo/1.0.0 + configured libbaz/1.0.0 + configured foo/1.0.0 + configured libbar/1.0.0 + %info: h1.+libbaz-1.0.0.+ is up to date% + %info: h1.+foo-1.0.0.+ is up to date% + %info: h1.+libbar-1.0.0.+ is up to date% + updated libbaz/1.0.0 + updated foo/1.0.0 + updated libbar/1.0.0 + EOE + + $pkg_status -d h1 -r >>/EOO + !libbar configured 1.0.0 + foo configured 1.0.0 + libbaz configured 1.0.0 + libbaz configured 1.0.0 + EOO + } + + : orphan-repointed + : + { + $cfg_create -d h1 --type host --name h1 &h1/***; + $cfg_create -d h2 --type host --name h2 &h2/***; + + $cfg_link -d h1 h2; + + $rep_add -d h1 $rep/t7b && $rep_fetch -d h1; + + $* -d h1 foo --yes 2>!; + + $rep_remove -d h1 $rep/t7b; + $rep_add -d h1 $rep/t7a && $rep_fetch -d h1; + + $* -d h1 libbaz +{ --config-name h2 } 2>>EOE != 0 + error: package foo/1.1.0 is orphaned + info: explicitly upgrade it to a new version + info: while satisfying foo/1.1.0 + EOE + } + + : unhold-repointed + : + { + $cfg_create -d h1 --type host --name h1 &h1/***; + $cfg_create -d h2 --type host --name h2 &h2/***; + + $cfg_link -d h1 h2; + + $rep_add -d h1 $rep/t7a && $rep_fetch -d h1; + + $* -d h1 foo --yes 2>!; + + $pkg_status -d h1 -r >>/EOO; + !foo configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $* -d h1 libbar ?foo libbaz +{ --config-name h2 } <<EOI 2>>~%EOE%; + y + EOI + % new libbaz/1.0.0 \[h2.\]% + drop libbaz/1.0.0 (unused) + reconfigure/update/unhold foo/1.0.0 + new libbar/1.0.0 + continue? [Y/n] disfigured foo/1.0.0 + disfigured libbaz/1.0.0 + %fetched libbaz/1.0.0 \[h2.\]% + %unpacked libbaz/1.0.0 \[h2.\]% + purged libbaz/1.0.0 + fetched libbar/1.0.0 + unpacked libbar/1.0.0 + %configured libbaz/1.0.0 \[h2.\]% + configured foo/1.0.0 + configured libbar/1.0.0 + %info: h2.+libbaz-1.0.0.+ is up to date% + %info: h1.+foo-1.0.0.+ is up to date% + %info: h1.+libbar-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[h2.\]% + updated foo/1.0.0 + updated libbar/1.0.0 + EOE + + $pkg_status -d h1 -r >>/EOO + !libbar configured 1.0.0 + foo configured 1.0.0 + !libbaz [h2/] configured 1.0.0 + !libbaz [h2/] configured 1.0.0 + !libbaz [h2/] configured 1.0.0 + EOO + } + + : satisfy + : + { + $cfg_create -d h1 --type host --name h1 &h1/***; + $cfg_create -d h2 --type host --name h2 &h2/***; + + $cfg_link -d h1 h2; + + $rep_add -d h2 $rep/t7b && $rep_fetch -d h2; + $* -d h2 foo --yes 2>!; + + $rep_add -d h1 $rep/t7a && $rep_fetch -d h1; + + $* -d h1 foo ?libbaz 2>>~%EOE%; + fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched foo/1.0.0 + unpacked foo/1.0.0 + configured libbaz/1.0.0 + configured foo/1.0.0 + %info: h1.+libbaz-1.0.0.+ is up to date% + %info: h1.+foo-1.0.0.+ is up to date% + updated libbaz/1.0.0 + updated foo/1.0.0 + EOE + + $pkg_status -d h1 -r >>/EOO; + !foo configured 1.0.0 + libbaz configured 1.0.0 + !foo [h2/] configured 1.1.0 + libbaz [h2/] configured 1.1.0 + EOO + + $* -d h1 ?libbaz/1.0.0 +{ --config-name h2 } 2>>~%EOE% != 0; + %error: unable to downgrade package libbaz/1.1.0 \[h2.\] to 1.0.0% + % info: because package foo \[h2.\] depends on \(libbaz \^1.1.0\)% + info: explicitly request up/downgrade of package foo + info: or explicitly specify package libbaz version to manually satisfy these constraints + EOE + + $* -d h1 ?libbaz +{ --config-name h2 } <<EOI 2>>~%EOE%; + y + n + EOI + % update libbaz/1.1.0 \[h2.\]% + drop libbaz/1.0.0 (unused) + % reconfigure foo/1.0.0 \(dependent of libbaz \[h2.\]\)% + continue? [Y/n] update dependent packages? [Y/n] disfigured foo/1.0.0 + disfigured libbaz/1.0.0 + purged libbaz/1.0.0 + configured foo/1.0.0 + %info: h2.+libbaz-1.1.0.+ is up to date% + %updated libbaz/1.1.0 \[h2.\]% + EOE + + $pkg_status -d h1 -r >>/EOO + !foo configured 1.0.0 + libbaz [h2/] configured 1.1.0 + !foo [h2/] configured 1.1.0 + libbaz [h2/] configured 1.1.0 + EOO + } + + : upgrade-repointed + : + { + $cfg_create -d t1 --name t1 &t1/***; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 libbar --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !libbar configured 1.0.0 + foo [t1/.bpkg/host/] configured 1.0.0 + libbaz [t1/.bpkg/host/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $cfg_create -d h1 --type host --name h1 &h1/***; + + $cfg_link -d t1 h1 2>!; + + $rep_add -d t1 $rep/t7b && $rep_fetch -d t1; + + $* -d t1 libbar ?foo +{ --config-name h1 } <<EOI 2>>~%EOE%; + y + EOI + % new libbaz/1.1.0 \[h1.\] \(required by foo \[h1.\]\)% + % new foo/1.1.0 \[h1.\]% + % drop libbaz/1.0.0 \[t1..bpkg.host.\] \(unused\)% + % drop foo/1.0.0 \[t1..bpkg.host.\] \(unused\)% + upgrade libbar/1.1.0 + continue? [Y/n] disfigured libbar/1.0.0 + %disfigured foo/1.0.0 \[t1..bpkg.host.\]% + %disfigured libbaz/1.0.0 \[t1..bpkg.host.\]% + %fetched libbaz/1.1.0 \[h1.\]% + %unpacked libbaz/1.1.0 \[h1.\]% + %fetched foo/1.1.0 \[h1.\]% + %unpacked foo/1.1.0 \[h1.\]% + %purged libbaz/1.0.0 \[t1..bpkg.host.\]% + %purged foo/1.0.0 \[t1..bpkg.host.\]% + fetched libbar/1.1.0 + unpacked libbar/1.1.0 + %configured libbaz/1.1.0 \[h1.\]% + %configured foo/1.1.0 \[h1.\]% + configured libbar/1.1.0 + %info: h1.+foo-1.1.0.+ is up to date% + %info: t1.+libbar-1.1.0.+ is up to date% + %updated foo/1.1.0 \[h1.\]% + updated libbar/1.1.0 + EOE + + $pkg_status -d t1 -r >>/EOO + !libbar configured 1.1.0 + foo [h1/] configured 1.1.0 + libbaz [h1/] configured 1.1.0 + libbaz configured 1.0.0 available 1.1.0 + EOO + } + + : upgrade-repointed-dependency + : + { + $cfg_create -d h1 --type host --name h1 &h1/***; + $cfg_create -d h2 --type host --name h2 &h2/***; + + $cfg_link -d h1 h2; + + $rep_add -d h1 $rep/t7a && $rep_fetch -d h1; + + $* -d h1 libbar --yes 2>!; + + $pkg_status -d h1 -r >>/EOO; + !libbar configured 1.0.0 + foo configured 1.0.0 + libbaz configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $rep_add -d h1 $rep/t7b && $rep_fetch -d h1; + + $* -d h1 libbar ?foo ?libbaz +{ --config-name h2 } <<EOI 2>>~%EOE%; + y + y + EOI + % new libbaz/1.1.0 \[h2.\]% + drop libbaz/1.0.0 (unused) + upgrade foo/1.1.0 + upgrade libbar/1.1.0 + continue? [Y/n] disfigured libbar/1.0.0 + disfigured foo/1.0.0 + disfigured libbaz/1.0.0 + %fetched libbaz/1.1.0 \[h2.\]% + %unpacked libbaz/1.1.0 \[h2.\]% + purged libbaz/1.0.0 + fetched foo/1.1.0 + unpacked foo/1.1.0 + fetched libbar/1.1.0 + unpacked libbar/1.1.0 + %configured libbaz/1.1.0 \[h2.\]% + configured foo/1.1.0 + configured libbar/1.1.0 + %info: h2.+libbaz-1.1.0.+ is up to date% + %info: h1.+foo-1.1.0.+ is up to date% + %info: h1.+libbar-1.1.0.+ is up to date% + %updated libbaz/1.1.0 \[h2.\]% + updated foo/1.1.0 + updated libbar/1.1.0 + EOE + + $pkg_status -d h1 -r >>/EOO + !libbar configured 1.1.0 + foo configured 1.1.0 + libbaz [h2/] configured 1.1.0 + libbaz [h2/] configured 1.1.0 + EOO + } + + : upgrade-prerequisite-replacement + : + { + $cfg_create -d t1 --name t1 &t1/***; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 libbar --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !libbar configured 1.0.0 + foo [t1/.bpkg/host/] configured 1.0.0 + libbaz [t1/.bpkg/host/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $cfg_create -d t2 --name t2 &t2/***; + + $rep_add -d t2 $rep/t7a && $rep_fetch -d t2; + + $* -d t2 libbaz --yes 2>!; + + $cfg_link -d t1 t2 2>!; + + $rep_add -d t1 $rep/t7b && $rep_fetch -d t1; + + $* -d t1 libbaz +{ --config-name t2 } <<EOI 2>>~%EOE%; + y + y + EOI + % upgrade libbaz/1.1.0 \[t2.\]% + drop libbaz/1.0.0 (unused) + % reconfigure libbar/1.0.0 \(dependent of libbaz \[t2.\]\)% + continue? [Y/n] update dependent packages? [Y/n] disfigured libbar/1.0.0 + disfigured libbaz/1.0.0 + %disfigured libbaz/1.0.0 \[t2.\]% + %fetched libbaz/1.1.0 \[t2.\]% + %unpacked libbaz/1.1.0 \[t2.\]% + purged libbaz/1.0.0 + %configured libbaz/1.1.0 \[t2.\]% + configured libbar/1.0.0 + %info: t2.+libbaz-1.1.0.+ is up to date% + %info: t1.+libbar-1.0.0.+ is up to date% + %updated libbaz/1.1.0 \[t2.\]% + updated libbar/1.0.0 + EOE + + $pkg_status -d t1 -r >>/EOO + !libbar configured 1.0.0 available 1.1.0 + foo [t1/.bpkg/host/] configured 1.0.0 available 1.1.0 + libbaz [t1/.bpkg/host/] configured 1.0.0 available 1.1.0 + !libbaz [t2/] configured 1.1.0 + !libbaz [t2/] configured 1.1.0 + EOO + } + + : copy-upgrade-dependency-tree + : + { + $cfg_create -d t1 --name t1 &t1/***; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 libbar --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !libbar configured 1.0.0 + foo [t1/.bpkg/host/] configured 1.0.0 + libbaz [t1/.bpkg/host/] configured 1.0.0 + libbaz configured 1.0.0 + EOO + + $cfg_create -d t2 --name t2 &t2/***; + + $cfg_link -d t1 t2 2>!; + + $rep_add -d t1 $rep/t7b && $rep_fetch -d t1; + + $* -d t1 libbar +{ --config-name t2 } <<EOI 2>>~%EOE%; + y + EOI + % new libbaz/1.1.0 \[t2..bpkg.host.\] \(required by foo \[t2..bpkg.host.\]\)% + % new foo/1.1.0 \[t2..bpkg.host.\] \(required by libbar \[t2.\]\)% + % new libbaz/1.1.0 \[t2.\] \(required by libbar \[t2.\]\)% + % new libbar/1.1.0 \[t2.\]% + %continue\? \[Y/n\] fetched libbaz/1.1.0 \[t2..bpkg.host.\]% + %unpacked libbaz/1.1.0 \[t2..bpkg.host.\]% + %fetched foo/1.1.0 \[t2..bpkg.host.\]% + %unpacked foo/1.1.0 \[t2..bpkg.host.\]% + %fetched libbaz/1.1.0 \[t2.\]% + %unpacked libbaz/1.1.0 \[t2.\]% + %fetched libbar/1.1.0 \[t2.\]% + %unpacked libbar/1.1.0 \[t2.\]% + %configured libbaz/1.1.0 \[t2..bpkg.host.\]% + %configured foo/1.1.0 \[t2..bpkg.host.\]% + %configured libbaz/1.1.0 \[t2.\]% + %configured libbar/1.1.0 \[t2.\]% + %info: t2.+libbar-1.1.0.+ is up to date% + %updated libbar/1.1.0 \[t2.\]% + EOE + + $pkg_status -d t1 -r >>/EOO + !libbar configured 1.0.0 available 1.1.0 + foo [t1/.bpkg/host/] configured 1.0.0 available 1.1.0 + libbaz [t1/.bpkg/host/] configured 1.0.0 available 1.1.0 + libbaz configured 1.0.0 available 1.1.0 + !libbar [t2/] configured 1.1.0 + foo [t2/.bpkg/host/] configured 1.1.0 + libbaz [t2/.bpkg/host/] configured 1.1.0 + libbaz [t2/] configured 1.1.0 + EOO + } + + : repointed-dependent-indirect-dependency-upgrade + : + { + $cfg_create -d t1 --name t1 &t1/***; + $cfg_create -d t2 --name t2 &t2/***; + $cfg_create -d h1 --name h1 --type host &h1/***; + + $cfg_link -d t1 t2 2>!; + $cfg_link -d t1 h1 2>!; + $cfg_link -d t2 h1 2>!; + + $rep_add -d t1 $rep/t7a && $rep_fetch -d t1; + + $* -d t1 libfix --yes 2>!; + + $pkg_status -d t1 -r >>/EOO; + !libfix configured 1.0.0 + libbar configured 1.0.0 + foo [h1/] configured 1.0.0 + libbaz [h1/] configured 1.0.0 + libbaz configured 1.0.0 + libbox configured 1.0.0 + foo [h1/] configured 1.0.0 + libbaz [h1/] configured 1.0.0 + libbaz configured 1.0.0 + libfax configured 1.0.0 + EOO + + $rep_add -d t1 $rep/t7b && $rep_fetch -d t1; + + $* -d t1 libfix libfax +{ --config-name t2 } foo +{ --config-name h1 } <<EOI 2>>~%EOE%; + y + y + EOI + % new libfax/1.0.0 \[t2.\]% + % upgrade libbaz/1.1.0 \[h1.\] \(required by foo \[h1.\]\)% + % upgrade foo/1.1.0 \[h1.\]% + % reconfigure libbox \(dependent of foo \[h1.\]\)% + % reconfigure libbar \(dependent of foo \[h1.\]\)% + % drop libfax/1.0.0 \(unused\)% + reconfigure/update libfix/1.0.0 + continue? [Y/n] update dependent packages? [Y/n] disfigured libfix/1.0.0 + disfigured libfax/1.0.0 + disfigured libbar/1.0.0 + disfigured libbox/1.0.0 + %disfigured foo/1.0.0 \[h1.\]% + %disfigured libbaz/1.0.0 \[h1.\]% + %fetched libfax/1.0.0 \[t2.\]% + %unpacked libfax/1.0.0 \[t2.\]% + %fetched libbaz/1.1.0 \[h1.\]% + %unpacked libbaz/1.1.0 \[h1.\]% + %fetched foo/1.1.0 \[h1.\]% + %unpacked foo/1.1.0 \[h1.\]% + purged libfax/1.0.0 + %configured libfax/1.0.0 \[t2.\]% + %configured libbaz/1.1.0 \[h1.\]% + %configured foo/1.1.0 \[h1.\]% + configured libbox/1.0.0 + configured libbar/1.0.0 + configured libfix/1.0.0 + %info: t2.+libfax-1.0.0.+ is up to date% + %info: h1.+foo-1.1.0.+ is up to date% + %info: t1.+libfix-1.0.0.+ is up to date% + %info: t1.+libbox-1.0.0.+ is up to date% + %info: t1.+libbar-1.0.0.+ is up to date% + %updated libfax/1.0.0 \[t2.\]% + %updated foo/1.1.0 \[h1.\]% + updated libfix/1.0.0 + updated libbox/1.0.0 + updated libbar/1.0.0 + EOE + + $pkg_status -d t1 -r >>/EOO + !libfix configured 1.0.0 + libbar configured 1.0.0 available 1.1.0 + !foo [h1/] configured 1.1.0 + libbaz [h1/] configured 1.1.0 + libbaz configured 1.0.0 available 1.1.0 + libbox configured 1.0.0 available 1.1.0 + !foo [h1/] configured 1.1.0 + libbaz [h1/] configured 1.1.0 + libbaz configured 1.0.0 available 1.1.0 + !libfax [t2/] configured 1.0.0 + !libfax [t2/] configured 1.0.0 + !foo [h1/] configured 1.1.0 + libbaz [h1/] configured 1.1.0 + EOO + } + } + + : build2-module-dep + : + { + +$clone_root_cfg && $rep_add $rep/t7a && $rep_fetch + + : private-config + : + { + $clone_cfg; + + $* libbiz <<EOI 2>>~%EOE% &cfg/.bpkg/build2/*** &cfg/.bpkg/host/***; + y + EOI + % new libbaz/1.0.0 \[cfg..bpkg.host.\] \(required by foo \[cfg..bpkg.host.\]\)% + % new foo/1.0.0 \[cfg..bpkg.host.\] \(required by libbiz\)% + % new libbaz/1.0.0 \[cfg..bpkg.build2..bpkg.host.\] \(required by foo \[cfg..bpkg.build2..bpkg.host.\]\)% + % new foo/1.0.0 \[cfg..bpkg.build2..bpkg.host.\] \(required by libbuild2-foo \[cfg..bpkg.build2.\]\)% + % new libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\] \(required by libbuild2-foo \[cfg..bpkg.build2.\]\)% + % new libbaz/1.0.0 \[cfg..bpkg.build2.\] \(required by libbuild2-foo \[cfg..bpkg.build2.\]\)% + % new libbuild2-foo/1.0.0 \[cfg..bpkg.build2.\] \(required by libbiz\)% + new libbaz/1.0.0 (required by libbiz) + new libbiz/1.0.0 + %continue\? \[Y/n\] fetched libbaz/1.0.0 \[cfg..bpkg.host.\]% + %unpacked libbaz/1.0.0 \[cfg..bpkg.host.\]% + %fetched foo/1.0.0 \[cfg..bpkg.host.\]% + %unpacked foo/1.0.0 \[cfg..bpkg.host.\]% + %fetched libbaz/1.0.0 \[cfg..bpkg.build2..bpkg.host.\]% + %unpacked libbaz/1.0.0 \[cfg..bpkg.build2..bpkg.host.\]% + %fetched foo/1.0.0 \[cfg..bpkg.build2..bpkg.host.\]% + %unpacked foo/1.0.0 \[cfg..bpkg.build2..bpkg.host.\]% + %fetched libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% + %unpacked libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% + %fetched libbaz/1.0.0 \[cfg..bpkg.build2.\]% + %unpacked libbaz/1.0.0 \[cfg..bpkg.build2.\]% + %fetched libbuild2-foo/1.0.0 \[cfg..bpkg.build2.\]% + %unpacked libbuild2-foo/1.0.0 \[cfg..bpkg.build2.\]% + fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched libbiz/1.0.0 + unpacked libbiz/1.0.0 + %configured libbaz/1.0.0 \[cfg..bpkg.host.\]% + %configured foo/1.0.0 \[cfg..bpkg.host.\]% + %configured libbaz/1.0.0 \[cfg..bpkg.build2..bpkg.host.\]% + %configured foo/1.0.0 \[cfg..bpkg.build2..bpkg.host.\]% + %configured libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% + %configured libbaz/1.0.0 \[cfg..bpkg.build2.\]% + %configured libbuild2-foo/1.0.0 \[cfg..bpkg.build2.\]% + configured libbaz/1.0.0 + configured libbiz/1.0.0 + %info: cfg.+libbiz-1.0.0.+ is up to date% + updated libbiz/1.0.0 + EOE + + $pkg_status -d cfg -r >>/EOO; + !libbiz configured 1.0.0 + foo [cfg/.bpkg/host/] configured 1.0.0 + libbaz [cfg/.bpkg/host/] configured 1.0.0 + libbaz configured 1.0.0 + libbuild2-foo [cfg/.bpkg/build2/] configured 1.0.0 + foo [cfg/.bpkg/build2/.bpkg/host/] configured 1.0.0 + libbaz [cfg/.bpkg/build2/.bpkg/host/] configured 1.0.0 + libbaz [cfg/.bpkg/build2/] configured 1.0.0 + libbuild2-bar [cfg/.bpkg/build2/] configured 1.0.0 + EOO + + $pkg_drop libbiz + } + + : external-config + : + { + $clone_cfg; + + $cfg_create -d cfg2 --type build2 --name cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + + $cfg_create -d cfg3 --type host --name cfg3 &cfg3/***; + $cfg_link -d cfg cfg3; + $cfg_link -d cfg2 cfg3; + + $* libbiz <<EOI 2>>~%EOE%; + y + EOI + % new libbaz/1.0.0 \[cfg3.\] \(required by foo \[cfg3.\]\)% + % new foo/1.0.0 \[cfg3.\] \(required by libbiz libbuild2-foo \[cfg2.\]\)% + % new libbuild2-bar/1.0.0 \[cfg2.\] \(required by libbuild2-foo \[cfg2.\]\)% + % new libbaz/1.0.0 \[cfg2.\] \(required by libbuild2-foo \[cfg2.\]\)% + % new libbuild2-foo/1.0.0 \[cfg2.\] \(required by libbiz\)% + new libbaz/1.0.0 (required by libbiz) + new libbiz/1.0.0 + %continue\? \[Y/n\] fetched libbaz/1.0.0 \[cfg3.\]% + %unpacked libbaz/1.0.0 \[cfg3.\]% + %fetched foo/1.0.0 \[cfg3.\]% + %unpacked foo/1.0.0 \[cfg3.\]% + %fetched libbuild2-bar/1.0.0 \[cfg2.\]% + %unpacked libbuild2-bar/1.0.0 \[cfg2.\]% + %fetched libbaz/1.0.0 \[cfg2.\]% + %unpacked libbaz/1.0.0 \[cfg2.\]% + %fetched libbuild2-foo/1.0.0 \[cfg2.\]% + %unpacked libbuild2-foo/1.0.0 \[cfg2.\]% + fetched libbaz/1.0.0 + unpacked libbaz/1.0.0 + fetched libbiz/1.0.0 + unpacked libbiz/1.0.0 + %configured libbaz/1.0.0 \[cfg3.\]% + %configured foo/1.0.0 \[cfg3.\]% + %configured libbuild2-bar/1.0.0 \[cfg2.\]% + %configured libbaz/1.0.0 \[cfg2.\]% + %configured libbuild2-foo/1.0.0 \[cfg2.\]% + configured libbaz/1.0.0 + configured libbiz/1.0.0 + %info: cfg.+libbiz-1.0.0.+ is up to date% + updated libbiz/1.0.0 + EOE + + $pkg_status -d cfg -r >>/EOO; + !libbiz configured 1.0.0 + foo [cfg3/] configured 1.0.0 + libbaz [cfg3/] configured 1.0.0 + libbaz configured 1.0.0 + libbuild2-foo [cfg2/] configured 1.0.0 + foo [cfg3/] configured 1.0.0 + libbaz [cfg3/] configured 1.0.0 + libbaz [cfg2/] configured 1.0.0 + libbuild2-bar [cfg2/] configured 1.0.0 + EOO + + $pkg_drop libbiz + } + + : build2-config + : + { + $cfg_create -d cfg --type build2 &cfg/***; + $rep_add $rep/t7a && $rep_fetch; + + $* libbiz 2>>~%EOE% != 0; + %error: unable to build build system module libbuild2-foo in its dependent package configuration cfg.% + info: use --config-* to select suitable configuration + info: while satisfying libbiz/1.0.0 + EOE + + $cfg_create -d cfg2 --type build2 --name cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + + $cfg_create -d cfg3 --type host --name cfg3 &cfg3/***; + $cfg_link -d cfg cfg3; + $cfg_link -d cfg2 cfg3; + + $* libbiz ?libbuild2-foo +{ --config-name cfg2 } \ + ?libbaz +{ --config-name cfg2 } <<EOI 2>>~%EOE%; + y + EOI + % new libbaz/1.0.0 \[cfg3.\] \(required by foo \[cfg3.\]\)% + % new foo/1.0.0 \[cfg3.\] \(required by libbiz libbuild2-foo \[cfg2.\]\)% + % new libbuild2-bar/1.0.0 \[cfg2.\] \(required by libbuild2-foo \[cfg2.\]\)% + % new libbaz/1.0.0 \[cfg2.\]% + % new libbuild2-foo/1.0.0 \[cfg2.\]% + new libbiz/1.0.0 + %continue\? \[Y/n\] fetched libbaz/1.0.0 \[cfg3.\]% + %unpacked libbaz/1.0.0 \[cfg3.\]% + %fetched foo/1.0.0 \[cfg3.\]% + %unpacked foo/1.0.0 \[cfg3.\]% + %fetched libbuild2-bar/1.0.0 \[cfg2.\]% + %unpacked libbuild2-bar/1.0.0 \[cfg2.\]% + %fetched libbaz/1.0.0 \[cfg2.\]% + %unpacked libbaz/1.0.0 \[cfg2.\]% + %fetched libbuild2-foo/1.0.0 \[cfg2.\]% + %unpacked libbuild2-foo/1.0.0 \[cfg2.\]% + fetched libbiz/1.0.0 + unpacked libbiz/1.0.0 + %configured libbaz/1.0.0 \[cfg3.\]% + %configured foo/1.0.0 \[cfg3.\]% + %configured libbuild2-bar/1.0.0 \[cfg2.\]% + %configured libbaz/1.0.0 \[cfg2.\]% + %configured libbuild2-foo/1.0.0 \[cfg2.\]% + configured libbiz/1.0.0 + %info: cfg2.+libbaz-1.0.0.+ is up to date% + %info: cfg2.+libbuild2-foo-1.0.0.+ is up to date% + %info: cfg.+libbiz-1.0.0.+ is up to date% + %updated libbaz/1.0.0 \[cfg2.\]% + %updated libbuild2-foo/1.0.0 \[cfg2.\]% + updated libbiz/1.0.0 + EOE + + $pkg_status -d cfg -r >>/EOO; + !libbiz configured 1.0.0 + foo [cfg3/] configured 1.0.0 + libbaz [cfg3/] configured 1.0.0 + libbaz [cfg2/] configured 1.0.0 + libbuild2-foo [cfg2/] configured 1.0.0 + foo [cfg3/] configured 1.0.0 + libbaz [cfg3/] configured 1.0.0 + libbaz [cfg2/] configured 1.0.0 + libbuild2-bar [cfg2/] configured 1.0.0 + EOO + + $pkg_drop libbiz + } + + : duplicates + : + { + $cfg_create -d cfg &cfg/***; + $rep_add $rep/t7a && $rep_fetch; + + $cfg_create -d cfg2 --name cfg2 &cfg2/***; + $cfg_link -d cfg cfg2; + + $cfg_create -d cfg3 --name cfg3 &cfg3/***; + $cfg_link -d cfg cfg3; + + $* libbiz +{ --config-name cfg2 } --yes 2>!; + $* libbuz +{ --config-name cfg3 } --yes 2>!; + + $* libbix 2>>/~%EOE% != 0 + error: building build system module libbuild2-bar in multiple configurations + % info: cfg(2|3)/.bpkg/build2/%{2} + EOE + } + } +} diff --git a/tests/pkg-build/t7a b/tests/pkg-build/t7a new file mode 120000 index 0000000..d02b5d4 --- /dev/null +++ b/tests/pkg-build/t7a @@ -0,0 +1 @@ +../common/linked/t7a
\ No newline at end of file diff --git a/tests/pkg-build/t7b b/tests/pkg-build/t7b new file mode 120000 index 0000000..808039d --- /dev/null +++ b/tests/pkg-build/t7b @@ -0,0 +1 @@ +../common/linked/t7b
\ No newline at end of file diff --git a/tests/pkg-drop.testscript b/tests/pkg-drop.testscript index db9cf7c..eb3d8ff 100644 --- a/tests/pkg-drop.testscript +++ b/tests/pkg-drop.testscript @@ -9,16 +9,31 @@ # |-- t4a # | |-- libfoo-1.1.0.tar.gz # | `-- repositories.manifest +# | # |-- t4b -> t4a (prerequisite repository) # | |-- libbar-1.1.0.tar.gz -> libfoo == 1.1.0 # | `-- repositories.manifest +# | # |-- t4c -> t4b (prerequisite repository) # | |-- libbaz-1.1.0.tar.gz -> libfoo, libbar # | |-- libfoo-1.0.0.tar.gz # | `-- repositories.manifest -# `-- t4d -> t4c (complement) -# |-- libbiz-1.0.0.tar.gz -> libfox, libfoo, libbaz -# |-- libfox-1.0.0.tar.gz +# | +# |-- t4d -> t4c (complement) +# | |-- libbiz-1.0.0.tar.gz -> libfox, libfoo, libbaz +# | |-- libfox-1.0.0.tar.gz +# | `-- repositories.manifest +# | +# |-- t7a +# | |-- libbaz-1.0.0.tar.gz +# | |-- foo-1.0.0.tar.gz -> libbaz ^1.0.0 +# | |-- libbar-1.0.0.tar.gz -> * foo ^1.0.0, libbaz ^1.0.0 +# | `-- repositories.manifest +# | +# `-- t7b -> t7a (complement repository) +# |-- libbaz-1.1.0.tar.gz +# |-- foo-1.1.0.tar.gz -> libbaz ^1.1.0 +# |-- libbar-1.1.0.tar.gz -> * foo ^1.1.0, libbaz ^1.0.0 # `-- repositories.manifest # Prepare repositories used by tests if running in the local mode. @@ -30,8 +45,12 @@ cp -r $src/t4b $out/t4b && $rep_create $out/t4b &$out/t4b/packages.manifest cp -r $src/t4c $out/t4c && $rep_create $out/t4c &$out/t4c/packages.manifest cp -r $src/t4d $out/t4d && $rep_create $out/t4d &$out/t4d/packages.manifest + cp -r $src/t7a $out/t7a && $rep_create $out/t7a &$out/t7a/packages.manifest + cp -r $src/t7b $out/t7b && $rep_create $out/t7b &$out/t7b/packages.manifest end +cfg_create += 2>! +cfg_link += 2>! pkg_build += -d cfg --yes 2>! pkg_status += -d cfg rep_add += -d cfg 2>! @@ -444,3 +463,269 @@ $* libfoo/1.0.0 2>>~%EOE% != 0 $* libfoo 2>'purged libfoo' } + +: linked-configs +: +{ + : 3-configs + : + { + +$clone_root_cfg && $rep_add $rep/t4c && $rep_fetch + + +$cfg_create -d cfg-bar &cfg-bar/*** + +$cfg_create -d cfg-foo &cfg-foo/*** + + +$cfg_link -d cfg cfg-bar + +$cfg_link -d cfg-bar cfg-foo + + : baz + : + { + $clone_cfg; + cp -pr ../cfg-bar ./; + cp -pr ../cfg-foo ./; + + $pkg_build libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes 2>!; + $pkg_build libbaz 2>!; + + $pkg_build '?libbar' +{ --config-id 1 } 2>!; + + $* libbaz <<EOI 2>>/~%EOE% + y + y + EOI + following dependencies were automatically built but will no longer be used: + libbar [cfg-bar/] + libfoo [cfg-foo/] + %drop unused packages\? \[Y.n\] drop libbaz% + drop libbar [cfg-bar/] + drop libfoo [cfg-foo/] + %continue\? \[Y.n\] disfigured libbaz% + disfigured libbar [cfg-bar/] + disfigured libfoo [cfg-foo/] + purged libbaz + purged libbar [cfg-bar/] + purged libfoo [cfg-foo/] + EOE + } + + : foo + : + { + $clone_cfg; + cp -pr ../cfg-bar ./; + cp -pr ../cfg-foo ./; + + $pkg_build libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes 2>!; + $pkg_build libbaz 2>!; + + # Make sure that dependents of a package being dropped can be found in + # implicitly linked configurations recursively. Note that configuring + # libbar as system, we make libbaz an only dependent of libfoo. + # + $pkg_build '?sys:libbar' +{ --config-id 1 } 2>!; + + $pkg_status -r libbaz >>/EOO; + !libbaz configured 1.1.0 + libbar [cfg-bar/] configured,system !* available [1.1.0] + libfoo [cfg-foo/] configured 1.1.0 + EOO + + $pkg_status -d cfg-bar -r libbar >>EOO; + libbar configured,system !* available 1.1.0 + EOO + + $pkg_status -d cfg-foo libfoo >'libfoo configured 1.1.0'; + + $* -d cfg-foo libfoo <<EOI 2>>/~%EOE%; + y + y + y + EOI + following dependent packages will have to be dropped as well: + libbaz [cfg/] (requires libfoo) + %drop dependent packages\? \[y.N\] following dependencies were automatically built but will no longer be used:% + sys:libbar [cfg-bar/] + %drop unused packages\? \[Y.n\] drop libbaz \[cfg/\]% + drop libfoo + drop libbar [cfg-bar/] + %continue\? \[Y.n\] disfigured libbaz \[cfg/\]% + disfigured libfoo + purged libbar [cfg-bar/] + purged libbaz [cfg/] + purged libfoo + EOE + + $pkg_status libbaz >'libbaz available 1.1.0'; + $pkg_status -d cfg-bar libbar >'libbar available 1.1.0'; + $pkg_status -d cfg-foo libfoo >'libfoo unknown' + } + + : bar + : + { + $clone_cfg; + cp -pr ../cfg-bar ./; + cp -pr ../cfg-foo ./; + + # Test that if we turn implicit links into explicit, then all dependents + # are still discovered. + # + $cfg_link -d cfg-bar cfg; + $cfg_link -d cfg-foo cfg-bar; + + $pkg_build libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes 2>!; + $pkg_build libbaz 2>!; + + $pkg_status -r libbaz >>/EOO; + !libbaz configured 1.1.0 + !libbar [cfg-bar/] configured !1.1.0 + libfoo [cfg-foo/] configured 1.1.0 + libfoo [cfg-foo/] configured 1.1.0 + EOO + + $pkg_status -d cfg-bar -r libbar >>/EOO; + !libbar configured !1.1.0 + libfoo [cfg-foo/] configured 1.1.0 + EOO + + $pkg_status -d cfg-foo libfoo >'libfoo configured 1.1.0'; + + $* -d cfg-bar libbar <<EOI 2>>/~%EOE%; + y + y + y + EOI + following dependent packages will have to be dropped as well: + libbaz [cfg/] (requires libbar) + %drop dependent packages\? \[y.N\] following dependencies were automatically built but will no longer be used:% + libfoo [cfg-foo/] + %drop unused packages\? \[Y.n\] drop libbaz \[cfg/\]% + drop libbar + drop libfoo [cfg-foo/] + %continue\? \[Y.n\] disfigured libbaz \[cfg/\]% + disfigured libbar + disfigured libfoo [cfg-foo/] + purged libbaz [cfg/] + purged libbar + purged libfoo [cfg-foo/] + EOE + + $pkg_status libbaz >'libbaz available 1.1.0'; + $pkg_status -d cfg-bar libbar >'libbar available 1.1.0'; + $pkg_status -d cfg-foo libfoo >'libfoo unknown' + } + } +} + +: buildtime-dep +: +{ + +$clone_cfg && $rep_add $rep/t7a && $rep_fetch + +$cfg_create -d cfg2 --type host &cfg2/*** + +$cfg_link -d cfg cfg2 + + : drop-dependent + : + { + $clone_cfg; + cp -pr ../cfg2 ./; + + $pkg_build libbar --yes >!; + + $* libbar <<EOI 2>>/~%EOE%; + y + y + EOI + following dependencies were automatically built but will no longer be used: + foo [cfg2/] + libbaz [cfg2/] + libbaz + %drop unused packages\? \[Y.n\] drop libbar% + drop foo [cfg2/] + drop libbaz [cfg2/] + drop libbaz + %continue\? \[Y.n\] disfigured libbar% + disfigured foo [cfg2/] + disfigured libbaz [cfg2/] + disfigured libbaz + purged libbar + purged foo [cfg2/] + purged libbaz [cfg2/] + purged libbaz + EOE + + $pkg_status -r libbar >'libbar available 1.0.0' + } + + : drop-dependency + : + { + $clone_cfg; + cp -pr ../cfg2 ./; + + $pkg_build libbar --yes >!; + + $* -d cfg2 libbaz <<EOI 2>>/~%EOE%; + y + y + y + EOI + following dependent packages will have to be dropped as well: + foo (requires libbaz) + libbar [cfg/] (requires foo) + %drop dependent packages\? \[y.N\] following dependencies were automatically built but will no longer be used:% + libbaz [cfg/] + %drop unused packages\? \[Y.n\] drop libbar \[cfg.\]% + drop foo + drop libbaz + drop libbaz [cfg/] + %continue\? \[Y.n\] disfigured libbar \[cfg.\]% + disfigured foo + disfigured libbaz + disfigured libbaz [cfg/] + purged libbar [cfg/] + purged foo + purged libbaz + purged libbaz [cfg/] + EOE + + $pkg_status -r libbar >'libbar available 1.0.0' + } + + : skip-deleted-dependency + : + { + $clone_cfg; + cp -pr ../cfg2 ./; + + $pkg_build libbar --yes >! &cfg/lib*/*** &cfg/lib*; + + mv cfg cfg.tmp; + + $* -d cfg2 libbaz <<EOI 2>>/~%EOE%; + y + y + EOI + following dependent packages will have to be dropped as well: + foo (requires libbaz) + %drop dependent packages\? \[y.N\] drop foo% + drop libbaz + %continue\? \[Y.n\] disfigured foo% + disfigured libbaz + purged foo + purged libbaz + EOE + + # While at it, test that we properly handle the missing prerequisite + # situation. + # + mv cfg.tmp cfg; + + $* libbar 2>>/EOE != 0; + error: unable to find prerequisite package foo in linked configuration cfg2/ + EOE + + $pkg_status -d cfg2 -r 2>'info: no held packages in the configuration' + } +} diff --git a/tests/pkg-drop/t7a b/tests/pkg-drop/t7a new file mode 120000 index 0000000..d02b5d4 --- /dev/null +++ b/tests/pkg-drop/t7a @@ -0,0 +1 @@ +../common/linked/t7a
\ No newline at end of file diff --git a/tests/pkg-drop/t7b b/tests/pkg-drop/t7b new file mode 120000 index 0000000..808039d --- /dev/null +++ b/tests/pkg-drop/t7b @@ -0,0 +1 @@ +../common/linked/t7b
\ No newline at end of file |