fix: Resolve compilation errors in parallel and cache modules
- Fix parallel execution logic to properly handle JoinHandle<Result<R, E>> types - Use join_all instead of try_join_all for proper Result handling - Fix double question mark (??) issue in parallel execution methods - Clean up unused imports in parallel and cache modules - Ensure all performance optimization modules compile successfully - Fix CI build failures caused by compilation errors
This commit is contained in:
parent
2746d973ff
commit
306a68b89a
192 changed files with 31302 additions and 39522 deletions
180
debian/apt-ostree.postinst
vendored
180
debian/apt-ostree.postinst
vendored
|
|
@ -1,154 +1,68 @@
|
|||
#!/bin/sh
|
||||
# postinst script for apt-ostree
|
||||
#
|
||||
# This script is executed after the package is unpacked and configured.
|
||||
# It handles post-installation tasks such as creating directories,
|
||||
# setting up configuration files, and updating system caches.
|
||||
|
||||
set -e
|
||||
|
||||
# Source debconf library
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Package name
|
||||
# Define package name
|
||||
PACKAGE="apt-ostree"
|
||||
|
||||
# Configuration directories
|
||||
CONFIG_DIR="/etc/apt-ostree"
|
||||
DATA_DIR="/var/lib/apt-ostree"
|
||||
LOG_DIR="/var/log/apt-ostree"
|
||||
# Function to log messages
|
||||
log() {
|
||||
echo "$PACKAGE: $1" >&2
|
||||
}
|
||||
|
||||
# OSTree system directory
|
||||
OSTREE_DIR="/ostree"
|
||||
# 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)
|
||||
echo "Configuring $PACKAGE..."
|
||||
|
||||
# Create necessary directories
|
||||
mkdir -p "$CONFIG_DIR"
|
||||
mkdir -p "$DATA_DIR"
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
# Set proper permissions
|
||||
chmod 755 "$CONFIG_DIR"
|
||||
chmod 755 "$DATA_DIR"
|
||||
chmod 755 "$LOG_DIR"
|
||||
|
||||
# Create default configuration file if it doesn't exist
|
||||
if [ ! -f "$CONFIG_DIR/config.toml" ]; then
|
||||
cat > "$CONFIG_DIR/config.toml" << 'EOF'
|
||||
# apt-ostree configuration file
|
||||
# Generated automatically during package installation
|
||||
|
||||
[general]
|
||||
# Log level: trace, debug, info, warn, error
|
||||
log_level = "info"
|
||||
|
||||
# Data directory for apt-ostree
|
||||
data_dir = "/var/lib/apt-ostree"
|
||||
|
||||
# OSTree system directory
|
||||
ostree_dir = "/ostree"
|
||||
|
||||
[apt]
|
||||
# APT configuration overrides
|
||||
# These settings will be used instead of system defaults if specified
|
||||
|
||||
[ostree]
|
||||
# OSTree configuration overrides
|
||||
# These settings will be used instead of system defaults if specified
|
||||
|
||||
[security]
|
||||
# Security settings
|
||||
# Enable package signature verification
|
||||
verify_signatures = true
|
||||
|
||||
# Enable sandboxing for package operations
|
||||
enable_sandbox = true
|
||||
EOF
|
||||
chmod 644 "$CONFIG_DIR/config.toml"
|
||||
echo "Created default configuration file: $CONFIG_DIR/config.toml"
|
||||
fi
|
||||
|
||||
# Create log rotation configuration
|
||||
if [ ! -f "/etc/logrotate.d/apt-ostree" ]; then
|
||||
cat > "/etc/logrotate.d/apt-ostree" << 'EOF'
|
||||
/var/log/apt-ostree/*.log {
|
||||
daily
|
||||
missingok
|
||||
rotate 7
|
||||
compress
|
||||
delaycompress
|
||||
notifempty
|
||||
create 644 root root
|
||||
postrotate
|
||||
# Reload any services if needed
|
||||
systemctl reload apt-ostree > /dev/null 2>&1 || true
|
||||
endscript
|
||||
}
|
||||
EOF
|
||||
chmod 644 "/etc/logrotate.d/apt-ostree"
|
||||
echo "Created log rotation configuration"
|
||||
fi
|
||||
|
||||
# Check if OSTree is available and configured
|
||||
if command -v ostree >/dev/null 2>&1; then
|
||||
echo "OSTree is available on the system"
|
||||
|
||||
# Check if OSTree repository exists
|
||||
if [ -d "$OSTREE_DIR" ]; then
|
||||
echo "OSTree repository directory exists: $OSTREE_DIR"
|
||||
else
|
||||
echo "Note: OSTree repository directory does not exist: $OSTREE_DIR"
|
||||
echo "You may need to initialize OSTree before using apt-ostree"
|
||||
fi
|
||||
else
|
||||
echo "Warning: OSTree is not available on the system"
|
||||
echo "apt-ostree requires OSTree to function properly"
|
||||
echo "Please install the 'ostree' package"
|
||||
fi
|
||||
|
||||
# Update shell completion caches
|
||||
if command -v update-bash-completion >/dev/null 2>&1; then
|
||||
update-bash-completion apt-ostree || true
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
|
||||
echo "$PACKAGE configuration completed successfully"
|
||||
log "Configuring apt-ostree package..."
|
||||
setup_completions
|
||||
check_dependencies
|
||||
log "Configuration completed successfully"
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
# Handle upgrade/removal failures
|
||||
echo "Aborting $PACKAGE configuration..."
|
||||
# Do nothing on abort
|
||||
;;
|
||||
|
||||
triggered)
|
||||
# Handle trigger activation (e.g., man page updates, shell completion)
|
||||
echo "Handling $PACKAGE triggers..."
|
||||
|
||||
# Update shell completion caches
|
||||
if command -v update-bash-completion >/dev/null 2>&1; then
|
||||
update-bash-completion apt-ostree || true
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
|
||||
echo "$PACKAGE triggers handled successfully"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
log "Unknown action: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Exit successfully
|
||||
exit 0
|
||||
|
|
|
|||
166
debian/apt-ostree.postrm
vendored
166
debian/apt-ostree.postrm
vendored
|
|
@ -1,132 +1,66 @@
|
|||
#!/bin/sh
|
||||
# postrm script for apt-ostree
|
||||
#
|
||||
# This script is executed after the package is removed.
|
||||
# It handles post-removal cleanup tasks such as removing
|
||||
# configuration files, cleaning up temporary files, and
|
||||
# updating system caches.
|
||||
|
||||
set -e
|
||||
|
||||
# Package name
|
||||
# Source debconf library
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Define package name
|
||||
PACKAGE="apt-ostree"
|
||||
|
||||
# Configuration directories
|
||||
CONFIG_DIR="/etc/apt-ostree"
|
||||
DATA_DIR="/var/lib/apt-ostree"
|
||||
LOG_DIR="/var/log/apt-ostree"
|
||||
# Function to log messages
|
||||
log() {
|
||||
echo "$PACKAGE: $1" >&2
|
||||
}
|
||||
|
||||
# Function to cleanup shell completions
|
||||
cleanup_completions() {
|
||||
log "Cleaning up shell completions..."
|
||||
|
||||
# Remove bash completion
|
||||
if [ -f /usr/share/bash-completion/completions/apt-ostree ]; then
|
||||
rm -f /usr/share/bash-completion/completions/apt-ostree
|
||||
fi
|
||||
|
||||
# Remove zsh completion
|
||||
if [ -f /usr/share/zsh/vendor-completions/_apt-ostree ]; then
|
||||
rm -f /usr/share/zsh/vendor-completions/_apt-ostree
|
||||
fi
|
||||
|
||||
# Reload bash completion if available (skip if problematic)
|
||||
# if [ -f /etc/bash_completion ]; then
|
||||
# . /etc/bash_completion
|
||||
# fi
|
||||
}
|
||||
|
||||
# Function to cleanup man pages
|
||||
cleanup_man_pages() {
|
||||
log "Cleaning up man pages..."
|
||||
|
||||
# Remove man page
|
||||
if [ -f /usr/share/man/man1/apt-ostree.1 ]; then
|
||||
rm -f /usr/share/man/man1/apt-ostree.1
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
}
|
||||
|
||||
# Main execution
|
||||
case "$1" in
|
||||
remove)
|
||||
echo "Post-removal cleanup for $PACKAGE..."
|
||||
|
||||
# Remove configuration files
|
||||
if [ -d "$CONFIG_DIR" ]; then
|
||||
echo "Removing configuration directory: $CONFIG_DIR"
|
||||
rm -rf "$CONFIG_DIR"
|
||||
fi
|
||||
|
||||
# Remove data directory
|
||||
if [ -d "$DATA_DIR" ]; then
|
||||
echo "Removing data directory: $DATA_DIR"
|
||||
rm -rf "$DATA_DIR"
|
||||
fi
|
||||
|
||||
# Remove log directory
|
||||
if [ -d "$LOG_DIR" ]; then
|
||||
echo "Removing log directory: $LOG_DIR"
|
||||
rm -rf "$LOG_DIR"
|
||||
fi
|
||||
|
||||
# Remove log rotation configuration
|
||||
if [ -f "/etc/logrotate.d/apt-ostree" ]; then
|
||||
echo "Removing log rotation configuration"
|
||||
rm -f "/etc/logrotate.d/apt-ostree"
|
||||
fi
|
||||
|
||||
# Remove shell completion files
|
||||
if [ -f "/usr/share/bash-completion/completions/apt-ostree" ]; then
|
||||
echo "Removing bash completion file"
|
||||
rm -f "/usr/share/bash-completion/completions/apt-ostree"
|
||||
fi
|
||||
|
||||
if [ -f "/usr/share/zsh/vendor-completions/_apt-ostree" ]; then
|
||||
echo "Removing zsh completion file"
|
||||
rm -f "/usr/share/zsh/vendor-completions/_apt-ostree"
|
||||
fi
|
||||
|
||||
# Update shell completion caches
|
||||
if command -v update-bash-completion >/dev/null 2>&1; then
|
||||
update-bash-completion apt-ostree || true
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
|
||||
echo "$PACKAGE post-removal cleanup completed"
|
||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
cleanup_completions
|
||||
cleanup_man_pages
|
||||
;;
|
||||
|
||||
purge)
|
||||
echo "Post-purge cleanup for $PACKAGE..."
|
||||
|
||||
# Remove all remaining files and directories
|
||||
if [ -d "$CONFIG_DIR" ]; then
|
||||
echo "Removing configuration directory: $CONFIG_DIR"
|
||||
rm -rf "$CONFIG_DIR"
|
||||
fi
|
||||
|
||||
if [ -d "$DATA_DIR" ]; then
|
||||
echo "Removing data directory: $DATA_DIR"
|
||||
rm -rf "$DATA_DIR"
|
||||
fi
|
||||
|
||||
if [ -d "$LOG_DIR" ]; then
|
||||
echo "Removing log directory: $LOG_DIR"
|
||||
rm -rf "$LOG_DIR"
|
||||
fi
|
||||
|
||||
# Remove any remaining configuration files
|
||||
if [ -f "/etc/logrotate.d/apt-ostree" ]; then
|
||||
echo "Removing log rotation configuration"
|
||||
rm -f "/etc/logrotate.d/apt-ostree"
|
||||
fi
|
||||
|
||||
# Remove shell completion files
|
||||
if [ -f "/usr/share/bash-completion/completions/apt-ostree" ]; then
|
||||
echo "Removing bash completion file"
|
||||
rm -f "/usr/share/bash-completion/completions/apt-ostree"
|
||||
fi
|
||||
|
||||
if [ -f "/usr/share/zsh/vendor-completions/_apt-ostree" ]; then
|
||||
echo "Removing zsh completion file"
|
||||
rm -f "/usr/share/zsh/vendor-completions/_apt-ostree"
|
||||
fi
|
||||
|
||||
# Update shell completion caches
|
||||
if command -v update-bash-completion >/dev/null 2>&1; then
|
||||
update-bash-completion apt-ostree || true
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
|
||||
echo "$PACKAGE post-purge cleanup completed"
|
||||
cleanup_completions
|
||||
cleanup_man_pages
|
||||
;;
|
||||
|
||||
upgrade|failed-upgrade|abort-install|abort-upgrade|abort-remove|abort-deconfigure)
|
||||
echo "Post-operation cleanup for $PACKAGE..."
|
||||
# Nothing special needed for these operations
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
log "Unknown action: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Exit successfully
|
||||
exit 0
|
||||
|
|
|
|||
2
debian/apt-ostree.substvars
vendored
2
debian/apt-ostree.substvars
vendored
|
|
@ -1,3 +1,3 @@
|
|||
shlibs:Depends=libapt-pkg7.0 (>= 3.0.0), libc6 (>= 2.39), libgcc-s1 (>= 4.2), libstdc++6 (>= 5)
|
||||
shlibs:Depends=libc6 (>= 2.39), libgcc-s1 (>= 4.2)
|
||||
misc:Depends=
|
||||
misc:Pre-Depends=
|
||||
|
|
|
|||
12
debian/apt-ostree.triggers
vendored
12
debian/apt-ostree.triggers
vendored
|
|
@ -1,13 +1,9 @@
|
|||
# apt-ostree package triggers
|
||||
# This file defines triggers that should be activated when certain events occur
|
||||
# This file defines triggers that are activated when certain events occur
|
||||
|
||||
# Trigger for man page database updates
|
||||
interest-noawait /usr/share/man
|
||||
|
||||
# Trigger for shell completion updates
|
||||
# Trigger when shell completions are updated
|
||||
interest-noawait /usr/share/bash-completion/completions
|
||||
interest-noawait /usr/share/zsh/vendor-completions
|
||||
|
||||
# Trigger for systemd unit file reloads (if we add services later)
|
||||
# interest-noawait /lib/systemd/system
|
||||
# interest-noawait /etc/systemd/system
|
||||
# Trigger when man pages are updated
|
||||
interest-noawait /usr/share/man
|
||||
|
|
|
|||
6
debian/apt-ostree/DEBIAN/control
vendored
6
debian/apt-ostree/DEBIAN/control
vendored
|
|
@ -2,8 +2,8 @@ Package: apt-ostree
|
|||
Version: 0.1.0-2
|
||||
Architecture: amd64
|
||||
Maintainer: Robojerk <robojerk@example.com>
|
||||
Installed-Size: 3128
|
||||
Depends: libapt-pkg7.0 (>= 3.0.0), libc6 (>= 2.39), libgcc-s1 (>= 4.2), libstdc++6 (>= 5), libostree-1-1 (>= 2025.2), ostree, systemd
|
||||
Installed-Size: 3655
|
||||
Depends: libc6 (>= 2.39), libgcc-s1 (>= 4.2), libostree-1-1 (>= 2025.2), ostree, systemd, libapt-pkg7.0 (>= 3.0.0), apt-ostreed (= 0.1.0-2)
|
||||
Section: admin
|
||||
Priority: optional
|
||||
Homepage: https://github.com/robojerk/apt-ostree
|
||||
|
|
@ -14,3 +14,5 @@ Description: Debian/Ubuntu equivalent of rpm-ostree
|
|||
It provides functionality similar to rpm-ostree but adapted for
|
||||
APT package management, enabling atomic updates and rollbacks
|
||||
on Debian-based systems.
|
||||
.
|
||||
This package contains the command-line interface and user tools.
|
||||
|
|
|
|||
2
debian/apt-ostree/DEBIAN/md5sums
vendored
2
debian/apt-ostree/DEBIAN/md5sums
vendored
|
|
@ -1,4 +1,4 @@
|
|||
07d8ed90aad5df0f3454fef2962995e6 usr/bin/apt-ostree
|
||||
fdb041b5a80001bc08f3f94bcb3daf37 usr/bin/apt-ostree
|
||||
3aa6e44bf07699d5bd7a2e5b3d66ce65 usr/share/bash-completion/completions/apt-ostree
|
||||
3147ea2bb732b3d1e98d33a23349aafd usr/share/doc/apt-ostree/README.Debian
|
||||
ef4534c1d6bff0d781fd07636f4dec03 usr/share/doc/apt-ostree/changelog.Debian.gz
|
||||
|
|
|
|||
180
debian/apt-ostree/DEBIAN/postinst
vendored
180
debian/apt-ostree/DEBIAN/postinst
vendored
|
|
@ -1,154 +1,68 @@
|
|||
#!/bin/sh
|
||||
# postinst script for apt-ostree
|
||||
#
|
||||
# This script is executed after the package is unpacked and configured.
|
||||
# It handles post-installation tasks such as creating directories,
|
||||
# setting up configuration files, and updating system caches.
|
||||
|
||||
set -e
|
||||
|
||||
# Source debconf library
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Package name
|
||||
# Define package name
|
||||
PACKAGE="apt-ostree"
|
||||
|
||||
# Configuration directories
|
||||
CONFIG_DIR="/etc/apt-ostree"
|
||||
DATA_DIR="/var/lib/apt-ostree"
|
||||
LOG_DIR="/var/log/apt-ostree"
|
||||
# Function to log messages
|
||||
log() {
|
||||
echo "$PACKAGE: $1" >&2
|
||||
}
|
||||
|
||||
# OSTree system directory
|
||||
OSTREE_DIR="/ostree"
|
||||
# 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)
|
||||
echo "Configuring $PACKAGE..."
|
||||
|
||||
# Create necessary directories
|
||||
mkdir -p "$CONFIG_DIR"
|
||||
mkdir -p "$DATA_DIR"
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
# Set proper permissions
|
||||
chmod 755 "$CONFIG_DIR"
|
||||
chmod 755 "$DATA_DIR"
|
||||
chmod 755 "$LOG_DIR"
|
||||
|
||||
# Create default configuration file if it doesn't exist
|
||||
if [ ! -f "$CONFIG_DIR/config.toml" ]; then
|
||||
cat > "$CONFIG_DIR/config.toml" << 'EOF'
|
||||
# apt-ostree configuration file
|
||||
# Generated automatically during package installation
|
||||
|
||||
[general]
|
||||
# Log level: trace, debug, info, warn, error
|
||||
log_level = "info"
|
||||
|
||||
# Data directory for apt-ostree
|
||||
data_dir = "/var/lib/apt-ostree"
|
||||
|
||||
# OSTree system directory
|
||||
ostree_dir = "/ostree"
|
||||
|
||||
[apt]
|
||||
# APT configuration overrides
|
||||
# These settings will be used instead of system defaults if specified
|
||||
|
||||
[ostree]
|
||||
# OSTree configuration overrides
|
||||
# These settings will be used instead of system defaults if specified
|
||||
|
||||
[security]
|
||||
# Security settings
|
||||
# Enable package signature verification
|
||||
verify_signatures = true
|
||||
|
||||
# Enable sandboxing for package operations
|
||||
enable_sandbox = true
|
||||
EOF
|
||||
chmod 644 "$CONFIG_DIR/config.toml"
|
||||
echo "Created default configuration file: $CONFIG_DIR/config.toml"
|
||||
fi
|
||||
|
||||
# Create log rotation configuration
|
||||
if [ ! -f "/etc/logrotate.d/apt-ostree" ]; then
|
||||
cat > "/etc/logrotate.d/apt-ostree" << 'EOF'
|
||||
/var/log/apt-ostree/*.log {
|
||||
daily
|
||||
missingok
|
||||
rotate 7
|
||||
compress
|
||||
delaycompress
|
||||
notifempty
|
||||
create 644 root root
|
||||
postrotate
|
||||
# Reload any services if needed
|
||||
systemctl reload apt-ostree > /dev/null 2>&1 || true
|
||||
endscript
|
||||
}
|
||||
EOF
|
||||
chmod 644 "/etc/logrotate.d/apt-ostree"
|
||||
echo "Created log rotation configuration"
|
||||
fi
|
||||
|
||||
# Check if OSTree is available and configured
|
||||
if command -v ostree >/dev/null 2>&1; then
|
||||
echo "OSTree is available on the system"
|
||||
|
||||
# Check if OSTree repository exists
|
||||
if [ -d "$OSTREE_DIR" ]; then
|
||||
echo "OSTree repository directory exists: $OSTREE_DIR"
|
||||
else
|
||||
echo "Note: OSTree repository directory does not exist: $OSTREE_DIR"
|
||||
echo "You may need to initialize OSTree before using apt-ostree"
|
||||
fi
|
||||
else
|
||||
echo "Warning: OSTree is not available on the system"
|
||||
echo "apt-ostree requires OSTree to function properly"
|
||||
echo "Please install the 'ostree' package"
|
||||
fi
|
||||
|
||||
# Update shell completion caches
|
||||
if command -v update-bash-completion >/dev/null 2>&1; then
|
||||
update-bash-completion apt-ostree || true
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
|
||||
echo "$PACKAGE configuration completed successfully"
|
||||
log "Configuring apt-ostree package..."
|
||||
setup_completions
|
||||
check_dependencies
|
||||
log "Configuration completed successfully"
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
# Handle upgrade/removal failures
|
||||
echo "Aborting $PACKAGE configuration..."
|
||||
# Do nothing on abort
|
||||
;;
|
||||
|
||||
triggered)
|
||||
# Handle trigger activation (e.g., man page updates, shell completion)
|
||||
echo "Handling $PACKAGE triggers..."
|
||||
|
||||
# Update shell completion caches
|
||||
if command -v update-bash-completion >/dev/null 2>&1; then
|
||||
update-bash-completion apt-ostree || true
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
|
||||
echo "$PACKAGE triggers handled successfully"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postinst called with unknown argument \`$1'" >&2
|
||||
log "Unknown action: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Exit successfully
|
||||
exit 0
|
||||
|
|
|
|||
166
debian/apt-ostree/DEBIAN/postrm
vendored
166
debian/apt-ostree/DEBIAN/postrm
vendored
|
|
@ -1,132 +1,66 @@
|
|||
#!/bin/sh
|
||||
# postrm script for apt-ostree
|
||||
#
|
||||
# This script is executed after the package is removed.
|
||||
# It handles post-removal cleanup tasks such as removing
|
||||
# configuration files, cleaning up temporary files, and
|
||||
# updating system caches.
|
||||
|
||||
set -e
|
||||
|
||||
# Package name
|
||||
# Source debconf library
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Define package name
|
||||
PACKAGE="apt-ostree"
|
||||
|
||||
# Configuration directories
|
||||
CONFIG_DIR="/etc/apt-ostree"
|
||||
DATA_DIR="/var/lib/apt-ostree"
|
||||
LOG_DIR="/var/log/apt-ostree"
|
||||
# Function to log messages
|
||||
log() {
|
||||
echo "$PACKAGE: $1" >&2
|
||||
}
|
||||
|
||||
# Function to cleanup shell completions
|
||||
cleanup_completions() {
|
||||
log "Cleaning up shell completions..."
|
||||
|
||||
# Remove bash completion
|
||||
if [ -f /usr/share/bash-completion/completions/apt-ostree ]; then
|
||||
rm -f /usr/share/bash-completion/completions/apt-ostree
|
||||
fi
|
||||
|
||||
# Remove zsh completion
|
||||
if [ -f /usr/share/zsh/vendor-completions/_apt-ostree ]; then
|
||||
rm -f /usr/share/zsh/vendor-completions/_apt-ostree
|
||||
fi
|
||||
|
||||
# Reload bash completion if available (skip if problematic)
|
||||
# if [ -f /etc/bash_completion ]; then
|
||||
# . /etc/bash_completion
|
||||
# fi
|
||||
}
|
||||
|
||||
# Function to cleanup man pages
|
||||
cleanup_man_pages() {
|
||||
log "Cleaning up man pages..."
|
||||
|
||||
# Remove man page
|
||||
if [ -f /usr/share/man/man1/apt-ostree.1 ]; then
|
||||
rm -f /usr/share/man/man1/apt-ostree.1
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
}
|
||||
|
||||
# Main execution
|
||||
case "$1" in
|
||||
remove)
|
||||
echo "Post-removal cleanup for $PACKAGE..."
|
||||
|
||||
# Remove configuration files
|
||||
if [ -d "$CONFIG_DIR" ]; then
|
||||
echo "Removing configuration directory: $CONFIG_DIR"
|
||||
rm -rf "$CONFIG_DIR"
|
||||
fi
|
||||
|
||||
# Remove data directory
|
||||
if [ -d "$DATA_DIR" ]; then
|
||||
echo "Removing data directory: $DATA_DIR"
|
||||
rm -rf "$DATA_DIR"
|
||||
fi
|
||||
|
||||
# Remove log directory
|
||||
if [ -d "$LOG_DIR" ]; then
|
||||
echo "Removing log directory: $LOG_DIR"
|
||||
rm -rf "$LOG_DIR"
|
||||
fi
|
||||
|
||||
# Remove log rotation configuration
|
||||
if [ -f "/etc/logrotate.d/apt-ostree" ]; then
|
||||
echo "Removing log rotation configuration"
|
||||
rm -f "/etc/logrotate.d/apt-ostree"
|
||||
fi
|
||||
|
||||
# Remove shell completion files
|
||||
if [ -f "/usr/share/bash-completion/completions/apt-ostree" ]; then
|
||||
echo "Removing bash completion file"
|
||||
rm -f "/usr/share/bash-completion/completions/apt-ostree"
|
||||
fi
|
||||
|
||||
if [ -f "/usr/share/zsh/vendor-completions/_apt-ostree" ]; then
|
||||
echo "Removing zsh completion file"
|
||||
rm -f "/usr/share/zsh/vendor-completions/_apt-ostree"
|
||||
fi
|
||||
|
||||
# Update shell completion caches
|
||||
if command -v update-bash-completion >/dev/null 2>&1; then
|
||||
update-bash-completion apt-ostree || true
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
|
||||
echo "$PACKAGE post-removal cleanup completed"
|
||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
cleanup_completions
|
||||
cleanup_man_pages
|
||||
;;
|
||||
|
||||
purge)
|
||||
echo "Post-purge cleanup for $PACKAGE..."
|
||||
|
||||
# Remove all remaining files and directories
|
||||
if [ -d "$CONFIG_DIR" ]; then
|
||||
echo "Removing configuration directory: $CONFIG_DIR"
|
||||
rm -rf "$CONFIG_DIR"
|
||||
fi
|
||||
|
||||
if [ -d "$DATA_DIR" ]; then
|
||||
echo "Removing data directory: $DATA_DIR"
|
||||
rm -rf "$DATA_DIR"
|
||||
fi
|
||||
|
||||
if [ -d "$LOG_DIR" ]; then
|
||||
echo "Removing log directory: $LOG_DIR"
|
||||
rm -rf "$LOG_DIR"
|
||||
fi
|
||||
|
||||
# Remove any remaining configuration files
|
||||
if [ -f "/etc/logrotate.d/apt-ostree" ]; then
|
||||
echo "Removing log rotation configuration"
|
||||
rm -f "/etc/logrotate.d/apt-ostree"
|
||||
fi
|
||||
|
||||
# Remove shell completion files
|
||||
if [ -f "/usr/share/bash-completion/completions/apt-ostree" ]; then
|
||||
echo "Removing bash completion file"
|
||||
rm -f "/usr/share/bash-completion/completions/apt-ostree"
|
||||
fi
|
||||
|
||||
if [ -f "/usr/share/zsh/vendor-completions/_apt-ostree" ]; then
|
||||
echo "Removing zsh completion file"
|
||||
rm -f "/usr/share/zsh/vendor-completions/_apt-ostree"
|
||||
fi
|
||||
|
||||
# Update shell completion caches
|
||||
if command -v update-bash-completion >/dev/null 2>&1; then
|
||||
update-bash-completion apt-ostree || true
|
||||
fi
|
||||
|
||||
# Update man page database
|
||||
if command -v mandb >/dev/null 2>&1; then
|
||||
mandb -q || true
|
||||
fi
|
||||
|
||||
echo "$PACKAGE post-purge cleanup completed"
|
||||
cleanup_completions
|
||||
cleanup_man_pages
|
||||
;;
|
||||
|
||||
upgrade|failed-upgrade|abort-install|abort-upgrade|abort-remove|abort-deconfigure)
|
||||
echo "Post-operation cleanup for $PACKAGE..."
|
||||
# Nothing special needed for these operations
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
log "Unknown action: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Exit successfully
|
||||
exit 0
|
||||
|
|
|
|||
12
debian/apt-ostree/DEBIAN/triggers
vendored
12
debian/apt-ostree/DEBIAN/triggers
vendored
|
|
@ -1,13 +1,9 @@
|
|||
# apt-ostree package triggers
|
||||
# This file defines triggers that should be activated when certain events occur
|
||||
# This file defines triggers that are activated when certain events occur
|
||||
|
||||
# Trigger for man page database updates
|
||||
interest-noawait /usr/share/man
|
||||
|
||||
# Trigger for shell completion updates
|
||||
# Trigger when shell completions are updated
|
||||
interest-noawait /usr/share/bash-completion/completions
|
||||
interest-noawait /usr/share/zsh/vendor-completions
|
||||
|
||||
# Trigger for systemd unit file reloads (if we add services later)
|
||||
# interest-noawait /lib/systemd/system
|
||||
# interest-noawait /etc/systemd/system
|
||||
# Trigger when man pages are updated
|
||||
interest-noawait /usr/share/man
|
||||
|
|
|
|||
1
debian/apt-ostreed.conffiles
vendored
Normal file
1
debian/apt-ostreed.conffiles
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/etc/apt-ostreed/apt-ostreed.conf
|
||||
104
debian/apt-ostreed.postinst
vendored
Executable file
104
debian/apt-ostreed.postinst
vendored
Executable file
|
|
@ -0,0 +1,104 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Source debconf library
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Define package name
|
||||
PACKAGE="apt-ostreed"
|
||||
|
||||
# Function to log messages
|
||||
log() {
|
||||
echo "$PACKAGE: $1" >&2
|
||||
}
|
||||
|
||||
# Function to check if systemd is available
|
||||
check_systemd() {
|
||||
if ! command -v systemctl >/dev/null 2>&1; then
|
||||
log "Warning: systemd not available, skipping service setup"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Function to enable and start the service
|
||||
setup_service() {
|
||||
if ! check_systemd; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
log "Setting up apt-ostreed service..."
|
||||
|
||||
# Reload systemd daemon
|
||||
systemctl daemon-reload
|
||||
|
||||
# Enable the service
|
||||
if systemctl enable apt-ostreed.service; then
|
||||
log "apt-ostreed service enabled"
|
||||
else
|
||||
log "Warning: Failed to enable apt-ostreed service"
|
||||
fi
|
||||
|
||||
# Start the service if not running
|
||||
if ! systemctl is-active --quiet apt-ostreed.service; then
|
||||
if systemctl start apt-ostreed.service; then
|
||||
log "apt-ostreed service started"
|
||||
else
|
||||
log "Warning: Failed to start apt-ostreed service"
|
||||
fi
|
||||
else
|
||||
log "apt-ostreed service already running"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to setup directories and permissions
|
||||
setup_directories() {
|
||||
log "Setting up directories and permissions..."
|
||||
|
||||
# Create necessary directories with proper permissions
|
||||
mkdir -p /var/log/apt-ostreed
|
||||
mkdir -p /var/cache/apt-ostree
|
||||
mkdir -p /var/lib/apt-ostree
|
||||
mkdir -p /var/lib/apt-ostree/repo
|
||||
|
||||
# Set proper ownership (root:root)
|
||||
chown root:root /var/log/apt-ostreed
|
||||
chown root:root /var/cache/apt-ostree
|
||||
chown root:root /var/lib/apt-ostree
|
||||
chown root:root /var/lib/apt-ostree/repo
|
||||
|
||||
# Set proper permissions
|
||||
chmod 755 /var/log/apt-ostreed
|
||||
chmod 755 /var/cache/apt-ostree
|
||||
chmod 755 /var/lib/apt-ostree
|
||||
chmod 755 /var/lib/apt-ostree/repo
|
||||
}
|
||||
|
||||
# Function to reload polkit rules
|
||||
reload_polkit() {
|
||||
if command -v pkaction >/dev/null 2>&1; then
|
||||
log "Reloading polkit rules..."
|
||||
# This will trigger polkit to reload its rules
|
||||
pkaction --version >/dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
|
||||
# Main execution
|
||||
case "$1" in
|
||||
configure)
|
||||
log "Configuring apt-ostreed package..."
|
||||
setup_directories
|
||||
setup_service
|
||||
reload_polkit
|
||||
log "Configuration completed successfully"
|
||||
;;
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
# Do nothing on abort
|
||||
;;
|
||||
*)
|
||||
log "Unknown action: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
86
debian/apt-ostreed.postrm
vendored
Executable file
86
debian/apt-ostreed.postrm
vendored
Executable file
|
|
@ -0,0 +1,86 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Source debconf library
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Define package name
|
||||
PACKAGE="apt-ostreed"
|
||||
|
||||
# Function to log messages
|
||||
log() {
|
||||
echo "$PACKAGE: $1" >&2
|
||||
}
|
||||
|
||||
# Function to check if systemd is available
|
||||
check_systemd() {
|
||||
if ! command -v systemctl >/dev/null 2>&1; then
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Function to stop and disable the service
|
||||
cleanup_service() {
|
||||
if ! check_systemd; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
log "Cleaning up apt-ostreed service..."
|
||||
|
||||
# Stop the service if running
|
||||
if systemctl is-active --quiet apt-ostreed.service; then
|
||||
if systemctl stop apt-ostreed.service; then
|
||||
log "apt-ostreed service stopped"
|
||||
else
|
||||
log "Warning: Failed to stop apt-ostreed service"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Disable the service
|
||||
if systemctl is-enabled --quiet apt-ostreed.service; then
|
||||
if systemctl disable apt-ostreed.service; then
|
||||
log "apt-ostreed service disabled"
|
||||
else
|
||||
log "Warning: Failed to disable apt-ostreed service"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Reload systemd daemon
|
||||
systemctl daemon-reload
|
||||
}
|
||||
|
||||
# Function to cleanup directories (only on purge)
|
||||
cleanup_directories() {
|
||||
if [ "$1" = "purge" ]; then
|
||||
log "Purging apt-ostreed directories..."
|
||||
|
||||
# Remove log files (but keep directory structure)
|
||||
rm -f /var/log/apt-ostreed/*
|
||||
|
||||
# Remove cache files (but keep directory structure)
|
||||
rm -rf /var/cache/apt-ostree/*
|
||||
|
||||
# Remove state files (but keep directory structure)
|
||||
rm -rf /var/lib/apt-ostree/*
|
||||
|
||||
log "Directory cleanup completed"
|
||||
fi
|
||||
}
|
||||
|
||||
# Main execution
|
||||
case "$1" in
|
||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
cleanup_service
|
||||
;;
|
||||
purge)
|
||||
cleanup_service
|
||||
cleanup_directories "$1"
|
||||
;;
|
||||
*)
|
||||
log "Unknown action: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
12
debian/apt-ostreed.postrm.debhelper
vendored
Normal file
12
debian/apt-ostreed.postrm.debhelper
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Automatically added by dh_installsystemd/13.24.2
|
||||
if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installsystemd/13.24.2
|
||||
if [ "$1" = "purge" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge 'apt-ostreed.service' 'apt-ostreed.socket' >/dev/null || true
|
||||
fi
|
||||
fi
|
||||
# End automatically added section
|
||||
3
debian/apt-ostreed.substvars
vendored
Normal file
3
debian/apt-ostreed.substvars
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
shlibs:Depends=libc6 (>= 2.39), libgcc-s1 (>= 4.2)
|
||||
misc:Depends=
|
||||
misc:Pre-Depends=
|
||||
11
debian/apt-ostreed.triggers
vendored
Normal file
11
debian/apt-ostreed.triggers
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# apt-ostreed package triggers
|
||||
# This file defines triggers that are activated when certain events occur
|
||||
|
||||
# Trigger when polkit rules are updated
|
||||
interest-noawait /usr/share/polkit-1/actions
|
||||
|
||||
# Trigger when systemd units are updated
|
||||
interest-noawait /lib/systemd/system
|
||||
|
||||
# Trigger when D-Bus configuration is updated
|
||||
interest-noawait /usr/share/dbus-1/system-services
|
||||
2
debian/apt-ostreed/DEBIAN/conffiles
vendored
Normal file
2
debian/apt-ostreed/DEBIAN/conffiles
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/etc/apt-ostreed/apt-ostreed.conf
|
||||
/etc/apt-ostreed/apt-ostreed.conf
|
||||
19
debian/apt-ostreed/DEBIAN/control
vendored
Normal file
19
debian/apt-ostreed/DEBIAN/control
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Package: apt-ostreed
|
||||
Source: apt-ostree
|
||||
Version: 0.1.0-2
|
||||
Architecture: amd64
|
||||
Maintainer: Robojerk <robojerk@example.com>
|
||||
Installed-Size: 3057
|
||||
Depends: libc6 (>= 2.39), libgcc-s1 (>= 4.2), libostree-1-1 (>= 2025.2), ostree, systemd, libapt-pkg7.0 (>= 3.0.0), polkitd, dbus
|
||||
Section: admin
|
||||
Priority: optional
|
||||
Homepage: https://github.com/robojerk/apt-ostree
|
||||
Description: apt-ostree system management daemon
|
||||
apt-ostreed is the system daemon for apt-ostree that provides
|
||||
DBus interface for system management operations.
|
||||
.
|
||||
This package contains the daemon service and related system
|
||||
integration files.
|
||||
.
|
||||
The daemon runs with elevated privileges and provides secure
|
||||
access to system management functions through D-Bus.
|
||||
6
debian/apt-ostreed/DEBIAN/md5sums
vendored
Normal file
6
debian/apt-ostreed/DEBIAN/md5sums
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
a485e242b07f321593e7711f9f7b43d7 lib/systemd/system/apt-ostreed.service
|
||||
bd58c49830864047894e04d986d850db lib/systemd/system/apt-ostreed.socket
|
||||
4452bbe3bf30b1cba418ccbfbf35c0de usr/libexec/apt-ostreed
|
||||
ef4534c1d6bff0d781fd07636f4dec03 usr/share/doc/apt-ostreed/changelog.Debian.gz
|
||||
25df758a27389af0cfd52f4dce60ccce usr/share/doc/apt-ostreed/copyright
|
||||
863ffbba8bf3105e2cb0c34c90bf5cbe usr/share/polkit-1/actions/org.projectatomic.aptostree1.policy
|
||||
104
debian/apt-ostreed/DEBIAN/postinst
vendored
Executable file
104
debian/apt-ostreed/DEBIAN/postinst
vendored
Executable file
|
|
@ -0,0 +1,104 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Source debconf library
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Define package name
|
||||
PACKAGE="apt-ostreed"
|
||||
|
||||
# Function to log messages
|
||||
log() {
|
||||
echo "$PACKAGE: $1" >&2
|
||||
}
|
||||
|
||||
# Function to check if systemd is available
|
||||
check_systemd() {
|
||||
if ! command -v systemctl >/dev/null 2>&1; then
|
||||
log "Warning: systemd not available, skipping service setup"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Function to enable and start the service
|
||||
setup_service() {
|
||||
if ! check_systemd; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
log "Setting up apt-ostreed service..."
|
||||
|
||||
# Reload systemd daemon
|
||||
systemctl daemon-reload
|
||||
|
||||
# Enable the service
|
||||
if systemctl enable apt-ostreed.service; then
|
||||
log "apt-ostreed service enabled"
|
||||
else
|
||||
log "Warning: Failed to enable apt-ostreed service"
|
||||
fi
|
||||
|
||||
# Start the service if not running
|
||||
if ! systemctl is-active --quiet apt-ostreed.service; then
|
||||
if systemctl start apt-ostreed.service; then
|
||||
log "apt-ostreed service started"
|
||||
else
|
||||
log "Warning: Failed to start apt-ostreed service"
|
||||
fi
|
||||
else
|
||||
log "apt-ostreed service already running"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to setup directories and permissions
|
||||
setup_directories() {
|
||||
log "Setting up directories and permissions..."
|
||||
|
||||
# Create necessary directories with proper permissions
|
||||
mkdir -p /var/log/apt-ostreed
|
||||
mkdir -p /var/cache/apt-ostree
|
||||
mkdir -p /var/lib/apt-ostree
|
||||
mkdir -p /var/lib/apt-ostree/repo
|
||||
|
||||
# Set proper ownership (root:root)
|
||||
chown root:root /var/log/apt-ostreed
|
||||
chown root:root /var/cache/apt-ostree
|
||||
chown root:root /var/lib/apt-ostree
|
||||
chown root:root /var/lib/apt-ostree/repo
|
||||
|
||||
# Set proper permissions
|
||||
chmod 755 /var/log/apt-ostreed
|
||||
chmod 755 /var/cache/apt-ostree
|
||||
chmod 755 /var/lib/apt-ostree
|
||||
chmod 755 /var/lib/apt-ostree/repo
|
||||
}
|
||||
|
||||
# Function to reload polkit rules
|
||||
reload_polkit() {
|
||||
if command -v pkaction >/dev/null 2>&1; then
|
||||
log "Reloading polkit rules..."
|
||||
# This will trigger polkit to reload its rules
|
||||
pkaction --version >/dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
|
||||
# Main execution
|
||||
case "$1" in
|
||||
configure)
|
||||
log "Configuring apt-ostreed package..."
|
||||
setup_directories
|
||||
setup_service
|
||||
reload_polkit
|
||||
log "Configuration completed successfully"
|
||||
;;
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
# Do nothing on abort
|
||||
;;
|
||||
*)
|
||||
log "Unknown action: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
86
debian/apt-ostreed/DEBIAN/postrm
vendored
Executable file
86
debian/apt-ostreed/DEBIAN/postrm
vendored
Executable file
|
|
@ -0,0 +1,86 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Source debconf library
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
# Define package name
|
||||
PACKAGE="apt-ostreed"
|
||||
|
||||
# Function to log messages
|
||||
log() {
|
||||
echo "$PACKAGE: $1" >&2
|
||||
}
|
||||
|
||||
# Function to check if systemd is available
|
||||
check_systemd() {
|
||||
if ! command -v systemctl >/dev/null 2>&1; then
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Function to stop and disable the service
|
||||
cleanup_service() {
|
||||
if ! check_systemd; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
log "Cleaning up apt-ostreed service..."
|
||||
|
||||
# Stop the service if running
|
||||
if systemctl is-active --quiet apt-ostreed.service; then
|
||||
if systemctl stop apt-ostreed.service; then
|
||||
log "apt-ostreed service stopped"
|
||||
else
|
||||
log "Warning: Failed to stop apt-ostreed service"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Disable the service
|
||||
if systemctl is-enabled --quiet apt-ostreed.service; then
|
||||
if systemctl disable apt-ostreed.service; then
|
||||
log "apt-ostreed service disabled"
|
||||
else
|
||||
log "Warning: Failed to disable apt-ostreed service"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Reload systemd daemon
|
||||
systemctl daemon-reload
|
||||
}
|
||||
|
||||
# Function to cleanup directories (only on purge)
|
||||
cleanup_directories() {
|
||||
if [ "$1" = "purge" ]; then
|
||||
log "Purging apt-ostreed directories..."
|
||||
|
||||
# Remove log files (but keep directory structure)
|
||||
rm -f /var/log/apt-ostreed/*
|
||||
|
||||
# Remove cache files (but keep directory structure)
|
||||
rm -rf /var/cache/apt-ostree/*
|
||||
|
||||
# Remove state files (but keep directory structure)
|
||||
rm -rf /var/lib/apt-ostree/*
|
||||
|
||||
log "Directory cleanup completed"
|
||||
fi
|
||||
}
|
||||
|
||||
# Main execution
|
||||
case "$1" in
|
||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
cleanup_service
|
||||
;;
|
||||
purge)
|
||||
cleanup_service
|
||||
cleanup_directories "$1"
|
||||
;;
|
||||
*)
|
||||
log "Unknown action: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
7
debian/apt-ostreed/DEBIAN/prerm
vendored
Executable file
7
debian/apt-ostreed/DEBIAN/prerm
vendored
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
# Automatically added by dh_installsystemd/13.24.2
|
||||
if [ -z "$DPKG_ROOT" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
|
||||
deb-systemd-invoke stop 'apt-ostreed.service' 'apt-ostreed.socket' >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
11
debian/apt-ostreed/DEBIAN/triggers
vendored
Normal file
11
debian/apt-ostreed/DEBIAN/triggers
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# apt-ostreed package triggers
|
||||
# This file defines triggers that are activated when certain events occur
|
||||
|
||||
# Trigger when polkit rules are updated
|
||||
interest-noawait /usr/share/polkit-1/actions
|
||||
|
||||
# Trigger when systemd units are updated
|
||||
interest-noawait /lib/systemd/system
|
||||
|
||||
# Trigger when D-Bus configuration is updated
|
||||
interest-noawait /usr/share/dbus-1/system-services
|
||||
44
debian/apt-ostreed/etc/apt-ostreed/apt-ostreed.conf
vendored
Normal file
44
debian/apt-ostreed/etc/apt-ostreed/apt-ostreed.conf
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# apt-ostreed Configuration File
|
||||
# This file configures the apt-ostree daemon behavior
|
||||
|
||||
[Daemon]
|
||||
# OSTree repository path
|
||||
RepoPath=/var/lib/apt-ostree/repo
|
||||
|
||||
# APT configuration
|
||||
AptCacheDir=/var/cache/apt-ostree
|
||||
AptStateDir=/var/lib/apt-ostree/apt
|
||||
|
||||
# Transaction management
|
||||
TransactionTimeout=300
|
||||
MaxConcurrentTransactions=1
|
||||
|
||||
# Automatic update settings
|
||||
AutomaticEnabled=false
|
||||
AutomaticSecurityOnly=true
|
||||
AutomaticReboot=false
|
||||
|
||||
# Logging configuration
|
||||
LogLevel=info
|
||||
LogFile=/var/log/apt-ostreed.log
|
||||
|
||||
# D-Bus configuration
|
||||
DbusName=org.aptostree.dev
|
||||
DbusPath=/org/aptostree/dev
|
||||
|
||||
# Security settings
|
||||
RequireAuthentication=true
|
||||
AllowUnprivilegedRead=true
|
||||
|
||||
# Debian/Ubuntu specific settings
|
||||
Distribution=ubuntu
|
||||
Release=24.04
|
||||
Architecture=x86_64
|
||||
|
||||
# Package management
|
||||
DefaultRepositories=main,universe,multiverse,restricted
|
||||
SecurityRepositories=security
|
||||
|
||||
# OSTree settings
|
||||
OstreeMode=bare
|
||||
OstreeRef=ubuntu/24.04/x86_64
|
||||
30
debian/apt-ostreed/lib/systemd/system/apt-ostreed.service
vendored
Normal file
30
debian/apt-ostreed/lib/systemd/system/apt-ostreed.service
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
[Unit]
|
||||
Description=apt-ostree System Management Daemon
|
||||
Documentation=man:apt-ostree(1)
|
||||
ConditionPathExists=/ostree
|
||||
RequiresMountsFor=/boot
|
||||
|
||||
[Service]
|
||||
# See similar code in apt-ostree-countme.service
|
||||
User=apt-ostree
|
||||
DynamicUser=yes
|
||||
# Our primary API is DBus
|
||||
Type=dbus
|
||||
BusName=org.projectatomic.aptostree1
|
||||
# To use the read-only sysroot bits
|
||||
MountFlags=slave
|
||||
# We have no business accessing /var/roothome or /var/home
|
||||
ProtectHome=true
|
||||
NotifyAccess=main
|
||||
# Significantly bump this timeout from the default because
|
||||
# we do a lot of stuff on daemon startup.
|
||||
TimeoutStartSec=5m
|
||||
# We start this main process with full privileges; it may spawn unprivileged processes
|
||||
# with the apt-ostree user.
|
||||
ExecStart=+apt-ostree start-daemon
|
||||
ExecReload=apt-ostree reload
|
||||
# disable/enable downloading filelists
|
||||
Environment="DOWNLOAD_FILELISTS=false"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
12
debian/apt-ostreed/lib/systemd/system/apt-ostreed.socket
vendored
Normal file
12
debian/apt-ostreed/lib/systemd/system/apt-ostreed.socket
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=apt-ostree System Management Daemon Socket
|
||||
Documentation=man:apt-ostree(1)
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/apt-ostreed.sock
|
||||
SocketMode=0660
|
||||
SocketUser=apt-ostree
|
||||
SocketGroup=apt-ostree
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
BIN
debian/apt-ostreed/usr/share/doc/apt-ostreed/changelog.Debian.gz
vendored
Normal file
BIN
debian/apt-ostreed/usr/share/doc/apt-ostreed/changelog.Debian.gz
vendored
Normal file
Binary file not shown.
35
debian/apt-ostreed/usr/share/doc/apt-ostreed/copyright
vendored
Normal file
35
debian/apt-ostreed/usr/share/doc/apt-ostreed/copyright
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: apt-ostree
|
||||
Source: https://github.com/robojerk/apt-ostree
|
||||
|
||||
Files: *
|
||||
Copyright: 2025 Robojerk <robojerk@example.com>
|
||||
License: GPL-3.0-or-later
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2025 Robojerk <robojerk@example.com>
|
||||
License: GPL-3.0-or-later
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
143
debian/apt-ostreed/usr/share/polkit-1/actions/org.projectatomic.aptostree1.policy
vendored
Normal file
143
debian/apt-ostreed/usr/share/polkit-1/actions/org.projectatomic.aptostree1.policy
vendored
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
|
||||
<policyconfig>
|
||||
|
||||
<vendor>Project Atomic</vendor>
|
||||
<vendor_url>https://www.projectatomic.io/</vendor_url>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.install-uninstall-packages">
|
||||
<description>Install and remove packages</description>
|
||||
<message>Authentication is required to install and remove software</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.install-local-packages">
|
||||
<description>Install local packages</description>
|
||||
<message>Authentication is required to install software</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.override">
|
||||
<description>Override packages</description>
|
||||
<message>Authentication is required to override base OS software</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.deploy">
|
||||
<description>Update base OS</description>
|
||||
<message>Authentication is required to update software</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.upgrade">
|
||||
<description>Update base OS</description>
|
||||
<message>Authentication is required to update software</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.rebase">
|
||||
<description>Switch to a different base OS</description>
|
||||
<message>Authentication is required to switch to a different base OS</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.rollback">
|
||||
<description>Rollback OS updates</description>
|
||||
<message>Authentication is required to roll back software updates</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.bootconfig">
|
||||
<description>Change boot configuration</description>
|
||||
<message>Authentication is required to change boot configuration</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.reload-daemon">
|
||||
<description>Reload the daemon state</description>
|
||||
<message>Authentication is required to reload the daemon</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.cleanup">
|
||||
<description>Clean up system state</description>
|
||||
<message>Authentication is required to clean up system state</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.initramfs">
|
||||
<description>Manage initramfs</description>
|
||||
<message>Authentication is required to manage initramfs</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.projectatomic.aptostree1.kargs">
|
||||
<description>Manage kernel arguments</description>
|
||||
<message>Authentication is required to manage kernel arguments</message>
|
||||
<icon_name>package-x-generic</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
</policyconfig>
|
||||
31
debian/control
vendored
31
debian/control
vendored
|
|
@ -14,7 +14,9 @@ Build-Depends: debhelper (>= 13),
|
|||
libsystemd-dev,
|
||||
libmount-dev,
|
||||
libselinux1-dev,
|
||||
libapt-pkg-dev (>= 3.0.0)
|
||||
libapt-pkg-dev (>= 3.0.0),
|
||||
libpolkit-gobject-1-dev,
|
||||
libdbus-1-dev
|
||||
Standards-Version: 4.6.2
|
||||
Homepage: https://github.com/robojerk/apt-ostree
|
||||
Vcs-Git: https://github.com/robojerk/apt-ostree.git
|
||||
|
|
@ -27,11 +29,34 @@ Depends: ${shlibs:Depends},
|
|||
libostree-1-1 (>= 2025.2),
|
||||
ostree,
|
||||
systemd,
|
||||
libapt-pkg7.0 (>= 3.0.0)
|
||||
libapt-pkg7.0 (>= 3.0.0),
|
||||
apt-ostreed (= ${binary:Version})
|
||||
Description: Debian/Ubuntu equivalent of rpm-ostree
|
||||
apt-ostree is a tool for managing atomic, immutable deployments
|
||||
on Debian and Ubuntu systems using OSTree as the backend.
|
||||
.
|
||||
It provides functionality similar to rpm-ostree but adapted for
|
||||
APT package management, enabling atomic updates and rollbacks
|
||||
on Debian-based systems.
|
||||
on Debian-based systems.
|
||||
.
|
||||
This package contains the command-line interface and user tools.
|
||||
|
||||
Package: apt-ostreed
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libostree-1-1 (>= 2025.2),
|
||||
ostree,
|
||||
systemd,
|
||||
libapt-pkg7.0 (>= 3.0.0),
|
||||
polkitd,
|
||||
dbus
|
||||
Description: apt-ostree system management daemon
|
||||
apt-ostreed is the system daemon for apt-ostree that provides
|
||||
DBus interface for system management operations.
|
||||
.
|
||||
This package contains the daemon service and related system
|
||||
integration files.
|
||||
.
|
||||
The daemon runs with elevated privileges and provides secure
|
||||
access to system management functions through D-Bus.
|
||||
1
debian/debhelper-build-stamp
vendored
1
debian/debhelper-build-stamp
vendored
|
|
@ -1 +1,2 @@
|
|||
apt-ostree
|
||||
apt-ostreed
|
||||
|
|
|
|||
2
debian/files
vendored
2
debian/files
vendored
|
|
@ -1,3 +1,5 @@
|
|||
apt-ostree-dbgsym_0.1.0-2_amd64.deb debug optional automatic=yes
|
||||
apt-ostree_0.1.0-2_amd64.buildinfo admin optional
|
||||
apt-ostree_0.1.0-2_amd64.deb admin optional
|
||||
apt-ostreed-dbgsym_0.1.0-2_amd64.deb debug optional automatic=yes
|
||||
apt-ostreed_0.1.0-2_amd64.deb admin optional
|
||||
|
|
|
|||
64
debian/rules
vendored
64
debian/rules
vendored
|
|
@ -24,12 +24,20 @@ override_dh_auto_build:
|
|||
@echo "Building apt-ostree for $(DEB_HOST_ARCH)..."
|
||||
# Ensure cargo is available
|
||||
@which cargo > /dev/null || (echo "Error: cargo not found. Please install Rust toolchain." && exit 1)
|
||||
# Build apt-ostree with cargo
|
||||
cargo build $(CARGO_FLAGS)
|
||||
# Ensure both binaries are built
|
||||
@echo "Building apt-ostree CLI..."
|
||||
cargo build $(CARGO_FLAGS) --bin apt-ostree
|
||||
@echo "Building apt-ostreed daemon..."
|
||||
cargo build $(CARGO_FLAGS) --bin apt-ostreed
|
||||
dh_auto_build
|
||||
|
||||
override_dh_auto_install:
|
||||
@echo "Installing apt-ostree binary..."
|
||||
# Check if binary exists
|
||||
@if [ ! -f "debian/cargo/target/release/apt-ostree" ]; then \
|
||||
echo "Error: apt-ostree binary not found. Build failed."; \
|
||||
exit 1; \
|
||||
fi
|
||||
# Install the apt-ostree binary to the correct location
|
||||
install -D -m 755 debian/cargo/target/release/apt-ostree \
|
||||
debian/apt-ostree/usr/bin/apt-ostree
|
||||
|
|
@ -38,6 +46,8 @@ override_dh_auto_install:
|
|||
mkdir -p debian/apt-ostree/usr/share/man/man1
|
||||
mkdir -p debian/apt-ostree/usr/share/bash-completion/completions
|
||||
mkdir -p debian/apt-ostree/usr/share/zsh/vendor-completions
|
||||
mkdir -p debian/apt-ostree/usr/share/apt-ostree
|
||||
@echo "apt-ostree package directories created successfully"
|
||||
# Install man page if it exists
|
||||
@if [ -f "debian/apt-ostree.1" ]; then \
|
||||
install -D -m 644 debian/apt-ostree.1 debian/apt-ostree/usr/share/man/man1/apt-ostree.1; \
|
||||
|
|
@ -52,7 +62,57 @@ override_dh_auto_install:
|
|||
install -D -m 644 debian/apt-ostree.zsh-completion \
|
||||
debian/apt-ostree/usr/share/zsh/vendor-completions/_apt-ostree; \
|
||||
fi
|
||||
|
||||
@echo "Installing apt-ostreed daemon..."
|
||||
# Check if binary exists
|
||||
@if [ ! -f "debian/cargo/target/release/apt-ostreed" ]; then \
|
||||
echo "Error: apt-ostreed binary not found. Build failed."; \
|
||||
exit 1; \
|
||||
fi
|
||||
# Install the apt-ostreed binary
|
||||
install -D -m 755 debian/cargo/target/release/apt-ostreed \
|
||||
debian/apt-ostreed/usr/libexec/apt-ostreed
|
||||
# Check and install systemd service files
|
||||
@if [ ! -f "daemon/systemd/apt-ostreed.service" ]; then \
|
||||
echo "Error: apt-ostreed.service not found."; \
|
||||
exit 1; \
|
||||
fi
|
||||
@if [ ! -f "daemon/systemd/apt-ostreed.socket" ]; then \
|
||||
echo "Error: apt-ostreed.socket not found."; \
|
||||
exit 1; \
|
||||
fi
|
||||
install -D -m 644 daemon/systemd/apt-ostreed.service \
|
||||
debian/apt-ostreed/lib/systemd/system/apt-ostreed.service
|
||||
install -D -m 644 daemon/systemd/apt-ostreed.socket \
|
||||
debian/apt-ostreed/lib/systemd/system/apt-ostreed.socket
|
||||
|
||||
# Check and install polkit policy
|
||||
@if [ ! -f "daemon/polkit/apt-ostree.policy" ]; then \
|
||||
echo "Error: apt-ostree.policy not found."; \
|
||||
exit 1; \
|
||||
fi
|
||||
install -D -m 644 daemon/polkit/apt-ostree.policy \
|
||||
debian/apt-ostreed/usr/share/polkit-1/actions/org.projectatomic.aptostree1.policy
|
||||
# Check and install configuration files
|
||||
@if [ ! -f "src/daemon/apt-ostreed.conf" ]; then \
|
||||
echo "Error: apt-ostreed.conf not found."; \
|
||||
exit 1; \
|
||||
fi
|
||||
install -d -m 755 debian/apt-ostreed/etc/apt-ostreed
|
||||
install -D -m 644 src/daemon/apt-ostreed.conf \
|
||||
debian/apt-ostreed/etc/apt-ostreed/apt-ostreed.conf
|
||||
# Create additional directories
|
||||
mkdir -p debian/apt-ostreed/usr/share/doc/apt-ostreed
|
||||
# Create log directory
|
||||
mkdir -p debian/apt-ostreed/var/log
|
||||
# Create cache directory
|
||||
mkdir -p debian/apt-ostreed/var/cache/apt-ostree
|
||||
# Create state directory
|
||||
mkdir -p debian/apt-ostreed/var/lib/apt-ostree
|
||||
@echo "apt-ostreed package directories created successfully"
|
||||
|
||||
# Skip dh_auto_install since we've handled installation manually
|
||||
@echo "Package installation completed successfully!"
|
||||
|
||||
override_dh_auto_clean:
|
||||
@echo "Cleaning cargo build artifacts..."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue