Skip to content

Commit

Permalink
Fixed: apache2_postinst.sh: Raised error if there is a version mismat…
Browse files Browse the repository at this point in the history
…ch between installed Apache2 package and source package
  • Loading branch information
nuxwin committed Jun 20, 2017
1 parent e1c2e06 commit a4b42f4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Expand Up @@ -13,6 +13,9 @@ DISTRIBUTIONS
FRONTEND
Fixed: Invalid parameter number: number of bound variables does not match number of tokens (Software Installer)

INSTALLER:
Fixed: apache2_postinst.sh: Raised error if there is a version mismatch between installed Apache2 package and source package

------------------------------------------------------------------------------------------------------------------------
1.4.6
------------------------------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions autoinstaller/Packages/debian-jessie.xml
Expand Up @@ -419,6 +419,7 @@
<package>libxml-simple-perl</package>
</perl>
<other>
<package>apt-src</package>
<package>at</package>
<package>bash</package>
<package>bash-completion</package>
Expand Down
1 change: 1 addition & 0 deletions autoinstaller/Packages/debian-stretch.xml
Expand Up @@ -334,6 +334,7 @@
<package>libxml-simple-perl</package>
</perl>
<other>
<package>apt-src</package>
<package>at</package>
<package>bash</package>
<package>bash-completion</package>
Expand Down
1 change: 1 addition & 0 deletions autoinstaller/Packages/devuan-jessie.xml
Expand Up @@ -418,6 +418,7 @@
<package>libxml-simple-perl</package>
</perl>
<other>
<package>apt-src</package>
<package>at</package>
<package>bash</package>
<package>bash-completion</package>
Expand Down
1 change: 1 addition & 0 deletions autoinstaller/Packages/ubuntu-trusty.xml
Expand Up @@ -451,6 +451,7 @@
<package>libxml-simple-perl</package>
</perl>
<other>
<package>apt-src</package>
<package>at</package>
<package>bash</package>
<package>bash-completion</package>
Expand Down
1 change: 1 addition & 0 deletions autoinstaller/Packages/ubuntu-xenial.xml
Expand Up @@ -394,6 +394,7 @@
<package>libxml-simple-perl</package>
</perl>
<other>
<package>apt-src</package>
<package>at</package>
<package>bash</package>
<package>bash-completion</package>
Expand Down
24 changes: 20 additions & 4 deletions autoinstaller/postinstall/apache2_postinst.sh
Expand Up @@ -23,7 +23,7 @@ set -e
# rm /usr/lib/apache2/modules/mod_proxy_fcgi.so
# dpkg-divert --rename --remove /usr/lib/apache2/modules/mod_proxy_fcgi.so

APACHE_VERSION=`dpkg-query --show --showformat '${Version}' apache2`
APACHE_INSTALLED_VERSION=$(dpkg-query --show --showformat '${Version}' apache2)

service apache2 stop

Expand All @@ -34,7 +34,7 @@ if [ -f /usr/lib/apache2/modules/mod_proxy_fcgi.so-DIST ] ; then
fi

# Don't process if Apache2 version is ge 2.4.24
if dpkg --compare-versions "$APACHE_VERSION" ge "2.4.24" ; then
if dpkg --compare-versions "$APACHE_INSTALLED_VERSION" ge "2.4.24" ; then
exit;
fi

Expand All @@ -48,7 +48,22 @@ if id "_apt" >/dev/null 2>&1; then
fi

cd ${SRC_DIR}
apt-get -y source apache2

apt-src remove apache2
apt-src install apache2

APACHE_SOURCE_VERSION=$(apt-src version apache2)

# We must check for version mismatch between installed apache2 package and
# source package
if dpkg --compare-versions "$APACHE_SOURCE_VERSION" ne "$APACHE_INSTALLED_VERSION" ; then
echo "There is a version mismatch between installed apache2 package and"
echo "apache2 source package. Please check your APT sources.list."
echo ""
echo "Both deb and deb-src repositories must provide the same version."
exit 1;
fi

cd apache2*/modules/proxy

# Patch for https://bz.apache.org/bugzilla/show_bug.cgi?id=55415
Expand All @@ -67,7 +82,7 @@ patch -p0 <<EOF
* everything after the headers
EOF

if dpkg --compare-versions "$APACHE_VERSION" lt "2.4.11" ; then
if dpkg --compare-versions "$APACHE_INSTALLED_VERSION" lt "2.4.11" ; then
# Patch for https://bz.apache.org/bugzilla/show_bug.cgi?id=55329
patch -p0 <<EOF
--- mod_proxy_fcgi.c 2017-06-13 10:24:54.008100497 +0200
Expand Down Expand Up @@ -175,4 +190,5 @@ apxs -c mod_proxy_fcgi.c
dpkg-divert --divert /usr/lib/apache2/modules/mod_proxy_fcgi.so-DIST --rename /usr/lib/apache2/modules/mod_proxy_fcgi.so
apxs -i mod_proxy_fcgi.la
cd /tmp
apt-src remove apache2
rm -fR ${SRC_DIR}

0 comments on commit a4b42f4

Please sign in to comment.