summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar The Linux Kitten <kitten@openbsdbox>2014-03-30 14:46:26 +0200
committerGravatar Mike Burns <mike@mike-burns.com>2014-04-01 11:57:15 +0200
commita7c2b6bed845b8512e878c992e07841ea9b88462 (patch)
tree918ba45f4015bfdffd5440416134b97f20bf633b
parent2cfc2548818c3e339e279c7f427e90682a7bfa3a (diff)
Files with the same prefix in different dirs
The bug: ~% ls -1 test-dotfiles/**/*(.) test-dotfiles/tag-openbsdbox/zshrc_alias test-dotfiles/tag-openbsdbox/zshrc_bsd test-dotfiles/tag-zsh/zshrc ~% lsrc -t openbsdbox -t zsh -d test-dotfiles /home/mike/.zshrc_alias:/home/mike/test-dotfiles/tag-openbsdbox/zshrc_alias /home/mike/.zshrc_bsd:/home/mike/test-dotfiles/tag-openbsdbox/zshrc_bsd ~% We expect to also see: /home/mike/.zshrc:/home/mike/test-dotfiles/tag-zsh/zshrc This arises because we were checking for files the start with another name, rather than a full equality.
-rw-r--r--NEWS.md.in3
-rwxr-xr-xbin/lsrc.in22
2 files changed, 14 insertions, 11 deletions
diff --git a/NEWS.md.in b/NEWS.md.in
index 10c1084..6e7451e 100644
--- a/NEWS.md.in
+++ b/NEWS.md.in
@@ -1,5 +1,8 @@
rcm (@PACKAGE_VERSION@) unstable; urgency=low
+ * BUGFIX: Allow files with the same prefix name in the same
+ directory. Verbose hidden files for lsrc(1) (Javier López).
+
-- Mike Burns <mburns@thoughtbot.com> Fri, 28 Mar 2014 16:30:53 +0100
rcm (1.2.2) unstable; urgency=low
diff --git a/bin/lsrc.in b/bin/lsrc.in
index 1402fec..c5ad700 100755
--- a/bin/lsrc.in
+++ b/bin/lsrc.in
@@ -108,20 +108,20 @@ show_file() {
local dotted=$5
local symlink_dirs_file_globs="$6"
local dest_file="$(build_path "$dest_dir" "$file" $dotted)"
+ local src_file="$(file_join "$dotfiles_subdir" "$file")"
+ local abs_src_file="$(file_join "$dotfiles_dir" "$src_file")"
+ local output="$dest_file:$abs_src_file"
- if echo "$DEST_STACK" | grep -vq ":$dest_file"; then
- DEST_STACK="$DEST_STACK:$dest_file"
-
- src_file="$(file_join "$dotfiles_subdir" "$file")"
- abs_src_file="$(file_join "$dotfiles_dir" "$src_file")"
- output="$dest_file:$abs_src_file"
-
- if [ $SHOW_SIGILS -eq 1 ]; then
- sigil="$(sigil_for "$src_file" "$symlink_dirs_file_globs")"
- output="$output:$sigil"
- fi
+ if [ $SHOW_SIGILS -eq 1 ]; then
+ sigil="$(sigil_for "$src_file" "$symlink_dirs_file_globs")"
+ output="$output:$sigil"
+ fi
+ if echo "$DEST_STACK:" | grep -vq ":$dest_file:"; then
+ DEST_STACK="$DEST_STACK:$dest_file"
$PRINT "$output"
+ else
+ $VERBOSE "skipping hidden file $output"
fi
}