Refactor changelog check into a generic function
This allows calling it early in generic_pack and avoid doing expensive operations before finding out the ChangeLog is not updated.
This commit is contained in:
@@ -426,18 +426,10 @@ auto_rel()
|
||||
-e "s;%%DEPENDENCIES%%;${deps};g" \
|
||||
${rn} > "$relmetadir/${secname}.txt"
|
||||
|
||||
# Add a ChangeLog if it exists
|
||||
if [ -r $metadir/ChangeLog ]; then
|
||||
echo "auto_rel: Adding ChangeLog to relnotes"
|
||||
# See if we can find an entry for this build otherwise complain
|
||||
if [ -z "$(${__grep} ${version}-${pkgver}$ $metadir/ChangeLog)" ]; then
|
||||
error $E_MISSING_CHGLOGV auto_rel
|
||||
fi
|
||||
echo >> "$relmetadir/${secname}.txt"
|
||||
cat $metadir/ChangeLog >> "$relmetadir/${secname}.txt"
|
||||
else
|
||||
error $E_MISSING_CHGLOG auto_rel
|
||||
fi
|
||||
# Add a ChangeLog
|
||||
echo "auto_rel: Adding ChangeLog to relnotes"
|
||||
echo >> "$relmetadir/${secname}.txt"
|
||||
cat $metadir/ChangeLog >> "$relmetadir/${secname}.txt"
|
||||
|
||||
### Add the relnotes to the prototype file
|
||||
add_dir $defaultperms $defaultuid $defaultgid "${metaprefix}relnotes" $secname
|
||||
@@ -952,6 +944,11 @@ generic_pack()
|
||||
if [ "$1" == "shortroot" ]; then
|
||||
error $E_ARG_OBSO generic_pack
|
||||
fi
|
||||
|
||||
# Before doing any expensive operations
|
||||
# check that the ChangeLog is in order
|
||||
check_changelog
|
||||
|
||||
clean meta
|
||||
if [ -d "${stagedir}${topinstalldir}${dir_prefix}/${_mandir}" ]; then
|
||||
setdir ${stagedir}${topinstalldir}${dir_prefix}/${_mandir}
|
||||
|
||||
Reference in New Issue
Block a user