[enh] Stable is 2.4 now, Jessie only.

This commit is contained in:
opi 2016-05-09 13:49:12 +02:00
parent a32f28d007
commit aa493b5697

View file

@ -110,12 +110,15 @@ installscript_dependencies() {
}
create_custom_config() {
if [[ "$DISTRIB" != "daily" ]] && [[ "$DISTRIB" != "unstable" ]] \
&& [[ "$DISTRIB" != "test" ]] && [[ "$DISTRIB" != "testing" ]] ; then
# Create YunoHost configuration folder
mkdir -p /etc/yunohost/
# Store info about installation method
touch /etc/yunohost/from_script
# Create default configuration if not already there
if [[ ! -f /etc/yunohost/yunohost.conf ]]
then
mkdir -p /etc/yunohost/
touch /etc/yunohost/from_script
cat << EOF > /etc/yunohost/yunohost.conf
# Yunohost custom config
# If you want to keep a custom service configuration replace "no" by "yes"
@ -134,22 +137,6 @@ ssh=yes
ssowat=no
EOF
fi
else
mkdir -p /etc/yunohost/
touch /etc/yunohost/from_script
fi
}
set_domain() {
# No amavis in testing/unstable anymore
[[ "$DISTRIB" != "stable" ]] && return 0
dpkg -l | grep amavisd-new | grep -e "^ii" > /dev/null 2>&1 \
|| [[ "$(hostname -d 2>/dev/null)" != "" ]] \
|| hostname yunohost.yunohost.org > /dev/null 2>&1 \
|| (echo "Unable to set an fully-qualified domain name to this \
container, amavisd installation will fail. Please set a fqdn \
manually before launching the installation." && exit 1)
}
confirm_installation() {
@ -174,9 +161,6 @@ Are you sure you want to proceed with the installation of Yunohost?
setup_package_source() {
local CUSTOMAPT=/etc/apt/sources.list.d/yunohost.list
if [[ "$DISTRIB" == "megusta" ]] || [[ "$DISTRIB" == "stable" ]] ; then
echo "deb http://repo.yunohost.org/ megusta main" > $CUSTOMAPT
else
# Check current system version and dependencies
if [[ $(lsb_release -c | awk '{print $2}') != jessie ]]; then
echo "Current $DISTRIB only works on Debian Jessie for the moment."
@ -186,7 +170,7 @@ setup_package_source() {
return 1
fi
# Make use of new repository
# Debian repository
local CUSTOMDEB="deb http://repo.yunohost.org/debian/ jessie stable"
if [[ "$DISTRIB" == "test" ]] || [[ "$DISTRIB" == "testing" ]] ; then
@ -194,7 +178,6 @@ setup_package_source() {
elif [[ "$DISTRIB" == "daily" ]] || [[ "$DISTRIB" == "unstable" ]] ; then
echo "$CUSTOMDEB testing unstable" > $CUSTOMAPT
fi
fi
# Add YunoHost repository key to the keyring
wget -O- http://repo.yunohost.org/yunohost.asc -q | apt-key add - -qq > /dev/null
@ -205,8 +188,6 @@ apt_update() {
}
register_debconf() {
if [[ $(lsb_release -c | awk '{print $2}') == jessie ]];
then
debconf-set-selections << EOF
slapd slapd/password1 password yunohost
slapd slapd/password2 password yunohost
@ -229,25 +210,6 @@ nslcd nslcd/ldap-binddn string
nslcd nslcd/ldap-base string dc=yunohost,dc=org
libnss-ldapd libnss-ldapd/nsswitch multiselect group, passwd, shadow
EOF
else
debconf-set-selections << EOF
slapd slapd/password1 password yunohost
slapd slapd/password2 password yunohost
slapd slapd/domain string yunohost.org
slapd shared/organization string yunohost.org
postfix postfix/main_mailer_type select Internet Site
postfix postfix/mailname string /etc/mailname
mysql-server-5.5 mysql-server/root_password password yunohost
mysql-server-5.5 mysql-server/root_password_again password yunohost
nslcd nslcd/ldap-bindpw password
nslcd nslcd/ldap-starttls boolean false
nslcd nslcd/ldap-reqcert select
nslcd nslcd/ldap-uris string ldap://localhost/
nslcd nslcd/ldap-binddn string
nslcd nslcd/ldap-base string dc=yunohost,dc=org
libnss-ldapd libnss-ldapd/nsswitch multiselect group, passwd, shadow
EOF
fi
}
workaround_avahi_installation() {
@ -291,21 +253,10 @@ workaround_avahi_installation() {
}
install_yunohost_packages() {
if [[ "$DISTRIB" != "daily" ]] && [[ "$DISTRIB" != "unstable" ]] \
&& [[ "$DISTRIB" != "test" ]] && [[ "$DISTRIB" != "testing" ]] ; then
apt_get_wrapper \
-o Dpkg::Options::="--force-confold" \
-y --force-yes install \
yunohost yunohost-config \
yunohost-config-postfix \
postfix postfix-ldap \
postfix-policyd-spf-perl
else
apt_get_wrapper \
-o Dpkg::Options::="--force-confold" \
-y --force-yes install \
yunohost postfix
fi
}
restart_services() {
@ -426,9 +377,9 @@ if ! step create_custom_config ; then
die "Creating custom configuration file /etc/yunohost/yunohost.conf failed" 4
fi
if ! step set_domain ; then
die "Setting hostname failed" 5
fi
# if ! step set_domain ; then
# die "Setting hostname failed" 5
# fi
if ! step confirm_installation ; then
die "Installation cancelled at your request" 6