File: generate-ChangeLog.sh

package info (click to toggle)
linpac 0.24-3
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,764 kB
  • ctags: 2,761
  • sloc: cpp: 17,368; sh: 10,621; ansic: 4,033; makefile: 186; perl: 101
file content (36 lines) | stat: -rwxr-xr-x 1,096 bytes parent folder | download | duplicates (2)
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
#
# generate-ChangeLog.sh - generate ChangeLog from git log
#
# generate-ChangeLog.sh <top_srcdir> <distdir>
#
# Based in the instructions at
# http://erikhjortsberg.blogspot.com/2010/06/using-automake-to-generate-changelog.html
#

#set -x

builddir=$PWD
# top_srcdir is important for parallel-builds (i.e. bulding outside the
# source tree). It is relative to the directory where this script is run
# (hence we define ${builddir} above.
top_srcdir=$1

distdir=$2

echo -e "Checkpoint:"
echo -e "   builddir:   $builddir"
echo -e "   top_srcdir: $top_srcdir"
echo -e "   distdir:    $distdir\n"


# Check the ChangeLog length to avoid over-writing.
# Placeholder ChangeLog in the git repository has only a single line.
#if [ `cat ${distdir}/ChangeLog | wc -l` = "1" ]; then
    chmod u+w ${distdir}/ChangeLog && \
    cd ${top_srcdir} && \
    echo "Running: git log --stat --name-only --date=short --abbrev-commit > ${builddir}/${distdir}/ChangeLog"
    git log --stat --name-only --date=short --abbrev-commit > ${builddir}/${distdir}/ChangeLog
#   else
#    echo "Doing nothing"
#fi