From fdfd3e0644095022b61316e220fce3f5a7a1a9ef Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 20 Jun 2023 20:22:29 +0300 Subject: Add --mask-repository-uuid pkg-build option --- tests/config.testscript | 3 ++- tests/pkg-build.testscript | 40 +++++++++++++++++++++++++++++++++------- 2 files changed, 35 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/config.testscript b/tests/config.testscript index 70eef42..442cf36 100644 --- a/tests/config.testscript +++ b/tests/config.testscript @@ -9,7 +9,8 @@ # shared between multiple bpkg processes. Also we need to make sure that # configurations are not cloned while being used by bpkg. # -+$cfg_create -d cfg 2>- &cfg/*** +cfg_uuid = "00000000-0000-0000-0000-000000000001" ++$cfg_create -d cfg --uuid $cfg_uuid 2>- &cfg/*** # The most commonly used configuration cloning command that copies it from the # parent scope working directory. diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript index c3ae96f..7c3da32 100644 --- a/tests/pkg-build.testscript +++ b/tests/pkg-build.testscript @@ -596,6 +596,27 @@ test.arguments += --sys-no-query error: repository '' cannot be masked: invalid repository location: empty URL EOE + : mask-repository-uuid-db-not-found + : + $clone_root_cfg; + $* --mask-repository-uuid '00000000-0000-0000-0000-123456789012=repo' libfoo 2>>/EOE != 0 + error: configuration repository '00000000-0000-0000-0000-123456789012=repo' cannot be masked: no configuration with uuid 00000000-0000-0000-0000-123456789012 is linked with cfg/ + EOE + + : mask-repository-uuid-empty + : + $clone_root_cfg; + $* --mask-repository-uuid "$cfg_uuid=" libfoo 2>>EOE != 0 + error: configuration repository '00000000-0000-0000-0000-000000000001=' cannot be masked: invalid repository location '': empty URL + EOE + + : mask-repository-uuid-not-found + : + $clone_root_cfg; + $* --mask-repository-uuid "$cfg_uuid=https://example.com/1" libfoo 2>>/EOE != 0 + error: configuration repository '00000000-0000-0000-0000-000000000001=https://example.com/1' cannot be masked: repository location 'https://example.com/1' not found in configuration 00000000-0000-0000-0000-000000000001 + EOE + : archive : $clone_root_cfg; @@ -1825,12 +1846,17 @@ test.arguments += --sys-no-query $pkg_status libbar >'!libbar configured 1.2.0'; - # While at it, test using --mask-repository instead of rep-remove. + # While at it, test using --mask-repository* instead of rep-remove. # $* --upgrade --mask-repository $rep/t2 --mask-repository $rep/t5 2>>/EOE != 0; error: libbar is not available EOE + $* --upgrade --mask-repository-uuid "$cfg_uuid=($rep/t2)" \ + --mask-repository-uuid "$cfg_uuid=($rep/t5)" 2>>/EOE != 0; + error: libbar is not available + EOE + $rep_remove $rep/t2 $rep/t5; $* --upgrade 2>>/EOE != 0; @@ -3262,7 +3288,7 @@ test.arguments += --sys-no-query : satisfy-masked : - : As above but using --mask-repository instead of rep-remove. + : As above but using --mask-repository* instead of rep-remove. : { $clone_cfg; @@ -3304,7 +3330,7 @@ test.arguments += --sys-no-query # Test that the selected package is left as there is no satisfactory # available package. # - $* --mask-repository $rep/t0b --mask-repository $rep/t0a ?libbaz; + $* --mask-repository $rep/t0b --mask-repository-uuid "$cfg_uuid=($rep/t0a)" ?libbaz; # Test that the above behavior is not triggered for the system package. # @@ -3848,13 +3874,13 @@ test.arguments += --sys-no-query : unavailable-masked : - : As above but using --mask-repository instead of rep-remove. + : As above but using --mask-repository* instead of rep-remove. : { $clone_cfg; $* libbar --mask-repository $rep/t0a --mask-repository $rep/t0b \ - --mask-repository $rep/t0c --recursive --yes + --mask-repository-uuid "$cfg_uuid=($rep/t0c)" --recursive --yes } -$pkg_drop libbar libbaz libfoo @@ -17959,7 +17985,7 @@ else : basics-masked : - : As above but using --mask-repository instead of rep-remove. + : As above but using --mask-repository* instead of rep-remove. : { $clone_root_cfg; @@ -18051,7 +18077,7 @@ else # Noop. # - $* --mask-repository $cn --deorphan ?libfoo; + $* --mask-repository-uuid "$cfg_uuid=$cn" --deorphan ?libfoo; $pkg_status -r libbar >>EOO; !libbar configured 1.1.0 -- cgit v1.1