Opened 3 years ago

Last modified 3 years ago

#16655 new enhancement

[pkgman] show package a file belongs to

Reported by: diver Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Applications/Command Line Tools Version: R1/beta2
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

At first I though pkgman belongs could be good choice but then I though why pkgman can't be smart enough and show package name if it was invoked with a file path, e.g.:

pkgman /system/Tracker
/system/Tracker belongs to /system/packages/haiku-r1~beta2_hrev54767-1-x86_64.hpkg

Change History (6)

comment:1 by diver, 3 years ago

I guess for easier scripting /system/Tracker belongs to could be omitted.

comment:2 by nephele, 3 years ago

that would conflict a bit if any file conflicts with a pkgman command, like a repository could have a file named "install" that could end up in a package

comment:3 by humdinger, 3 years ago

The advantage of using a command word for this feature is improved discoverability. You wouldn't really know that pkgman could show the package some file belongs to. If, OTOH, you have a command option like "origin" that is described in pkgman --help , you can learn about it.

comment:4 by waddlesplash, 3 years ago

You don't need to use pkgman for this, you can just use attributes: catattr SYS:PACKAGE <file> will do the trick.

comment:5 by X512, 3 years ago

I made Tracker add-on that show package file for selected file in package. I can upload it on HaikuUtils.

Last edited 3 years ago by X512 (previous) (diff)

in reply to:  4 comment:6 by diver, 3 years ago

Replying to waddlesplash:

You don't need to use pkgman for this, you can just use attributes: catattr SYS:PACKAGE <file> will do the trick.

Yes, I know that, but having it inside a single pkgman is easier for the user. This is also implemented in other package managers: dpkg -S /bin/sh and rpm -qf /bin/sh. So it seems logical to have it in pkgman but with easier syntax.

Note: See TracTickets for help on using tickets.