SA Bugzilla – Bug 7296
Make sa-learn handle folder list prefixes with blank types
Last modified: 2017-08-07 16:05:22 UTC
Created attachment 5378 [details] Patch When given a folder list with the -f option, sa-learn does not currently handle prefixes that do not specify a type. For example, given this line: ham::/path/to/ham sa-learn will throw this error: archive-iterator: unable to open ham::/path/to/ham: No such file or directory This is because ArchiveIterator expects a format to be specified, and sa-learn is supposed to pass "detect" by default if one is not specified. This was not happening when sa-learn was given a folder list with unspecified formats. I have attached a patch to make sa-learn ensure that the format field is filled upon reading in the folder list.
To clarify, because sa-learn did not put "detect" into the string when reading the folder list, sa-learn later tries to "fix" the improperly formatted target string by running it through a subroutine (target()) which is only meant to be used on bare paths, and not prefixed folder list entries.
It's been a month, is anyone going to look at this?
Anyone want to look at this for the upcoming minor release?
Created attachment 5458 [details] Patch generated with svn diff Regenerated the patch with svn diff instead of git format-patch
Thanks for the report, John. Indeed, sa-learn happily accepted an empty type argument in the --folders option, but failed to rewrite it to "detect". According to the documentation, sa-learn promises to accept an empty type, while the ArchiveIterator expects the "detect" type to be given explicitly. Fixed in trunk and stable 3.4 branch respectively: Sending sa-learn.raw Committed revision 1804345. Sending sa-learn.raw Committed revision 1804346. Closing RESOLVED FIXED.