From d8b81613d51559b2a796e88a2ddfef8236953d24 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Tue, 2 Feb 2016 11:15:13 -0800 Subject: [PATCH] genarate a symlink script AND a log of "not found" adjust to generate a script which can be inspected before being run; try to locate all HTML, single HTML, PDF and text files and report on the 'not found' outputs This is just to help during migration to the new content structure. --- .../create-compatibility-symlinks | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/LDP/builder-2016/create-compatibility-symlinks b/LDP/builder-2016/create-compatibility-symlinks index 29f2a332..4b3fc7d8 100755 --- a/LDP/builder-2016/create-compatibility-symlinks +++ b/LDP/builder-2016/create-compatibility-symlinks @@ -58,55 +58,81 @@ find . -mindepth 1 -maxdepth 1 -type d -printf "%P\n" \ cd "${OLDTREE}" \ || abort 1 "Could not \"cd $OLDTREE\"" + # HTML chunked outputs + # + unset DOC_HTML NEWFILE="${NEWTREE}/${STEM}/${STEM}.html" - for OLDFILE in html/{HOWTO,FAQ,REF}/${STEM}.html html/LDP/${STEM}/html/${STEM}.html ; do + for OLDFILE in html/HOWTO/${STEM}/index.html html/HOWTO/${STEM}.html html/FAQ/${STEM}/index.html html/LDP/${STEM}/html/index.html ; do if test -e "$OLDFILE"; then + DOC_HTML=$OLDFILE notice "$STEM symlinking (html) $OLDFILE (to $NEWFILE)" $DRYRUN ln -srf --backup=simple --suffix="-$( date +%F-%T)" -- "$NEWFILE" "$OLDFILE" break else : # -- noop - notice "$STEM missing (html) $OLDFILE" + #notice "$STEM missing (html) $OLDFILE" fi done # HTML single file outputs for HOWTO and GUIDE document categories # + unset DOC_HTMLS NEWFILE="${NEWTREE}/${STEM}/${STEM}-single.html" - for OLDFILE in html/HOWTO/${STEM}.html html/LDP/${STEM}/html/${STEM}.html ; do + for OLDFILE in html/HOWTO/html_single/${STEM}/index.html html/LDP/${STEM}/html/${STEM}.html ; do if test -e "$OLDFILE"; then + DOC_HTMLS=$OLDFILE notice "$STEM symlinking (htmls) $OLDFILE (to $NEWFILE)" $DRYRUN ln -srf --backup=simple --suffix="-$( date +%F-%T)" -- "$NEWFILE" "$OLDFILE" + break else : # -- noop - notice "$STEM missing (htmls) $OLDFILE" + #notice "$STEM missing (htmls) $OLDFILE" fi done + unset DOC_TXT NEWFILE="${NEWTREE}/${STEM}/${STEM}.txt" for OLDFILE in html/{FAQ/faqs,HOWTO/text}/${STEM} html/{LDP,REF}/${STEM}/${STEM}.txt ; do if test -e "$OLDFILE"; then + DOC_TXT=$OLDFILE notice "$STEM symlinking (text) $OLDFILE (to $NEWFILE)" $DRYRUN ln -srf --backup=simple --suffix="-$( date +%F-%T)" -- "$NEWFILE" "$OLDFILE" + break else : # -- noop - notice "$STEM missing (text) $OLDFILE" + #notice "$STEM missing (text) $OLDFILE" fi done + unset DOC_PDF NEWFILE="${NEWTREE}/${STEM}/${STEM}.pdf" - OLDFILE="html/HOWTO/pdf/${STEM}.pdf" for OLDFILE in html/{HOWTO,FAQ}/pdf/${STEM}.pdf html/{LDP,REF}/${STEM}/${STEM}.pdf ; do if test -e "$OLDFILE"; then + DOC_PDF=$OLDFILE notice "$STEM symlinking (pdf) $OLDFILE (to $NEWFILE)" $DRYRUN ln -srf --backup=simple --suffix="-$( date +%F-%T)" -- "$NEWFILE" "$OLDFILE" + break else : # -- noop - notice "$STEM missing (pdf) $OLDFILE" + #notice "$STEM missing (pdf) $OLDFILE" fi done + for var in DOC_HTML DOC_HTMLS DOC_TXT DOC_PDF; do + + if test -n "${!var}"; then + notice "$STEM ${var} ${!var}" + else + notice "$STEM ${var} not found" + fi + + done + done +# -- add some special handling for: +# +# solrhe +# # -- end of file