Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Dave Barach | 8d0f2f0 | 2018-03-12 09:31:36 -0400 | [diff] [blame] | 3 | # 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 Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 16 | CHANGELOG=deb/debian/changelog |
| 17 | DIST=unstable |
| 18 | FIRST=1 |
| 19 | |
| 20 | print_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 | |
| 35 | VER=$(scripts/version) |
| 36 | TAG=HEAD |
| 37 | ADDS=$(echo ${VER} | sed -e 's/~.*//'| cut -s -d- -f2) |
| 38 | |
| 39 | rm -f ${CHANGELOG} |
| 40 | |
| 41 | if [ -n "${ADDS}" ]; then |
| 42 | DESC=" * includes ${ADDS} commits after $(echo ${VER}| cut -d- -f1) release" |
| 43 | print_changelog_item |
| 44 | fi |
| 45 | |
Ed Warnicke | 45050f8 | 2016-06-15 23:17:07 -0500 | [diff] [blame] | 46 | for TAG in $(git tag -l 'v[0-9][0-9].[0-9][0-9]' | sort -r ); do |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 47 | VER=$(echo ${TAG}| sed -e 's/^v//') |
| 48 | DESC=$(git tag -l -n20 ${TAG} | tail -n+2 | sed -e 's/^ */ /') |
| 49 | print_changelog_item |
| 50 | done |