summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Steinbeiß <ochosi@xfce.org>2021-01-02 22:50:18 +0100
committerSimon Steinbeiß <ochosi@xfce.org>2021-01-02 22:50:18 +0100
commit385f43220419a38c3641482ecefe35189c1db030 (patch)
tree48d53a5449717bd1847b0ed53835c99cfe46c7e3
parent418ba8d073010112f6f7741dc3e3045020f67d07 (diff)
downloadxfce4-dev-tools-385f43220419a38c3641482ecefe35189c1db030.tar.gz
helpers: Add 'xfce-build describe' command
This command prints the versions of the components built within this container, which are located in the /git folder.
-rwxr-xr-xhelpers/xfce-build24
1 files changed, 17 insertions, 7 deletions
diff --git a/helpers/xfce-build b/helpers/xfce-build
index 30298c5..7fd49bf 100755
--- a/helpers/xfce-build
+++ b/helpers/xfce-build
@@ -4,6 +4,8 @@
# Possible arguments:
# - the version of the xfce-build container (if you want to build with a special version)
# - 'pull' to simply update the container and exit
+# - 'version' as second positional argument after an actual version (e.g. xfce-build latest version)
+# to print all git versions built in the container by build_libs.sh
CONTAINER="xfce/xfce-build"
VERSION="latest"
@@ -15,19 +17,27 @@ docker_pull () {
docker pull xfce/xfce-build:$VERSION
}
+docker_run () {
+ # Run the build in the docker container
+ docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) --volume $VOLUME:/tmp --env CFLAGS="${CFLAGS}" --env CONTAINER=$CONTAINER --env VERSION=$VERSION $CONTAINER:$VERSION /bin/bash -c "${BUILD_CMD}"
+}
+
+# Parse the commandline arguments
if [ -z "$1" ]; then
VERSION="latest"
elif [[ "$1" == "pull" ]]; then
docker_pull
exit 0
-else
- VERSION=$1
+elif [[ "$1" == "describe" ]]; then
+ if [[ ! -z "$2" ]]; then
+ VERSION="$2"
+ fi
+ BUILD_CMD='printf "\e[1m$CONTAINER:$VERSION contains:\e[0m\n";cat /git/xfce_build_version_info.txt'
+ docker_run
+ exit 0
fi
-# Make sure we're running the latest version
+# Run the local build
docker_pull
-
-# Run the build in the docker container
-docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) --volume $VOLUME:/tmp --env CFLAGS="${CFLAGS}" $CONTAINER:$VERSION /bin/bash -c "${BUILD_CMD}"
-
+docker_run
printf "\n---\nBuilt using container $CONTAINER:$VERSION on $VOLUME\n"