Skip to content

Commit 5411af1

Browse files
committed
fix: Remove erroneous 'Skipping fileName existing symlink' errors for man pages
This arised because the man page autodetector (search_heuristics function) searched subdirectories of subdirectories, as well as directories. So when the root path was searched, it looked in the 'man' subdirectory. Since we already looked in 'man', there was a collision. So the code was updated to only look for man _files_ at the root of the directory
1 parent d26c423 commit 5411af1

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

pkg/lib/util/abstract-mans.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ abstract.mans_search_heuristics() {
5252
local action="$1"
5353
local id="$2"
5454

55-
for file in "$BPM_PACKAGES_PATH/$id"/{,man/}*; do
55+
for file in "$BPM_PACKAGES_PATH/$id"/man/*; do
5656
if [ -f "$file" ]; then
5757
abstract.mans_do_action "$action" "$file"
5858
elif [ -d "$file" ]; then
@@ -63,6 +63,12 @@ abstract.mans_search_heuristics() {
6363
done
6464
fi
6565
done
66+
67+
for file in "$BPM_PACKAGES_PATH/$id"/*; do
68+
if [ -f "$file" ]; then
69+
abstract.mans_do_action "$action" "$file"
70+
fi
71+
done
6672
}
6773

6874
# @arg $1 The man file to symlink or remove. Not all the files passed

tests/do-plumbing-link-man.bats

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,24 +94,6 @@ load 'util/init.sh'
9494
assert [ "$(readlink "$BPM_INSTALL_MAN/man2/exec.2")" = "$BPM_PACKAGES_PATH/$site/$pkg/man/2man/exec.2" ]
9595
}
9696

97-
@test "adds man page determined from heuristics (manN directory)" {
98-
local site='github.com'
99-
local pkg='username/package'
100-
101-
test_util.setup_pkg "$pkg"; {
102-
mkdir {1,2}man
103-
touch '1man/exec.1'
104-
touch '2man/exec.2'
105-
}; test_util.finish_pkg
106-
test_util.mock_add "$pkg"
107-
108-
run do-plumbing-link-man "$site/$pkg"
109-
110-
assert_success
111-
assert [ "$(readlink "$BPM_INSTALL_MAN/man1/exec.1")" = "$BPM_PACKAGES_PATH/$site/$pkg/1man/exec.1" ]
112-
assert [ "$(readlink "$BPM_INSTALL_MAN/man2/exec.2")" = "$BPM_PACKAGES_PATH/$site/$pkg/2man/exec.2" ]
113-
}
114-
11597
@test "adds man page determined from heuristics (root directory)" {
11698
local site='github.com'
11799
local pkg='username/package'

0 commit comments

Comments
 (0)