#!/bin/sh set -e # Source debconf library . /usr/share/debconf/confmodule # Define package name PACKAGE="apt-ostree" # Function to log messages log() { echo "$PACKAGE: $1" >&2 } # Function to setup shell completions setup_completions() { log "Setting up shell completions..." # Reload bash completion if available (skip if problematic) # if [ -f /etc/bash_completion ]; then # . /etc/bash_completion || true # fi # Reload zsh completion if available if [ -d /usr/share/zsh/vendor-completions ]; then # Zsh will automatically pick up completions from this directory log "Zsh completions installed" fi } # Function to check dependencies check_dependencies() { log "Checking dependencies..." # Check if apt-ostreed is installed and running if ! dpkg -l apt-ostreed >/dev/null 2>&1; then log "Warning: apt-ostreed package not found. Some features may not work." fi # Check if ostree is available if ! command -v ostree >/dev/null 2>&1; then log "Warning: ostree command not found. Please install ostree package." fi # Check if systemd is available if ! command -v systemctl >/dev/null 2>&1; then log "Warning: systemd not available. Some features may not work." fi } # Main execution case "$1" in configure) log "Configuring apt-ostree package..." setup_completions check_dependencies log "Configuration completed successfully" ;; abort-upgrade|abort-remove|abort-deconfigure) # Do nothing on abort ;; *) log "Unknown action: $1" exit 1 ;; esac exit 0