wpkg --search | -S

Short Hand

wpkg -S

Options Comments
--admindir Define the administration directory, where the database of the installed packages resides.
--debug Define a set of flags of things to print out for debug purposes.
--instdir Define the installation directory, where the data files are installed on the target.
--quiet This option is ignored.
--root Define the installation root path.
--verbose In verbose mode the name of the package is shown only for the first file found in a package and is kept hidden for the others.

The --search command allows you to find the name of a package from the full path of an installed file1. The command searches the index.wpkgar file from all the packages that were installed on the specified target. If the file name specified on the command line is found in one of them, then the name of the corresponding package is printed out. Multiple filenames can be specified at once. In that case the name of all the packages where each one of the specified file is found will be listed.

The output is the name of the package followed by a colon and then the filename as found in the package.

Note that this command slows down as more packages are being installed on your target. There is no well defined index that gives you a fast search. Since this command is used in a rather seldom manner, at this point we are not looking forward to improving its performance.

To list all the files that were installed from a given package, check out the --listfiles command.

IMPORTANT NOTE

wpkg does not record which files get overwritten by which files. Therefore, if you installed two different packages using the --force-overwrite option and both define the same file then both package names get listed by this command line function.

 

 
  • 1. Note that the "full path" here means the path starting from the --root directory.