[Pkg-javascript-devel] Javascript trigger design

Thomas Goirand zigo at debian.org
Mon Dec 1 22:46:33 UTC 2014


On 12/01/2014 04:26 PM, Thorsten Glaser wrote:
> On Sat, 29 Nov 2014, Thomas Goirand wrote:
> 
>> 2/ in debian/openstack-dashboard.postinst, implement something like:
>>
>> if [ "$1" = "triggered" ] ; then
>> 	/usr/share/openstack-dashboard/manage.py compress --force
>> fi
>>
>> Is it *that* simple?
> 
> No, triggers unfortunately are not that simple: if you install/upgrade
> openstack-dashboard together with some of the packages it wants a
> trigger on, $1="triggered" will sometimes not happen, only "configure".
> 
> Have a look at these:
> 
>https://evolvis.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=evolvis-platfrm/evolvisforge.git;a=blob;f=mw-plugin/debian/triggers;h=723d1c077e3cf10350952cf9ded297b85cfde812;hb=HEAD
>https://evolvis.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=evolvis-platfrm/evolvisforge.git;a=blob;f=mw-plugin/debian/postinst;h=fa480512bf5b32bcfe5412544159a158e6cfab08;hb=HEAD
> 
> The thing to call when triggered is the upgrade_mediawikis shell
> function, it’s called from the “triggered” case, but also from
> the regular “configure” case. This is suboptimal, but apparently
> needed.
> 
> bye,
> //mirabilos

Hi Thorsten,

First, thanks a lot for your help here. It's really appreciated. I hope
I'll get it this time...

I did get the point I needed to do it on my postinst too, and I am doing
it already. So let me rephrase, just to make sure I got it:

So if I understand well (by reading your example package), the only
thing I have to do (for horizon) is:

1/ Create a debian/openstack-dashboard.triggers that would contain a
list of "interest /usr/share/javascript/<something>", for example:

interest /usr/share/javascript/jsencrypt

then I'd get triggered in my postinst, and then I should do:

2/ in debian/openstack-dashboard.postinst, implement something like:

if [ "$1" = "configure" ] ; then
    <some-other-stuff>
    /usr/share/openstack-dashboard/manage.py compress --force
    <some-other-stuff>
fi
if [ "$1" = "triggered" ] ; then
    /usr/share/openstack-dashboard/manage.py compress --force
fi

Is it *that* simple? I'm surprised by the "interest" thing just being
hinted with a directory. Does this mean that if anything changes in that
directory, then there's a trigger, and the openstack-dashboard compress
stuff will happen?

Cheers,

Thomas Goirand (zigo)




More information about the Pkg-javascript-devel mailing list