The time now is Sun 24 Jan 2021, 14:27
All times are UTC - 4 |
Author |
Message |
rockedge

Joined: 11 Apr 2012 Posts: 1874 Location: Connecticut, United States
|
Posted: Sun 12 Jan 2020, 20:09 Post subject:
|
|
Plugin system! fantastic work...looking forward to the added flexibility
now we're getting to be power users!
|
Back to top
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2806 Location: UK
|
Posted: Sun 19 Jan 2020, 09:18 Post subject:
|
|
The plugin system is now merged into Pkg
You can get the latest from https://gitlab.com/sc0ttj/Pkg/-/archive/master/Pkg-master.tar.gz
Plugins must be a shell script ending in .sh (ash, no Bash arrays).
If you want your plugin to run for a specific package, put it in:
/usr/share/pkg/plugins/<hook>/<pkgname>/
If you want your plugin to run for more than one specific package, put it in:
/usr/share/pkg/plugins/<hook>/
The "hook" given decides WHEN the plugin is run.
The hook you use can be any of the following (each is a dir in the plugins folder):
init
pre_install
post_install
pre_uninstall
post_uninstall
pre_build
post_build
exit
You can disable a plugin simply by making it non-executable:
chmod -x /usr/share/pkg/plugins/post_install/some-plugin.sh
(and enable it by making it executable with chmod +x)
---
Plugins require a run() function, as that is what Pkg will execute after sourcing the plugins.
Look in /usr/share/pkg/plugins/post_install/ for examples.
Using the vars provided by Pkg and DISTRO_SPECS, you can run plugins conditionally:
- only for certain systems (Debian-based, Slackware-based, etc)
- only for certain package types (.deb, .pet, .txz, .sfs, etc)
- only for specific packages (gimp, wings3d, kodi, etc)
- only for specific versions of packages (gimp-3.01, wings3d-2.3, etc)
- only if certain Pkg options were given (--ask, --force, --quiet, etc)
- only for packages starting with "lib*" (etc)
- any combination of the above
_________________ Pkg, mdsh, Woofy, Akita, VLC-GTK, Search
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|