-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discerning between a file and a folder in the files signal is impossible? #117
Comments
To add a bit more credence to this, if you look at: This file contains the file lists for all the packages in a particular repository. The file is huge so, I just took out an excerpt from drbd-utils:
As you can see, the "directory" files, have the:
parts which is very useful to know. I actually wrote a function to figure out which files must be dirs (because they have other listed files in the contents), but unfortunately some cases such as Thanks again! |
At least when using the |
That is very funny, because my https://github.com/purpleidea/mgmt/ actually uses the exact same convention to distinguish between a file and a directory. So that is a perfectly acceptable way to represent this. @ximion Very useful information, thanks! For anyone using my tool under the aptcc backend, will not experience any issues, although I've tried to workaround some of them anyways. This is an issue with the libhif (dnf) backend AFAICT. Can packagekit add the trailing slashes, since it has this information? This would be a perfectly acceptable way to represent this for me, and wouldn't require any API changes. |
Fwiw, I agree that a trailing backslash should indicate a directory. The issue is sometimes when packages own the files in a directory, and explicitly not the directory itself, e.g. in the bash completion case. If the directory-owned-by-package == trailing backslash is the behaviour you want, that should be pretty easily fixable. |
On Mon, Mar 7, 2016 at 3:25 AM, Richard Hughes [email protected]
Yeah this sounds great. If the package doesn't own the directory, then it So is it fair to count the current behaviour of sometimes not returning the |
I looked into this briefly, and tried to work out what all the various pieces are doing:
As far as I can tell from looking into this (and I could well be wrong), this would mean a patch to libsolv to store information about what type of thing each |
Getting the list of a files in a package is wonderfully useful, although in some packages (such as drbd-utils) on Fedora (an arbitrary example that demonstrates the issue) it lists:
as a file, which is in fact a directory.
I'm well aware of the similarity in Linux, but it would be particularly useful for certain tools if there was a way to get more information about the file, such as if in fact it is a directory or not.
Other properties might also be useful information, although I have not found a personal use for this information yet. Getting file owner/group/mode and executable status would probably also be quite handy!
I expect this might involve adding a new method and signal to the API as to not break it.
Thanks in advance!
The text was updated successfully, but these errors were encountered: