Skip to contentSkip to conversation

python-web2py improvements

PATCH Superseded Angelo Compagnucci 2 participants 6 messages Jul 24, 2015 – Jul 26, 2015

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover python-web2py improvements

This patch series improves web2py disk space usage and bumps to the latest version.

Angelo Compagnucci (3):
package/python-web2py: cleaning for space savings package/python-pydal: bump to version v15.07 package/python-web2py: bump to version R-2.11.2

 package/python-pydal/python-pydal.mk   |  2 +-
 package/python-web2py/Config.in        | 10 ++++++++++
 package/python-web2py/python-web2py.mk | 17 ++++++++++++-----
 3 files changed, 23 insertions(+), 6 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 package/python-web2py: cleaning for space savings

This patch cleans web2py folder from welcome and examples application, furthermore, it cleans the admin interface if unneeded

---
 package/python-web2py/Config.in        | 10 ++++++++++
 package/python-web2py/python-web2py.mk | 15 +++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)
package/python-web2py/Config.in +10 -0
index b10d3a4..d5a0164 100644
@@ -14,6 +14,8 @@ config BR2_PACKAGE_PYTHON_WEB2PY
 
 if BR2_PACKAGE_PYTHON_WEB2PY
 
+if ! BR2_PACKAGE_PYTHON_WEB2PY_CLEAN_ADMIN
+
 config BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD
 	string "admin panel password"
 	default web2py
@@ -21,3 +23,11 @@ config BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD
 	  Set the admin panel password.
 
 endif
+
+config BR2_PACKAGE_PYTHON_WEB2PY_CLEAN_ADMIN
+	bool "clean admin panel application"
+	help
+	  This option removes admin panel application form web2py,
+	  useful for deploy on embedded systems.
+
+endif
package/python-web2py/python-web2py.mk +11 -4
index 641d7ef..8eab6bd 100644
@@ -11,12 +11,19 @@ PYTHON_WEB2PY_LICENSE_FILES = LICENSE
 PYTHON_WEB2PY_DEPENDENCIES = python python-pydal host-python-pydal
 
 define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
-	$(HOST_DIR)/usr/bin/python2 -c 'import os; \
-		os.chdir("$(@D)"); \
-		from gluon.main import save_password; \
-		save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
 	mkdir -p $(TARGET_DIR)/var/www/web2py
 	cp -dpfr $(@D)/* $(TARGET_DIR)/var/www/web2py
+	rm -rf $(TARGET_DIR)/var/www/web2py/welcome.w2p
+	rm -rf $(TARGET_DIR)/var/www/web2py/applications/examples
+	rm -rf $(TARGET_DIR)/var/www/web2py/applications/welcome
+	if test -n "$(BR2_PACKAGE_PYTHON_WEB2PY_CLEAN_ADMIN)" ; then\
+		rm -rf $(TARGET_DIR)/var/www/web2py/applications/admin;\
+	else\
+		$(HOST_DIR)/usr/bin/python2 -c 'import os; \
+		os.chdir("$(@D)"); \
+		from gluon.main import save_password; \
+		save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)';\
+	fi
 endef
 
 define PYTHON_WEB2PY_INSTALL_INIT_SYSV
Signature · 1 line
1.9.1
#2 lore raw

PATCH 1/3 package/python-web2py: cleaning for space savings

Angelo,

package/python-web2py/Config.in config BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD · line 25

Quoted 11 lines · Angelo Compagnucci

if BR2_PACKAGE_PYTHON_WEB2PY

package/python-web2py/Config.in +2 -0
+if ! BR2_PACKAGE_PYTHON_WEB2PY_CLEAN_ADMIN
+
 config BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD
 	string "admin panel password"
 	default web2py
@@ -21,3 +23,11 @@ config BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD
 	  Set the admin panel password.
 
 endif

Then it's more logical for this option to be defined *after* the clean admin option.

package/python-web2py/Config.in config BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD · line 28

Quoted 3 lines
package/python-web2py/Config.in +3 -0
+
+config BR2_PACKAGE_PYTHON_WEB2PY_CLEAN_ADMIN
+	bool "clean admin panel application"

Instead of clean, I think you should use "remove".

Quoted 8 lines
package/python-web2py/python-web2py.mk +1 -4
 define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
-	$(HOST_DIR)/usr/bin/python2 -c 'import os; \
-		os.chdir("$(@D)"); \
-		from gluon.main import save_password; \
-		save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
 	mkdir -p $(TARGET_DIR)/var/www/web2py
 	cp -dpfr $(@D)/* $(TARGET_DIR)/var/www/web2py
+	rm -rf $(TARGET_DIR)/var/www/web2py/welcome.w2p

package/python-web2py/python-web2py.mk PYTHON_WEB2PY_LICENSE_FILES = LICENSE · line 26

Quoted 10 lines
package/python-web2py/python-web2py.mk +10 -0
+	rm -rf $(TARGET_DIR)/var/www/web2py/applications/examples
+	rm -rf $(TARGET_DIR)/var/www/web2py/applications/welcome
+	if test -n "$(BR2_PACKAGE_PYTHON_WEB2PY_CLEAN_ADMIN)" ; then\
+		rm -rf $(TARGET_DIR)/var/www/web2py/applications/admin;\
+	else\
+		$(HOST_DIR)/usr/bin/python2 -c 'import os; \
+		os.chdir("$(@D)"); \
+		from gluon.main import save_password; \
+		save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)';\
+	fi

Please use a make based conditional rather than a shell one.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/3 package/python-pydal: bump to version v15.07

In reply to Angelo Compagnucci

This patch bumps python-pydal to version v15.07.

---
 package/python-pydal/python-pydal.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-pydal/python-pydal.mk +1 -1
index a99b61e..4c5da41 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-PYTHON_PYDAL_VERSION = v15.03
+PYTHON_PYDAL_VERSION = v15.07
 PYTHON_PYDAL_SITE = $(call github,web2py,pydal,$(PYTHON_PYDAL_VERSION))
 PYTHON_PYDAL_LICENSE = BSD-3c
 PYTHON_PYDAL_LICENSE_FILES = LICENSE
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/3 package/python-pydal: bump to version v15.07

Dear Angelo Compagnucci,

Quoted 6 lines · Angelo Compagnucci

This patch bumps python-pydal to version v15.07.

---
 package/python-pydal/python-pydal.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I've applied patches 2/3 and 3/3 of your series. I've marked patch 1/3 as "Changes Requested" since I made some comments about it. Can you respin 1/3 ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 3/3 package/python-web2py: bump to version R-2.11.2

In reply to Angelo Compagnucci

This patch bumps python-web2py to version R-2.11.2.

---
 package/python-web2py/python-web2py.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-web2py/python-web2py.mk +1 -1
index 8eab6bd..869d723 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-PYTHON_WEB2PY_VERSION = R-2.10.3
+PYTHON_WEB2PY_VERSION = R-2.11.2
 PYTHON_WEB2PY_SITE = $(call github,web2py,web2py,$(PYTHON_WEB2PY_VERSION))
 PYTHON_WEB2PY_LICENSE = LGPLv3
 PYTHON_WEB2PY_LICENSE_FILES = LICENSE
Signature · 1 line
1.9.1