So, given that changes in argument handling for f-spot has caused 2 bugs (this one and https://bugs.launchpad.net/ubuntu/+source/f-spot/+bug/202717), it would make sense to return the argument handling to the old behavour. Since f-spot is a script, it seems that the old behaviour could be emulated there:
* If the 1st arg is --import, then don't touch anything - assume sanity.
* If the 1st and only arg is a directory and it is directly under /media, then add a --import
* Otherwise, for each file:// arg, add a --view arg before it.
Also, the existing line saying:
for arg in $* ; do
is also a bug. If someone passes a filename called "foo --trace=bar.jpg" then the wrong thing will happen - yes, that is unlikely but the fix is easy! The above should just be:
for arg; do
A patch that does all of the above is attached. I've patched /usr/bin/f-spot rather than the source file... however, if the patch is useful then it should be easy to apply to the source file. Some of the code is bash-specific - without bash I think all is lost, since bash arrays provide a way of maintaining filenames with whitespace in them.
... and yes... the way of done it is a little bit insane, but it works for all of my desired use cases so far... :-)
Yep, I agree with the last 2 comments.
So, given that changes in argument handling for f-spot has caused 2 bugs (this one and https:/ /bugs.launchpad .net/ubuntu/ +source/ f-spot/ +bug/202717), it would make sense to return the argument handling to the old behavour. Since f-spot is a script, it seems that the old behaviour could be emulated there:
* If the 1st arg is --import, then don't touch anything - assume sanity.
* If the 1st and only arg is a directory and it is directly under /media, then add a --import
* Otherwise, for each file:// arg, add a --view arg before it.
Also, the existing line saying:
for arg in $* ; do
is also a bug. If someone passes a filename called "foo --trace=bar.jpg" then the wrong thing will happen - yes, that is unlikely but the fix is easy! The above should just be:
for arg; do
A patch that does all of the above is attached. I've patched /usr/bin/f-spot rather than the source file... however, if the patch is useful then it should be easy to apply to the source file. Some of the code is bash-specific - without bash I think all is lost, since bash arrays provide a way of maintaining filenames with whitespace in them.
... and yes... the way of done it is a little bit insane, but it works for all of my desired use cases so far... :-)