Bug#1138812: With =?UTF-8?Q?=E2=80=9C-ow=E2=80=9D, ?= write through soft links or bail out on soft links or at least warn on soft links
Md Ayquassar
MdAyq6 at ro.ru
Sat Jun 6 04:11:18 BST 2026
>> for file in *.png; do pngcrush -ow $file; done
>>
>> In this situation, if the current directory contains a mixture of links with the extension .png and regular .png files, all the soft links will be silently turned into regular files, and their origins get forgotten forever.
> The origins still on the disk.
Yes, and if the disk has lots of PNG images, the origins (the sources of the prior soft links) cannot be reconstructed in acceptable time. (For example, we'd have to compress or convert each PNG file into a unique form and then search for the duplicates.)
>> At the very least, pngcrush should warn the caller or simply bail out with an error message and a nonzero error code. In my personal use cases, I need the tool to write through a soft link. (An alternative solution, though an overkill for me, would be to have an option, say, “-dereference”, which would allow for writing through a soft link specified with the option “-ow” and bailing out on a soft link if “-dereference” is not supplied.)
>>
> The pngcrush only a simple tool.
>
> The filesystem links is a little complex for such a simple tool.
>
Yes, and there is a difference between the current complexity of the tool and the complexity that a flawless implementation of “-ow” would involve. In my understanding, this implementation has to be re-written from scratch because of https://bugs.debian.org/913268 anyway.
More information about the Pkg-phototools-devel
mailing list