mirror of https://github.com/tLDP/LDP
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.
This commit is contained in:
parent
d851cd4f67
commit
d8b81613d5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue