File: create-upstream-release-notes.sh

package info (click to toggle)
percona-toolkit 3.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 106,720 kB
  • sloc: perl: 257,236; sql: 23,577; sh: 21,388; javascript: 6,322; makefile: 398; python: 62; awk: 38; sed: 1
file content (41 lines) | stat: -rwxr-xr-x 1,239 bytes parent folder | download | duplicates (4)
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
#!/bin/bash
#
# This script looks for any upstream release notes file that matches 
# the current package version and creates a 'debian/RELEASENOTES' file 
# from it.
#
# The current package version is extracted from Makefile.PL file.
#
# Usually, upstream stores release notes files under the 'docs' 
# directory and the filename contains a mangled version number.
#
# ie: Release notes filename for version 3.0.12 is docs/rn.3-0-12.txt
#
# This script is prepared to be called from inside 'debian/rules' by 
# the 'override_dh_installdocs' target.
#

set -e

echo "****************************************************************"

VERSION=$(grep "VERSION " Makefile.PL | awk -F "'" {'print $2'})

echo "Detected version: ${VERSION}"

VERSION=${VERSION//./-}
UPSTREAM_RELEASE_NOTES=$(echo "docs/rn.${VERSION}.txt")
DEBIAN_RELEASE_NOTES="debian/RELEASENOTES"

echo "Removing ${DEBIAN_RELEASE_NOTES} from previous executions ..."
rm -fv ${DEBIAN_RELEASE_NOTES}


if [ ! -f ${UPSTREAM_RELEASE_NOTES} ]; then
    echo "File not found!"
else
	echo "Upstream release notes filename: ${UPSTREAM_RELEASE_NOTES}"
	cp -v ${UPSTREAM_RELEASE_NOTES} ${DEBIAN_RELEASE_NOTES}
fi

echo "****************************************************************"