File: updateversion.sh

package info (click to toggle)
backintime 1.5.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,632 kB
  • sloc: python: 23,454; sh: 859; makefile: 172; xml: 62
file content (83 lines) | stat: -rwxr-xr-x 2,827 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# SPDX-FileCopyrightText: © 2008 Oprea Dan
# SPDX-FileCopyrightText: © 2012 Germar Reitze
# SPDX-FileCopyrightText: © 2022 Jürgen Altfeld (aryoda)
# SPDX-FileCopyrightText: © 2023 Christian Buhtz <c.buhtz@posteo.jp>
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This file is part of the program "Back In time" which is released under GNU
# General Public License v2 (GPLv2). See LICENSES directory or go to
# <https://spdx.org/licenses/GPL-2.0-or-later.html>.

# Updates all version numbers using the VERSION file
# and creates a new DEBIAN changelog file for this version
# by extracting the changes of this version from the
# CHANGES file.
#
# Development notes (May '23, Buhtz):
# Should be treated as a workaround that will get replaced in the future.
# Handling of version numbers and other package metadata can be done very
# elegant and centralized within the Python Packaging process (e.g. using
# pyproject.toml and additional tools.
# Handling of Debian (and PPA) related stuff will be separated from that
# upstream repo because it is distro specific.

# Outdated TODOs:
# TODO Requires refactoring and adjustments to separate
#      - the update of version numbers
#      - from the preparation of a new DEBIAN package release
#      since version updates must be possible without
#      a DEBIAN package release.
#
# TODO The version number must still be maintained in two places
#      (despite this script):
#      1. File "VERSION"
#      2. As headline in the file "CHANGES"
#      If those two numbers do not match the script does
#      not extract the correct changes of the version from the CHANGES file.
#
# TODO The name of this script file is misleading (find a better one)
# TODO Make sure this script works idempotent (multiple calls = same result)
# TODO This script does not update release dates scattered around in
#      different files (eg. common/man/C/backintime.1 line 1)
VERSION=`cat VERSION`

if [[ $VERSION == *-dev ]]
then
    VERSION+="."`git rev-parse --short HEAD`
fi

echo VERSION: $VERSION

MAINTAINER="Germar Reitze <germar.reitze@gmail.com>"
# MAINTAINER="BIT Team <dan@le-web.org>"
# MAINTAINER="BIT Team <bit-dev@python.org>"

update_app_version () {
  echo "Update '$1'"
  sed -e "s/^\(\s*\)__version__ = '.*'$/\1__version__ = '$VERSION'/" \
      -i $1
}

update_man_page () {
  echo "Update '$1'"
  sed -e "s/\.TH\(.*\)\"version\([^\"]*\)\"\(.*\)$/.TH\1\"version $VERSION\"\3/" \
      -i $1
}

update_omf () {
  echo "Update '$1'"
  sed -e "s/^\([ \]*\)<version\([^0-9]*\)\([^\"]*\)\(.*\)$/\1<version\2$VERSION\4/" \
      -i $1
}

update_app_version common/version.py

update_man_page common/man/C/backintime.1

update_man_page common/man/C/backintime-config.1

update_man_page common/man/C/backintime-askpass.1

update_man_page qt/man/C/backintime-qt.1