#!/bin/sh # The last upgrade before the change # gettext domain TEXTDOMAIN="lliurex-up" export TEXTDOMAIN COMMON_LIBRARY="/usr/share/lliurex-up/common-upgrade-vars.sh" if [ -r $COMMON_LIBRARY ] ; then . $COMMON_LIBRARY fi #gettext messages INFO_MESSAGE="$(gettext "Update software cache")" UPDATE_CACHE_MESSAGE="$(gettext "Update software cache")" UPGRADE_PACKAGES_MESSAGE="$(gettext "Upgrade installed packages")" UPGRADE_PACKAGES_END_MESSAGE="$(gettext "Upgrade complete")" # Methods _info() { echo "$INFO_MESSAGE" } _migrate() { # Update cache echo "$UPDATE_CACHE_MESSAGE" apt-get update # Upgrade packages echo "$UPGRADE_PACKAGES_MESSAGE" apt-get -f install -y --force-yes # Upgrade package completion echo "$UPGRADE_PACKAGES_END_MESSAGE" } get_details() { apt-get update 2>&1 >/dev/null # Create file to log in it. INSTALL_TMP_FILE="$(mktemp /tmp/lliurex-up-working-area.log-to-parse.XXXX)" LANG=C apt-get dist-upgrade -sV >> "$INSTALL_TMP_FILE" lliurex-upgrade-parser "$INSTALL_TMP_FILE" } _usage() { echo " * [ LliureX Up ] : # Unknown argument" } _die() { echo " * [ LliureX Up ] : Error: $1" exit 1 } ACTION="$1" case "$ACTION" in migrate) _migrate ;; info) _info ;; details) get_details ;; *) _usage ;; esac exit 0