From ecb8c74e002b66f61199e1cb6bc61fabf2f29a01 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 30 May 2023 21:00:41 +0300 Subject: Add progress indication for verifying and fixing up symlinks in pkg-checkout --- bpkg/fetch-git.cxx | 6 ++++++ tests/pkg-checkout.testscript | 8 +++++++- tests/rep-fetch-git-refname.testscript | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bpkg/fetch-git.cxx b/bpkg/fetch-git.cxx index f3c6355..44387de 100644 --- a/bpkg/fetch-git.cxx +++ b/bpkg/fetch-git.cxx @@ -2692,6 +2692,9 @@ namespace bpkg void git_verify_symlinks (const common_options& co, const dir_path& dir) { + if ((verb && !co.no_progress ()) || co.progress ()) + text << "verifying symlinks..."; + verify_symlinks (co, dir, dir_path () /* prefix */); } @@ -3003,6 +3006,9 @@ namespace bpkg bool revert, bool ie) { + if (!revert && ((verb && !co.no_progress ()) || co.progress ())) + text << "fixing up symlinks..."; + try { optional r ( diff --git a/tests/pkg-checkout.testscript b/tests/pkg-checkout.testscript index 1ec8b37..a5e511a 100644 --- a/tests/pkg-checkout.testscript +++ b/tests/pkg-checkout.testscript @@ -72,7 +72,9 @@ else $pkg_status style-basic | sed -n -e 's/style-basic available \[.+\] ([^ ]+)/\1/p' | set v; - $* "style-basic/$v" 2>>"EOE"; + $* "style-basic/$v" 2>>~"%EOE%"; + verifying symlinks... + %fixing up symlinks...%? distributing style-basic/$v checked out style-basic/$v EOE @@ -151,6 +153,8 @@ else $* links/0.0.1 2>>~%EOE%; checking out links/0.0.1 + verifying symlinks... + %fixing up symlinks...%? distributing links/0.0.1 checked out links/0.0.1 EOE @@ -178,6 +182,8 @@ else if $posix $* links/1.0.1 2>>~%EOE% != 0 checking out links/1.0.1 + verifying symlinks... + %fixing up symlinks...%? distributing links/1.0.1 %warning: skipping dangling symlink .+% %error: unable to stat .+% diff --git a/tests/rep-fetch-git-refname.testscript b/tests/rep-fetch-git-refname.testscript index e9aa4e9..0275d56 100644 --- a/tests/rep-fetch-git-refname.testscript +++ b/tests/rep-fetch-git-refname.testscript @@ -93,6 +93,8 @@ %fetching submodule 'libbar/extras' from .+style-basic\.git+% $info4 %submodule path 'libbar/extras': checked out .+% + verifying symlinks... + %fixing up symlinks...%? distributing libfoo/1.0.0 checked out libfoo/1.0.0 EOE @@ -149,6 +151,8 @@ %fetching submodule 'libbaz' from .+libbaz\.git% $info2 %submodule path 'libbaz': checked out .+% + verifying symlinks... + %fixing up symlinks...%? distributing libfoo/1.0.0 checked out libfoo/1.0.0 EOE -- cgit v1.1