From a8218ef3b2f2706a810d10f3956982e5b0bd6c57 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 8 Mar 2018 20:07:40 +0300 Subject: Search for repository location in database before parsing for pkg-build --- tests/pkg-build.test | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/pkg-build.test b/tests/pkg-build.test index f5b3dee..6c5ceed 100644 --- a/tests/pkg-build.test +++ b/tests/pkg-build.test @@ -1445,6 +1445,29 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! error: package libbar is not found in pkg:build2.org/pkg-build/t4d or its complements EOE } + + : location-search + : + : Test that the repository location is searched in the database before being + : parsed. The latest would fail as the repository type would be misguessed. + : + { + $clone_root_cfg; + $rep_add $src/libfoo-1.1.0 --type dir && $rep_fetch; + + d = $canonicalize([dir_path] $src/libfoo-1.1.0); + + $* "libfoo@$d" 2>>~"%EOE%"; + fetching dir:$d + using libfoo/1.1.0 \(external\) + configured libfoo/1.1.0 + %info: .+dir\\{libfoo-1.1.0.\\} is up to date% + updated libfoo/1.1.0 + EOE + + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } } : dir-rep @@ -1455,19 +1478,22 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! : Test that dir (local) repository is preferred over non-dir local repository : that comes first. : - $clone_root_cfg; - $rep_fetch $rep/t4a; - $rep_add $src/libfoo-1.1.0 --type dir && $rep_fetch "dir:$src/libfoo-1.1.0"; - - $* libfoo 2>>~%EOE%; - using libfoo/1.1.0 (external) - configured libfoo/1.1.0 - %info: .+dir\{libfoo-1.1.0.\} is up to date% - updated libfoo/1.1.0 - EOE + { + $clone_root_cfg; + $rep_fetch $rep/t4a; + $rep_add $src/libfoo-1.1.0 --type dir; + $rep_fetch "dir:$canonicalize([dir_path] $src/libfoo-1.1.0)"; + + $* libfoo 2>>~%EOE%; + using libfoo/1.1.0 (external) + configured libfoo/1.1.0 + %info: .+dir\{libfoo-1.1.0.\} is up to date% + updated libfoo/1.1.0 + EOE - $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; - $pkg_purge libfoo 2>'purged libfoo/1.1.0' + $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; + $pkg_purge libfoo 2>'purged libfoo/1.1.0' + } } : git-rep -- cgit v1.1