From fdf7a459eb74c8d859b129cb26970e809cc11a77 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Tue, 4 Apr 2023 18:28:26 +0530 Subject: [PATCH] Added pre-installation steps to remove venv and web folder for RPM and Debian. --- pkg/debian/build.sh | 8 ++++++++ pkg/redhat/build.sh | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/pkg/debian/build.sh b/pkg/debian/build.sh index ae70776ef..3657833cf 100755 --- a/pkg/debian/build.sh +++ b/pkg/debian/build.sh @@ -31,6 +31,14 @@ _copy_code echo "Creating the server package..." mkdir "${SERVERROOT}/DEBIAN" +echo "Creating preinst script..." +cat << EOF > "${SERVERROOT}/DEBIAN/preinst" +#!/bin/sh + +rm -rf /usr/pgadmin4/venv +rm -rf /usr/pgadmin4/web +EOF + cat << EOF > "${SERVERROOT}/DEBIAN/control" Package: ${APP_NAME}-server Version: ${APP_LONG_VERSION} diff --git a/pkg/redhat/build.sh b/pkg/redhat/build.sh index 8d6f2a24f..b1547b540 100755 --- a/pkg/redhat/build.sh +++ b/pkg/redhat/build.sh @@ -67,6 +67,10 @@ Requires: ${PYTHON_BINARY}, libpq5, krb5-libs %description The core server package for pgAdmin. pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world. +%pre +rm -rf /usr/pgadmin4/venv +rm -rf /usr/pgadmin4/web + %build %install