Commit 75fe6e79 authored by Holger Levsen's avatar Holger Levsen
Browse files

documentation/scripts/get_manual: set DOC_DATE based on current date as...


documentation/scripts/get_manual: set DOC_DATE based on current date as get_manual is only called manually when the document is updated from the wiki.

Signed-off-by: default avatarHolger Levsen <holger@layer-acht.org>
parent f3ca44f0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
debian-edu-doc (2.10.17) UNRELEASED; urgency=medium

  *
  [ Holger Levsen ]
  * documentation/scripts/get_manual: set DOC_DATE based on current date as
    get_manual is only called manually when the document is updated from the
    wiki.

 -- Holger Levsen <holger@debian.org>  Sat, 01 Jun 2019 02:23:42 +0200

+3 −4
Original line number Diff line number Diff line
@@ -166,11 +166,10 @@ echo "calling ../scripts/get_images $xmlfile $path1"
#  -0\777  read multiple lines
perl -0\777 -pi -e "s/<ulink url=\"$path2(.*)\/(.*)\">(.*)\n<\/ulink>/<link linkend=\"\2\">\3<\/link>/g" $xmlfile

# set SOURCE_DATE_EPOCH
SOURCE_DATE_EPOCH="$(dpkg-parsechangelog -STimestamp -l ../../debian/changelog)"
DATE="$(date -d @$SOURCE_DATE_EPOCH +'%Y-%m-%d')"
# set DOC_DATE based on current date as get_manual is only called manually when the document is updated from the wiki
DOC_DATE="$(TZ=UTC date +'%Y-%m-%d')"
# make it a docbook article again
sed -i "1,/</ s#<#<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.4//EN\" \"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\"><article lang=\"en\"><articleinfo><title>$DEBIAN_EDU_DOC_TITLE $DATE</title></articleinfo>\n<#" $xmlfile
sed -i "1,/</ s#<#<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.4//EN\" \"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\"><article lang=\"en\"><articleinfo><title>$DEBIAN_EDU_DOC_TITLE $DOC_DATE</title></articleinfo>\n<#" $xmlfile
sed -i "$ s#>#>\n</article>#" $xmlfile
# remove the first empty lines
sed -i "1,2d" $xmlfile