68 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			68 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
| # este script fuerza que los cambios se vean reflejados
 | |
| # directamente en trytond.
 | |
| #
 | |
| # variables exportadas:
 | |
| # - module_name
 | |
| 
 | |
| [ ! -d "$SRC" ] && die "no se ubica ruta en SRC"
 | |
| 
 | |
| if [ -z "${DEVELOP}" ]; then
 | |
|   DEVELOP="False"
 | |
| fi
 | |
| 
 | |
| if [ ${DEVELOP} = "True" ]; then
 | |
|   pip3 install --break-system-packages proteus==${TRYTOND_VERSION}
 | |
|   pip3 install --break-system-packages -r .dev/requirements_dev.txt
 | |
| fi
 | |
| 
 | |
| # dependencias minimas
 | |
| pip3 install --break-system-packages -r requirements.txt
 | |
| 
 | |
| pip3 install --break-system-packages trytond==${TRYTOND_VERSION}
 | |
| official_modules=".dev/official_modules.txt"
 | |
| 
 | |
| while IFS= read -r module; do
 | |
|   pip3 index versions "trytond-$module" | grep -oP '\d+\.\d+\.\d+' | grep "^${TRYTOND_VERSION}" | while read version; do
 | |
|     pip3 install --break-system-packages "trytond-$module==${version}"
 | |
|     echo "Versión instalada: $module==$version"
 | |
|     break
 | |
|   done
 | |
| 
 | |
| done <"$official_modules"
 | |
| 
 | |
| if [ -d "modules" ] && [ "$(ls -A modules)" ]; then
 | |
| 
 | |
|   module_names=()
 | |
|   for module in modules/*/; do
 | |
| 
 | |
|     pushd "$module"
 | |
| 
 | |
|     # instalar dependencias de tryton desde paquete
 | |
|     python3 setup.py install
 | |
| 
 | |
|     # usamos enlace al paquete
 | |
|     python3 setup.py develop
 | |
| 
 | |
|     # instalar modulo
 | |
|     trytond_modules_path=$(pip3 show trytond | grep Location | sed -nr 's/Location: +//gp')/trytond/modules
 | |
|     module_name=$(cat "setup.py" | fgrep -A 1 [trytond.modules] | sed 1d | cut -d '=' -f 1 | tr -d ' \n')
 | |
| 
 | |
|     # Añadir el nombre del módulo al arreglo
 | |
|     module_names+=("$module_name")
 | |
| 
 | |
|     [ ! -d "$trytond_modules_path" ] && die "fallo al ubicar ruta de modulos de trytond"
 | |
|     ln -sf "$SRC/$module" "$trytond_modules_path/$module_name"
 | |
|     rm -rf "$SRC/$module/$module_name"
 | |
| 
 | |
|     popd
 | |
| 
 | |
|   done
 | |
| 
 | |
|   trytond_path=$(pip3 show trytond | grep Location | sed -nr 's/Location: +//gp')/trytond
 | |
| 
 | |
|   module_names=$(
 | |
|     IFS=:
 | |
|     echo "${module_names[*]}"
 | |
|   )
 | |
| fi
 |