Changeset 05d60ce


Ignore:
Timestamp:
07/06/2007 05:54:18 PM (15 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 6.3, 6.3-8326, 6.3-rc1, 6.3-rc2, 6.4, 6.5, 6.5-rc1, 6.5-rc2, 6.6, 6.6-rc1, 6.6-rc2, 6.7, 6.7-rc1, 6.8, 6.8-rc1, 7.0, 7.0-rc1, 7.0-rc2, 7.1, 7.1-rc1, 7.10, 7.10-rc1, 7.2, 7.2-rc1, 7.3, 7.3-rc1, 7.4, 7.4-rc1, 7.4-rc2, 7.5, 7.5-SYSTEMD-rc1, 7.5-rc1, 7.5-systemd, 7.5-systemd-rc1, 7.6, 7.6-rc1, 7.6-systemd, 7.6-systemd-rc1, 7.6-systemd-rc2, 7.7, 7.7-rc1, 7.7-systemd, 7.7-systemd-rc1, 7.8, 7.8-rc1, 7.8-systemd, 7.9, 7.9-rc1, 7.9-rc2, 7.9-systemd, 7.9-systemd-rc1, 7.9-systemd-rc2, 8.0, 8.0-rc1, 8.1, 8.1-rc1, 8.1-rc2, 8.2, 8.2-rc1, 8.3, 8.3-rc1, 8.3-rc2, 8.4, 8.4-rc1, 9.0, 9.0-rc1, 9.1, 9.1-rc1, BOOK.old, arm, cross-chap5, hybrid, jh, ml-11.0, multilib, nosym, old-trunk, s6-init, systemd, test, trunk, x86_64-POC, xry111/arm64, xry111/clfs-ng, xry111/git-transition, xry111/glibc-2.34, xry111/lfs-next, xry111/pip3, xry111/queue-11.3, xry111/rust-wip-20221008, xry111/tester-nohack, xry111/usr-move
Children:
6dd1a9f
Parents:
0e6d3c0
Message:

Added a versose flag and other fixes to the Makefile.
Changed obfuscate.sh to try to prevent hangs when parsing nonchunked output.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8203 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r0e6d3c0 r05d60ce  
    66NOCHUNKS_OUTPUT=LFS-BOOK.html
    77
     8ifdef V
     9  Q =
     10else
     11  Q = @
     12endif
     13
    814lfs: validxml profile-html
    915        @echo "Generating chunked XHTML files..."
    10         @xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
     16        $(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
    1117          -stringparam rootid $(ROOT_ID) -stringparam base.dir $(BASEDIR)/ \
    1218          stylesheets/lfs-chunked.xsl /tmp/lfs-html.xml
    1319
    1420        @echo "Copying CSS code and images..."
    15         @if [ ! -e $(BASEDIR)/stylesheets ]; then \
     21        $(Q)if [ ! -e $(BASEDIR)/stylesheets ]; then \
    1622          mkdir -p $(BASEDIR)/stylesheets; \
    1723        fi;
    18         @cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
    19         @if [ ! -e $(BASEDIR)/images ]; then \
     24        $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
     25        $(Q)if [ ! -e $(BASEDIR)/images ]; then \
    2026          mkdir -p $(BASEDIR)/images; \
    2127        fi;
    22         @cp images/*.png $(BASEDIR)/images
    23         @cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html
    24         @cd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html
     28        $(Q)cp images/*.png $(BASEDIR)/images
     29        $(Q)cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" *.html
     30        $(Q)cd $(BASEDIR)/; sed -i -e "s@../images@images@g" *.html
    2531
    26         @echo "Running Tidy..."
    27         @for filename in `find $(BASEDIR) -name "*.html"`; do \
     32        @echo "Running Tidy and obfuscate.sh..."
     33        $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
    2834          tidy -config tidy.conf $$filename; \
    2935          true; \
     
    3238        done;
    3339
    34         @$(MAKE) wget-list
     40        $(Q)$(MAKE) wget-list
    3541
    3642pdf: validxml
    3743        @echo "Generating profiled XML for PDF..."
    38         @xsltproc --nonet --stringparam profile.condition pdf \
     44        $(Q)xsltproc --nonet --stringparam profile.condition pdf \
    3945          --output /tmp/lfs-pdf.xml stylesheets/lfs-xsl/profile.xsl \
    4046          /tmp/lfs-full.xml
    4147
    4248        @echo "Generating FO file..."
    43         @xsltproc --nonet -stringparam rootid $(ROOT_ID) \
     49        $(Q)xsltproc --nonet -stringparam rootid $(ROOT_ID) \
    4450          --output /tmp//lfs-pdf.fo stylesheets/lfs-pdf.xsl /tmp/lfs-pdf.xml
    45         @sed -i -e 's/span="inherit"/span="all"/' /tmp/lfs-pdf.fo
     51        $(Q)sed -i -e 's/span="inherit"/span="all"/' /tmp/lfs-pdf.fo
    4652
    4753        @echo "Generating PDF file..."
    48         @fop /tmp/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
     54        $(Q)fop /tmp/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
    4955
    5056nochunks: validxml profile-html
    5157        @echo "Generating non chunked XHTML file..."
    52         @xsltproc --nonet -stringparam profile.condition html \
     58        $(Q)xsltproc --nonet -stringparam profile.condition html \
    5359          -stringparam rootid $(ROOT_ID) --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
    5460          stylesheets/lfs-nochunks.xsl /tmp/lfs-html.xml
    5561
    5662        @echo "Running Tidy..."
    57         @tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
    58         @sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
    59         @sed -i -e "s@text/html@application/xhtml+xml@g"  \
     63        $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
     64        @echo "Running obfuscate.sh..."
     65        $(Q)sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
     66        $(Q)sed -i -e "s@text/html@application/xhtml+xml@g"  \
    6067          $(BASEDIR)/$(NOCHUNKS_OUTPUT)
    6168
    6269validxml:
    6370        @echo "Validating the book..."
    64         @xmllint --nonet --noent --xinclude --postvalid \
     71        $(Q)xmllint --nonet --noent --xinclude --postvalid \
    6572          -o /tmp/lfs-full.xml index.xml
    6673
    6774profile-html: validxml
    6875        @echo "Generating profiled XML for XHTML..."
    69         @xsltproc --nonet --stringparam profile.condition html \
     76        $(Q)xsltproc --nonet --stringparam profile.condition html \
    7077          --output /tmp/lfs-html.xml stylesheets/lfs-xsl/profile.xsl \
    7178          /tmp/lfs-full.xml
     
    7380wget-list:
    7481        @echo "Generating wget list..."
    75         @mkdir -p $(BASEDIR)
    76         @xsltproc --xinclude --nonet --output $(BASEDIR)/wget-list \
     82        $(Q)mkdir -p $(BASEDIR)
     83        $(Q)xsltproc --xinclude --nonet --output $(BASEDIR)/wget-list \
    7784          stylesheets/wget-list.xsl chapter03/chapter03.xml
    7885
    79 dump-commands:
     86dump-commands: validxml
    8087        @echo "Dumping book commands..."
    81         @xsltproc --xinclude --nonet --output $(DUMPDIR)/ \
    82            stylesheets/dump-commands.xsl index.xml
     88        $(Q)xsltproc --output $(DUMPDIR)/ \
     89           stylesheets/dump-commands.xsl /tmp/lfs-full.xml
    8390
    8491validate:
    8592        @echo "Validating the book..."
    86         @xmllint --noout --nonet --xinclude --postvalid index.xml
     93        $(Q)xmllint --noout --nonet --xinclude --postvalid index.xml
    8794
    8895all: lfs nochunks pdf dump-commands
  • obfuscate.sh

    r0e6d3c0 r05d60ce  
    44# obfuscate email addresses in XML/HTML
    55# Script written (and slight perl modification) by Archaic <archaic AT linuxfromscratch D0T org>
     6# Modified from "sed -i" to old style "sed -e" by Manuel Canales <manuel AT linuxfromscratch D0T org>
     7# to prevent hangs on very long files, like nonckunked books.
    68# Original Perl expression by Anderson Lizardo <lizardo AT linuxfromscratch D0T org>
    79# Released under the GNU General Public License
     
    2628#cp "$1" "$1".bak
    2729
    28 for i in `grep -o '"mailto:.*@.*"' "$1" |sed -e 's|^"mailto:||' -e 's|"$||'`; do
     30for i in `grep -o '"mailto:.*@.*"' ${1} |sed -e 's|^"mailto:||' -e 's|"$||'`; do
    2931  link=`echo $i | perl -pe 's/[^\n]/"\\\&#".ord($&)."\;"/ge'`
    3032  plaintext=`echo $i | sed -e 's|@| AT |' -e 's|\.| D0T |g'`
    31   sed -i "s|mailto:$i|mailto:$link|" "$1"
    32   sed -i "s|$i|$plaintext|" "$1"
     33  cp ${1}{,.tmp}
     34  sed -e "s|mailto:$i|mailto:$link|" \
     35      -e "s|$i|$plaintext|" ${1}.tmp > ${1}
     36  rm ${1}.tmp
    3337done
    34 
     38#rm $FILE.tmp
    3539#exit 0
Note: See TracChangeset for help on using the changeset viewer.