diff options
author | Slack Coder <slackcoder@server.ky> | 2024-03-25 09:10:36 -0500 |
---|---|---|
committer | Slack Coder <slackcoder@server.ky> | 2024-03-25 09:10:36 -0500 |
commit | 175057f6b5d7444fa756b2ce972f5e6041ce0932 (patch) | |
tree | de0abfa053737ac1e7a29be4d4c4859f80305bc8 /src | |
parent | 71518754d14197274f61264f2a9ac9488b029384 (diff) | |
download | slack-autoupdate-175057f6b5d7444fa756b2ce972f5e6041ce0932.tar.xz |
Minor fixes
- Cleanup unused variables.
- Fix deletion of consumed updates.
- Source profile.d environments as they may be required by some SBO
scripts.
Diffstat (limited to 'src')
-rw-r--r-- | src/autoupdate | 3 | ||||
-rw-r--r-- | src/rc.update | 22 |
2 files changed, 5 insertions, 20 deletions
diff --git a/src/autoupdate b/src/autoupdate index d00c818..30315df 100644 --- a/src/autoupdate +++ b/src/autoupdate @@ -127,7 +127,6 @@ if ! OUTPUT="$( /var/lib/slackpkg/ChangeLog.txt \ | head -n 1 )" - echo $LAST_INSTALLED_PACKAGE echo "Slackware updates" echo @@ -149,6 +148,8 @@ if ! OUTPUT="$( exit 0 fi + source /etc/profile.d/*.sh + PACKAGE_UPDATES=$(mktemp /tmp/slack-autoupdate.XXXXXX) trap "rm -f ${PACKAGE_UPDATES}" EXIT diff --git a/src/rc.update b/src/rc.update index 7c80cdc..afc45d9 100644 --- a/src/rc.update +++ b/src/rc.update @@ -7,26 +7,11 @@ # will run if found. We recommend placing this under /usr/local/sbin. # -# A local Slackware mirror with just enough information to support slackpkg. -# -# This step could be skipped if slackpkg supports downloading updates without -# installing them. -LOCAL_MIRROR=${LOCAL_MIRROR:-"/var/cache/slack-autoupdate/mirror"} - -# slackpkg exit code when updates are available. -SLACKPKG_UPDATES_PENDING=100 - # Where packages are stored pending installation. You can use sub-directories # to order and group packages. UPDATE_DIR="/var/spool/slack-autoupdate" -# Where information about pending updates is stored. -UPDATE_INFO="$UPDATE_DIR/info.txt" - -# Where information about failed updates is stored. -UPDATE_ERROR="$UPDATE_DIR/error.txt" - -UPDATES=$(find "$UPDATE_DIR" -name '*.t*z' | sort) +UPDATES="$(find "$UPDATE_DIR" -name '*.t*z' | sort)" if [ -z "$UPDATES" ]; then exit 0 @@ -39,8 +24,7 @@ fi OLD_KERNEL="$(realpath /boot/vmlinuz)" for PKG in $UPDATES; do - upgradepkg --install-new "$PKG" && - rm "$PKG" + upgradepkg --install-new "$PKG" done NEW_KERNEL="$(realpath /boot/vmlinuz)" @@ -51,6 +35,6 @@ if [ "$OLD_KERNEL" != "$NEW_KERNEL" ]; then fi # All package updates have been processed. -find "$UPDATE_DIR" -mindepth 1 -not -path "$UPDATE_DIR_IGNORED/*" | xargs rm -fr +find "$UPDATE_DIR" -mindepth 1 | xargs rm -fr reboot |