added packages to the prereq list since we are not building them with the global...
[lxqt-slackware.git] / GRAB_VERSION.sh
CommitLineData
73c8ba7d 1#! /bin/bash
2
3# grab the current tag for each git submodule and store it for later use.
4
5set -e
6
7CWD=$(pwd)
8OUTPUT=${CWD}/versioning
9WORKDIR=$1
10
11# the versioning file will contain an array that will be pulled by the SlackBuild
12cat > $OUTPUT <<ASDFA
13#! /bin/bash
14#
15# Array of LXQT modules and relative version
16# This file is sourced during the build process to determine the
17# version of every module that is being built.
18
19declare -A versions
20
21versions+=(
22ASDFA
23
24cd $WORKDIR
25SUBDIRS=$(find . \( ! -regex '.*/\..*' \) -type d -mindepth 1 -maxdepth 1 -print)
26
27for mod in $SUBDIRS; do
28 cd $mod
29 VERSION=$(git describe --tags)
30 MODNAME=$(basename $mod)
31 echo -e "\t[\"$MODNAME\"]=\"$VERSION\"" >> $OUTPUT
32 # forcing libfm-extra version number because of shared source directory with libfm
33 if [[ $MODNAME == "libfm" ]]; then
34 echo -e "\t[\"libfm-extra\"]=\"$VERSION\"" >> $OUTPUT
35 fi
36 cd $WORKDIR
37done
38echo ")" >> $OUTPUT
39echo "" >> $OUTPUT