Skip to content

Commit dfc9ff3

Browse files
committed
Split dblog_latest.ddoc Makefile rule into two targets
1 parent 2481d95 commit dfc9ff3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

posix.mak

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,14 +575,15 @@ $G/dlangspec.verbatim.txt : $G/dlangspec-consolidated.d $(DMD) verbatim.ddoc
575575
# Fetch the latest article from the official D blog
576576
################################################################################
577577

578-
$G/dblog_latest.ddoc:
578+
$G/dblog_latest.html:
579579
@echo "Receiving the latest DBlog article. Disable with DIFFABLE=1"
580-
curl -s --fail --retry 3 --retry-delay 5 http://blog.dlang.org > $(TMP)/blog.html
581-
@[ $? -eq 0 ] || (echo "Curl couldn't connect to the DBlog."; exit 1)
582-
cat $(TMP)/blog.html | grep -m1 'entry-title' | \
580+
curl -s --fail --retry 3 --retry-delay 5 http://blog.dlang.org -o $@
581+
582+
$G/dblog_latest.ddoc: $G/dblog_latest.html
583+
cat $< | grep -m1 'entry-title' | \
583584
sed -E 's/^.*<a href="(.+)" rel="bookmark">([^<]+)<\/a>.*<time.*datetime="[^"]+">([^<]*)<\/time><time class="updated".*Author *<\/span><a [^>]+>([^<]+)<\/a>.*/DBLOG_LATEST_TITLE=\2|DBLOG_LATEST_LINK=\1|DBLOG_LATEST_DATE=\3|DBLOG_LATEST_AUTHOR=\4/' | \
584585
tr '|' '\n' > $@
585-
cat $(TMP)/blog.html | grep -m2 'entry-title' | tail -n1 | \
586+
cat $< | grep -m2 'entry-title' | tail -n1 | \
586587
sed -E 's/^.*<a href="(.+)" rel="bookmark">([^<]+)<\/a>.*<time.*datetime="[^"]+">([^<]*)<\/time><time class="updated".*Author *<\/span><a [^>]+>([^<]+)<\/a>.*/DBLOG_LATEST_TITLE2=\2|DBLOG_LATEST_LINK2=\1|DBLOG_LATEST_DATE2=\3|DBLOG_LATEST_AUTHOR2=\4/' | \
587588
tr '|' '\n' > $(basename $@)2.ddoc
588589
rm $(TMP)/blog.html

0 commit comments

Comments
 (0)