archlinux: properly add qubes markers in pacman.conf

This commit is contained in:
Olivier MEDOC 2016-01-21 18:21:44 +01:00
parent 1bbcf126ad
commit eb105540c5
2 changed files with 11 additions and 5 deletions

View File

@ -6,7 +6,7 @@
# Maintainer: Olivier Medoc <o_medoc@yahoo.fr> # Maintainer: Olivier Medoc <o_medoc@yahoo.fr>
pkgname=qubes-vm-core pkgname=qubes-vm-core
pkgver=`cat version` pkgver=`cat version`
pkgrel=4 pkgrel=6
epoch= epoch=
pkgdesc="The Qubes core files for installation inside a Qubes VM." pkgdesc="The Qubes core files for installation inside a Qubes VM."
arch=("x86_64") arch=("x86_64")

View File

@ -198,13 +198,18 @@ systemctl daemon-reload
} }
config_addlinetofile() { config_prependtomark() {
FILE=$1
APPENDBEFORELINE=$2
APPENDLINE=$3
grep -q "$APPENDLINE" "$FILE" || sed "/$APPENDBEFORELINE/i$APPENDLINE" -i "$FILE"
}
config_appendtomark() {
FILE=$1 FILE=$1
APPENDAFTERLINE=$2 APPENDAFTERLINE=$2
APPENDLINE=$3 APPENDLINE=$3
grep -q "$APPENDLINE" "$FILE" || sed "/$APPENDAFTERLINE/a$APPENDLINE" -i "$FILE" grep -q "$APPENDLINE" "$FILE" || sed "/$APPENDAFTERLINE/a$APPENDLINE" -i "$FILE"
} }
update_finalize() { update_finalize() {
@ -224,10 +229,11 @@ update_finalize() {
# Archlinux specific: Prepare pacman.conf to add qubes specific config # Archlinux specific: Prepare pacman.conf to add qubes specific config
QUBES_MARKER="### QUBES CONFIG MARKER ###" QUBES_MARKER="### QUBES CONFIG MARKER ###"
config_addlinetofile "/etc/pacman.conf" "NoUpgrade" "$QUBES_MARKER" config_prependtomark "/etc/pacman.conf" "# REPOSITORIES" "$QUBES_MARKER"
# Add Qubes setup script markers at the right place (this won't work at the end of pacman.conf)" # Add Qubes setup script markers at the right place (this won't work at the end of pacman.conf)"
config_addlinetofile "/etc/pacman.conf "$QUBES_MARKER" "### QUBES BEGIN ###" config_appendtomark "/etc/pacman.conf" "$QUBES_MARKER" "### QUBES END ###"
config_appendtomark "/etc/pacman.conf" "$QUBES_MARKER" "### QUBES BEGIN ###"
systemctl daemon-reload systemctl daemon-reload
} }