Discussion:
[wpkg-users] chained packages are ignored. Bug in wpkg?
Holger Kröber
2016-05-03 12:43:32 UTC
Permalink
Hello,

i would like to use the chaining feature of wpkg, so if i install
package A, package B will also be installed.
This works for me if i run package A for the first time (install mode).
But if i run it again, e.g. after making
some changes and increasing the version number, package B is ignored and
no longer chained to package A
(even if i also change the version number of package B).
Maybe this is because the package is then running in upgrade mode and i
use precheck-upgrade="always" in all of my packages.
Also see here: https://marc.info/?l=wpkg-users&m=132982313114127
In my opinion, the precheck-upgrade option makes absolutely sense, so i
want to keep using this option.
At the same time i want to use the chaining feature, but it seems, that
there is a conflict.
Do i have to change the script code of wpkg or is there any other
solution? Is it a bug or is this behavior wanted?

wpkg.js, line 5399 to 5482. maybe also line 5680

this part is to find in "case install", but not in "case upgrade"
// install all chained packages
var chainedSuccess =
installPackageReferences(packageNode, "chained");
if (chainedSuccess) {
info(packageMessage +
"Package and all chained packages are
already installed. Skipping.");

} else {
info(packageMessage +
"Installed but at least one chained package
is missing.");
}

Regards,
Holger
Rainer Meier
2016-05-03 16:31:36 UTC
Permalink
Hi Holger,
Post by Holger Kröber
Hello,
i would like to use the chaining feature of wpkg, so if i install package A,
package B will also be installed.
This works for me if i run package A for the first time (install mode). But if i
run it again, e.g. after making
some changes and increasing the version number, package B is ignored and no
longer chained to package A
(even if i also change the version number of package B).
Maybe this is because the package is then running in upgrade mode and i use
precheck-upgrade="always" in all of my packages.
In fact by definition "chained" means that if package A is processed, then it
will (and only after processing A) process package B too.

In your case you are using precheck-upgrade which means WPKG will actually
detect that package A is to be updated, then runs the pre-checks and very likely
detects that the checks succeeds and there is no need to perform any actions on
package A. Therefore it makes WPKG skip the installation of package A. As a
result there is also nothing to be chained as package A does not actually get
executed as you checks instruct WPKG not to do anything with package a.

The idea of chaining was to perform some changes or add additional packages to
be executed right after some action in some other package is done. As your
package A likely does not do any change, there is no need for WPKG to perform
changes on package B. At least not if package B is only added to the
host/profile via this chain. If you add package B directly to the profile, then
WPKG should also detect this change and upgrade B. But there is no point in
upgrading B if A is detected unchanged/unnecessary due to the precheck-upgrade.
Post by Holger Kröber
Also see here: https://marc.info/?l=wpkg-users&m=132982313114127
In my opinion, the precheck-upgrade option makes absolutely sense, so i want to
keep using this option.
At the same time i want to use the chaining feature, but it seems, that there is
a conflict.
I would have to check the code and I would say in case package A is upgraded
(i.e. pre-checks enabled with false result so package A upgrade is performed)
and no package B upgrade takes place (requires package B to be changed too) then
it's a bug.

However in your situation you might be better off going for dependencies rather
than chained packages. Dependencies will pull the package into the dependency
tree rather than just executing a chain.


best regards,
Rainer

-------------------------------------------------------------------------
SSLrack - get your cheap cheap SSL certificates (standard, wildcard, EV)
http://www.sslrack.com/
-------------------------------------------------------------------------
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
Loading...