summaryrefslogtreecommitdiffstats
path: root/tde_release_notes
blob: b1cb54f5d2d965b952950af9474a0113230017fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
# A script to open/autostart the release notes in the help
# handbook, but only once.

# Run this script from the global autostart directory.

# When the release version increments, this script will detect the
# difference through tde-config and a respective key in kdeglobals.
# This script then will open the release notes for that next release.
# The only file to update is: tdebase/doc/releasenotes/index.docbook.

# As this script is run as a global TDE autostart app, all
# environment variables should already be set.

if [ "$TDEDIR" = "" ] || [ "$TDEHOME" = "" ]; then
  exit 1
fi

RELEASE_VERSION="$( ${TDEDIR}/bin/tde-config --version | sed -n 's|^TDE: ||p' )"
RELEASE_NOTES="$( ${TDEDIR}/bin/kreadconfig --file ${TDEHOME}/share/config/kdeglobals --group "Release Notes" --key "$RELEASE_VERSION" )"
RELEASE_SERIES="$( ${TDEDIR}/bin/tde-config --version | sed -n 's|^TDE: \([^\.]*\.[^\.]*\).*|\l\1.x|p' )"

if [ "$RELEASE_NOTES" = "" ] || [ "$RELEASE_NOTES" != "true" ]; then
  echo "[release_notes] Release version: $RELEASE_VERSION"
  echo "[release_notes] Release notes: $RELEASE_NOTES"
  if ${TDEDIR}/bin/khelpcenter help:/khelpcenter/releasenotes/${RELEASE_SERIES} ; then
    ${TDEDIR}/bin/kwriteconfig --file ${TDEHOME}/share/config/kdeglobals --group "Release Notes" --key "$RELEASE_VERSION" --type bool "true"
  fi
  RELEASE_NOTES="$( ${TDEDIR}/bin/kreadconfig --file ${TDEHOME}/share/config/kdeglobals --group "Release Notes" --key "$RELEASE_VERSION" )"
  echo "[release_notes] Release notes: $RELEASE_NOTES"
fi

unset RELEASE_NOTES RELEASE_VERSION RELEASE_SERIES
exit 0