| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function texinfo_updateNodes { |
| |
| |
| local NODES=$(cat $MANUAL_CHAPTER_DIR/chapter-menu.${MANUAL_EXTENSION} \ |
| | sed -r 's!^\* !!' | sed -r 's!:{1,2}.*$!!g' \ |
| | egrep -v '^@(end )?menu$' | sed -r 's! !:!g' | sort | uniq) |
| |
| |
| for NODE in $NODES;do |
| |
| NODE=$(echo "${NODE}" | sed -r 's!:! !g') |
| SECT=$(echo "${NODE}" | cut -d' ' -f2- | sed -r 's! !/!g') |
| INCL=$(echo "${NODE}" | sed -r 's! !/!g').${MANUAL_EXTENSION} |
| CIND=$(echo "${NODE}") |
| |
| |
| |
| |
| |
| |
| if [[ ! -f ${MANUAL_BASEDIR}/$INCL ]] \ |
| && [[ $(cli_getRepoStatus ${MANUAL_BASEDIR}/$INCL) != 'D' ]];then |
| |
| |
| |
| |
| |
| local CONFFILE="${MANUAL_TEMPLATE}/${MANUAL_NAME}.conf" |
| |
| |
| cli_checkFiles $CONFFILE |
| |
| |
| |
| |
| |
| local CONFLINE='' |
| local CONFLINES=$(cat ${CONFFILE} \ |
| | egrep -v '^#' \ |
| | egrep -v '^[[:space:]]*$' \ |
| | sed -r 's![[:space:]]*!!g') |
| |
| |
| |
| local CONFLHS='' |
| local CONFRHS='' |
| |
| |
| local TEMPLATE='' |
| |
| |
| |
| |
| |
| for CONFLINE in $CONFLINES;do |
| |
| CONFLHS=$(echo $CONFLINE \ |
| | gawk 'BEGIN{FS = "="}; { print $1 }' \ |
| | sed -r 's![[:space:]]*!!g') |
| |
| CONFRHS=$(echo $CONFLINE \ |
| | gawk 'BEGIN{FS = "="}; { print $2 }' \ |
| | sed -r 's![[:space:]]*!!g' | sed -r 's!^"(.+)"$!\1!') |
| |
| if [[ ${MANUAL_BASEDIR}/${INCL} =~ $CONFRHS ]];then |
| TEMPLATE="${MANUAL_TEMPLATE}/${CONFLHS}" |
| break |
| fi |
| |
| done |
| |
| |
| |
| |
| cli_checkFiles $TEMPLATE |
| |
| |
| |
| svn cp ${TEMPLATE} ${MANUAL_BASEDIR}/$INCL --quiet |
| |
| |
| cli_replaceTMarkers "${MANUAL_BASEDIR}/$INCL" |
| |
| |
| |
| sed -i -r "s!=SECT=!${SECT}!g" "${MANUAL_BASEDIR}/$INCL" |
| |
| |
| |
| ${MANUAL_BACKEND}_makeSeeAlso "${MANUAL_BASEDIR}/$INCL" "$NODE" |
| |
| fi |
| |
| |
| |
| |
| cli_checkFiles ${MANUAL_TEMPLATE}/${MANUAL_CHAPTER_NAME}/chapter-nodes.${MANUAL_EXTENSION} |
| |
| |
| |
| cat ${MANUAL_TEMPLATE}/${MANUAL_CHAPTER_NAME}/chapter-nodes.${MANUAL_EXTENSION} \ |
| | sed -r -e "s!=NODE=!${NODE}!g" -e "s!=SECT=!${SECT}!g" \ |
| -e "s!=CIND=!${CIND}!g" -e "s!=INCL=!${INCL}!g" |
| |
| |
| done > $MANUAL_CHAPTER_DIR/chapter-nodes.${MANUAL_EXTENSION} |
| |
| } |