Solved Stupid questions I have always wanted to ask: Part Two

OK I install a package and now what? I have to run a search for newest files?

Why does pkg install output not show you what was installed and where? pkg-descr is only so useful.

Why not an output report. What file and where was it placed.. Am I missing some command flag?
 
Sure after the fact.

A simple screen output would show you the executables installed and the docs.
Granted most packages contain a single executable it can still be a guessing game if the package name is not the executable name.
 
And some packages contain hundreds of files.

Imagine I'm installing (or upgrading) 30 packages at once. Do I want to see every file they installed? Probably not, instead I want to see the progress: Now doing package 13, now doing 14, ...

Maybe with some -v option, this would make sense.
 
Am I missing some command flag?
Sure after the fact.
pkg-rquery(8) doesn't offer the possibility to query for files in a package; I imagine that information is not stored in the local copy db of the remote repository. The best option, before actually installing, seems to be the longer road via first fetching the package, then querying the package file. Install the package, either using the normal route using pkg-install(8) or using pkg-add(8) using the the downloaded package files. For example using lsof:
Code:
[1-0] # pkg fetch -o . lsof
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.
The following packages will be fetched:

New packages to be FETCHED:
        lsof: 4.99.5,8 (117 KiB: 100.00% of the 117 KiB to download)

Number of packages to be fetched: 1

117 KiB to be downloaded.

Proceed with fetching packages? [y/N]: y
Fetching lsof-4.99.5,8.pkg: 100%  117 KiB 119.7kB/s    00:01
[2-0] # pkg query --file ./All/lsof-4.99.5,8.pkg '%Fp'
/usr/local/share/licenses/lsof-4.99.5,8/catalog.mk
/usr/local/share/licenses/lsof-4.99.5,8/LICENSE
/usr/local/share/licenses/lsof-4.99.5,8/lsof
/usr/local/share/man/man8/lsof.8.gz
/usr/local/sbin/lsof
/usr/local/share/lsof/00MANIFEST
/usr/local/share/lsof/00README
/usr/local/share/lsof/big_brother.pl
/usr/local/share/lsof/count_pf.pl
/usr/local/share/lsof/identd.pl
/usr/local/share/lsof/idrlogin.pl
/usr/local/share/lsof/list_NULf.pl
/usr/local/share/lsof/list_fields.awk
/usr/local/share/lsof/list_fields.pl
/usr/local/share/lsof/shared.pl
/usr/local/share/lsof/sort_res.pl
/usr/local/share/lsof/watch_a_file.pl
/usr/local/share/lsof/xusers.awk
[3-0] #
 
"Hey Siri, why am I installing this package?" "Because you want to run GIMP" "Ok, but what do I do after installing this package named gimp? "have you tried typing in gimp and hitting return?"

I guess I'm not sure why the question is being asked. Typically one installs a package satisfy a need, the need is a known prerequisite, so after installing why not simply try "the need"?
 
Trying to figure out the binary for webkit2-gtk_60 was fun :p

I needed MiniBrowser but it isn't extracted to a bin folder:

Code:
/usr/local/libexec/webkitgtk-6.0/MiniBrowser

I usually look for stuff like pkg info -l 'webkit2-gtk_60' | grep 'bin', but there's no hint of minbrowser.
 
OK I install a package and now what? I have to run a search for newest files?

Why does pkg install output not show you what was installed and where? pkg-descr is only so useful.

Why not an output report. What file and where was it placed.. Am I missing some command flag?

Usually the pkg-message should tell you what to do after installing a port or hint you to the manpage if it is non-tvirial[*]. But yes, many ports only give a very generic message ("thank you for installing XY") and you need to look at the installed files to get a clue.
Maybe it might be sensible to raise a PR with ports that could need some improvement on their pkg-message?
Sure, that message should be short and conscice to not litter stdout with pages upon pages of output when installing some package and its dependencies, but IMHO at least a hint to the manpage or documentation for "first steps" for any non-trivial port[*] should be present. Also if the port doesn't install config/data into the standard places, e.g. /usr/local/etc/<portname> for config; like databases that just dump everything in their /var/db/<database> directory...


[*]'non-trivial port' meaning something that doesn't come with an executable and manpage with the same name as the port (e.g. vim) but needing some additional steps to set up (config, services) or comes with an assortment of binaries and manpages that don't match the port name (e.g. some 'toolkits') and/or don't install into the usual places (e.g. /usr/local/etc/<portname> for their config)
 
[*]'non-trivial port' meaning something that doesn't come with an executable and manpage with the same name as the port
Apropos not matching the port name, not only non-trivial ports but also trivial ports like deskutils/bookworm are affected. I had to look up the packages binary name, the "bookworm" command couldn't be found.

It turns out the binary is named impossible to guess:
Rich (BB code):
 % pkg list bookworm | grep bin
/usr/local/bin/com.github.babluboy.bookworm
A post-install message would have been helpful for such an unusual executable name. A newbe might simply give up using bookworm, not knowing how to obtain the necessary information.
 
As most (binaries of) ports have some sort of help or usage function, of those that do not have a man page at all, or have a man page that is not 'simply derived' from the port's name: these, IMO, should at some point in the future be banned from the ports tree. Preferably, of course, they should be provided with a decent man page.

If there's no binary help/usage function and no man page, I feel there isn't much sense for a particular software to be the FreeBSD ports tree at all.
 
a little script could help you to find executable files in package

Bash:
pkg info -l $1 | sed s/^[[:space:]]*//g | while read file; do
    if [ -x "$file" ]; then
       echo "$file"
    fi
done

Before I have known command pkg info -l (to list package content) sometimes it was difficult task to find what to run)
 
a little script could help you to find executable files in package
I like that :)

With a bit of added parameter-paranoia, and use file rather than echo...

Code:
#!/bin/sh

pkg info -l "$1" | sed s/^[[:space:]]*//g | while read filename; do
    if [ -f "${filename}" ] && [ -x "${filename}" ]; then
       file "${filename}"
    fi
done
 
I am going to mark this as solved.

My thinking here was wrong. For a single package it would be convenient to see files installed but for 400 packages the file list would be useless as ralphbsz pointed out.

I will continue to search for newest files in these corner cases where executable is not the package name or documented.

Very enjoyable seeing all the possible methods.
 
Back
Top