OPNsense Forum

English Forums => Development and Code Review => Topic started by: ndejong on August 10, 2018, 06:12:40 pm

Title: [SOLVED] Adding package(s) dependencies for plugins?
Post by: ndejong on August 10, 2018, 06:12:40 pm
Hi,

We are in the process of writing another OPNsense plugin that requires an additional standard FreeBSD distribution package, namely autossh.

Have done dirty hacks in the past by manually pulling in packages from the FreeBSD repo and installing manually when those packages are not available via the opnsense repo but this is surely not the right thing to be doing.

What is the correct way (if any) to add package dependencies to a plugin?  If anyone could point to other plugin examples that handle any part this that would be great.

Thanks in advance.

N
Title: Re: Adding package(s) dependencies for plugins?
Post by: mimugmail on August 10, 2018, 06:33:32 pm
Ask in GitHub/Tools for a pkg
Title: Re: Adding package(s) dependencies for plugins?
Post by: franco on August 11, 2018, 01:50:11 pm
Yep... thanks for the ticket. We'll have this up in 18.7.2 because 18.7.1 is currently being prepared.


Cheers,
Franco
Title: Re: Adding package(s) dependencies for plugins?
Post by: franco on August 12, 2018, 08:54:32 pm
I assumed that the package was missing, not remembering we added it over three years ago already:

https://github.com/opnsense/tools/commit/22f90aa

 8)


Cheers,
Franco
Title: Re: [SOLVED] Adding package(s) dependencies for plugins?
Post by: ndejong on August 13, 2018, 02:26:15 pm
Urgh - this is embarrassing :(

Franco, thank you for taking the time in responding both here and the ticket, it is entirely my fault.

To help others hopefully not make the same mistake:-

 - packages on the OPNsense host listed under System > Firmware > Packages are those packages that are currently installed, not those that "can be" installed as per the Plugins.  It's silly that I made this mistake, it seems so obvious but this is indeed what led me astray to begin with.

 - packages listed under https://github.com/opnsense/tools/blob/master/config/[release]/ports.conf are not in alphabetical order, they are prefixed by their package-subpath.  I know looked here myself before placing the ticket but neglected to do a simple string search to find autossh further down the file.

Good news, there is nothing required to be done  :/

Thanks again Franco - will make up for it by making sure the promised Autossh plugin gets completed and submitted for review.

N
Title: Re: [SOLVED] Adding package(s) dependencies for plugins?
Post by: franco on August 14, 2018, 01:54:03 pm
Hi N,

No worries at all.  :)

It's true that packages in the GUI only show what is installed. We decided against allowing to manually install+click packages there not knowing what it would do to user installations and they would have to go to the command line to configure them anyway. So the idea was to use plugins to pull in the packages automatically and provide a GUI way to deal with them.

You can also query all available binary packages from the command line:

# pkg rquery "%n-%v: %c"


Cheers,
Franco