diff --git a/Makefile b/Makefile index 74abd2bfcc..5a8d0661f6 100644 --- a/Makefile +++ b/Makefile @@ -30,18 +30,11 @@ sources := $(shell grep -l -R --include='*.xhtml' $(SELECT) . ) .PHONY: localmenus -localmenus: localmenuinfo.xml +localmenus: localmenuinfo.en.xml -$(HELPERFILE) : - rm -f $(HELPERFILE) +localmenuinfo.en.xml: $(sources) echo \ > $(HELPERFILE) grep -R --include='*.xhtml' $(SELECT) .| sed -e 's,$(FIND),$(REPLACE),' >> $(HELPERFILE) echo \ >> $(HELPERFILE) - -localmenuinfo.xml: $(HELPERFILE) $(sources) xsltproc -o $@ $(STYLESHEET) $(HELPERFILE) - rm -f $(HELPERFILE) - -%.html : %.xhtml $(HELPERFILE) - perl tools/bogus-build.pl $< | xsltproc -o $@ fsfeurope.xsl - - + rm $(HELPERFILE) diff --git a/build/HELP b/build/HELP index 78d2491ea4..6df00e7ad2 100644 --- a/build/HELP +++ b/build/HELP @@ -3,8 +3,8 @@ Usage: ------------------------------------------------------------------------------ build_main.sh [options] build_into "destination_dir" - Perform the page build. Write output to destination_dir. The source directory - is determined from the build scripts own location. + Perform the page build. Write output to destination_dir. The source + directory is determined from the build scripts own location. build_main.sh [options] build_xmlstream "file.xhtml" Compile an xml stream from the specified file, additional sources will be @@ -24,6 +24,15 @@ build_main.sh [options] tree_maker [input_dir] "destination_dir" Note: if destination_dir is set via previous options, and only one paramter is given, then this parameter will be interpreted as input_dir +build_main.sh [options] wakeup_news [date] + News items that are in the future at the time of their commit are not + considered for the content of dependent files (e.g. news.html, index.html). + This function performs a `touch` on all files which are to be released at + the presented date, thus forcing a subsequent buildrun to rebuild dependent + files even though the input files may not have changed their content. + The date option defaults to the present date, if given it must adhere to + the form YYYY-MM-DD. + OPTIONS ------- diff --git a/build/arguments.sh b/build/arguments.sh index bb560cc930..17e23ec587 100755 --- a/build/arguments.sh +++ b/build/arguments.sh @@ -4,7 +4,7 @@ if [ -z "$inc_arguments" ]; then inc_arguments=true - basedir="$(realpath "$(dirname "$0")/..")" + basedir="$(realpath "${0%/*}/..")" while [ "$#" -gt 0 ]; do case "$1" in @@ -72,6 +72,10 @@ if [ -z "$inc_arguments" ]; then [ "$#" -gt 0 ] && shift 1 && globfile="$1" [ "$#" -gt 0 ] && shift 1 && reffile="$1" ;; + wakeup_news) + command="$1$command" + [ "$#" -gt 0 ] && shift 1 && today="$1" + ;; *) print_error "Unknown option: $1" exit 1 @@ -82,7 +86,8 @@ if [ -z "$inc_arguments" ]; then olang="${olang:-en}" tree="${tree:-$basedir}" - stagedir=${stagedir:-$target} + stagedir="${stagedir:-$target}" + today="${today:-$(date +%F)}" readonly tree="${tree:+$(realpath "$tree")}" readonly stagedir="${stagedir:+$(realpath "$stagedir")}" readonly basedir="${basedir:+$(realpath "$basedir")}" @@ -98,8 +103,9 @@ if [ -z "$inc_arguments" ]; then tree_maker) [ -z "$target" ] && die "Missing target location" ;; sourceglobs) [ -z "$sourcesfile" ] && die "Missing .sources file" ;; lang_sources) [ -z "$sourceglobfile" -o -z "$lang" ] && die "Need source globfile and language" ;; - cast_refglobs) [ -z "$globfile" -o -z "$reffile" ] && die "Need globfile and reffile" ;; + cast_refglobs) [ -z "$globfile" -o -z "$reffile" ] && die "Need globfile and reffile" ;; map_tags) true;; + wakeup_news) true;; *help*) print_help; exit 0 ;; *) die "Urecognised command or no command given" ;; esac diff --git a/build/build_main.sh b/build/build_main.sh index 9ed662f2b2..55cd7763c1 100755 --- a/build/build_main.sh +++ b/build/build_main.sh @@ -1,6 +1,6 @@ #!/bin/sh -basedir="$(dirname "$0")/.." +basedir="${0%/*}/.." [ -z "$inc_misc" ] && . "$basedir/build/misc.sh" readonly start_time="$(date +%s)" @@ -32,6 +32,7 @@ fi [ -z "$inc_processor" ] && . "$basedir/build/processor.sh" [ -z "$inc_scaffold" ] && . "$basedir/build/scaffold.sh" [ -z "$inc_sources" ] && . "$basedir/build/sources.sh" +[ -z "$inc_stirrups" ] && . "$basedir/build/stirrups.sh" case "$command" in map_tags) map_tags "$@";; @@ -43,4 +44,5 @@ case "$command" in sourceglobs) sourceglobs "$sourcesfile" ;; lang_sources) lang_sources "$sourceglobfile" "$lang" ;; cast_refglobs) cast_refglobs "$globfile" "$reffile" ;; + wakeup_news) wakeup_news "$today" ;; esac diff --git a/build/filenames.sh b/build/filenames.sh index abd622476c..33f79e58f1 100755 --- a/build/filenames.sh +++ b/build/filenames.sh @@ -36,15 +36,14 @@ get_processor(){ # a given xhtml file. # expects the shortname of the file as input (i.e. the # the file path without language and file endings) - shortname="$1" if [ -f "${shortname}.xsl" ]; then echo "${shortname}.xsl" else - location="$(dirname "$shortname")" + location="${shortname%/*}" until [ -f "$location/default.xsl" -o "$location" = . -o "$location" = / ]; do - location="$(dirname "$location")" + location="${location%/*}" done echo "$location/default.xsl" fi diff --git a/build/makerules.sh b/build/makerules.sh index 34b3001abe..13b475706e 100755 --- a/build/makerules.sh +++ b/build/makerules.sh @@ -36,12 +36,14 @@ glob_maker(){ # issue make rules for preglobbed sources files sourcesfile="$1" - filedir="\${INPUTDIR}/$(dirname "$sourcesfile")" - shortbase="$(basename "$sourcesfile" |sed -r 's;\.sources$;;')" + filedir="\${INPUTDIR}/${sourcesfile}" + filedir="${filedir%/*}" + shortbase="${sourcesfile##*/}" + shortbase="${shortbase%.sources}" for lang in $(get_languages); do - globfile="${filedir%/.}/._._${shortbase}.${lang}.sourceglobs" - refglobs="${filedir%/.}/._._${shortbase}.${lang}.refglobs" + globfile="${filedir}/._._${shortbase}.${lang}.sourceglobs" + refglobs="${filedir}/._._${shortbase}.${lang}.refglobs" cat <"$globfile" @@ -75,12 +77,12 @@ xhtml_maker(){ shortname="$input/$1" outpath="\${OUTPUTDIR}/${2}" - outpath="${outpath%/.}" + outpath="${outpath%/*}" textsen="$(get_textsfile "en")" menufile="$basedir/tools/menu-global.xml" - filedir="$(dirname "$shortname")" - shortbase="$(basename "$shortname")" + filedir="${shortname%/*}" + shortbase="${shortname##*/}" processor="$(get_processor "$shortname")" langglob="$filedir/._._${shortbase}.langglob" @@ -91,7 +93,7 @@ xhtml_maker(){ olang="$(echo "${shortname}".[a-z][a-z].xhtml "${shortname}".[e]n.xhtml |sed -rn 's;^.*\.([a-z]{2})\.xhtml.*$;\1;p')" - if [ "${shortbase}" = "$(basename "$filedir")" ] && \ + if [ "${shortbase}" = "${filedir##*/}" ] && \ [ ! -f "${filedir}/index.${olang}.xhtml" ]; then bool_indexname=true else @@ -149,7 +151,7 @@ xhtml_makers(){ | sed -r 's;\.[a-z][a-z]\.xhtml$;;' \ | sort -u \ | while read shortpath; do - xhtml_maker "$shortpath" "$(dirname "$shortpath")" + xhtml_maker "$shortpath" "${shortpath}" done } @@ -159,16 +161,14 @@ xhtml_additions(){ | sort -u \ | xargs realpath \ | while read addition; do - xhtml_maker "${addition#$input/}" "$(dirname "${addition#$input/}")" + xhtml_maker "${addition#$input/}" "${addition#$input/}" done } copy_maker(){ # generate make rule for copying a plain file infile="\${INPUTDIR}/$1" - outpath="\${OUTPUTDIR}/${2}" - outpath="${outpath%/.}" - outfile="$outpath/$(basename "$infile")" + outfile="\${OUTPUTDIR}/$2" cat <>"$Make_globs" \ diff --git a/build/process_file.sh b/build/process_file.sh index fb286e2a83..a196c1b362 100755 --- a/build/process_file.sh +++ b/build/process_file.sh @@ -1,6 +1,6 @@ #!/bin/sh -basedir="$(dirname $0)/.." +basedir="${0%/*}/.." [ -z "$inc_processor" ] && . "$basedir/build/processor.sh" . "$basedir/build/arguments.sh" diff --git a/build/scaffold.sh b/build/scaffold.sh index 7ec088480a..2148d2db75 100755 --- a/build/scaffold.sh +++ b/build/scaffold.sh @@ -15,7 +15,7 @@ build_xmlstream(){ lang="$2" olang="$3" - dirname="$(dirname "$shortname")" + dirname="${shortname%/*}/" texts_xml=$(get_textsfile $lang) fundraising_xml=$(get_fundraisingfile $lang) date="$(date +%Y-%m-%d)" @@ -35,8 +35,8 @@ build_xmlstream(){ diff --git a/build/source_globber.sh b/build/source_globber.sh index d5684a6fa2..fe5d566224 100755 --- a/build/source_globber.sh +++ b/build/source_globber.sh @@ -1,6 +1,6 @@ #!/bin/sh -basedir="$(dirname $0)/.." +basedir="${0%/*}/.." [ -z "$inc_sources" ] && . "$basedir/build/sources.sh" . "$basedir/build/arguments.sh" diff --git a/build/stirrups.sh b/build/stirrups.sh index db4c0e1ec7..0606f1eb3e 100755 --- a/build/stirrups.sh +++ b/build/stirrups.sh @@ -59,3 +59,13 @@ remove_orphans(){ rm -v "$dtree/$file" done } + +wakeup_news(){ + # Performs a `touch` on all files which are to be released at the + # presented date. + today="$1" + + find "$basedir" -name '*.xml' \ + | xargs egrep -l "<[^>]+ date=[\"']${today}[\"'][^>]*>" \ + | xargs touch -c 2>&- || true +} diff --git a/build/xslt/fsfe_localmenu.xsl b/build/xslt/fsfe_localmenu.xsl index 4c1d65c1b1..69667e36f0 100644 --- a/build/xslt/fsfe_localmenu.xsl +++ b/build/xslt/fsfe_localmenu.xsl @@ -4,71 +4,64 @@ + - - - - - - 0 - - + + + + 0 + + + + localmenu - [ - - - - - - - - - - - - - - - - local_menu_item - - - - - - - - - bamboo - - - - - - - - | - - - ] [ - - - - - ] - + [ + + + + + + + + + + + + + + + + local_menu_item + + + + + + + bamboo + + + + + + + | + + ] [ + + + + + ] diff --git a/donate/thankgnus-2001.sources b/donate/thankgnus-2001.sources index b66a6af865..1b4a4a685e 100644 --- a/donate/thankgnus-2001.sources +++ b/donate/thankgnus-2001.sources @@ -1 +1,2 @@ donate/donors/donors-2001:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2002.sources b/donate/thankgnus-2002.sources index 22bb5a5d6c..7609982e76 100644 --- a/donate/thankgnus-2002.sources +++ b/donate/thankgnus-2002.sources @@ -1 +1,2 @@ donate/donors/donors-2002:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2003.sources b/donate/thankgnus-2003.sources index a293226569..14afc9b0f8 100644 --- a/donate/thankgnus-2003.sources +++ b/donate/thankgnus-2003.sources @@ -1 +1,2 @@ donate/donors/donors-2003:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2004.sources b/donate/thankgnus-2004.sources index f514364b05..722949341e 100644 --- a/donate/thankgnus-2004.sources +++ b/donate/thankgnus-2004.sources @@ -1 +1,2 @@ donate/donors/donors-2004:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2005.sources b/donate/thankgnus-2005.sources index c47122d9fb..969e6c9871 100644 --- a/donate/thankgnus-2005.sources +++ b/donate/thankgnus-2005.sources @@ -1 +1,2 @@ donate/donors/donors-2005:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2006.sources b/donate/thankgnus-2006.sources index 971910d43c..79bdcf28ab 100644 --- a/donate/thankgnus-2006.sources +++ b/donate/thankgnus-2006.sources @@ -1 +1,2 @@ donate/donors/donors-2006:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2007.sources b/donate/thankgnus-2007.sources index ef762312e3..b0ad695eb5 100644 --- a/donate/thankgnus-2007.sources +++ b/donate/thankgnus-2007.sources @@ -1 +1,2 @@ donate/donors/donors-2007:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2008.sources b/donate/thankgnus-2008.sources index f4ab141b22..aa01daf505 100644 --- a/donate/thankgnus-2008.sources +++ b/donate/thankgnus-2008.sources @@ -1 +1,2 @@ donate/donors/donors-2008:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2009.sources b/donate/thankgnus-2009.sources index 58028c7a51..ae38255858 100644 --- a/donate/thankgnus-2009.sources +++ b/donate/thankgnus-2009.sources @@ -1 +1,2 @@ donate/donors/donors-2009:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2010.sources b/donate/thankgnus-2010.sources index e2a94d8dfc..c5b7467b72 100644 --- a/donate/thankgnus-2010.sources +++ b/donate/thankgnus-2010.sources @@ -1 +1,2 @@ donate/donors/donors-2010:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2011.sources b/donate/thankgnus-2011.sources index 8fe1529e1a..ce862beea4 100644 --- a/donate/thankgnus-2011.sources +++ b/donate/thankgnus-2011.sources @@ -1 +1,2 @@ donate/donors/donors-2011:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2012.sources b/donate/thankgnus-2012.sources index 24db45cb45..66cdb5ff95 100644 --- a/donate/thankgnus-2012.sources +++ b/donate/thankgnus-2012.sources @@ -1 +1,2 @@ donate/donors/donors-2012:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2013.sources b/donate/thankgnus-2013.sources index 70fcaf8030..1afbef1f9d 100644 --- a/donate/thankgnus-2013.sources +++ b/donate/thankgnus-2013.sources @@ -1 +1,2 @@ donate/donors/donors-2013:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2014.sources b/donate/thankgnus-2014.sources index f4b8627f6d..0b4608f0b8 100644 --- a/donate/thankgnus-2014.sources +++ b/donate/thankgnus-2014.sources @@ -1 +1,2 @@ donate/donors/donors-2014:[] +localmenuinfo:[] diff --git a/donate/thankgnus-2015.sources b/donate/thankgnus-2015.sources index 1ecaa1bab2..f043cfb7c9 100644 --- a/donate/thankgnus-2015.sources +++ b/donate/thankgnus-2015.sources @@ -1 +1,2 @@ donate/donors/donors-2015:[] +localmenuinfo:[] diff --git a/donate/thankgnus.sources b/donate/thankgnus.sources index 266bd99254..d26139845c 100644 --- a/donate/thankgnus.sources +++ b/donate/thankgnus.sources @@ -1,2 +1,3 @@ donate/donors/donors-2014:[] donate/donors/donors-2015:[] +localmenuinfo:[]