Merge pull request #296 from adivinho/PG-430-Update-rpm-changelog-automatically
PG-430 update rpm changelog automaticallypull/303/head
commit
16536ae07d
|
@ -92,6 +92,30 @@ add_percona_yum_repo(){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_changelog(){
|
||||||
|
if [ -z $1 ]
|
||||||
|
then
|
||||||
|
echo "No spec file is provided"
|
||||||
|
return
|
||||||
|
else
|
||||||
|
start_line=0
|
||||||
|
while read -r line; do
|
||||||
|
(( start_line++ ))
|
||||||
|
if [ "$line" = "%changelog" ]
|
||||||
|
then
|
||||||
|
(( start_line++ ))
|
||||||
|
echo "$start_line"
|
||||||
|
current_date=$(date +"%a %b %d %Y")
|
||||||
|
sed -i "$start_line,$ d" $1
|
||||||
|
echo "* $current_date Percona Build/Release Team <eng-build@percona.com> - ${VERSION}-${RPM_RELEASE}" >> $1
|
||||||
|
echo "- Release ${VERSION}-${RPM_RELEASE}" >> $1
|
||||||
|
echo >> $1
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done <$1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
get_sources(){
|
get_sources(){
|
||||||
cd "${WORKDIR}"
|
cd "${WORKDIR}"
|
||||||
if [ "${SOURCE}" = 0 ]
|
if [ "${SOURCE}" = 0 ]
|
||||||
|
@ -137,6 +161,8 @@ get_sources(){
|
||||||
sed -i "s:@@RPM_RELEASE@@:${RPM_RELEASE}:g" rpm/pg-stat-monitor.spec
|
sed -i "s:@@RPM_RELEASE@@:${RPM_RELEASE}:g" rpm/pg-stat-monitor.spec
|
||||||
sed -i "s:@@VERSION@@:${VERSION}:g" rpm/pg-stat-monitor.spec
|
sed -i "s:@@VERSION@@:${VERSION}:g" rpm/pg-stat-monitor.spec
|
||||||
|
|
||||||
|
set_changelog rpm/pg-stat-monitor.spec
|
||||||
|
|
||||||
cd ${WORKDIR}
|
cd ${WORKDIR}
|
||||||
#
|
#
|
||||||
source pg-stat-monitor.properties
|
source pg-stat-monitor.properties
|
||||||
|
|
Loading…
Reference in New Issue