Article 565RY slackpkg return value

slackpkg return value

by
Lockywolf
from LinuxQuestions.org on (#565RY)
Hello, everyone.

At the moment I'm trying to bodge some scripts in order to make updating easier.

I just wonder whether it would make sense for `slackpkg upgrade-all` to return some false value (that is non-zero) in the case of cancelling the update (or, thinking further, different return values in cases of different interruption causes).

That is, zero (0) would mean "update succeeded", 1 would, for example, mean "update cancelled by the user", 2 could mean "download failed".

Then it would be easier to use slackpkg within the scripts.

For example, at the moment I'm doing four things at each update:
  1. slackpkg update && slackpkg install-new && slackpkg upgrade-all
  2. sbopkg -i nvidia-legacy390-kernel:KERNEL=$(find /lib/modules/ | head -1)
  3. sbopkg -i wireguard-linux-compat:KERNEL=$(find /lib/modules/ | head -1)
  4. dd if=/dev/root of=/mnt/backup/$(date)
I would like each of those steps to fail in case something is wrong and terminate the whole script. Hitting "cancel" at the update screen counts as a failure, because apparently means that updating is inappropriate at the moment.

What do people thing about this? Is it a good idea? Would anyone find this useful?latest?d=yIl2AUoC8zA latest?i=xP0pCpWXu34:rvVX34JkK20:F7zBnMy latest?i=xP0pCpWXu34:rvVX34JkK20:V_sGLiP latest?d=qj6IDK7rITs latest?i=xP0pCpWXu34:rvVX34JkK20:gIN9vFwxP0pCpWXu34
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments