2019-02-16 09:53:32 +01:00
|
|
|
#!/bin/bash
|
2015-05-21 16:31:43 +00:00
|
|
|
|
|
|
|
|
inc_makerules=true
|
2015-05-24 23:18:52 +00:00
|
|
|
[ -z "$inc_misc" ] && . "$basedir/build/misc.sh"
|
2015-05-21 16:31:43 +00:00
|
|
|
[ -z "$inc_translations" ] && . "$basedir/build/translations.sh"
|
|
|
|
|
[ -z "$inc_filenames" ] && . "$basedir/build/filenames.sh"
|
|
|
|
|
[ -z "$inc_fundraising" ] && . "$basedir/build/fundraising.sh"
|
|
|
|
|
[ -z "$inc_languages" ] && . "$basedir/build/languages.sh"
|
|
|
|
|
[ -z "$inc_sources" ] && . "$basedir/build/sources.sh"
|
|
|
|
|
|
2015-05-28 14:55:27 +00:00
|
|
|
sourcefind() {
|
2017-08-18 16:45:59 +02:00
|
|
|
find "$input" -name .svn -prune -o -name .git -prune -o -type f "$@" -printf '%P\n'
|
2015-05-28 14:55:27 +00:00
|
|
|
}
|
|
|
|
|
|
2015-05-29 15:55:00 +00:00
|
|
|
mio(){
|
|
|
|
|
# make input/output abstraction, produce reusable makefiles
|
|
|
|
|
# by replacing in and out pathes with make variables.
|
|
|
|
|
for each in "$@"; do
|
2015-05-30 14:04:30 +00:00
|
|
|
case "$each" in
|
2017-01-18 19:29:15 +00:00
|
|
|
"$input"/*) printf '${INPUTDIR}/%s\n' "${each#${input}/}" ;;
|
|
|
|
|
"$output"/*) printf '${OUTPUTDIR}/%s\n' "${each#${output}/}" ;;
|
|
|
|
|
*) printf %s\\n "$each" ;;
|
2015-05-30 14:04:30 +00:00
|
|
|
esac
|
2015-05-29 15:55:00 +00:00
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-21 16:31:43 +00:00
|
|
|
mes(){
|
|
|
|
|
# make escape... escape a filename for make syntax
|
|
|
|
|
# possibly not complete
|
2015-05-29 15:55:00 +00:00
|
|
|
mio "$@" \
|
2017-01-18 19:29:15 +00:00
|
|
|
| sed -r ':X; $bY; N; bX; :Y;
|
|
|
|
|
s;[ #];\\&;g; s;\n; ;g'
|
2015-05-21 16:31:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
xhtml_maker(){
|
|
|
|
|
# generate make rules for building html files out of xhtml
|
|
|
|
|
# account for included xml files and xsl rules
|
|
|
|
|
|
2015-05-29 15:55:00 +00:00
|
|
|
shortname="$input/$1"
|
2015-06-04 17:21:37 +00:00
|
|
|
outpath="\${OUTPUTDIR}/${2}"
|
2015-10-28 21:28:21 +00:00
|
|
|
outpath="${outpath%/*}"
|
2015-05-21 16:31:43 +00:00
|
|
|
|
|
|
|
|
textsen="$(get_textsfile "en")"
|
|
|
|
|
menufile="$basedir/tools/menu-global.xml"
|
2015-10-28 21:28:21 +00:00
|
|
|
filedir="${shortname%/*}"
|
|
|
|
|
shortbase="${shortname##*/}"
|
2015-05-21 16:31:43 +00:00
|
|
|
processor="$(get_processor "$shortname")"
|
|
|
|
|
|
|
|
|
|
[ -f "$shortname".rss.xsl ] && bool_rss=true || bool_rss=false
|
|
|
|
|
[ -f "$shortname".ics.xsl ] && bool_ics=true || bool_ics=false
|
|
|
|
|
|
2016-09-07 16:35:07 +00:00
|
|
|
[ -f "${shortname}.sources" ] && sourcesfile="${shortname}.sources" || unset sourcesfile
|
2015-05-21 16:31:43 +00:00
|
|
|
|
|
|
|
|
# For speed considerations: avoid all disk I/O in this loop
|
|
|
|
|
for lang in $(get_languages); do
|
|
|
|
|
infile="${shortname}.${lang}.xhtml"
|
2016-10-14 19:53:52 +00:00
|
|
|
depfile="${shortname}.*.xhtml"
|
2015-05-21 16:31:43 +00:00
|
|
|
|
2015-05-29 15:55:00 +00:00
|
|
|
infile="$(mio "$infile")"
|
2015-05-21 16:31:43 +00:00
|
|
|
outbase="${shortbase}.${lang}.html"
|
|
|
|
|
outfile="${outpath}/${outbase}"
|
|
|
|
|
|
|
|
|
|
textsfile="$(get_textsfile "$lang")"
|
|
|
|
|
fundraisingfile="$(get_fundraisingfile "$lang")"
|
|
|
|
|
|
|
|
|
|
cat <<MakeEND
|
2019-03-10 15:39:23 +01:00
|
|
|
all: $(mes "$outfile")
|
2016-09-07 16:35:07 +00:00
|
|
|
$(mes "$outfile"): $(mes "$depfile" "$processor" "$textsen" "$textsfile" "$fundraisingfile" "$menufile" "$sourcesfile")
|
2019-03-10 15:39:23 +01:00
|
|
|
\${PROCESSOR} \${PROCFLAGS} process_file "${infile}" "$(mio "$processor")" >"$outfile" || { rm $outfile; exit 1; }
|
2015-05-21 16:31:43 +00:00
|
|
|
MakeEND
|
|
|
|
|
done
|
|
|
|
|
}
|
2015-05-31 21:09:48 +00:00
|
|
|
|
2015-05-28 14:55:27 +00:00
|
|
|
xhtml_makers(){
|
2015-05-31 21:09:48 +00:00
|
|
|
# generate make rules concerning all .xhtml files in source tree
|
2015-05-28 14:55:27 +00:00
|
|
|
sourcefind -name '*.[a-z][a-z].xhtml' \
|
2015-05-31 21:09:48 +00:00
|
|
|
| sed -r 's;\.[a-z][a-z]\.xhtml$;;' \
|
2015-05-28 14:55:27 +00:00
|
|
|
| sort -u \
|
|
|
|
|
| while read shortpath; do
|
2015-10-28 21:28:21 +00:00
|
|
|
xhtml_maker "$shortpath" "${shortpath}"
|
2015-05-28 14:55:27 +00:00
|
|
|
done
|
|
|
|
|
}
|
2015-05-21 16:31:43 +00:00
|
|
|
|
2015-05-31 21:09:48 +00:00
|
|
|
xhtml_additions(){
|
2015-07-30 13:08:37 +00:00
|
|
|
printf "%s\n" "$@" \
|
2015-05-31 21:09:48 +00:00
|
|
|
| sed -rn 's;\.[a-z][a-z]\.xhtml$;;p' \
|
|
|
|
|
| sort -u \
|
|
|
|
|
| xargs realpath \
|
|
|
|
|
| while read addition; do
|
2015-10-28 21:28:21 +00:00
|
|
|
xhtml_maker "${addition#$input/}" "${addition#$input/}"
|
2015-05-31 21:09:48 +00:00
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-21 16:31:43 +00:00
|
|
|
xslt_dependencies(){
|
2015-05-31 21:09:48 +00:00
|
|
|
# list referenced xsl files for a given xsl file
|
|
|
|
|
# *not* recursive since Make will handle recursive
|
|
|
|
|
# dependency resolution
|
2015-05-21 16:31:43 +00:00
|
|
|
file="$1"
|
|
|
|
|
|
|
|
|
|
cat "$file" \
|
2016-05-09 20:45:56 +00:00
|
|
|
| tr '\n\t\r' ' ' \
|
2015-05-21 16:31:43 +00:00
|
|
|
| sed -r 's;(<xsl:(include|import)[^>]*>);\n\1\n;g' \
|
2015-05-29 15:55:00 +00:00
|
|
|
| sed -nr '/<xsl:(include|import)[^>]*>/s;^.*href *= *"([^"]*)".*$;\1;gp'
|
2015-05-21 16:31:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
xslt_maker(){
|
|
|
|
|
# find external references in a xsl file and generate
|
|
|
|
|
# Make dependencies accordingly
|
|
|
|
|
|
2015-05-29 15:55:00 +00:00
|
|
|
file="$input/$1"
|
2015-10-28 21:28:21 +00:00
|
|
|
dir="${file%/*}"
|
2015-05-21 16:31:43 +00:00
|
|
|
|
2015-06-01 00:01:37 +00:00
|
|
|
deps="$( xslt_dependencies "$file" |xargs -I'{}' realpath "$dir/{}" )"
|
2015-05-21 16:31:43 +00:00
|
|
|
cat <<MakeEND
|
2015-05-29 15:55:00 +00:00
|
|
|
$(mes "$file"): $(mes $deps)
|
|
|
|
|
touch "$(mio "$file")"
|
2015-05-21 16:31:43 +00:00
|
|
|
MakeEND
|
|
|
|
|
}
|
2015-05-31 21:09:48 +00:00
|
|
|
|
2015-05-28 14:55:27 +00:00
|
|
|
xslt_makers(){
|
2015-05-31 21:09:48 +00:00
|
|
|
# generate make dependencies for all .xsl files in input tree
|
2015-05-28 14:55:27 +00:00
|
|
|
sourcefind -name '*.xsl' \
|
|
|
|
|
| while read filepath; do
|
2015-05-29 15:55:00 +00:00
|
|
|
xslt_maker "$filepath"
|
2015-05-28 14:55:27 +00:00
|
|
|
done
|
|
|
|
|
}
|
2015-05-21 16:31:43 +00:00
|
|
|
|
2015-05-31 21:09:48 +00:00
|
|
|
xslt_additions(){
|
2015-07-30 13:08:37 +00:00
|
|
|
printf "%s\n" "$@" \
|
2015-05-31 21:09:48 +00:00
|
|
|
| egrep '.+\.xsl$' \
|
|
|
|
|
| xargs realpath \
|
|
|
|
|
| while read addition; do
|
|
|
|
|
xslt_maker "${addition#$input/}"
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-21 16:31:43 +00:00
|
|
|
tree_maker(){
|
|
|
|
|
# walk through file tree and issue Make rules according to file type
|
2015-05-30 14:04:30 +00:00
|
|
|
input="$(realpath "$1")"
|
2015-05-31 21:09:48 +00:00
|
|
|
output="$(realpath "$2")"
|
|
|
|
|
shift 2
|
2015-05-21 16:31:43 +00:00
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
# List of languages in a single line, separated by blanks
|
|
|
|
|
languages=$(echo $(get_languages))
|
|
|
|
|
|
2015-05-21 16:31:43 +00:00
|
|
|
cache_textsfile
|
|
|
|
|
cache_fundraising
|
|
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
cat <<EOF
|
2015-07-16 16:42:43 +00:00
|
|
|
.PHONY: all
|
2019-03-09 20:55:42 +01:00
|
|
|
.DELETE_ON_ERROR:
|
2015-07-16 16:42:43 +00:00
|
|
|
PROCESSOR = "$basedir/build/process_file.sh"
|
|
|
|
|
PROCFLAGS = --source "$basedir" --statusdir "$statusdir" --domain "$domain"
|
|
|
|
|
INPUTDIR = $input
|
|
|
|
|
OUTPUTDIR = $output
|
2019-03-10 01:08:46 +01:00
|
|
|
STATUSDIR = $statusdir
|
2019-03-10 15:39:23 +01:00
|
|
|
LANGUAGES = $languages
|
2019-03-09 01:21:03 +01:00
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Build .html files from .xhtml sources
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# All .xhtml source files
|
|
|
|
|
HTML_SRC_FILES := \$(shell find \$(INPUTDIR) -name '*.??.xhtml')
|
|
|
|
|
|
|
|
|
|
# All basenames of .xhtml source files (without .<lang>.xhtml ending)
|
|
|
|
|
# Note: \$(sort ...) is used to remove duplicates
|
|
|
|
|
HTML_SRC_BASES := \$(sort \$(basename \$(basename \$(HTML_SRC_FILES))))
|
|
|
|
|
|
|
|
|
|
# All directories containing .xhtml source files
|
|
|
|
|
HTML_SRC_DIRS := \$(sort \$(dir \$(HTML_SRC_BASES)))
|
|
|
|
|
|
|
|
|
|
# The same as above, but moved to the output directory
|
|
|
|
|
HTML_DST_BASES := \$(patsubst \$(INPUTDIR)/%,\$(OUTPUTDIR)/%,\$(HTML_SRC_BASES))
|
|
|
|
|
|
|
|
|
|
# List of .<lang>.html files to build
|
|
|
|
|
HTML_DST_FILES := \$(foreach base,\$(HTML_DST_BASES),\$(foreach lang,\$(LANGUAGES),\$(base).\$(lang).html))
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Create index.* symlinks
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# All .xhtml source files with the same name as their parent directory
|
|
|
|
|
INDEX_SRC_FILES := \$(wildcard \$(foreach directory,\$(HTML_SRC_DIRS),\$(directory)\$(notdir \$(directory:/=)).??.xhtml))
|
|
|
|
|
|
|
|
|
|
# All basenames of .xhtml source files with the same name as their parent
|
|
|
|
|
# directory
|
|
|
|
|
INDEX_SRC_BASES := \$(sort \$(basename \$(basename \$(INDEX_SRC_FILES))))
|
|
|
|
|
|
|
|
|
|
# All directories containing .xhtml source files with the same name as their
|
|
|
|
|
# parent directory (that is, all directories in which index files should be
|
|
|
|
|
# created)
|
|
|
|
|
INDEX_SRC_DIRS := \$(dir \$(INDEX_SRC_BASES))
|
|
|
|
|
|
|
|
|
|
# The same as above, but moved to the output directory
|
|
|
|
|
INDEX_DST_DIRS := \$(patsubst \$(INPUTDIR)/%,\$(OUTPUTDIR)/%,\$(INDEX_SRC_DIRS))
|
|
|
|
|
|
|
|
|
|
# List of index.<lang>.html and index.html.<lang> symlinks to create
|
|
|
|
|
INDEX_DST_LINKS := \$(foreach base,\$(INDEX_DST_DIRS),\$(foreach lang,\$(LANGUAGES),\$(base)index.\$(lang).html \$(base)index.html.\$(lang)))
|
|
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
all: \$(INDEX_DST_LINKS)
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
for lang in ${languages}; do
|
|
|
|
|
cat<<EOF
|
|
|
|
|
\$(OUTPUTDIR)/%/index.${lang}.html:
|
|
|
|
|
@echo "* Creating symlink \$*/index.${lang}.html"
|
|
|
|
|
@ln -sf \$(notdir \$*).${lang}.html \$@
|
|
|
|
|
EOF
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Create symlinks from file.<lang>.html to file.html.<lang>
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# List of .html.<lang> symlinks to create
|
|
|
|
|
HTML_DST_LINKS := \$(foreach base,\$(HTML_DST_BASES) \$(addsuffix index,\$(INDEX_DST_DIRS)),\$(foreach lang,\$(LANGUAGES),\$(base).html.\$(lang)))
|
|
|
|
|
|
|
|
|
|
all: \$(HTML_DST_LINKS)
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
for lang in ${languages}; do
|
|
|
|
|
cat<<EOF
|
|
|
|
|
\$(OUTPUTDIR)/%.html.${lang}:
|
|
|
|
|
@echo "* Creating symlink \$*.html.${lang}"
|
|
|
|
|
@ln -sf \$(notdir \$*).${lang}.html \$@
|
|
|
|
|
EOF
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
|
|
2019-03-09 01:21:03 +01:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Build .rss files from .xhtml sources
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# All .rss.xsl scripts which can create .rss output
|
|
|
|
|
RSS_SRC_SCRIPTS := \$(shell find \$(INPUTDIR) -name '*.rss.xsl')
|
|
|
|
|
|
|
|
|
|
# All basenames of .xhtml source files from which .rss files should be built
|
|
|
|
|
RSS_SRC_BASES := \$(sort \$(basename \$(basename \$(RSS_SRC_SCRIPTS))))
|
|
|
|
|
|
|
|
|
|
# The same as above, but moved to the output directory
|
|
|
|
|
RSS_DST_BASES := \$(patsubst \$(INPUTDIR)/%,\$(OUTPUTDIR)/%,\$(RSS_SRC_BASES))
|
|
|
|
|
|
|
|
|
|
# List of .<lang>.rss files to build
|
|
|
|
|
RSS_DST_FILES := \$(foreach base,\$(RSS_DST_BASES),\$(foreach lang,\$(LANGUAGES),\$(base).\$(lang).rss))
|
|
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
all: \$(RSS_DST_FILES)
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
for lang in ${languages}; do
|
|
|
|
|
cat<<EOF
|
|
|
|
|
\$(OUTPUTDIR)/%.${lang}.rss: \$(INPUTDIR)/%.*.xhtml \$(INPUTDIR)/%.sources \$(INPUTDIR)/%.rss.xsl \$(INPUTDIR)/tools/menu-global.xml $(get_textsfile "en") $(get_fundraisingfile "${lang}")
|
|
|
|
|
@echo "* Building \$*.${lang}.rss"
|
|
|
|
|
@\${PROCESSOR} \${PROCFLAGS} process_file \$(INPUTDIR)/%.${lang}.xhtml \$(INPUTDIR)/%.rss.xsl > \$@
|
|
|
|
|
EOF
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
|
|
2019-03-09 01:21:03 +01:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Build .ics files from .xhtml sources
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# All .ics.xsl scripts which can create .ics output
|
|
|
|
|
ICS_SRC_SCRIPTS := \$(shell find \$(INPUTDIR) -name '*.ics.xsl')
|
|
|
|
|
|
|
|
|
|
# All basenames of .xhtml source files from which .ics files should be built
|
|
|
|
|
ICS_SRC_BASES := \$(sort \$(basename \$(basename \$(ICS_SRC_SCRIPTS))))
|
|
|
|
|
|
|
|
|
|
# The same as above, but moved to the output directory
|
|
|
|
|
ICS_DST_BASES := \$(patsubst \$(INPUTDIR)/%,\$(OUTPUTDIR)/%,\$(ICS_SRC_BASES))
|
|
|
|
|
|
|
|
|
|
# List of .<lang>.ics files to build
|
|
|
|
|
ICS_DST_FILES := \$(foreach base,\$(ICS_DST_BASES),\$(foreach lang,\$(LANGUAGES),\$(base).\$(lang).ics))
|
|
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
all: \$(ICS_DST_FILES)
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
for lang in ${languages}; do
|
|
|
|
|
cat<<EOF
|
|
|
|
|
\$(OUTPUTDIR)/%.${lang}.ics: \$(INPUTDIR)/%.*.xhtml \$(INPUTDIR)/%.sources \$(INPUTDIR)/%.ics.xsl \$(INPUTDIR)/tools/menu-global.xml $(get_textsfile "en") $(get_fundraisingfile "${lang}")
|
|
|
|
|
@echo "* Building \$*.${lang}.ics"
|
|
|
|
|
@\${PROCESSOR} \${PROCFLAGS} process_file \$(INPUTDIR)/%.${lang}.xhtml \$(INPUTDIR)/%.ics.xsl > \$@
|
|
|
|
|
EOF
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
|
|
2019-03-09 01:21:03 +01:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Copy images, docments etc
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# All files which should just be copied over
|
|
|
|
|
COPY_SRC_FILES := \$(shell find \$(INPUTDIR) -type f -not -path '\$(INPUTDIR)/.git/*' -not -name 'Makefile' -not -name '*.sources' -not -name '*.xhtml' -not -name '*.xml' -not -name '*.xsl')
|
|
|
|
|
|
|
|
|
|
# The same as above, but moved to the output directory
|
|
|
|
|
COPY_DST_FILES := \$(patsubst \$(INPUTDIR)/%,\$(OUTPUTDIR)/%,\$(COPY_SRC_FILES))
|
|
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
all: \$(COPY_DST_FILES)
|
|
|
|
|
\$(COPY_DST_FILEST): \$(OUTPUTDIR)/%: \$(INPUTDIR)/%
|
|
|
|
|
@echo "* Copying file \$*"
|
|
|
|
|
@cp \$< \$@
|
|
|
|
|
|
2019-03-09 01:21:03 +01:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Copy .xhtml files to "source" directory in target directory tree
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
SOURCE_DST_FILES := \$(patsubst \$(INPUTDIR)/%,\$(OUTPUTDIR)/source/%,\$(HTML_SRC_FILES))
|
|
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
all: \$(SOURCE_DST_FILES)
|
|
|
|
|
\$(SOURCE_DST_FILES): \$(OUTPUTDIR)/source/%: \$(INPUTDIR)/%
|
|
|
|
|
@echo "* Copying source \$*"
|
|
|
|
|
cp \$< \$@
|
|
|
|
|
|
2019-03-09 01:21:03 +01:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
# Clean up excess files in target directory
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
ALL_DST := \$(HTML_DST_FILES) \$(INDEX_DST_LINKS) \$(HTML_DST_LINKS) \$(RSS_DST_FILES) \$(ICS_DST_FILES) \$(COPY_DST_FILES) \$(SOURCE_DST_FILES)
|
2019-03-09 01:21:03 +01:00
|
|
|
|
|
|
|
|
.PHONY: clean
|
2019-03-09 19:07:16 +01:00
|
|
|
all: clean
|
2019-03-09 01:21:03 +01:00
|
|
|
clean:
|
2019-03-09 20:55:42 +01:00
|
|
|
@# Write all destination filenames into "manifest" file, one per line
|
2019-03-10 15:39:23 +01:00
|
|
|
\$(file >\$(STATUSDIR)/manifest)
|
2019-03-10 10:51:53 +01:00
|
|
|
\$(foreach filename,\$(ALL_DST),\$(file >>\$(STATUSDIR)/manifest,\$(filename)))
|
|
|
|
|
@sort \$(STATUSDIR)/manifest > \$(STATUSDIR)/manifest.sorted
|
2019-03-09 20:55:42 +01:00
|
|
|
@find -L \$(OUTPUTDIR) -type f \\
|
|
|
|
|
| sort \\
|
2019-03-10 15:39:23 +01:00
|
|
|
| diff - \$(STATUSDIR)/manifest.sorted \\
|
2019-03-09 20:55:42 +01:00
|
|
|
| sed -rn 's;^< ;;p' \\
|
2019-03-09 01:21:03 +01:00
|
|
|
| while read file; do echo "* Deleting \$\${file}"; rm "\$\${file}"; done
|
|
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
2015-07-16 16:42:43 +00:00
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
EOF
|
2015-05-22 18:50:24 +00:00
|
|
|
|
2015-05-28 14:55:27 +00:00
|
|
|
forcelog Make_xslt; Make_xslt="$(logname Make_xslt)"
|
2015-05-29 15:55:00 +00:00
|
|
|
Make_xhtml="$(logname Make_xhtml)"
|
|
|
|
|
|
2015-10-28 21:28:21 +00:00
|
|
|
trap "trap - 0 2 3 6 9 15; killall \"${0##*/}\"" 0 2 3 6 9 15
|
2015-05-28 14:55:27 +00:00
|
|
|
|
2015-05-31 21:09:48 +00:00
|
|
|
[ "$regen_xslt" = false -a -s "$Make_xslt" ] && \
|
|
|
|
|
xslt_additions "$@" >>"$Make_xslt" \
|
2015-05-28 14:55:27 +00:00
|
|
|
|| xslt_makers >"$Make_xslt" &
|
2015-07-30 13:08:37 +00:00
|
|
|
|
2015-05-31 21:09:48 +00:00
|
|
|
if [ "$regen_xhtml" = false -a -s "$Make_xhtml" ]; then
|
|
|
|
|
cat "$Make_xhtml"
|
|
|
|
|
xhtml_additions "$@" |tee -a "$Make_xhtml"
|
|
|
|
|
else
|
|
|
|
|
xhtml_makers |tee "$Make_xhtml"
|
|
|
|
|
fi
|
2015-05-29 15:55:00 +00:00
|
|
|
|
2015-05-28 14:55:27 +00:00
|
|
|
wait
|
|
|
|
|
trap - 0 2 3 6 9 15
|
2015-05-31 21:09:48 +00:00
|
|
|
|
2019-03-10 15:39:23 +01:00
|
|
|
cat "$Make_xslt"
|
2015-05-21 16:31:43 +00:00
|
|
|
}
|
|
|
|
|
|