From 9d6b7709b62ce5f84948e10ab45d8d4ef0e56b03 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 20 Apr 2023 15:22:30 -0400 Subject: [PATCH 01/38] debian add initial systemd service --- debian/ola.olad.service | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 debian/ola.olad.service diff --git a/debian/ola.olad.service b/debian/ola.olad.service new file mode 100644 index 000000000..b4510e9ca --- /dev/null +++ b/debian/ola.olad.service @@ -0,0 +1,14 @@ +[Unit] +Description=Open Lighting Architecture daemon +Documentation=man:olad(1) +After=network.target remote-fs.target + +[Service] +Environment=LOG_LEVEL=3 +Environment=CONFIG_DIR=/var/lib/ola/conf +User=olad +ExecStart=/usr/bin/olad --log-level $LOG_LEVEL --config-dir $CONFIG_DIR +Restart=on-failure + +[Install] +WantedBy=multi-user.target From 693dc63515a8f91da0d085b507e15b43703f9bde Mon Sep 17 00:00:00 2001 From: Wouter Verhelst Date: Mon, 21 Apr 2014 09:30:40 +0200 Subject: [PATCH 02/38] debian/ola.postinst: add --home parameter to adduser invocation Co-authored-by: Wouter Verhelst Co-authored-by: Perry Naseck --- debian/changelog | 7 +++++++ debian/ola.postinst | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c205fcd1b..043194a67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ola (0.11.0-1) UNRELEASED; urgency=medium + * debian/ola.postinst: add --home parameter to adduser invocation + * This change pulled from Debian by Perry Naseck + https://salsa.debian.org/wouter/ola/-/commit/b9a0e2ab290d64f215891e1d543079dd78e7125e + + -- Perry Naseck Thu, 20 Apr 2023 18:47:03 -0400 + ola (0.10.9-2) UNRELEASED; urgency=medium * Fix ola-rdm-tests Debian package by patching python shebangs to python3 diff --git a/debian/ola.postinst b/debian/ola.postinst index 8ca980bce..f3b84a961 100644 --- a/debian/ola.postinst +++ b/debian/ola.postinst @@ -56,7 +56,7 @@ EOF esac #create the olad user, add it to groups -getent passwd olad > /dev/null || adduser --system --no-create-home olad +getent passwd olad > /dev/null || adduser --system --home /usr/lib/olad --no-create-home olad getent group olad > /dev/null || addgroup --system olad groups olad | grep dialout > /dev/null || adduser olad dialout groups olad | grep plugdev > /dev/null || adduser olad plugdev From 14d6d7e75b45ed6f22cb5d4e8be3dc18995a6052 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 20 Apr 2023 18:52:29 -0400 Subject: [PATCH 03/38] debian remove debconf from init script, add OLAD_OPTS --- debian/ola.olad.init | 17 ++++++----------- debian/ola.olad.service | 4 ++-- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/debian/ola.olad.init b/debian/ola.olad.init index 786534563..c92114730 100644 --- a/debian/ola.olad.init +++ b/debian/ola.olad.init @@ -18,15 +18,12 @@ DESC="OLA daemon" USER=olad LOG_LEVEL=3 CONFIG_DIR="/var/lib/ola/conf" +OLAD_OPTS="" # Reads config file (will override defaults above) [ -r /etc/default/ola ] && . /etc/default/ola -if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then - DAEMON_ARGS="--syslog --log-level $LOG_LEVEL --config-dir $CONFIG_DIR" -elif [ "$1" = "start" ] || [ "$1" = "stop" ] ; then - echo "The init script is currently inactive;\nuse \"dpkg-reconfigure ola\" to change this." >&2 -fi +DAEMON_ARGS="--syslog --log-level $LOG_LEVEL --config-dir $CONFIG_DIR $OLAD_OPTS" [ -x "$DAEMON" ] || exit 0 @@ -43,12 +40,10 @@ case "$1" in ;; stop) # master switch - if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then - log_daemon_msg "Stopping $DESC" "$NAME" - /sbin/start-stop-daemon --stop --pidfile $PIDFILE --chuid $USER --exec $DAEMON --retry 10 - /bin/rm -f $PIDFILE - log_end_msg $? - fi + log_daemon_msg "Stopping $DESC" "$NAME" + /sbin/start-stop-daemon --stop --pidfile $PIDFILE --chuid $USER --exec $DAEMON --retry 10 + /bin/rm -f $PIDFILE + log_end_msg $? ;; reload|force-reload|restart) $0 stop && $0 start diff --git a/debian/ola.olad.service b/debian/ola.olad.service index b4510e9ca..1b4371fe3 100644 --- a/debian/ola.olad.service +++ b/debian/ola.olad.service @@ -6,8 +6,8 @@ After=network.target remote-fs.target [Service] Environment=LOG_LEVEL=3 Environment=CONFIG_DIR=/var/lib/ola/conf -User=olad -ExecStart=/usr/bin/olad --log-level $LOG_LEVEL --config-dir $CONFIG_DIR +Environment=OLAD_OPTS= +ExecStart=/usr/bin/olad --log-level $LOG_LEVEL --config-dir $CONFIG_DIR $OLAD_OPTS Restart=on-failure [Install] From 27585151123519296f6fa9ad69cd8efd257f146b Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 20 Apr 2023 18:53:51 -0400 Subject: [PATCH 04/38] debian move config to /etc/ola --- debian/ola.olad.init | 2 +- debian/ola.olad.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/ola.olad.init b/debian/ola.olad.init index c92114730..c7c7f2714 100644 --- a/debian/ola.olad.init +++ b/debian/ola.olad.init @@ -17,7 +17,7 @@ PIDFILE=/var/run/$NAME.pid DESC="OLA daemon" USER=olad LOG_LEVEL=3 -CONFIG_DIR="/var/lib/ola/conf" +CONFIG_DIR="/etc/ola" OLAD_OPTS="" # Reads config file (will override defaults above) diff --git a/debian/ola.olad.service b/debian/ola.olad.service index 1b4371fe3..58ed0661c 100644 --- a/debian/ola.olad.service +++ b/debian/ola.olad.service @@ -5,7 +5,7 @@ After=network.target remote-fs.target [Service] Environment=LOG_LEVEL=3 -Environment=CONFIG_DIR=/var/lib/ola/conf +Environment=CONFIG_DIR=/etc/ola Environment=OLAD_OPTS= ExecStart=/usr/bin/olad --log-level $LOG_LEVEL --config-dir $CONFIG_DIR $OLAD_OPTS Restart=on-failure From 48d7dfb84e7842ab36b7c2ab24cb3d616466a783 Mon Sep 17 00:00:00 2001 From: Wouter Verhelst Date: Mon, 21 Apr 2014 13:02:32 +0200 Subject: [PATCH 05/38] Don't use debconf for this --- debian/ola-rdm-tests.config | 30 ------------------- debian/ola-rdm-tests.templates | 10 ------- debian/ola.config | 30 ------------------- debian/ola.postinst | 54 ---------------------------------- debian/ola.templates | 10 ------- 5 files changed, 134 deletions(-) delete mode 100644 debian/ola-rdm-tests.config delete mode 100644 debian/ola-rdm-tests.templates delete mode 100644 debian/ola.config delete mode 100644 debian/ola.templates diff --git a/debian/ola-rdm-tests.config b/debian/ola-rdm-tests.config deleted file mode 100644 index 857ae8014..000000000 --- a/debian/ola-rdm-tests.config +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -e -# ola-rdm-tests package configuration script - -conffile="/etc/default/ola-rdm-tests" - -get_config_file() { - config_field=$1 - db_field=$2 - - if [ -f "$conffile" ] ; then - VALUE="$(grep "^[ ]*$config_field" $conffile | sed -e "s/^$config_field *= *\"\(.*\)\"/\1/g")" - if [ -n "$VALUE" ] ; then - db_set $db_field "$VALUE" - fi - fi -} - -# Source debconf library -- we have a Depends line -# to make sure it is there... -. /usr/share/debconf/confmodule -db_version 2.0 - -if [ "$1" = configure -o "$1" = reconfigure ] ; then - get_config_file RUN_DAEMON ola-rdm-tests/daemon - db_input high ola-rdm-tests/daemon || true - db_go - db_get ola-rdm-tests/daemon -fi - -exit 0 diff --git a/debian/ola-rdm-tests.templates b/debian/ola-rdm-tests.templates deleted file mode 100644 index 861ca0782..000000000 --- a/debian/ola-rdm-tests.templates +++ /dev/null @@ -1,10 +0,0 @@ -Template: ola-rdm-tests/daemon -Type: boolean -Default: false -Description: Do you want to start the OLA RDM Test Server at boot time? - The OLA RDM Test Server is needed to run RDM Responder Tests. - . - You have the option of starting the OLA RDM Test Server automatically on - system boot. - . - This setting can be modified later by running 'dpkg-reconfigure ola-rdm-tests'. diff --git a/debian/ola.config b/debian/ola.config deleted file mode 100644 index ab0f9d9b6..000000000 --- a/debian/ola.config +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -e -# ola package configuration script - -conffile="/etc/default/ola" - -get_config_file() { - config_field=$1 - db_field=$2 - - if [ -f "$conffile" ] ; then - VALUE="$(grep "^[ ]*$config_field" $conffile | sed -e "s/^$config_field *= *\"\(.*\)\"/\1/g")" - if [ -n "$VALUE" ] ; then - db_set $db_field "$VALUE" - fi - fi -} - -# Source debconf library -- we have a Depends line -# to make sure it is there... -. /usr/share/debconf/confmodule -db_version 2.0 - -if [ "$1" = configure -o "$1" = reconfigure ] ; then - get_config_file RUN_DAEMON ola/daemon - db_input high ola/daemon || true - db_go - db_get ola/daemon -fi - -exit 0 diff --git a/debian/ola.postinst b/debian/ola.postinst index f3b84a961..64438f827 100644 --- a/debian/ola.postinst +++ b/debian/ola.postinst @@ -1,60 +1,6 @@ #!/bin/sh -e # postinst script for ola -conffile="/etc/default/ola" - -update_config_file() { - db_field=$1 - config_field=$2 - - RET=false - db_get $db_field - if [ -n "$RET" ] ; then - if grep -q "^$config_field" $conffile ; then - # keep any admin changes, while replacing the variable content - sed "s/^[ ]*$config_field=\".*\"/$config_field=\"$RET\"/" < $conffile > $conffile.new && - mv $conffile.new $conffile - else - echo "$config_field=\"$RET\"" >> $conffile - fi - fi -} - -# Source debconf library -- we have a Depends line -# to make sure it is there... -. /usr/share/debconf/confmodule -db_version 2.0 - -case "$1" in - configure) - if [ -f $conffile ] ; then - sed -i -e 's/^[ ]*DAEMON/RUN_DAEMON/g' $conffile - else - cat << EOF > $conffile -# Defaults for ola initscript (/etc/init.d/ola) -# This is a POSIX shell fragment - -# [automatically edited by postinst, do not change line format ] - -# ola daemon switch. If set to true, olad will run. -RUN_DAEMON="true" -EOF - fi - - update_config_file ola/daemon RUN_DAEMON - - db_stop - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - #create the olad user, add it to groups getent passwd olad > /dev/null || adduser --system --home /usr/lib/olad --no-create-home olad getent group olad > /dev/null || addgroup --system olad diff --git a/debian/ola.templates b/debian/ola.templates deleted file mode 100644 index 96de6cca8..000000000 --- a/debian/ola.templates +++ /dev/null @@ -1,10 +0,0 @@ -Template: ola/daemon -Type: boolean -Default: false -Description: Do you want to start the OLA daemon at boot time? - The OLA daemon is needed to use OLA. - . - You have the option of starting the OLA daemon automatically on - system boot. - . - This setting can be modified later by running 'dpkg-reconfigure ola'. From 12090e622909e55e085970d7cabcf45e44527d0f Mon Sep 17 00:00:00 2001 From: Wouter Verhelst Date: Tue, 30 Jun 2015 19:50:35 +0200 Subject: [PATCH 06/38] More debconf removals Co-authored-by: Wouter Verhelst Co-authored-by: Perry Naseck --- debian/changelog | 5 ++ debian/ola-rdm-tests.dirs | 1 + debian/ola-rdm-tests.postinst | 64 ----------------------- debian/ola-rdm-tests.rdm_test_server.init | 7 +-- debian/ola.dirs | 1 + debian/ola.postinst | 9 +--- 6 files changed, 10 insertions(+), 77 deletions(-) delete mode 100644 debian/ola-rdm-tests.postinst diff --git a/debian/changelog b/debian/changelog index 043194a67..f80498397 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,11 @@ ola (0.11.0-1) UNRELEASED; urgency=medium * debian/ola.postinst: add --home parameter to adduser invocation * This change pulled from Debian by Perry Naseck https://salsa.debian.org/wouter/ola/-/commit/b9a0e2ab290d64f215891e1d543079dd78e7125e + * Remove debconf usage + * This change pulled from Debian by Perry Naseck + https://salsa.debian.org/wouter/ola/-/commit/6d27c071547426536b6f8f0db193dcfd7a4e5991 + * This change pulled from Debian by Perry Naseck + 191514d233d2300674df7e9c3febb35c2890c50c -- Perry Naseck Thu, 20 Apr 2023 18:47:03 -0400 diff --git a/debian/ola-rdm-tests.dirs b/debian/ola-rdm-tests.dirs index ee941365a..e93c0bbb8 100644 --- a/debian/ola-rdm-tests.dirs +++ b/debian/ola-rdm-tests.dirs @@ -1,3 +1,4 @@ +etc/ola usr/bin usr/lib usr/share diff --git a/debian/ola-rdm-tests.postinst b/debian/ola-rdm-tests.postinst deleted file mode 100644 index 31acfe364..000000000 --- a/debian/ola-rdm-tests.postinst +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -e -# postinst script for ola-rdm-tests - -conffile="/etc/default/ola-rdm-tests" - -update_config_file() { - db_field=$1 - config_field=$2 - - RET=false - db_get $db_field - if [ -n "$RET" ] ; then - if grep -q "^$config_field" $conffile ; then - # keep any admin changes, while replacing the variable content - sed "s/^[ ]*$config_field=\".*\"/$config_field=\"$RET\"/" < $conffile > $conffile.new && - mv $conffile.new $conffile - else - echo "$config_field=\"$RET\"" >> $conffile - fi - fi -} - -# Source debconf library -- we have a Depends line -# to make sure it is there... -. /usr/share/debconf/confmodule -db_version 2.0 - -case "$1" in - configure) - if [ -f $conffile ] ; then - sed -i -e 's/^[ ]*DAEMON/RUN_DAEMON/g' $conffile - else - cat << EOF > $conffile -# Defaults for ola-rdm-tests initscript (/etc/init.d/ola-rdm-tests) -# This is a POSIX shell fragment - -# [automatically edited by postinst, do not change line format ] - -# ola-rdm-tests daemon switch. If set to true, rdm_test_server.py will run. -RUN_DAEMON="true" -EOF - fi - - update_config_file ola-rdm-tests/daemon RUN_DAEMON - - db_stop - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 diff --git a/debian/ola-rdm-tests.rdm_test_server.init b/debian/ola-rdm-tests.rdm_test_server.init index 942e4dc12..2de22fd76 100644 --- a/debian/ola-rdm-tests.rdm_test_server.init +++ b/debian/ola-rdm-tests.rdm_test_server.init @@ -17,16 +17,11 @@ DAEMON=/usr/bin/$NAME PIDFILE=/var/run/$CMD.pid DESC="OLA RDM Test Server" USER=olad +DAEMON_ARGS="--world-writable" # Reads config file (will override defaults above) [ -r /etc/default/ola-rdm-tests ] && . /etc/default/ola-rdm-tests -if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then - DAEMON_ARGS="--world-writeable" -elif [ "$1" = "start" ] || [ "$1" = "stop" ] ; then - echo "The init script is currently inactive;\nuse \"dpkg-reconfigure ola-rdm-tests\" to change this." >&2 -fi - [ -x "$DAEMON" ] || exit 0 . /lib/lsb/init-functions diff --git a/debian/ola.dirs b/debian/ola.dirs index 2d4f2c89f..e18bd5176 100644 --- a/debian/ola.dirs +++ b/debian/ola.dirs @@ -1,3 +1,4 @@ +etc/ola usr/bin usr/lib usr/share/olad/www diff --git a/debian/ola.postinst b/debian/ola.postinst index 64438f827..fd6976c01 100644 --- a/debian/ola.postinst +++ b/debian/ola.postinst @@ -8,13 +8,8 @@ groups olad | grep dialout > /dev/null || adduser olad dialout groups olad | grep plugdev > /dev/null || adduser olad plugdev # setup the config dir -CONF_DIR=/var/lib/ola -if [ ! -d ${CONF_DIR} ]; then - mkdir -p ${CONF_DIR}; - chown -R olad:olad ${CONF_DIR}; - chmod g+s ${CONF_DIR}; -fi; - +chown -R olad:olad /etc/ola +chmod g+s /etc/ola # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. From 84282f4932269c38e7acaadaf1c819165e211163 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 20 Apr 2023 19:18:27 -0400 Subject: [PATCH 07/38] add rdm_test_server systemd service --- debian/ola-rdm-tests.rdm_test_server.service | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 debian/ola-rdm-tests.rdm_test_server.service diff --git a/debian/ola-rdm-tests.rdm_test_server.service b/debian/ola-rdm-tests.rdm_test_server.service new file mode 100644 index 000000000..92ad1d2c4 --- /dev/null +++ b/debian/ola-rdm-tests.rdm_test_server.service @@ -0,0 +1,12 @@ +[Unit] +Description=Open Lighting Architecture RDM Test Server +Documentation=man:olad(1) +After=network.target remote-fs.target olad.service + +[Service] +Environment=OLA_RDM_TEST_SERVER_OPTS= +ExecStart=/usr/bin/rdm_test_server.py --world-writable $OLA_RDM_TEST_SERVER_OPTS +Restart=on-failure + +[Install] +WantedBy=multi-user.target From 9ffb314d1f15adc303f3d2177ce65df7d394dc0e Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 21 Apr 2023 10:37:47 -0400 Subject: [PATCH 08/38] debian systemd services user, rdm_test_server service configurable args --- debian/ola-rdm-tests.rdm_test_server.service | 6 +++--- debian/ola.olad.service | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/ola-rdm-tests.rdm_test_server.service b/debian/ola-rdm-tests.rdm_test_server.service index 92ad1d2c4..e1c66f545 100644 --- a/debian/ola-rdm-tests.rdm_test_server.service +++ b/debian/ola-rdm-tests.rdm_test_server.service @@ -4,9 +4,9 @@ Documentation=man:olad(1) After=network.target remote-fs.target olad.service [Service] -Environment=OLA_RDM_TEST_SERVER_OPTS= -ExecStart=/usr/bin/rdm_test_server.py --world-writable $OLA_RDM_TEST_SERVER_OPTS -Restart=on-failure +User=olad +Environment=RDM_TEST_SERVER_OPTS="--world-writable" +ExecStart=/usr/bin/rdm_test_server.py $RDM_TEST_SERVER_OPTS [Install] WantedBy=multi-user.target diff --git a/debian/ola.olad.service b/debian/ola.olad.service index 58ed0661c..53d3cae4e 100644 --- a/debian/ola.olad.service +++ b/debian/ola.olad.service @@ -4,6 +4,7 @@ Documentation=man:olad(1) After=network.target remote-fs.target [Service] +User=olad Environment=LOG_LEVEL=3 Environment=CONFIG_DIR=/etc/ola Environment=OLAD_OPTS= From 896b13fffcf89150f3534d268b057512491a7dca Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 21 Apr 2023 10:59:03 -0400 Subject: [PATCH 09/38] debian systemd services wait for network, olad --- debian/ola-rdm-tests.rdm_test_server.service | 1 + debian/ola.olad.service | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/ola-rdm-tests.rdm_test_server.service b/debian/ola-rdm-tests.rdm_test_server.service index e1c66f545..76d266474 100644 --- a/debian/ola-rdm-tests.rdm_test_server.service +++ b/debian/ola-rdm-tests.rdm_test_server.service @@ -2,6 +2,7 @@ Description=Open Lighting Architecture RDM Test Server Documentation=man:olad(1) After=network.target remote-fs.target olad.service +Wants=olad.service [Service] User=olad diff --git a/debian/ola.olad.service b/debian/ola.olad.service index 53d3cae4e..59ccb0e2e 100644 --- a/debian/ola.olad.service +++ b/debian/ola.olad.service @@ -1,7 +1,8 @@ [Unit] Description=Open Lighting Architecture daemon Documentation=man:olad(1) -After=network.target remote-fs.target +After=network.target remote-fs.target network-online.target +Wants=network-online.target [Service] User=olad From bd8910235c71c9ea3ebcb50b39a145cc7bd385b5 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 21 Apr 2023 11:48:15 -0400 Subject: [PATCH 10/38] update Debian compat level --- debian/compat | 1 - debian/control | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 debian/compat diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec635144f..000000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control index 0fed249b9..cdb2134a6 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: ola Priority: optional Maintainer: Wouter Verhelst Uploaders: RenZO -Build-Depends: debhelper (>= 13), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy +Build-Depends: debhelper-compat (= 13), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy Standards-Version: 3.9.8 Section: libs Vcs-Git: https://github.com/OpenLightingProject/ola.git From e905f028f9dc56db6823ea596b70bc55bb7d0c06 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 21 Apr 2023 11:52:57 -0400 Subject: [PATCH 11/38] debian dh-autoreconf superseeds autotools-dev --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index cdb2134a6..dc49055e1 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: ola Priority: optional Maintainer: Wouter Verhelst Uploaders: RenZO -Build-Depends: debhelper-compat (= 13), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy +Build-Depends: debhelper-compat (= 13), dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy Standards-Version: 3.9.8 Section: libs Vcs-Git: https://github.com/OpenLightingProject/ola.git From d24b096e7a98bc59b3e9f17e1ac1076fa252d6d6 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 21 Apr 2023 12:00:18 -0400 Subject: [PATCH 12/38] debian rules remove autotools_dev but keep package --- debian/control | 2 +- debian/rules | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index dc49055e1..cdb2134a6 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: ola Priority: optional Maintainer: Wouter Verhelst Uploaders: RenZO -Build-Depends: debhelper-compat (= 13), dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy +Build-Depends: debhelper-compat (= 13), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy Standards-Version: 3.9.8 Section: libs Vcs-Git: https://github.com/OpenLightingProject/ola.git diff --git a/debian/rules b/debian/rules index 0089ad108..5e37bb2be 100755 --- a/debian/rules +++ b/debian/rules @@ -11,7 +11,7 @@ export VERBOSE=1 %: - dh $@ --parallel --with autotools_dev,autoreconf,bash_completion,python3 + dh $@ --parallel --with autoreconf,bash_completion,python3 override_dh_auto_configure: dh_auto_configure -- --enable-python-libs --enable-rdm-tests CXXFLAGS='-Wno-error=deprecated-declarations -Wno-error=unused-parameter' pythondir='/usr/lib/python3/dist-packages' From 886c092cc5903a65bc27c0849f5bd400cee15b68 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 21 Apr 2023 12:18:00 -0400 Subject: [PATCH 13/38] Debian stick with debhelper 12 --- debian/control | 2 +- debian/rules | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index cdb2134a6..cae705cf0 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: ola Priority: optional Maintainer: Wouter Verhelst Uploaders: RenZO -Build-Depends: debhelper-compat (= 13), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy +Build-Depends: debhelper-compat (= 12), autotools-dev, dh-autoreconf, dh-python, bash-completion, libcppunit-dev, bison, flex, pkg-config, uuid-dev, python3, python3-protobuf, libprotobuf-dev, protobuf-compiler, libprotoc-dev, libusb-1.0-0-dev, libftdi1-dev, liblo-dev, libmicrohttpd-dev, libncurses5-dev, libavahi-client-dev, python3-numpy Standards-Version: 3.9.8 Section: libs Vcs-Git: https://github.com/OpenLightingProject/ola.git diff --git a/debian/rules b/debian/rules index 5e37bb2be..85a1b1fa4 100755 --- a/debian/rules +++ b/debian/rules @@ -11,7 +11,7 @@ export VERBOSE=1 %: - dh $@ --parallel --with autoreconf,bash_completion,python3 + dh $@ --parallel --with bash_completion,python3 override_dh_auto_configure: dh_auto_configure -- --enable-python-libs --enable-rdm-tests CXXFLAGS='-Wno-error=deprecated-declarations -Wno-error=unused-parameter' pythondir='/usr/lib/python3/dist-packages' From 24d2cec5a99fd6fed4c52f133a0e7f32cd59f7b5 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 21 Apr 2023 12:20:52 -0400 Subject: [PATCH 14/38] Debian add override_dh_installsystemd --- debian/rules | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/rules b/debian/rules index 85a1b1fa4..b4de45045 100755 --- a/debian/rules +++ b/debian/rules @@ -20,6 +20,10 @@ override_dh_installinit: dh_installinit -p ola --name=olad dh_installinit -p ola-rdm-tests --name=rdm_test_server +override_dh_installsystemd: + dh_installsystemd -p ola --name=olad + dh_installsystemd -p ola-rdm-tests --name=rdm_test_server + override_dh_makeshlibs: dh_makeshlibs -V From b31073a19ce3a6e3a59ebf397b24144507857854 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Sun, 18 Jun 2023 17:11:28 -0400 Subject: [PATCH 15/38] debian update Makefile dist files list --- debian/Makefile.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/debian/Makefile.mk b/debian/Makefile.mk index 99b5cae78..e16791a98 100644 --- a/debian/Makefile.mk +++ b/debian/Makefile.mk @@ -1,7 +1,6 @@ # Debian build files EXTRA_DIST += \ debian/changelog \ - debian/compat \ debian/control \ debian/copyright \ debian/libola-dev.dirs \ @@ -10,20 +9,18 @@ EXTRA_DIST += \ debian/ola-python.dirs \ debian/ola-python.install \ debian/ola-rdm-tests.bash-completion \ - debian/ola-rdm-tests.config \ debian/ola-rdm-tests.dirs \ debian/ola-rdm-tests.install \ - debian/ola-rdm-tests.postinst \ debian/ola-rdm-tests.rdm_test_server.init \ - debian/ola-rdm-tests.templates \ + debian/ola-rdm-tests.rdm_test_server.service \ debian/ola.bash-completion \ debian/ola.config \ debian/ola.dirs \ debian/ola.docs \ debian/ola.install \ debian/ola.olad.init \ + debian/ola.olad.service \ debian/ola.postinst \ - debian/ola.templates \ debian/ola.udev \ debian/org.openlighting.ola.ola.metainfo.xml \ debian/rules \ From 146a9d14d1a894d61ea4dba3d5689373ab9232c7 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Sun, 18 Jun 2023 17:22:18 -0400 Subject: [PATCH 16/38] debian update Makefile dist files list again --- debian/Makefile.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/Makefile.mk b/debian/Makefile.mk index e16791a98..1840398e1 100644 --- a/debian/Makefile.mk +++ b/debian/Makefile.mk @@ -14,7 +14,6 @@ EXTRA_DIST += \ debian/ola-rdm-tests.rdm_test_server.init \ debian/ola-rdm-tests.rdm_test_server.service \ debian/ola.bash-completion \ - debian/ola.config \ debian/ola.dirs \ debian/ola.docs \ debian/ola.install \ From 1740d5a3aac7481e25de2eb172cfa4b0bf827d90 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 16:45:16 -0400 Subject: [PATCH 17/38] add build name generation and bake into build --- common/base/Flags.cpp | 1 + common/base/Version.cpp | 4 ++++ configure.ac | 9 +++++++++ include/ola/base/Version.h.in | 10 ++++++++++ javascript/ola/common/server_stats.js | 1 + olad/Olad.cpp | 3 ++- olad/OladHTTPServer.cpp | 1 + olad/www/mobile.html | 3 +++ olad/www/mobile.js | 2 +- olad/www/new/views/overview.html | 4 ++++ olad/www/ola.html | 3 +++ olad/www/ola.js | 2 +- scripts/build_name.sh | 19 +++++++++++++++++++ 13 files changed, 59 insertions(+), 3 deletions(-) create mode 100755 scripts/build_name.sh diff --git a/common/base/Flags.cpp b/common/base/Flags.cpp index 201a87ce1..79de19835 100644 --- a/common/base/Flags.cpp +++ b/common/base/Flags.cpp @@ -291,6 +291,7 @@ void FlagRegistry::DisplayUsage() { */ void FlagRegistry::DisplayVersion() { cout << "OLA " << m_argv0 << " version: " << ola::base::Version::GetVersion() + << ", build: " << ola::base::Version::GetBuildName() << endl; } diff --git a/common/base/Version.cpp b/common/base/Version.cpp index fbb79308c..a523fe013 100644 --- a/common/base/Version.cpp +++ b/common/base/Version.cpp @@ -40,6 +40,10 @@ unsigned int Version::GetRevision() { return OLA_VERSION_REVISION; } +string Version::GetBuildName() { + return OLA_BUILD_NAME; +} + string Version::GetVersion() { std::ostringstream str; str << GetMajor() << "." << GetMinor() << "." << GetRevision(); diff --git a/configure.ac b/configure.ac index 3e9e809af..2119ce4d0 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,14 @@ AC_SUBST([ola_revision_version]) OLA_REVISION_VERSION=ola_revision_version AC_SUBST(OLA_REVISION_VERSION) +# Build name is separate because AC_CHECK_PROG must come after AC_INIT +AC_CHECK_PROG([git],[git],[yes],[no]) +AM_CONDITIONAL([FOUND_GIT], [test "x$git" = xyes]) +AC_SUBST(OLA_BUILD_NAME) +AM_COND_IF([FOUND_GIT], + [OLA_BUILD_NAME="$(./scripts/build_name.sh)"], + [OLA_BUILD_NAME="unknown"]) + # Checks for programs. AC_LANG([C++]) AC_PROG_CXX @@ -1025,6 +1033,7 @@ echo \ "------------------------------------------------------- ${PACKAGE_NAME} Version ${PACKAGE_VERSION} +Build Name: ${OLA_BUILD_NAME} Prefix: '${prefix}' Compiler: '${CXX} ${CXXFLAGS} ${CPPFLAGS}' Linker: '${LD} ${AM_LDFLAGS} ${LIBS}' diff --git a/include/ola/base/Version.h.in b/include/ola/base/Version.h.in index 3d2201bc1..067cb0a8e 100644 --- a/include/ola/base/Version.h.in +++ b/include/ola/base/Version.h.in @@ -27,9 +27,13 @@ namespace ola { namespace base { +#define PRE_QUOTE(s) #s +#define PRE_STR(s) PRE_QUOTE(s) + #define OLA_VERSION_MAJOR @OLA_MAJOR_VERSION@ #define OLA_VERSION_MINOR @OLA_MINOR_VERSION@ #define OLA_VERSION_REVISION @OLA_REVISION_VERSION@ +#define OLA_BUILD_NAME PRE_STR(@OLA_BUILD_NAME@) /** * @class Version ola/base/Version.h @@ -63,6 +67,12 @@ class Version { */ static std::string GetVersion(); + /** + * @brief the build name as a string. + * @return the build name as a string. + */ + static std::string GetBuildName(); + /** * @brief Check the running version is newer than or equal to a specific * version. diff --git a/javascript/ola/common/server_stats.js b/javascript/ola/common/server_stats.js index cd63dee6b..021945096 100644 --- a/javascript/ola/common/server_stats.js +++ b/javascript/ola/common/server_stats.js @@ -76,6 +76,7 @@ ola.common.ServerStats.prototype.updateServerInfo_ = function(e) { goog.dom.$('server_mac').innerHTML = e.server_info['hw_address']; goog.dom.$('server_instance_name').innerHTML = e.server_info['instance_name']; goog.dom.$('server_version').innerHTML = e.server_info['version']; + goog.dom.$('server_build').innerHTML = e.server_info['build']; goog.dom.$('server_uptime').innerHTML = e.server_info['up_since']; if (!e.server_info['quit_enabled']) { diff --git a/olad/Olad.cpp b/olad/Olad.cpp index cf1927a28..a4a16d5ff 100644 --- a/olad/Olad.cpp +++ b/olad/Olad.cpp @@ -95,7 +95,8 @@ int main(int argc, char *argv[]) { ola::ParseFlags(&argc, argv); ola::InitLoggingFromFlags(); - OLA_INFO << "OLA Daemon version " << ola::base::Version::GetVersion(); + OLA_INFO << "OLA Daemon version " << ola::base::Version::GetVersion() + << " build " << ola::base::Version::GetBuildName(); #ifndef OLAD_SKIP_ROOT_CHECK uid_t uid; diff --git a/olad/OladHTTPServer.cpp b/olad/OladHTTPServer.cpp index 812684ffe..86298cf64 100644 --- a/olad/OladHTTPServer.cpp +++ b/olad/OladHTTPServer.cpp @@ -462,6 +462,7 @@ int OladHTTPServer::JsonServerStats(const HTTPRequest*, json.Add("hw_address", m_interface.hw_address.ToString()); #endif // OLA_SCREENSHOT_MODE json.Add("version", ola::base::Version::GetVersion()); + json.Add("build", ola::base::Version::GetBuildName()); json.Add("up_since", start_time_str); json.Add("quit_enabled", m_enable_quit); diff --git a/olad/www/mobile.html b/olad/www/mobile.html index d52d754af..4617ab563 100644 --- a/olad/www/mobile.html +++ b/olad/www/mobile.html @@ -424,6 +424,9 @@ Version
+ + Build
+ Started
diff --git a/olad/www/mobile.js b/olad/www/mobile.js index ffa0a3078..f418a7634 100644 --- a/olad/www/mobile.js +++ b/olad/www/mobile.js @@ -146,7 +146,7 @@ function Sg(a,b){var c=gf(b.target);fe(a.Yb);var d=a.Yb.element;d.innerHTML="";i "Save"),S(h,d),K(h,"action",function(){Tg(this)},!1,a));a.Vd=c.items}} function Tg(a){for(var b=a.Vd,c=b.length,d=P(a.za.id()),h="",g=0;g "+(o-1));return}o=b[g].max;if(o!=k&&n>o){a.Dd("Invalid Value",b[g].description+" must be < "+(o+1));return}h+=j+"="+l+"&"}else if(b[g].type=="string")l=d.elements[j].value,h+=j+"="+l+"&"; else if(b[g].type=="bool")h+=j+"="+(b[g].object.vb()?"1":"0")+"&";else if(b[g].type=="select")l=b[g].object.qb(),l=b[g].value[l].value,h+=j+"="+l+"&"}Df(a.J,a.Aa,a.Ib,a.za.id(),a.za.hint(),h,function(b){b=gf(b.target);b.error?alert(b.error):Rg(a)})};function Ug(){var a=sf.p();K(a,"server_info_change",this.gf,!1,this);xf(a)}Ug.prototype.title=r("Home");Ug.prototype.blur=aa();Ug.prototype.update=function(){xf(sf.p())}; -Ug.prototype.gf=function(a){P("server_hostname").innerHTML=a.Ma.hostname;P("server_ip").innerHTML=a.Ma.ip;P("server_broadcast").innerHTML=a.Ma.broadcast;P("server_mac").innerHTML=a.Ma.hw_address;P("server_instance_name").innerHTML=a.Ma.instance_name;P("server_version").innerHTML=a.Ma.version;P("server_uptime").innerHTML=a.Ma.up_since;if(!a.Ma.quit_enabled&&(a=P("stop_button")))a.style.display="none"};function Vg(a){this.ia=a;this.Bd=[];this.enabled=this.ke=!1;this.ec=k}Vg.prototype.O=function(a,b){this.enabled=a;this.ec=b;if(this.enabled){if(!this.ke){for(var c=0;c<512;++c){var d=Q("div");d.title="Channel "+(c+1);var h=Q("div");h.innerHTML=c+1;var g=Q("span");g.innerHTML=" ";d.appendChild(h);d.appendChild(g);this.ia.appendChild(d);this.Bd.push(g)}this.ke=!0}Wg(this)}};function Wg(a){a.enabled&&Ff(sf.p(),a.ec,function(b){Xg(a,b.dmx)})} +Ug.prototype.gf=function(a){P("server_hostname").innerHTML=a.Ma.hostname;P("server_ip").innerHTML=a.Ma.ip;P("server_broadcast").innerHTML=a.Ma.broadcast;P("server_mac").innerHTML=a.Ma.hw_address;P("server_instance_name").innerHTML=a.Ma.instance_name;P("server_version").innerHTML=a.Ma.version;P("server_build").innerHTML=a.Ma.build;P("server_uptime").innerHTML=a.Ma.up_since;if(!a.Ma.quit_enabled&&(a=P("stop_button")))a.style.display="none"};function Vg(a){this.ia=a;this.Bd=[];this.enabled=this.ke=!1;this.ec=k}Vg.prototype.O=function(a,b){this.enabled=a;this.ec=b;if(this.enabled){if(!this.ke){for(var c=0;c<512;++c){var d=Q("div");d.title="Channel "+(c+1);var h=Q("div");h.innerHTML=c+1;var g=Q("span");g.innerHTML=" ";d.appendChild(h);d.appendChild(g);this.ia.appendChild(d);this.Bd.push(g)}this.ke=!0}Wg(this)}};function Wg(a){a.enabled&&Ff(sf.p(),a.ec,function(b){Xg(a,b.dmx)})} function Xg(a,b){for(var c=Math.min(512,b.length),d=0;d90?"#ffffff":"#000000"}function Zg(a,b){var c=a.Bd[b];if(c!=k)c.innerHTML=" ",c.style.background="#ffffff"};function $g(){this.Zd=new ae("monitor_frame");this.K=new ae("monitor_universe_frame");this.H();this.Zb();this.J=sf.p();K(this.J,"universe_list_change",this.fc,!1,this);this.Yd=new Vg(P("monitor_frame"))}s=$g.prototype;s.title=r("DMX Monitor");s.blur=function(){this.Yd.O(!1,k)};s.Zb=function(){this.aa=k};s.H=function(){ce(this.Zd);ce(this.K)};s.update=function(){this.H();this.Zb();ee(this.K);be(this.K);zf(this.J)}; s.fc=function(a){if(this.aa==k){fe(this.K);var b=new Z;S(b,this.K.element);var c=this;this.aa=new Pd(b,new Mg(function(a){c.Db(a.id(),a.name())}))}for(var b=[],d=0;d512)return!1}d=c[2];if(d!=k&&d!=""&&(d=eh(c[2]),d==k||d==0||d>512))return!1;d=c[3];return d!=k&&d!=""&&(c=eh(c[3]),c==k||c>255)?!1:!0}function eh(a){if(!(a==m||a==k))return a=parseInt(a),isNaN(a)?k:a}function dh(a){a=a.replace(">","THRU");a=a.replace("*","1 THRU 512");a=a.replace("ALL","1 THRU 512");a=a.replace("@ +","@ 255");return a=a.replace("@ FULL","@ 255")};function fh(a,b){this.ec=b;this.ee=new bh;this.Bb=Q("table");var c=Q("caption");c.innerHTML=a;this.Bb.appendChild(c);gh(this);c="7,8,9, THRU ,4,5,6, @ ,1,2,3,FULL,0,ENTER".split(",");for(i=0;i<3;++i){var d=Q("tr");for(x=0;x<4;++x){var h=Q("td"),g=hh(this,c[i*4+x]);S(g,h);d.appendChild(h)}this.Bb.appendChild(d)}Q("tr");d=Q("td");g=hh(this,c[12]);S(g,d);this.Bb.appendChild(d);d=Q("td");g=hh(this,c[13]);S(g,d);d.colSpan="3";this.Bb.appendChild(d)} diff --git a/olad/www/new/views/overview.html b/olad/www/new/views/overview.html index c17021af3..08d219852 100644 --- a/olad/www/new/views/overview.html +++ b/olad/www/new/views/overview.html @@ -34,6 +34,10 @@

{{Info.instance_name}}

Version: {{Info.version}} + + Build: + {{Info.build}} + Configuration Directory: {{Info.config_dir}} diff --git a/olad/www/ola.html b/olad/www/ola.html index 757131aea..a8209c0eb 100644 --- a/olad/www/ola.html +++ b/olad/www/ola.html @@ -783,6 +783,9 @@ Version
+ + Build
+ Started
diff --git a/olad/www/ola.js b/olad/www/ola.js index 67e12702b..c6a04ab2e 100644 --- a/olad/www/ola.js +++ b/olad/www/ola.js @@ -289,7 +289,7 @@ p.qe=function(a,b){var c=this.Fd[a];if(c!=j){c.innerHTML=b;var d=255-b;c.style.b function al(a){ah(W.c(),a.J,function(b){a.$c.setData(b.dmx);a.ee=!1;a.ha()&&a.bh.start()})}$k.prototype.xh=function(){if(!this.ee){this.ee=!0;var a=this.$c.getData(),b=this;bh(W.c(),this.J,a,function(){b.ee=!1})}};function bl(a,b){this.element=N(a);this.Bg=b;this.Ab=j;this.kb=new Yj(N(a+"_tab_pane"));ak(this.kb,new bk(N("tab_page_1"),"Settings"));ak(this.kb,new bk(N("tab_page_2"),"RDM"));ak(this.kb,new bk(N("tab_page_3"),"RDM Patcher"));ak(this.kb,new bk(N("tab_page_4"),"DMX Monitor"));ak(this.kb,new bk(N("tab_page_5"),"DMX Console"));this.Aa=[];this.Aa.push(new Tj("tab_page_1",function(){b.Hd()}));this.kb.xa(1);this.Aa.push(new pk("tab_page_2"));this.kb.xa(0);this.Aa.push(new tj("tab_page_3"));this.Aa.push(new Aj("tab_page_4")); this.Aa.push(new $k("tab_page_5"));F(this.kb,"change",this.Mi,!1,this);var c=W.c();F(c,"universe_list_change",this.Yj,!1,this)}w(bl,Xj);function cl(a){var b=N("ola-splitpane-content"),b=Md(b);a.Aa[a.kb.Ub()].lc(b)}bl.prototype.Pa=function(a,b){if(this.Ab!=a){for(var c=0;c /dev/null || echo 'unknown-out-of-tree' From b66a17ac5c24cc346262c143f1c845114389ec55 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 17:01:25 -0400 Subject: [PATCH 18/38] build name move git check to script (can be used outside of autoconf) --- configure.ac | 6 +++--- scripts/build_name.sh | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 2119ce4d0..0047040e7 100644 --- a/configure.ac +++ b/configure.ac @@ -24,12 +24,12 @@ OLA_REVISION_VERSION=ola_revision_version AC_SUBST(OLA_REVISION_VERSION) # Build name is separate because AC_CHECK_PROG must come after AC_INIT +# build_name.sh also checks for Git, but this allows that check to show +# up in ./configure for troubleshooting AC_CHECK_PROG([git],[git],[yes],[no]) AM_CONDITIONAL([FOUND_GIT], [test "x$git" = xyes]) AC_SUBST(OLA_BUILD_NAME) -AM_COND_IF([FOUND_GIT], - [OLA_BUILD_NAME="$(./scripts/build_name.sh)"], - [OLA_BUILD_NAME="unknown"]) +OLA_BUILD_NAME="$(./scripts/build_name.sh)" # Checks for programs. AC_LANG([C++]) diff --git a/scripts/build_name.sh b/scripts/build_name.sh index f3f4692c6..d043b54d2 100755 --- a/scripts/build_name.sh +++ b/scripts/build_name.sh @@ -16,4 +16,8 @@ # build_name.sh # Copyright (C) 2023 Perry Naseck -git describe --abbrev=7 --dirty --always --tags 2> /dev/null || echo 'unknown-out-of-tree' +if command -v git &> /dev/null; then + git describe --abbrev=7 --dirty --always --tags 2> /dev/null || echo 'unknown-out-of-tree' +else + echo 'unknown' +fi From f903797a6505d465231632b43867ccd8ade85bfa Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 17:47:35 -0400 Subject: [PATCH 19/38] github actions debian use git describe for version --- .github/workflows/debian.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index dbf285ba8..36fd3edc7 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -28,6 +28,13 @@ jobs: - name: Install Git run: apt-get -y install git - uses: actions/checkout@v3 + - name: Generate build name + shell: bash + run: | + head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git`./scripts/build_name.sh`-\2/" >> $BUILD_NAME + echo "Build name: $BUILD_NAME" + echo "BUILD_NAME=$BUILD_NAME`" >> $GITHUB_OUTPUT + id: generate-build-name - name: Install build tools run: apt-get -y install devscripts adduser fakeroot sudo - name: Install build dependencies @@ -38,7 +45,7 @@ jobs: chown -R builduser:builduser . chown builduser:builduser .. - name: Build - run: sudo -u builduser dpkg-buildpackage -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} + run: sudo -u builduser dpkg-buildpackage -v${{ steps.generate-build-name.BUILD_NAME }} -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} - name: Move built files if: always() run: | From 938733c0ee182df090471e27710ab54159f18caf Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 17:51:11 -0400 Subject: [PATCH 20/38] github actions debian git build name fix env assignment --- .github/workflows/debian.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 36fd3edc7..5cee1882e 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -31,9 +31,9 @@ jobs: - name: Generate build name shell: bash run: | - head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git`./scripts/build_name.sh`-\2/" >> $BUILD_NAME - echo "Build name: $BUILD_NAME" + export BUILD_NAME=$(head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git`./scripts/build_name.sh`-\2/") echo "BUILD_NAME=$BUILD_NAME`" >> $GITHUB_OUTPUT + echo "Build name: $BUILD_NAME" id: generate-build-name - name: Install build tools run: apt-get -y install devscripts adduser fakeroot sudo From 511142870ae2c41fb15db02791fe9d5f56c6ca52 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 17:52:14 -0400 Subject: [PATCH 21/38] github actions debian git build name fix env assignment typo --- .github/workflows/debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 5cee1882e..5016d170b 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -32,7 +32,7 @@ jobs: shell: bash run: | export BUILD_NAME=$(head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git`./scripts/build_name.sh`-\2/") - echo "BUILD_NAME=$BUILD_NAME`" >> $GITHUB_OUTPUT + echo "BUILD_NAME=$BUILD_NAME" >> $GITHUB_OUTPUT echo "Build name: $BUILD_NAME" id: generate-build-name - name: Install build tools From dab152abb0c018f423d78f0d22562a8e1dedae14 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 18:04:18 -0400 Subject: [PATCH 22/38] github actions debian build name fix step reference --- .github/workflows/debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 5016d170b..06ec990a3 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -45,7 +45,7 @@ jobs: chown -R builduser:builduser . chown builduser:builduser .. - name: Build - run: sudo -u builduser dpkg-buildpackage -v${{ steps.generate-build-name.BUILD_NAME }} -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} + run: sudo -u builduser dpkg-buildpackage -v${{ steps.generate-build-name.outputs.BUILD_NAME }} -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} - name: Move built files if: always() run: | From 0f3cf4ba9e49b5cc296d0576e5aca1d4bd0d7a3b Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 18:10:25 -0400 Subject: [PATCH 23/38] github actions debian separate build name from debian version, no backticks --- .github/workflows/debian.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 06ec990a3..83a1cb74f 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -31,9 +31,12 @@ jobs: - name: Generate build name shell: bash run: | - export BUILD_NAME=$(head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git`./scripts/build_name.sh`-\2/") - echo "BUILD_NAME=$BUILD_NAME" >> $GITHUB_OUTPUT - echo "Build name: $BUILD_NAME" + export OLA_BUILD_NAME=$(./scripts/build_name.sh) + export OLA_DEBIAN_BUILD_VERSION=$(head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git$OLA_BUILD_NAME-\2/") + echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_OUTPUT + echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT + echo "Build name: $OLA_BUILD_NAME" + echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION" id: generate-build-name - name: Install build tools run: apt-get -y install devscripts adduser fakeroot sudo @@ -45,7 +48,7 @@ jobs: chown -R builduser:builduser . chown builduser:builduser .. - name: Build - run: sudo -u builduser dpkg-buildpackage -v${{ steps.generate-build-name.outputs.BUILD_NAME }} -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} + run: sudo -u builduser dpkg-buildpackage -v${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }} -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} - name: Move built files if: always() run: | From c4c97a213b20661bb3e9deda61eeb1ba0f3d2399 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 18:12:14 -0400 Subject: [PATCH 24/38] github actions debian try git describe in action --- .github/workflows/debian.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 83a1cb74f..c58c54e24 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -37,6 +37,7 @@ jobs: echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT echo "Build name: $OLA_BUILD_NAME" echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION" + git describe --abbrev=7 --dirty --always --tags id: generate-build-name - name: Install build tools run: apt-get -y install devscripts adduser fakeroot sudo From 46cb35ed435d24e60666ad89943e2b3f1123f32d Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 18:20:37 -0400 Subject: [PATCH 25/38] github actions debian git security precaution fix --- .github/workflows/debian.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index c58c54e24..91d754074 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -31,6 +31,7 @@ jobs: - name: Generate build name shell: bash run: | + chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775 export OLA_BUILD_NAME=$(./scripts/build_name.sh) export OLA_DEBIAN_BUILD_VERSION=$(head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git$OLA_BUILD_NAME-\2/") echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_OUTPUT From 66ba1567c0cae19043bdc60558084ae3ea3f7bbb Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 18:28:59 -0400 Subject: [PATCH 26/38] github actions debian remove test git describe, add dash to debian build version --- .github/workflows/debian.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 91d754074..3da0af7ad 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -33,12 +33,11 @@ jobs: run: | chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775 export OLA_BUILD_NAME=$(./scripts/build_name.sh) - export OLA_DEBIAN_BUILD_VERSION=$(head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git$OLA_BUILD_NAME-\2/") + export OLA_DEBIAN_BUILD_VERSION=$(head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git-$OLA_BUILD_NAME-\2/") echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_OUTPUT echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT echo "Build name: $OLA_BUILD_NAME" echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION" - git describe --abbrev=7 --dirty --always --tags id: generate-build-name - name: Install build tools run: apt-get -y install devscripts adduser fakeroot sudo From c6a521a9061a86f9b0982f9b2dc37ca93bf8939d Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 18:43:03 -0400 Subject: [PATCH 27/38] allow overriding build name --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0047040e7..79c3dfd45 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,10 @@ AC_SUBST(OLA_REVISION_VERSION) AC_CHECK_PROG([git],[git],[yes],[no]) AM_CONDITIONAL([FOUND_GIT], [test "x$git" = xyes]) AC_SUBST(OLA_BUILD_NAME) -OLA_BUILD_NAME="$(./scripts/build_name.sh)" +AC_ARG_VAR([OLA_BUILD_NAME], [Override the build name]) +AS_IF([test "x$OLA_BUILD_NAME" = x], [ + OLA_BUILD_NAME="$(./scripts/build_name.sh)" +]) # Checks for programs. AC_LANG([C++]) From cc2be83d36a3626a1d27e7f0de9cae7362b39b6b Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 19:01:44 -0400 Subject: [PATCH 28/38] github actions debian build name no dirty, create changelong entry --- .github/workflows/debian.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 3da0af7ad..6c92f3638 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -35,12 +35,21 @@ jobs: export OLA_BUILD_NAME=$(./scripts/build_name.sh) export OLA_DEBIAN_BUILD_VERSION=$(head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git-$OLA_BUILD_NAME-\2/") echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_OUTPUT + echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_ENV # Set build name globally so that modifications don't cause -dirty echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT echo "Build name: $OLA_BUILD_NAME" echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION" id: generate-build-name - name: Install build tools run: apt-get -y install devscripts adduser fakeroot sudo + - name: Create Debian version for build + shell: bash + run: | + DEBFULLNAME="GitHub Actions" DEBEMAIL=actions@github.com \ + debchange --allow-lower-version \ + --newversion ${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }} \ + "GitHub Actions Build \ + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - name: Install build dependencies run: mk-build-deps -t "apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends" -i -r - name: Set up build user From f1345160067ade0e2910a67145f8cd8dd971b5ff Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 19:06:42 -0400 Subject: [PATCH 29/38] github actions debian preserve build name in builduser --- .github/workflows/debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 6c92f3638..dc22260e5 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -58,7 +58,7 @@ jobs: chown -R builduser:builduser . chown builduser:builduser .. - name: Build - run: sudo -u builduser dpkg-buildpackage -v${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }} -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} + run: sudo -u builduser env "OLA_BUILD_NAME=$OLA_BUILD_NAME" dpkg-buildpackage -v${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }} -b -rfakeroot -j${{ steps.num-cpu-cores.outputs.NUM_CPU_CORES }} - name: Move built files if: always() run: | From 4e6477a0b0d29712544dddfe40ff8adaec16dd46 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 22 Jun 2023 19:21:27 -0400 Subject: [PATCH 30/38] github actions debian build force explicit previous version --- .github/workflows/debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index dc22260e5..fc197c672 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -46,7 +46,7 @@ jobs: shell: bash run: | DEBFULLNAME="GitHub Actions" DEBEMAIL=actions@github.com \ - debchange --allow-lower-version \ + debchange --force-bad-version \ --newversion ${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }} \ "GitHub Actions Build \ ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" From 23e29c36e37c38125e5f1d8b1850be7b6f697ce5 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 23 Jun 2023 09:34:58 -0400 Subject: [PATCH 31/38] github actions checkout full to create useful OLA_BUILD_NAME --- .github/workflows/build.yaml | 2 ++ .github/workflows/debian.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 554baa985..d16e0ed44 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -57,6 +57,8 @@ jobs: - name: Install Git run: apt-get -y install git - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all tags for generating OLA_BUILD_NAME - name: Install build tools shell: bash run: | diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index fc197c672..230f52623 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -28,6 +28,8 @@ jobs: - name: Install Git run: apt-get -y install git - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all tags for generating OLA_BUILD_NAME - name: Generate build name shell: bash run: | From 60f615fba83712ab3964c9c302d24515f4e65362 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 23 Jun 2023 11:20:36 -0400 Subject: [PATCH 32/38] github actions debian build name in artifacts --- .github/workflows/debian.yml | 30 +++++++++++++++++++++++------- scripts/build_name.sh | 10 ++++++++-- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 230f52623..5488b0ac3 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -25,8 +25,8 @@ jobs: # create a .git folder or .git.config. The Problem Matcher looks for # .git/config to find where the root of the repo is, so it must be # present. - - name: Install Git - run: apt-get -y install git + - name: Install Git and lsb-release + run: apt-get -y install git lsb-release - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all tags for generating OLA_BUILD_NAME @@ -35,10 +35,13 @@ jobs: run: | chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775 export OLA_BUILD_NAME=$(./scripts/build_name.sh) - export OLA_DEBIAN_BUILD_VERSION=$(head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git-$OLA_BUILD_NAME-\2/") + # No docker number tag for testing, so must use lsb_release + export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)+deb$(lsb_release --short --release) + echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_OUTPUT echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_ENV # Set build name globally so that modifications don't cause -dirty echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT + echo "Build name: $OLA_BUILD_NAME" echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION" id: generate-build-name @@ -78,7 +81,7 @@ jobs: - uses: actions/upload-artifact@v3 if: always() with: - name: ola-built-debian-${{ matrix.image_tag }}-${{ matrix.architecture }} + name: ola-built-debian-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }} path: ./built debian-test: name: 'Debian Test ${{ matrix.image_tag }} ${{ matrix.architecture }}' @@ -92,11 +95,24 @@ jobs: architecture: [amd64] container: debian:${{ matrix.image_tag }} steps: - - uses: actions/checkout@master + - name: Install Git and lsb-release + run: apt-get -y install git lsb-release + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all tags for generating OLA_DEBIAN_BUILD_VERSION + - name: Generate build name # Job step outputs can't be passed between builds for matrix jobs, so we re-generate + shell: bash + run: | + chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775 + # No docker number tag for testing, so must use lsb_release + export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)+deb$(lsb_release --short --release) + echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT + echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION" + id: generate-build-name - name: Download build artifact uses: actions/download-artifact@v3 with: - name: ola-built-debian-${{ matrix.image_tag }}-${{ matrix.architecture }} + name: ola-built-debian-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }} path: built - name: Display structure of artifact files run: ls -alR @@ -110,5 +126,5 @@ jobs: - uses: actions/upload-artifact@v3 if: always() # Always upload the test output, even on failed tests with: - name: ola-test-output-debian-${{ matrix.image_tag }}-${{ matrix.architecture }} + name: ola-test-output-debian-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }} path: test-output diff --git a/scripts/build_name.sh b/scripts/build_name.sh index d043b54d2..b89b36108 100755 --- a/scripts/build_name.sh +++ b/scripts/build_name.sh @@ -17,7 +17,13 @@ # Copyright (C) 2023 Perry Naseck if command -v git &> /dev/null; then - git describe --abbrev=7 --dirty --always --tags 2> /dev/null || echo 'unknown-out-of-tree' + OLA_BUILD_NAME=$(git describe --abbrev=7$dirty_flag --always --tags 2> /dev/null || echo 'unknown-out-of-tree') else - echo 'unknown' + OLA_BUILD_NAME='unknown' +fi + +if [ "$1" = "--debian" ]; then + head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git-$OLA_BUILD_NAME-\2/" +else + echo $OLA_BUILD_NAME fi From 3a3db2e84fd8ec7887ef7ac571ca0e4c254d1666 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 23 Jun 2023 11:28:38 -0400 Subject: [PATCH 33/38] github actions debian include tag name in artifact name in case Debian version numbers match --- .github/workflows/debian.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 5488b0ac3..6d5d95be5 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -81,7 +81,7 @@ jobs: - uses: actions/upload-artifact@v3 if: always() with: - name: ola-built-debian-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }} + name: ola-built-debian-${{ matrix.image_tag }}-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }} path: ./built debian-test: name: 'Debian Test ${{ matrix.image_tag }} ${{ matrix.architecture }}' @@ -112,7 +112,7 @@ jobs: - name: Download build artifact uses: actions/download-artifact@v3 with: - name: ola-built-debian-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }} + name: ola-built-debian-${{ matrix.image_tag }}-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }} path: built - name: Display structure of artifact files run: ls -alR @@ -126,5 +126,5 @@ jobs: - uses: actions/upload-artifact@v3 if: always() # Always upload the test output, even on failed tests with: - name: ola-test-output-debian-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }} + name: ola-test-output-debian-${{ matrix.image_tag }}-${{ steps.generate-build-name.outputs.OLA_DEBIAN_BUILD_VERSION }}_${{ matrix.architecture }} path: test-output From 28469df356b176af76687fa2d1b412f966aa6fad Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Fri, 23 Jun 2023 11:37:23 -0400 Subject: [PATCH 34/38] github actions test update apt --- .github/workflows/debian.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 6d5d95be5..c88d7eaff 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -95,6 +95,8 @@ jobs: architecture: [amd64] container: debian:${{ matrix.image_tag }} steps: + - name: Update package database + run: apt-get update -y - name: Install Git and lsb-release run: apt-get -y install git lsb-release - uses: actions/checkout@v3 From 059bc44a9a585e3cace27fefd28729c817c5f137 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Tue, 11 Jul 2023 16:21:36 -0400 Subject: [PATCH 35/38] script build name include dirty flag --- scripts/build_name.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_name.sh b/scripts/build_name.sh index b89b36108..04084616b 100755 --- a/scripts/build_name.sh +++ b/scripts/build_name.sh @@ -17,7 +17,7 @@ # Copyright (C) 2023 Perry Naseck if command -v git &> /dev/null; then - OLA_BUILD_NAME=$(git describe --abbrev=7$dirty_flag --always --tags 2> /dev/null || echo 'unknown-out-of-tree') + OLA_BUILD_NAME=$(git describe --abbrev=7 --dirty --always --tags 2> /dev/null || echo 'unknown-out-of-tree') else OLA_BUILD_NAME='unknown' fi From 801576735f260c54d9a0d02d914838be583a9ab2 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Tue, 11 Jul 2023 16:53:27 -0400 Subject: [PATCH 36/38] github actions debian build version do not append debian version if not found --- .github/workflows/debian.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index c88d7eaff..387ac265f 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -36,7 +36,8 @@ jobs: chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775 export OLA_BUILD_NAME=$(./scripts/build_name.sh) # No docker number tag for testing, so must use lsb_release - export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)+deb$(lsb_release --short --release) + OLA_DEBIAN_BUILD_VERSION_SUFFIX_VER=$(lsb_release --short --release) + export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)$([[ "$OLA_DEBIAN_BUILD_VERSION_SUFFIX_VER" != "n/a" ]] && printf "+deb$OLA_DEBIAN_BUILD_VERSION_SUFFIX_VER") echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_OUTPUT echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_ENV # Set build name globally so that modifications don't cause -dirty From 49d4d44c8c771a24d66db14ab3e01df9c7c5381b Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Wed, 12 Jul 2023 09:50:45 -0400 Subject: [PATCH 37/38] build name script debian version move os ver suffix to script --- .github/workflows/debian.yml | 5 ++--- scripts/build_name.sh | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 387ac265f..2e08f0a6d 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -36,8 +36,7 @@ jobs: chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775 export OLA_BUILD_NAME=$(./scripts/build_name.sh) # No docker number tag for testing, so must use lsb_release - OLA_DEBIAN_BUILD_VERSION_SUFFIX_VER=$(lsb_release --short --release) - export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)$([[ "$OLA_DEBIAN_BUILD_VERSION_SUFFIX_VER" != "n/a" ]] && printf "+deb$OLA_DEBIAN_BUILD_VERSION_SUFFIX_VER") + export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian) echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_OUTPUT echo "OLA_BUILD_NAME=$OLA_BUILD_NAME" >> $GITHUB_ENV # Set build name globally so that modifications don't cause -dirty @@ -108,7 +107,7 @@ jobs: run: | chown root:root . # workaround Git security precaution, see https://github.com/actions/runner-images/issues/6775 # No docker number tag for testing, so must use lsb_release - export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian)+deb$(lsb_release --short --release) + export OLA_DEBIAN_BUILD_VERSION=$(./scripts/build_name.sh --debian) echo "OLA_DEBIAN_BUILD_VERSION=$OLA_DEBIAN_BUILD_VERSION" >> $GITHUB_OUTPUT echo "Debian Build Version: $OLA_DEBIAN_BUILD_VERSION" id: generate-build-name diff --git a/scripts/build_name.sh b/scripts/build_name.sh index 04084616b..e5faa6779 100755 --- a/scripts/build_name.sh +++ b/scripts/build_name.sh @@ -23,7 +23,9 @@ else fi if [ "$1" = "--debian" ]; then - head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git-$OLA_BUILD_NAME-\2/" + OLA_DEBIAN_BUILD_VERSION_SUFFIX_VER=$(lsb_release --short --release) + OLA_DEBIAN_BUILD_VERSION_SUFFIX=$([[ "$OLA_DEBIAN_BUILD_VERSION_SUFFIX_VER" != "n/a" ]] && printf "+deb$OLA_DEBIAN_BUILD_VERSION_SUFFIX_VER") + head -n 1 debian/changelog | sed -E "s/ola \((.+)-([0-9]+)\).*/\1~git-$OLA_BUILD_NAME-\2$OLA_DEBIAN_BUILD_VERSION_SUFFIX/" else echo $OLA_BUILD_NAME fi From dda1a02d36d62aa8d4ab0d202f5651759e861ea4 Mon Sep 17 00:00:00 2001 From: Perry Naseck Date: Thu, 9 Nov 2023 15:48:50 -0500 Subject: [PATCH 38/38] debian systemd rdm-test use env file --- debian/ola-rdm-tests.rdm_test_server.service | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/ola-rdm-tests.rdm_test_server.service b/debian/ola-rdm-tests.rdm_test_server.service index 76d266474..08822da83 100644 --- a/debian/ola-rdm-tests.rdm_test_server.service +++ b/debian/ola-rdm-tests.rdm_test_server.service @@ -7,6 +7,7 @@ Wants=olad.service [Service] User=olad Environment=RDM_TEST_SERVER_OPTS="--world-writable" +EnvironmentFile=-/etc/default/ola-rdm-tests ExecStart=/usr/bin/rdm_test_server.py $RDM_TEST_SERVER_OPTS [Install]