blob: d3112f778ac8ed160d2f713e89b22bbd5bf76ea8 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001#!/bin/bash
2
Dave Barach8d0f2f02018-03-12 09:31:36 -04003# Copyright (c) 2015 Cisco and/or its affiliates.
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at:
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
Ed Warnickecb9cada2015-12-08 15:45:58 -070016CHANGELOG=deb/debian/changelog
17DIST=unstable
18FIRST=1
19
20print_changelog_item() {
21 DATE=$(git log -1 --format=%cD ${TAG})
22 DEBFULLNAME=$(git log -1 --format=%an ${TAG})
23 DEBEMAIL=$(git log -1 --format=%ae ${TAG})
24
25 if [ ${FIRST} = 0 ]; then echo >> ${CHANGELOG}; fi
26 FIRST=0
27
28 echo "vpp (${VER}) ${DIST}; urgency=low" >> ${CHANGELOG}
29 echo >> ${CHANGELOG}
30 echo "${DESC}" >> ${CHANGELOG}
31 echo >> ${CHANGELOG}
32 echo " -- ${DEBFULLNAME} <${DEBEMAIL}> ${DATE}" >> ${CHANGELOG}
33}
34
35VER=$(scripts/version)
36TAG=HEAD
37ADDS=$(echo ${VER} | sed -e 's/~.*//'| cut -s -d- -f2)
38
39rm -f ${CHANGELOG}
40
41if [ -n "${ADDS}" ]; then
42 DESC=" * includes ${ADDS} commits after $(echo ${VER}| cut -d- -f1) release"
43 print_changelog_item
44fi
45
Ed Warnicke45050f82016-06-15 23:17:07 -050046for TAG in $(git tag -l 'v[0-9][0-9].[0-9][0-9]' | sort -r ); do
Ed Warnickecb9cada2015-12-08 15:45:58 -070047 VER=$(echo ${TAG}| sed -e 's/^v//')
48 DESC=$(git tag -l -n20 ${TAG} | tail -n+2 | sed -e 's/^ */ /')
49 print_changelog_item
50done