#!/bin/sh

set -e

if test "$1" = "remove"; then
    if command -v update-binfmts >/dev/null; then
        update-binfmts --package llvm-19-runtime \
            --remove llvm-19-runtime.binfmt /usr/bin/lli-19 || true
        if test -f /var/lib/binfmts/llvm-19.binfmt; then
            # Purge old file
            update-binfmts --package llvm-19-runtime \
                --remove llvm-19.binfmt /usr/bin/lli-19 || true
        fi
    fi
fi



