Browse Source

compatibility and portability changes from test

svn path=/trunk/; revision=34953
tags/stw2018
paul 2 years ago
parent
commit
19853ef064
4 changed files with 18 additions and 15 deletions
  1. 2
    0
      build/logging.sh
  2. 5
    4
      build/makerules.sh
  3. 10
    10
      build/processor.sh
  4. 1
    1
      build/stirrups.sh

+ 2
- 0
build/logging.sh View File

@@ -21,6 +21,8 @@ forcelog(){
[ "$(logname "$name")" = "/dev/null" ] \
&& forcedlog="$forcedlog\n${name}=$(tempfile -p w3bld -s $$)"
}

[ -z "$USER" ] && USER="$(whoami)"
trap "trap - 0 2 3 6 9 15; find \"${TMPDIR:-/tmp}/\" -maxdepth 1 -user \"$USER\" -name \"w3bld*$$\" -delete" 0 2 3 6 9 15

logstatus(){

+ 5
- 4
build/makerules.sh View File

@@ -17,9 +17,9 @@ mio(){
# by replacing in and out pathes with make variables.
for each in "$@"; do
case "$each" in
"$input"/*) echo "\${INPUTDIR}/${each#$input/}" ;;
"$output"/*) echo "\${OUTPUTDIR}/${each#$output/}" ;;
*) echo "$each" ;;
"$input"/*) printf '${INPUTDIR}/%s\n' "${each#${input}/}" ;;
"$output"/*) printf '${OUTPUTDIR}/%s\n' "${each#${output}/}" ;;
*) printf %s\\n "$each" ;;
esac
done
}
@@ -28,7 +28,8 @@ mes(){
# make escape... escape a filename for make syntax
# possibly not complete
mio "$@" \
| sed -zr 's;[ #];\\&;g; s;\n; ;g'
| sed -r ':X; $bY; N; bX; :Y;
s;[ #];\\&;g; s;\n; ;g'
}

xhtml_maker(){

+ 10
- 10
build/processor.sh View File

@@ -16,17 +16,17 @@ process_file(){
build_xmlstream "$shortname" "$lang" "$olang" \
| xsltproc "$processor" - \
| sed -r ':X; N; $!bX;
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="https?://'"$domain"'/([^"]*)";<\1\2 href="/\3";g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''https?://'"$domain"'/([^'\'']*)'\'';<\1\2 href='\''/\3'\'';g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="(https?:)?//'"$domain"'/([^"]*)";<\1\2 href="/\4";gI
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''(https?:)?//'"$domain"'/([^'\'']*)'\'';<\1\2 href='\''/\4'\'';gI

s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="(https?://[^"]*)";<\1\2 href="#== norewrite ==\3";g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="([^#"])([^"]*/)?([^\./"]*\.)(html|rss|ics)(#[^"]*)?";<\1\2 href="\3\4\5'"$lang"'.\6\7";g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="([^#"]*/)(#[^"]*)?";<\1\2 href="\3index.'"$lang"'.html\4";g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="#== norewrite ==(https?://[^"]*)";<\1\2 href="\3";g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="((https?:)?//[^"]*)";<\1\2 href="#== norewrite ==\3";gI
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="([^#"])([^"]*/)?([^\./"]*\.)(html|rss|ics)(#[^"]*)?";<\1\2 href="\3\4\5'"$lang"'.\6\7";gI
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="([^#"]*/)(#[^"]*)?";<\1\2 href="\3index.'"$lang"'.html\4";gI
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href="#== norewrite ==((https?:)?//[^"]*)";<\1\2 href="\3";gI

s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''(https?://[^'\'']*)'\'';<\1\2 href='\''#== norewrite ==\3'\'';g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''([^#'\''])([^'\'']*/)?([^\./'\'']*\.)(html|rss|ics)(#[^'\'']*)?'\'';<\1\2 href='\''\3\4\5'"$lang"'.\6\7'\'';g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''([^#'\'']*/)(#[^'\'']*)?'\'';<\1\2 href='\''\3index.'"$lang"'.html\4'\'';g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''#== norewrite ==(https?://[^'\'']*)'\'';<\1\2 href='\''\3'\'';g
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''((https?:)?//[^'\'']*)'\'';<\1\2 href='\''#== norewrite ==\3'\'';gI
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''([^#'\''])([^'\'']*/)?([^\./'\'']*\.)(html|rss|ics)(#[^'\'']*)?'\'';<\1\2 href='\''\3\4\5'"$lang"'.\6\7'\'';gI
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''([^#'\'']*/)(#[^'\'']*)?'\'';<\1\2 href='\''\3index.'"$lang"'.html\4'\'';gI
s;<[\r\n\t ]*(a|link)([\r\n\t ][^>]*)?[\r\n\t ]href='\''#== norewrite ==((https?:)?//[^'\'']*)'\'';<\1\2 href='\''\3'\'';gI
'
}

+ 1
- 1
build/stirrups.sh View File

@@ -35,7 +35,7 @@ build_manifest(){

sed -nr 's;\\ ; ;g;
s;\\#;#;g;
s;\$\{OUTPUTDIR\}/([^:]+) :.*;\1;p'
s;\$\{OUTPUTDIR\}/([^:]+):.*;\1;p'
}

remove_orphans(){

Loading…
Cancel
Save