diff --git a/Scripts/Functions/Help/Texinfo/texinfo_copyEntry.sh b/Scripts/Functions/Help/Texinfo/texinfo_copyEntry.sh index 1f58f10..cbf0bf4 100755 --- a/Scripts/Functions/Help/Texinfo/texinfo_copyEntry.sh +++ b/Scripts/Functions/Help/Texinfo/texinfo_copyEntry.sh @@ -27,10 +27,9 @@ function texinfo_copyEntry { + # Initialize source and target locations. local MANUAL_ENTRY_SRC='' local MANUAL_ENTRY_DST='' - local MANUAL_ENTRY='' - local MANUAL_ENTRIES='' # Execute copying action based on documentation entries passed as # non-option arguments to `centos-art.sh' script in the diff --git a/Scripts/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh b/Scripts/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh index e38428d..373644d 100755 --- a/Scripts/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh +++ b/Scripts/Functions/Help/Texinfo/texinfo_copyEntryChapter.sh @@ -31,12 +31,8 @@ function texinfo_copyEntryChapter { # Redefine documentation entry target's location. MANUAL_ENTRY_DST=${MANUAL_BASEDIR_L10N}/${MANUAL_CHAN[((${MANUAL_DOCENTRY_ID} + 1))]} - # When we are copying chapters, the source location and the target - # location must be different in value. They cannot point to the - # same chapter directory. - if [[ $MANUAL_ENTRY_SRC == $MANUAL_ENTRY_DST ]];then - cli_printMessage "`gettext "The chapter cannot be copied into itself."`" --as-error-line - fi + # Verify entry source and target locations. + ${FLAG_BACKEND}_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" # When we are copying chapters, document structure actualization # needs to be performed against the target chapter not the source @@ -55,8 +51,8 @@ function texinfo_copyEntryChapter { ${FLAG_BACKEND}_createChapter # Create list of sections from source chapter that need to be - # copied to target chapter. Don't include chapter main definition - # files. + # copied to target chapter. Don't include chapter's main + # definition files. local MANUAL_ENTRIES=$(cli_getFilesList $MANUAL_ENTRY_SRC \ --pattern="${MANUAL_ENTRY_SRC}/.+\.${MANUAL_EXTENSION}" \ | egrep -v '/chapter') diff --git a/Scripts/Functions/Help/Texinfo/texinfo_copyEntrySection.sh b/Scripts/Functions/Help/Texinfo/texinfo_copyEntrySection.sh index 1fae087..9d70290 100755 --- a/Scripts/Functions/Help/Texinfo/texinfo_copyEntrySection.sh +++ b/Scripts/Functions/Help/Texinfo/texinfo_copyEntrySection.sh @@ -51,33 +51,12 @@ function texinfo_copyEntrySection { cli_printMessage "`gettext "The location provided as target isn't valid."`" --as-error-line fi - # Verify source and target locations to be sure they are different - # one another. We cannot copy a source location to itself. - if [[ $MANUAL_ENTRY_SRC == $MANUAL_ENTRY_DST ]];then - cli_printMessage "`gettext "The source and target locations cannot be the same."`" --as-error-line - fi - # Print separator line along with action message. cli_printMessage '-' --as-separator-line cli_printMessage "${MANUAL_ENTRY_DST}" --as-creating-line - # Verify existence of source location. - if [[ ! -a ${MANUAL_ENTRY_SRC} ]];then - cli_printMessage "`gettext "The source location doesn't exist."`" --as-error-line - fi - - # When we copy sections, the target chapter directory where the - # source section will be duplicated in, must exist first. In that - # sake, verify the chapter directory of target section entry and - # if it doesn't exist, create it adding using subversion. - if [[ ! -d $(dirname ${MANUAL_ENTRY_DST}) ]];then - svn mkdir $(dirname ${MANUAL_ENTRY_DST}) --quiet - fi - - # Verify existence of target location. - if [[ -a ${MANUAL_ENTRY_DST} ]];then - cli_printMessage "`gettext "The target location already exists."`" --as-error-line - fi + # Verify entry source and target locations. + ${FLAG_BACKEND}_checkEntrySrcDst "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" # Copy section entry from source to target using subversion. svn cp "${MANUAL_ENTRY_SRC}" "${MANUAL_ENTRY_DST}" --quiet