Commit 5c3614aa authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Installing and updating component library.

parent e9a42853
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. ${DIR}/common.sh
# Fetch and install latest ASN1SCC release
LIBDIR=${PREFIX}/share/components_library
mkdir -p ${LIBDIR} || exit 1
getver() {
grep TASTE_IV_Properties::Version "$@" | head -1 | \
awk -F\" '{print $(NF-1)}'
}
cd "${DIR}"/../components_library || exit 1
for i in * ; do
# Only check folders (the components folder has files, too)
cd "${DIR}"/../components_library || exit 1
[ ! -d "$i" ] && continue
# Is it already installed?
if [ ! -d ${LIBDIR}/"$i" ] ; then
# No, install component in library
echo "[-] Installing $i in component library..."
cp -a "$i" ${LIBDIR} || exit 1
else
# Yes, it is - check for updates
cd "${DIR}"/../components_library/"$i" || exit 1
NEWVER=$(getver *aadl)
cd ${LIBDIR}/"$i" || exit 1
OLDVER=$(getver *aadl)
if [ "${OLDVER}" != "${NEWVER}" ] ; then
echo "[-] Updating $i in component library..."
cp -a "${DIR}"/../components_library/"$i"/* .
fi
fi
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment