It would be helpful if the --query --file options would follow symlinks to offer more information, especially if the symlink itself is not owned by an rpm. For example, rpm currently gives: $ rpm -qf /etc/rc.d/rc2.d/S10network file /etc/rc.d/rc2.d/S10network is not owned by any package It would be helpful if rpm did the obvious legwork: $ rpm -qf /etc/rc.d/rc2.d/S10network file /etc/rc.d/rc2.d/S10network is not owned by any package file /etc/rc.d/rc2.d/S10network is a symlink to ../init.d/network initscripts-6.67-1 The symlink value may be retrieved with readlink(2). In the case of symlinks which were owned, I think it should give the following output. $ rpm -qf /path/to/symlink mysymlinks-1.0-1 file /path/to/symlink is a symlink to ./realfile myrealfiles-1.0-1
I claim that rpm should manage packages, not the file system. That means that rpm should not follow symlinks that are not "owned" by packages. Adding another line of output to "rpm -qf" output would break various scripts. There ain't no easy answer, and alternatives (e.g. /usr/bin/rpm) implemented through symlinks just make the whole issue even more complicated. Basically, I don't think the additional functionality is worth the effort.