From 4d00005d2e3fa5ed09c7eb4e0943a97c16ab10ee Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Feb 27 2011 16:57:52 +0000 Subject: Merge content of manual_checkChapter, manual_checkEntry and manual_createEntry into manual_editEntry. --- diff --git a/Scripts/Bash/centos-art/Functions/Manual/manual_checkChapter.sh b/Scripts/Bash/centos-art/Functions/Manual/manual_checkChapter.sh deleted file mode 100755 index afb57de..0000000 --- a/Scripts/Bash/centos-art/Functions/Manual/manual_checkChapter.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# manual_checkChapter.sh -- This function checks chapter structure. If -# it doesn't exist, create it. Inside CentOS Artwork Repository -# chapters are the base structure used to organize documentation. -# -# Copyright (C) 2009-2011 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function manual_checkChapter { - - # Check chapter's directory existence. - if [[ ! -d $MANUAL_DIR_CHAPTER ]];then - - cli_printMessage "`gettext "The following documentation chapter will be created:"`" - cli_printMessage "$MANUAL_DIR_CHAPTER" "AsResponseLine" - cli_printMessage "`gettext "Do you want to continue?"`" "AsYesOrNoRequestLine" - - manual_updateChaptersFiles - manual_updateChaptersMenu - manual_updateChaptersNodes - - fi - -} diff --git a/Scripts/Bash/centos-art/Functions/Manual/manual_checkEntry.sh b/Scripts/Bash/centos-art/Functions/Manual/manual_checkEntry.sh deleted file mode 100755 index b851aef..0000000 --- a/Scripts/Bash/centos-art/Functions/Manual/manual_checkEntry.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# manual_checkEntry.sh -- This function checks the documentation entry -# existence. -# -# Copyright (C) 2009-2011 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function manual_checkEntry { - - # Check entry to edit and create it if it doesn't exist. - if [[ ! -f $ENTRY ]];then - - cli_printMessage "`gettext "The following documentation section will be created:"`" - cli_printMessage "$ENTRY" "AsResponseLine" - cli_printMessage "`gettext "Do you want to continue?"`" "AsYesOrNoRequestLine" - - manual_createEntry - - fi - -} diff --git a/Scripts/Bash/centos-art/Functions/Manual/manual_createEntry.sh b/Scripts/Bash/centos-art/Functions/Manual/manual_createEntry.sh deleted file mode 100755 index 0f61198..0000000 --- a/Scripts/Bash/centos-art/Functions/Manual/manual_createEntry.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# manual_createEntry.sh -- This function creates a new documentation -# entry based on action value (ACTIONVAL). -# -# Copyright (C) 2009-2011 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function manual_createEntry { - - # Check chapter structure for this entry. - manual_checkChapter - - # Update chapter-menu for this entry. - manual_updateMenu - - # Update chapter-nodes (based on chapter-menu). - manual_updateNodes - - # Update old missing cross references. If for some reason a - # documentation entry is removed by mistake, and that mistake is - # fixing by adding the removed documentation entry back into the - # repository, rebuild the missing cross reference message to use - # the correct link to the documentation section. - manual_restoreCrossReferences - -} diff --git a/Scripts/Bash/centos-art/Functions/Manual/manual_editEntry.sh b/Scripts/Bash/centos-art/Functions/Manual/manual_editEntry.sh index 7bc2e81..d87dcbf 100755 --- a/Scripts/Bash/centos-art/Functions/Manual/manual_editEntry.sh +++ b/Scripts/Bash/centos-art/Functions/Manual/manual_editEntry.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# manual_editEntry.sh -- This function edits documentation entry based -# on entry pattern. +# manual_editEntry.sh -- This function implements the edition flow of +# documentation entries inside the working copy. # # Copyright (C) 2009-2011 Alain Reguera Delgado # @@ -26,19 +26,71 @@ function manual_editEntry { - # Check chapter existence. In order to create/edit a section the - # chapter of that section needs to exist first. If the chapter - # hasn't been created, where are you going to store the section - # files? Put the chapter's checker here. - manual_checkChapter + # Verify definition of manual chapters. Definition of manual + # chapters sets how many chapters does the manual has and the + # directory and file structure required to make them active part + # of a texinfo manual. + if [[ ! -d $MANUAL_DIR_CHAPTER ]];then - # Check section existence. - manual_checkEntry + # Print confirmation question. + cli_printMessage "`gettext "The following documentation chapter will be created:"`" + cli_printMessage "$MANUAL_DIR_CHAPTER" "AsResponseLine" + cli_printMessage "`gettext "Do you want to continue?"`" "AsYesOrNoRequestLine" + + # Update manual chapter related files. + manual_updateChaptersFiles + + # Update manual chapter related menu. + manual_updateChaptersMenu + + # Update manual chapter related nodes (based on chapter + # related menu). + manual_updateChaptersNodes + + fi + + # Verify definition of chapter sections. Definition of chapter + # sections sets how many sections does each chapter, inside the + # manual, has. + if [[ ! -f $ENTRY ]];then + + # Print confirmation question. + cli_printMessage "`gettext "The following documentation section will be created:"`" + cli_printMessage "$ENTRY" "AsResponseLine" + cli_printMessage "`gettext "Do you want to continue?"`" "AsYesOrNoRequestLine" + + # Print action message. + cli_printMessage "$ENTRY" 'AsCreatingLine' + + # Update chapter section related menu. + manual_updateMenu + + # Update chapter section related nodes (based on chapter + # section related menu). + manual_updateNodes + + # Update old missing cross references. If for some reason a + # documentation entry is removed by mistake, and that mistake + # is fixing by adding the removed documentation entry back + # into the repository, rebuild the missing cross reference + # message to use the correct link to the documentation + # section. + manual_restoreCrossReferences + + else + + # Print action message. + cli_printMessage "$ENTRY" 'AsUpdatingLine' + + fi # Use default text editor to edit the documentation entry. eval $EDITOR $ENTRY - # Re-build output files to propagate recent changes. + # Print separator line. + cli_printMessage '-' 'AsSeparatorLine' + + # Rebuild output files to propagate recent changes. manual_updateOutputFiles }