added packages to the prereq list since we are not building them with the global...
[lxqt-slackware.git] / GRAB_VERSION.sh
1 #! /bin/bash
2
3 # grab the current tag for each git submodule and store it for later use.
4
5 set -e
6
7 CWD=$(pwd)
8 OUTPUT=${CWD}/versioning
9 WORKDIR=$1
10
11 # the versioning file will contain an array that will be pulled by the SlackBuild
12 cat > $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
19 declare -A versions
20
21 versions+=(
22 ASDFA
23
24 cd $WORKDIR
25 SUBDIRS=$(find . \( ! -regex '.*/\..*' \) -type d -mindepth 1 -maxdepth 1 -print)
26
27 for 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
37 done
38 echo ")" >> $OUTPUT
39 echo "" >> $OUTPUT