Skip to content

Commit ee94368

Browse files
committed
Fix test build script lib path and improve adjust_dotfile docs
The generated GNU Stow binary had a 'use lib' path pointing to a nonexistent install directory, causing tests to use system stow libraries instead of 2.4.1. Fixed by patching the lib path after make. Also expanded adjust_dotfile docstring to document edge cases.
1 parent 1efa5e8 commit ee94368

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

bin/stow

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ def adjust_dotfile(pkg_node):
320320
"""
321321
Converts dot-X to .X for dotfiles mode.
322322
Used when stowing with --dotfiles flag.
323+
324+
Only transforms 'dot-X' to '.X' when X starts with a non-dot character.
325+
This prevents transforming:
326+
- 'dot-' (no character after dash)
327+
- 'dot-.' (next char is dot)
328+
- 'dot-..' (next char is dot)
323329
"""
324330
# Perl: (my $adjusted = $pkg_node) =~ s/^dot-([^.])/.$1/;
325331
# Matches "dot-" followed by a character that is not a dot

tests/get_gnu_stow_for_testing_identical_behavior.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ cd "$DEST_DIR"
1818
./configure --prefix="$DEST_DIR/install" >/dev/null
1919
make bin/stow bin/chkstow lib/Stow.pm lib/Stow/Util.pm >/dev/null
2020

21+
# Fix the lib path in bin/stow to use the local lib directory instead of install
22+
# The generated bin/stow has 'use lib "...install/share/perl/..."' which doesn't exist
23+
# after just 'make' (without 'make install'). Point it to the local lib/ instead.
24+
sed -i 's|use lib "[^"]*";|use lib "'"$DEST_DIR"'/lib";|' bin/stow bin/chkstow
25+
2126
echo "Perl stow ${VERSION} built in ${DEST_DIR}"

0 commit comments

Comments
 (0)