OneCDOnly / sherpa

A mini-package-manager for QNAP NAS
GNU General Public License v3.0
114 stars 13 forks source link

package inits can fail but sherpa shows install as fine #48

Closed OneCDOnly closed 4 years ago

OneCDOnly commented 4 years ago

Clearly, return codes from the init scripts are being lost on the way back to sherpa. :confused:

These packages have been fixed:

OneCDOnly commented 4 years ago

Probably because this line in sherpa.sh:InstallQPKG() allows 0 or 10 (and I added it so long ago I forgot):

if [[ $result -eq 0 || $result -eq 10 ]]; then

Now, if only I knew why QPKGs generate 10 as an exitcode. Might need to ask QNAP.

OneCDOnly commented 4 years ago

Ah, looks like this is it: https://github.com/qnap-dev/QDK/blob/b5573bec245e936eef044c80c6871fd1fafcbee5/shared/bin/qbuild#L657-L658

# Return value 0 to keep the QPKG package after installation
# Return value 10 to remove QPKG package after installation

Which I think means packages return 0 if they are to be kept after install, and 10 if they are to be deleted. I wonder why a package would be allowed to determine if it's to be deleted?

OneCDOnly commented 4 years ago

Need to test whether a failed init start yields a usable return code if it happens during package installation.

OneCDOnly commented 4 years ago

Nope. Package install can be OK, but if the package init start fails, this isn't returned to the shell. :disappointed:

This is a QNAP problem. I'm not yet sure how to workaround this.

OneCDOnly commented 4 years ago

https://github.com/qnap-dev/QDK/issues/24#issue-679370148