2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

print pillow requirements and added them to setup_frappe.sh

This commit is contained in:
Anand Doshi 2015-10-15 15:47:01 +05:30
parent b9385257cc
commit b3c95685ec
3 changed files with 34 additions and 25 deletions

View File

@ -245,9 +245,6 @@ 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:

View File

@ -351,7 +351,13 @@ def update_requirements(bench='.'):
for app in os.listdir(apps_dir):
req_file = os.path.join(apps_dir, app, 'requirements.txt')
if os.path.exists(req_file):
exec_cmd("{pip} install -q -r {req_file}".format(pip=pip, req_file=req_file))
try:
exec_cmd("{pip} install -q -r {req_file}".format(pip=pip, req_file=req_file))
except CommandFailedError, e:
if "Pillow" in e:
print_pillow_dependencies()
raise
def backup_site(site, bench='.'):
if FRAPPE_VERSION == 4:
@ -614,27 +620,21 @@ 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 print_pillow_dependencies():
distro = platform.linux_distribution()
distro_name = distro[0].lower()
if "centos" in distro_name or "fedora" in distro_name:
print "Please install these dependencies using the command:"
print "sudo yum install libtiff-devel libjpeg-devel libzip-devel freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel"
def validate_libjpeg():
out = get_output("whereis", "libjpeg")
elif "ubuntu" in distro_name or "elementary os" in distro_name or "debian" in distro_name:
print "Please install these dependencies using the command:"
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
if "ubuntu" in distro_name and distro[1]=="12.04":
print "sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk"
else:
print "sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk"
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)

View File

@ -179,10 +179,18 @@ 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 libjpeg-devel
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 \
libtiff-devel libjpeg-devel libzip-devel freetype-devel lcms2-devel libwebp-devel tcl-devel tk-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 libjpeg-devel
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 \
libtiff-devel libjpeg-devel libzip-devel freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel
fi
echo "Installing wkhtmltopdf"
@ -197,7 +205,11 @@ 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 libjpeg-dev
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 \
libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
echo "Installing wkhtmltopdf"
install_wkhtmltopdf_deb