mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Add apt regenconf hook to manage sury pinning policy on all
This commit is contained in:
parent
b7c4f8f85e
commit
a23233ab0f
1 changed files with 39 additions and 0 deletions
39
data/hooks/conf_regen/10-apt
Executable file
39
data/hooks/conf_regen/10-apt
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
do_pre_regen() {
|
||||||
|
pending_dir=$1
|
||||||
|
|
||||||
|
mkdir --parents "${pending_dir}/etc/apt/preferences.d"
|
||||||
|
|
||||||
|
for package in "php" "php-fpm" "php-mysql" "php-xml" "php-zip" "php-mbstring" "php-ldap" "php-gd" "php-curl" "php-bz2" "php-json" "php-sqlite3" "php-intl" "openssl" "libssl1.1" "libssl-dev"
|
||||||
|
do
|
||||||
|
echo "
|
||||||
|
Package: $package
|
||||||
|
Pin: origin \"packages.sury.org\"
|
||||||
|
Pin-Priority: -1" >> "/etc/apt/preferences.d/extra_php_version"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
do_post_regen() {
|
||||||
|
regen_conf_files=$1
|
||||||
|
}
|
||||||
|
|
||||||
|
FORCE=${2:-0}
|
||||||
|
DRY_RUN=${3:-0}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
pre)
|
||||||
|
do_pre_regen $4
|
||||||
|
;;
|
||||||
|
post)
|
||||||
|
do_post_regen $4
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "hook called with unknown argument \`$1'" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Add table
Reference in a new issue