Skip to content

Commit e90e51d

Browse files
authored
Merge pull request #150 from Vogtinator/datefix
helpers/check_dates_in_changes: Only look at the first line of entries
2 parents c67c5f7 + 46e368c commit e90e51d

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

helpers/check_dates_in_changes

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ for CHANGES in "$@" ; do
2020

2121
while read LINE ; do
2222
case "$LINE" in
23-
removed*) ;;
24-
*@*@*) ;;
25-
*-*@*)
23+
--------------*)
24+
# Next line is the changelog entry header
25+
read LINE
26+
;;
27+
*)
28+
continue
29+
;;
30+
esac
31+
2632
DATESTR=""
2733
LINE=${LINE#\*}
2834
for i in $LINE ; do
@@ -53,14 +59,15 @@ for CHANGES in "$@" ; do
5359
TROUBLE_FOUND=true
5460
;;
5561
esac
56-
DATE=`date +%s --date "$DATESTR" 2> /dev/null`
62+
if ! DATE=`date +%s --date "$DATESTR"`; then
63+
TROUBLE_FOUND=true
64+
continue
65+
fi
5766
test $? -gt 0 -o -z "$DATE" -o "$LAST_IS_YEAR" != true -o "$DATE" -gt "$now" && {
5867
echo "$CHANGES"
5968
echo "ERROR: INVALID DATE \"$DATESTR\" "
6069
TROUBLE_FOUND=true
6170
}
62-
;;
63-
esac
6471
done < "$CHANGES"
6572
done
6673
if test $TROUBLE_FOUND = false ; then

0 commit comments

Comments
 (0)