Skip to content
Snippets Groups Projects
Commit 9f131870 authored by Armand Bahi's avatar Armand Bahi
Browse files

Utilisation des utils sans avoir besoin de libxml2

parent 1a61e637
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,6 @@ vMap is able to manage business objects while using WMS producing server softwar
To install the dev version of this project run the following steps:
- Install the app via the VAI setup on var/www/[app name]
- Run `sudo apt-get install libxml2-utils`
- Clone this repo on var/wwww/[app name]\_dev
- Run install.sh and give the var/www/[app name] path when asked to build your tree structure
- Now you have the correct versioned tree structure, rename var/www/[app name] as var/www/[app name]\_vai and var/www/[app name]\_dev as var/www/[app name]
......
#!/bin/bash
#
# Récupère l'ensemble des dépendances depuis conf/_install/dependency.xml
# Nécessite xmllint : sudo apt install libxml2-utils
#
#
#
#
if [ "../conf/_install/dependency.xml" ]; then
let depsCount=$(xmllint --xpath 'count(//dependenciesCollection/dependency/name)' ../conf/_install/dependency.xml)
declare -A aDeps
vitisVersion=master
dependencies=($(cat "../conf/_install/dependency.xml" | tr -d '\040\011\012\015' | grep -oP '<dependency>([\s\S]*?)<\/dependency>'))
for (( i=1; i <= $depsCount; i++ )); do
for i in ${!dependencies[*]}; do
sName="$(xmllint --xpath 'string(//dependenciesCollection/dependency['$i']/name)' ../conf/_install/dependency.xml)"
sVersion="$(xmllint --xpath 'string(//dependenciesCollection/dependency['$i']/version)' ../conf/_install/dependency.xml)"
sNature="$(xmllint --xpath 'string(//dependenciesCollection/dependency['$i']/nature)' ../conf/_install/dependency.xml)"
sName=$(grep -oP '(?<=name>)[^<]+' <<< ${dependencies[$i]})
sVersion=$(grep -oP '(?<=version>)[^<]+' <<< ${dependencies[$i]})
sNature=$(grep -oP '(?<=nature>)[^<]+' <<< ${dependencies[$i]})
if [ $sName == "vitis" ]; then
vitisVersion=$sVersion
......@@ -33,16 +31,16 @@ if [ "../conf/_install/dependency.xml" ]; then
echo "[INFO] dependencies:"
echo "vitis : $vitisVersion"
for (( i=1; i <= $depsCount; i++ )); do
echo "name: ${aDeps[$i, name]}"
echo "version: ${aDeps[$i, version]}"
for i in ${!dependencies[*]}; do
echo "(${aDeps[$i, nature]}) ${aDeps[$i, name]} : ${aDeps[$i, version]}"
done
depsCount=${#dependencies[@]}
export vitisVersion
export depsCount
export aDeps
else
echo "[ERROR] ../conf/_install/dependency.xml not found"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment