Well, during my cleanup, I've shuffled my photos around a bit. The result is better, but today I stumbled across a directory that contains softlinks to a directory containing photos. I'd moved the (target) directory, thus none of the softlinked image files were readable.
How could I update the softlinks to point the the new location?
I ended up with this solution:
$ for f in *.JPG; do test -L $f && test -f /new/path/$f && rm $f && ln -s /new/path/$f .; done
obviously you should replaces /new/path with the new path to the files.
Here's a "script" version of the above one-liner:
for f in *.JPG; do test -L $f && \ test -f /new/path/$f && \ rm $f && \ ln -s /new/path/$f . done
I'm looping over all files with the extension .JPG in the current directory. For each file i check if it's a softlink (test -L $f) and a file with the same name exists in the new location (test -f /new/path/$f). If both checks are true the softlink is removed (rm $f) and a new softlink is created (ln -s /new/path/$f .)
Pretty simple, eh?