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