Created
August 10, 2025 18:15
-
-
Save b-/4cb94432e08b17b937bc0ef637eaac13 to your computer and use it in GitHub Desktop.
one-true-optfix.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euxo pipefail | |
| shopt -s nullglob | |
| optdirs=(/opt/*) | |
| if [[ -n "${optdirs[*]}" ]]; then | |
| optfix_dir="/usr/lib/bluebuild-optfix" | |
| mkdir -pv "${optfix_dir}" | |
| echo "Creating symlinks to fix packages that installed to /opt:" | |
| for optdir in "${optdirs[@]}"; do | |
| opt=$(basename "${optdir}") | |
| lib_opt_dir="${optfix_dir}/${opt}" | |
| mv -v "${optdir}" "${lib_opt_dir}" | |
| echo "linking ${optdir} => ${lib_opt_dir}" | |
| echo "L+? ${optdir} - - - - ${lib_opt_dir}" | tee "/usr/lib/tmpfiles.d/bluebuild-optfix-${opt}.conf" | |
| done | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment