portal: fetch with a Makefile

ksp
Astro 2013-11-13 23:32:49 +01:00
parent 62c4351c8d
commit e2a5b7279a
2 changed files with 15 additions and 10 deletions

View File

@ -220,18 +220,17 @@ build/%.pls : NOVALID:=true
portal:
mkdir $@
portal/fetch.sh : STYLE=xsl/portal2fetch.xsl
portal/fetch.sh : NOINPUTVALID:=true
portal/fetch.sh : NOVALID:=true
portal/fetch.sh: content/portal-config.xml $(STYLE)
portal/Makefile : STYLE=xsl/portal2fetch.xsl
portal/Makefile : NOINPUTVALID:=true
portal/Makefile : NOVALID:=true
portal/Makefile: content/portal-config.xml $(STYLE)
$(call xml_process)
chmod a+x $@
portal/items.xml : STYLE=xsl/portal2items.xsl
portal/items.xml : NOINPUTVALID:=true
portal/items.xml : NOVALID:=true
portal/items.xml: content/portal-config.xml $(STYLE) portal/fetch.sh news.xml
( cd portal && ./fetch.sh )
portal/items.xml: content/portal-config.xml $(STYLE) portal/Makefile news.xml
$(MAKE) -C portal fetch
$(call xml_process)
portal/items-sorted.xml : STYLE=xsl/portal-sort.xsl

View File

@ -5,14 +5,20 @@
<xsl:output method="text" encoding="utf-8"/>
<xsl:template match="/config">
<xsl:text>#!/bin/sh&#10;</xsl:text>
<xsl:text>fetch:</xsl:text>
<xsl:for-each select="*[@id]">
<xsl:text> portal-</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>.xml</xsl:text>
</xsl:for-each>
<xsl:text>&#10;</xsl:text>
<xsl:apply-templates select="*[@id]"/>
</xsl:template>
<xsl:template match="/config/*">
<xsl:text>wget -O portal-</xsl:text>
<xsl:text>portal-</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>.xml --no-check-certificate '</xsl:text>
<xsl:text>.xml:&#10; wget -O $@ --no-check-certificate '</xsl:text>
<xsl:value-of select="string(.)"/>
<xsl:text>'&#10;</xsl:text>
</xsl:template>