mirror of
https://github.com/frappe/bench.git
synced 2025-02-08 05:38:25 +00:00
Added libjpeg in install and validate_os_requirements
This commit is contained in:
parent
8a673c419a
commit
b9385257cc
@ -14,7 +14,7 @@ from .utils import (build_assets, patch_sites, exec_cmd, update_bench, get_env_c
|
||||
get_config, update_config, restart_supervisor_processes, put_config, default_config, update_requirements,
|
||||
backup_all_sites, backup_site, get_sites, prime_wheel_cache, is_root, set_mariadb_host, drop_privileges,
|
||||
fix_file_perms, fix_prod_setup_perms, set_ssl_certificate, set_ssl_certificate_key, get_cmd_output, post_upgrade,
|
||||
pre_upgrade, validate_upgrade, PatchError, download_translations_p, setup_socketio)
|
||||
pre_upgrade, validate_upgrade, PatchError, download_translations_p, setup_socketio, validate_os_requirements)
|
||||
from .app import get_app as _get_app
|
||||
from .app import new_app as _new_app
|
||||
from .app import pull_all_apps, get_apps, get_current_frappe_version, is_version_upgrade, switch_to_v4, switch_to_v5, switch_to_master, switch_to_develop
|
||||
@ -245,7 +245,11 @@ def _update(pull=False, patch=False, build=False, bench=False, auto=False, resta
|
||||
|
||||
def update(pull=False, patch=False, build=False, bench=False, auto=False, restart_supervisor=False, requirements=False, no_backup=False, upgrade=False, bench_path='.', force=False):
|
||||
conf = get_config(bench=bench_path)
|
||||
if not validate_os_requirements():
|
||||
return
|
||||
|
||||
version_upgrade = is_version_upgrade(bench=bench_path)
|
||||
|
||||
if version_upgrade[0] and not upgrade:
|
||||
raise Exception("Major Version Upgrade")
|
||||
|
||||
|
@ -614,5 +614,32 @@ def log_line(data, stream):
|
||||
return sys.stderr.write(data)
|
||||
return sys.stdout.write(data)
|
||||
|
||||
def validate_os_requirements():
|
||||
valid = validate_libjpeg()
|
||||
return valid
|
||||
|
||||
def validate_libjpeg():
|
||||
out = get_output("whereis", "libjpeg")
|
||||
|
||||
if not out:
|
||||
distro = platform.linux_distribution()
|
||||
distro_name = distro[0].lower()
|
||||
if "centos" in distro_name:
|
||||
print "Please install libjpeg using the command:"
|
||||
print "sudo yum install libjpeg-devel"
|
||||
return False
|
||||
|
||||
elif "ubuntu" in distro_name or "elementary os" in distro_name or "debian" in distro_name:
|
||||
print "Please install libjpeg using the command:"
|
||||
print "sudo apt-get install libjpeg-dev"
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def get_output(*cmd):
|
||||
s = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
out = s.stdout.read()
|
||||
s.stdout.close()
|
||||
return out
|
||||
|
||||
FRAPPE_VERSION = get_current_frappe_version()
|
||||
|
@ -179,10 +179,10 @@ install_packages() {
|
||||
run_cmd sudo yum groupinstall -y "Development tools"
|
||||
if [ $OS_VER == "6" ]; then
|
||||
run_cmd add_ius_repo
|
||||
run_cmd sudo yum install -y git MariaDB-server MariaDB-client MariaDB-compat python-setuptools nginx zlib-devel bzip2-devel openssl-devel postfix python27-devel python27 libxml2 libxml2-devel libxslt libxslt-devel redis MariaDB-devel libXrender libXext python27-setuptools cronie sudo which xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi nodejs npm
|
||||
run_cmd sudo yum install -y git MariaDB-server MariaDB-client MariaDB-compat python-setuptools nginx zlib-devel bzip2-devel openssl-devel postfix python27-devel python27 libxml2 libxml2-devel libxslt libxslt-devel redis MariaDB-devel libXrender libXext python27-setuptools cronie sudo which xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi nodejs npm libjpeg-devel
|
||||
elif [ $OS_VER == "7" ]; then
|
||||
run_cmd add_epel_centos7
|
||||
run_cmd sudo yum install -y git mariadb-server mariadb-devel python-setuptools nginx zlib-devel bzip2-devel openssl-devel postfix python-devel libxml2 libxml2-devel libxslt libxslt-devel redis libXrender libXext supervisor cronie sudo which xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 nodejs npm
|
||||
run_cmd sudo yum install -y git mariadb-server mariadb-devel python-setuptools nginx zlib-devel bzip2-devel openssl-devel postfix python-devel libxml2 libxml2-devel libxslt libxslt-devel redis libXrender libXext supervisor cronie sudo which xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 nodejs npm libjpeg-devel
|
||||
fi
|
||||
|
||||
echo "Installing wkhtmltopdf"
|
||||
@ -197,7 +197,7 @@ install_packages() {
|
||||
run_cmd bash -c "curl -sL https://deb.nodesource.com/setup_0.12 | bash -"
|
||||
fi
|
||||
run_cmd sudo apt-get update
|
||||
run_cmd sudo apt-get install -y python-dev python-setuptools build-essential python-mysqldb git ntp vim screen htop mariadb-server mariadb-common libmariadbclient-dev libxslt1.1 libxslt1-dev redis-server libssl-dev libcrypto++-dev postfix nginx supervisor python-pip fontconfig libxrender1 libxext6 xfonts-75dpi xfonts-base nodejs npm
|
||||
run_cmd sudo apt-get install -y python-dev python-setuptools build-essential python-mysqldb git ntp vim screen htop mariadb-server mariadb-common libmariadbclient-dev libxslt1.1 libxslt1-dev redis-server libssl-dev libcrypto++-dev postfix nginx supervisor python-pip fontconfig libxrender1 libxext6 xfonts-75dpi xfonts-base nodejs npm libjpeg-dev
|
||||
|
||||
echo "Installing wkhtmltopdf"
|
||||
install_wkhtmltopdf_deb
|
||||
|
Loading…
x
Reference in New Issue
Block a user