tests(packer): simplify pkg install script.
This commit is contained in:
parent
a3426fef8c
commit
9ee2605026
1 changed files with 8 additions and 11 deletions
|
|
@ -3,16 +3,11 @@
|
|||
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
set -eux
|
||||
set -eux -o pipefail
|
||||
|
||||
_lsb_release() {
|
||||
# shellcheck source=/dev/null
|
||||
. /etc/os-release
|
||||
echo "$ID"
|
||||
}
|
||||
DISTRIBUTION="$(_lsb_release)"
|
||||
# shellcheck source=/dev/null
|
||||
source /etc/os-release || exit 1
|
||||
readonly SRC=/tmp/
|
||||
readonly DISTRIBUTION
|
||||
|
||||
main() {
|
||||
install -dm0750 -o "$SUDO_USER" -g "$SUDO_USER" "/home/$SUDO_USER/Projects/" "/home/$SUDO_USER/Projects/apparmor.d" "/home/$SUDO_USER/.config/"
|
||||
|
|
@ -24,7 +19,7 @@ main() {
|
|||
install -Dm0755 $SRC/aa-clean /usr/bin/aa-clean
|
||||
chown -R "$SUDO_USER:$SUDO_USER" "/home/$SUDO_USER/.config/"
|
||||
|
||||
case "$DISTRIBUTION" in
|
||||
case "$ID" in
|
||||
arch)
|
||||
rm -f $SRC/*.sig # Ignore signature files
|
||||
rm -f $SRC/*enforced* # Ignore enforced package
|
||||
|
|
@ -32,8 +27,10 @@ main() {
|
|||
;;
|
||||
|
||||
debian | ubuntu)
|
||||
apt-get install -y apparmor-profiles
|
||||
dpkg -i $SRC/*.deb || true
|
||||
# Do not install apparmor.d on the current development version
|
||||
if [[ $VERSION_ID != "25.10" ]]; then
|
||||
dpkg -i $SRC/*.deb || true
|
||||
fi
|
||||
;;
|
||||
|
||||
opensuse*)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue