You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symbolic links under CONFIG_DIR/topgrade.d/ are ignored even if they point to files.
Expected Behavior
The configuration files of the symbolic link destination are included.
Steps to reproduce
$ mkdir -p ~/.config/topgrade.d
$ cat >config.toml <<END[misc]no_self_update = trueEND
$ ln -s ~/.config/topgrade.d/config.toml config.toml
$ topgrade --log-filter debug
# ~/.config/topgrade.d/config.toml is not included
Possible Cause (Optional)
Additional configuration files are searched in ConfigFile::ensure_topgrade_d().
That function filters entries of the directory by DirEntry::file_type() and FileType::is_file(). DirEntry::file_type() will not traverse symlinks (see std document). FileType::is_file() returns false for symlinks (see std document).
So, entry.file_type()?.is_file() returns false for symbolic links.
Erroneous Behavior
Symbolic links under
CONFIG_DIR/topgrade.d/
are ignored even if they point to files.Expected Behavior
The configuration files of the symbolic link destination are included.
Steps to reproduce
Possible Cause (Optional)
Additional configuration files are searched in
ConfigFile::ensure_topgrade_d()
.That function filters entries of the directory by
DirEntry::file_type()
andFileType::is_file()
.DirEntry::file_type()
will not traverse symlinks (see std document).FileType::is_file()
returnsfalse
for symlinks (see std document).So,
entry.file_type()?.is_file()
returnsfalse
for symbolic links.topgrade/src/config.rs
Lines 534 to 543 in 960b14f
You can use
Path::is_file()
as follows to follow symbolic links.Problem persists without calling from topgrade
Did you run topgrade through
Remote Execution
If yes, does the issue still occur when you run topgrade directlly in your
remote host
Configuration file (Optional)
Additional Details
Operation System/Version
Installation
Topgrade version (
topgrade -V
)Verbose Output (
topgrade -v
)The text was updated successfully, but these errors were encountered: