summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaël Bonithon <gael@xfce.org>2021-09-24 11:11:34 +0200
committerGaël Bonithon <gael@xfce.org>2021-09-24 11:26:36 +0200
commit5e6bdfba4427f2a70c13099726c9c4edd21a5c97 (patch)
tree5fa7a2a0af047bbc20d63d72bb3a972dd5d58fd4
parent7f231c22e1ade73d984ea51d48eee8662065ca8d (diff)
downloadxfce4-dev-tools-5e6bdfba4427f2a70c13099726c9c4edd21a5c97.tar.gz
xfce-do-release: Update Appdata file
This adds the new release to the Appdata file if the `<releases>` tag exists. This file is only searched in the root of the repository and in the `data` directory, and must be unique.
-rwxr-xr-xhelpers/xfce-do-release22
1 files changed, 22 insertions, 0 deletions
diff --git a/helpers/xfce-do-release b/helpers/xfce-do-release
index ca4604f..edd6f5d 100755
--- a/helpers/xfce-do-release
+++ b/helpers/xfce-do-release
@@ -157,6 +157,25 @@ run_command () {
fi
}
+update_appdata_file () {
+ local -a files
+ local set_nullglob=$(shopt -p nullglob) set_nocaseglob=$(shopt -p nocaseglob)
+
+ shopt -s nullglob nocaseglob
+ files=(*"$1.appdata.xml.in" data/*"$1.appdata.xml.in")
+ $set_nullglob
+ $set_nocaseglob
+
+ if ((${#files[@]} == 1)); then
+ sed -Ei "s%(\s*)<releases>%&\n\1\1<release date=\"$(date '+%Y-%m-%d')\" version=\"$2\"/>%" "${files[0]}"
+ elif ((${#files[@]} > 1)); then
+ echo " Found several files whose name ends with '$1.appdata.xml.in' (case insensitive, no modification):"
+ printf ' %s\n' "${files[@]}"
+ else
+ echo " Could not find any file whose name ends with '$1.appdata.xml.in' (case insensitive)."
+ fi
+}
+
edit () {
read -n 1 -p " → Accept? ([Y]es, [e]dit) " response
if [ "$response" = "e" ]; then
@@ -201,6 +220,9 @@ run_steps () {
run_command "xfce-update-news $component $version"
edit NEWS
+ step "Update Appdata file \e[0m(add new release)"
+ run_command "update_appdata_file $component $version"
+
step "Build the tarball \e[0m(./autogen.sh && make distcheck)"
# either in the xfce-build or xfce-test container or on the local machine
if [ -n "$TAG" ]; then