Browse Source

Add support for $thisyear and $lastyear in *.sources

pull/833/head
Reinhard Müller 2 years ago
parent
commit
456817fb58
4 changed files with 22 additions and 13 deletions
  1. +2
    -2
      donate/thankgnus.sources
  2. +5
    -3
      index.sources
  3. +8
    -8
      news/news.sources
  4. +7
    -0
      tools/update_xmllists.sh

+ 2
- 2
donate/thankgnus.sources View File

@ -1,4 +1,4 @@
donate/donors/donors-2018:[]
donate/donors/donors-2019:[]
donate/donors/donors-$thisyear:[]
donate/donors/donors-$lastyear:[]
localmenuinfo:[]
d_day:[]

+ 5
- 3
index.sources View File

@ -1,5 +1,7 @@
news/2019/news:[frontpage]
news/2019/.news:[frontpage]
events/2019/event:[frontpage]
news/$thisyear/news:[frontpage]
news/$lastyear/news:[frontpage]
news/$thisyear/.news:[frontpage]
news/$lastyear/.news:[frontpage]
events/$thisyear/event:[frontpage]
tools/frontpage/:[]
tools/static-elements/element-:[]

+ 8
- 8
news/news.sources View File

@ -1,9 +1,9 @@
news/2019/news:[]
news/2019/.news:[]
news/nl/nl-2019:[]
news/nl/.nl-2019:[]
news/2018/news:[]
news/2018/.news:[]
news/nl/nl-2018:[]
news/nl/.nl-2018:[]
news/$thisyear/news:[]
news/$lastyear/news:[]
news/$thisyear/.news:[]
news/$lastyear/.news:[]
news/nl/nl-$thisyear:[]
news/nl/nl-$lastyear:[]
news/nl/.nl-$thisyear:[]
news/nl/.nl-$lastyear:[]
tools/static-elements/element-:[]

+ 7
- 0
tools/update_xmllists.sh View File

@ -27,6 +27,9 @@ set -o pipefail
pid=$$
thisyear=$(date --date="this year" +%Y)
lastyear=$(date --date="last year" +%Y)
# -----------------------------------------------------------------------------
# Make sure temporary directory is empty
# -----------------------------------------------------------------------------
@ -101,6 +104,10 @@ for source_file in $(find * -name '*.sources' | sort); do
continue
fi
# Honor $thisyear and $lastyear variables
pattern=${pattern//\$thisyear/${thisyear}}
pattern=${pattern//\$lastyear/${lastyear}}
# Change from a glob pattern into a regex
pattern=$(echo "${pattern}" | sed -r -e 's/([.^$[])/\\\1/g; s/\*/.*/g')


Loading…
Cancel
Save