prevent relatedTemplate from truncating a filename to end in whitespace
Avoid a problem with temp file names ending in whitespace on filesystems
like VFAT that don't support such filenames.
See a6eb7d7339
previously for the same but
with "."
At some point relatedTemplate is more bother than it's worth and it would
be simpler to just use "temp" as the basename of all temp files. We seem to
be approaching that point, since my interest in absurd ancient filesystem
limitations is limited.
Sponsored-by: unqueued on Patreon
This commit is contained in:
parent
6818e69b81
commit
2007507e2b
3 changed files with 9 additions and 3 deletions
|
@ -2,6 +2,8 @@ git-annex (10.20250606) UNRELEASED; urgency=medium
|
|||
|
||||
* Skip and warn when a tree import includes empty filenames,
|
||||
which can happen with eg a S3 bucket.
|
||||
* Avoid a problem with temp file names ending in whitespace on
|
||||
filesystems like VFAT that don't support such filenames.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Mon, 23 Jun 2025 11:11:29 -0400
|
||||
|
||||
|
|
|
@ -117,13 +117,15 @@ relatedTemplate' :: RawFilePath -> RawFilePath
|
|||
relatedTemplate' f
|
||||
| len > templateAddedLength =
|
||||
{- Some filesystems like FAT have issues with filenames
|
||||
- ending in ".", so avoid truncating a filename to end
|
||||
- that way. -}
|
||||
B.dropWhileEnd (== dot) $
|
||||
- ending in ".", and others like VFAT don't allow a
|
||||
- filename to end with trailing whitespace, so avoid
|
||||
- truncating a filename to end that way. -}
|
||||
B.dropWhileEnd disallowed $
|
||||
truncateFilePath (len - templateAddedLength) f
|
||||
| otherwise = f
|
||||
where
|
||||
len = B.length f
|
||||
disallowed c = c == dot || isSpace (chr (fromIntegral c))
|
||||
dot = fromIntegral (ord '.')
|
||||
#else
|
||||
-- Avoids a test suite failure on windows, reason unknown, but
|
||||
|
|
|
@ -43,3 +43,5 @@ failed
|
|||
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
||||
|
||||
I use it quite successfully to archive media on removable spinning hard drives.
|
||||
|
||||
> [[fixed|done]] --[[Joey]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue