788260 Update centos-art.sh's prepare module.

Authored and Committed by Alain Reguera Delgado 11 years ago
24 files changed. 653 lines added. 239 lines removed.
Automation/Modules/Prepare/Configs/render.conf
file removed
-8
Automation/Modules/Prepare/Manuals/centos-art.sh-prepare.asciidoc
file added
+157
Automation/Modules/Prepare/Manuals/render.conf
file added
+7
Automation/Modules/Prepare/Modules/Documents/documents.shAutomation/Scripts/tcar_setFnEnvironment.sh
file renamed
+17 -14
Automation/Modules/Prepare/Modules/Images/images.sh
file added
+58
Automation/Modules/Prepare/Modules/Links/Configs/render.conf
file added
+26
Automation/Modules/Prepare/Modules/Links/Configs/vimrcAutomation/Modules/Prepare/Configs/vimrc
file renamed
+0 -0
Automation/Modules/Prepare/Modules/Links/links.sh
file added
+50
Automation/Modules/Prepare/Modules/Locales/locales.shAutomation/Modules/Prepare/prepare.conf.sh
file renamed
+10 -6
Automation/Modules/Prepare/Modules/Packages/packages.sh
file added
+56
Automation/Modules/Prepare/prepare.sh
file modified
+11 -8
Automation/Modules/Prepare/prepare_getOptions.sh
file modified
+20 -25
Automation/Modules/Prepare/prepare_setPackages.sh
file removed
-72
Automation/Modules/Prepare/prepare_setRenderEnvironment.sh
file added
+114
Automation/Modules/Prepare/prepare_setRepository.sh
file removed
-61
Automation/Scripts/tcar_checkFiles.sh
file modified
+7 -8
Automation/Scripts/tcar_checkRepoDirSource.sh
file modified
+11 -7
Automation/Scripts/tcar_printHelp.sh
file modified
+2 -2
Automation/Scripts/tcar_printMessage.sh
file modified
+7 -7
Automation/Scripts/tcar_setModuleEnvironment.sh
file modified
+9 -17
Automation/Scripts/tcar_setModuleEnvironmentScripts.sh
file modified
+4 -0
Automation/Scripts/tcar_setSubModuleEnvironment.sh
file added
+83
Automation/Scripts/tcar_synchronizeRepoChanges.sh
file modified
+1 -1
Automation/Scripts/tcar_unsetModuleEnvironment.sh
file modified
+3 -3
    Update centos-art.sh's prepare module.
    
    - Previously, the prepare module doesn't fit inside the modular design
      of centos-art.sh script. As consequence, the prepare actions didn't
      work. This updates makes the prepare module to fit the centos-art.sh
      script modular design and prepare module now runs as expected.
    
    - The command-line options changed. See centos-art.sh-prepare.1
      documentation, also added with this update inside the Manuals
      directory. Notice that, in this update, the --links option doesn't
      work because the symlink sub-module isn't implemented inside render
      module yet. This is an issue of render module not prepare module.
    
    - Previously, the prepare module hasn't any documentation in its
      structure. In this update an initial documentation written in
      centos-art.sh-prepare.asciidoc file was put in the Manuals directory
      of prepare module. In this directory there is also a render.conf
      file that can be used to produce both html and man pages from the
      asciidoc file.
    
    The update of centos-art.sh-preapre module required the following
    updates to centos-art.sh common scripts:
    
    - Add tcar_checkFnEnvironment.sh and tcar_setSubModuleEnvironment.sh
      files.
    
    - Previously, the tcar_checkFiles function didn't verify whether the
      FILES variable had an empty value or not. Since the FILES variable
      is used as data source for the loop, all the verifications could be
      skipped because no data was provided. Because verification were not
      applied, the work flow continues as no error would be present. This
      would provoke further calls that required the file to continue to
      fail because no file was present. This updates the tcar_checkFiles
      function to verify whether FILES variable has an empty value or not,
      letting the script execution to finish with an error the way we
      expect in case of empty value.
    
    - Previously, it was not possible to refer the current working
      directory using the ./ form from the centos-art.sh script command
      line. With this update the tcar_checkRepoDirSource function was
      changed to let referring the current directory using the form ./.
    
    - Previously, it was not possible to refer the repository's root
      directory from a place different to repository's root directory.
      This update changes the tcar_checkRepoDirsource function to let
      referring the repository's root directory using a single slash (/)
      as argument to centos-art.sh command. In case more than one slash be
      passed instead of a single one, they all will be removed in the sake
      of a single slash only. This way the final location is returned
      clean.
    
    - Previously, module documentation was read from files in the form
      MODULE_NAME.1, produced from MODULE_NAME.asciidoc files. This may
      bring confusion to users since it is possible that some modules has
      the same name of other commands outside centos-art.sh script. To
      avoid confusion, this update changes the tcar_printHelp function to
      start using the form centos-art.sh-MODULE_NAME.1 to all modules'
      documentation.
    
    - Previously, error messages produced by tcar_printMessage function
      were all output to standard error. When errors where produced by
      functions called inside variable assignment, the error messages
      produced by tcar_printMessage was stored in the variable and printed
      in unexpected ways later. This update changes the tcar_printMessage
      to redirect error messages to standard error. This change fixes the
      issue of saving error messages inside variables but don't fixes the
      problem of stop script execution after an error triggered this way.
      To workaround this last script execution issue, do all the
      verifications you need before calling functions in the right side of
      variable assignment constructions. To do that be sure the functions
      you call will not fail in any way.
    
    - Remove the tcar_setFnEnvironment function from Scripts/ directory.
      The tcar_setModuleEnvironment function should be used instead.  We
      are re-organizing code in a modular fashion and
      tcar_setFnEnvironment doesn't fit in it. In fact, the
      tcar_setFnEnvironment has evolved into tcar_setModuleEnvironment.
    
    - Previously, when tcar_setModuleEnvironment function tried to load a
      module and the module didn't exist, it printed an error message
      telling so, but no reference to the exact non-existent module was
      mentioned in the error message. This update changes the
      tcar_setModuleEnvironment function to tell what the non-existent
      module is.
    
    - Previously, everything was treated as a module. Even modules inside
      modules. It seems like there is no problem with this design when
      there is no need to call parent modules from children modules.
      However, when we need to call parents modules from children modules,
      we cannot use the same name space for both of them because path
      information is remember only for the last module loaded. If we try
      to load a parent module from a children module the children module
      will try to load a module children to it with the name of the parent
      module we tried to load. If such module doesn't exist, centos-art.sh
      script shows an error message.
    
      To solve this issue, we created two module name-spaces inside the
      centos-art.sh script. One for parent modules defined by the function
      tcar_setModuleEnvironment and other for children modules defined for
      the function tcar_setSubModuleEnvironment.
    
      When the centos-art.sh script is executed, it is executed with a
      parent module that may call several levels of children modules one
      inside another so the last children has all the information of its
      parents.  In this configuration, you cannot call parent modules from
      children modules unless the module you are calling is in the first
      level of modules' directory structure (i.e., Automation/Modules/)
      and use the tcar_setModuleEnvironment function for that.
    
        
Automation/Modules/Prepare/Modules/Documents/documents.sh Automation/Scripts/tcar_setFnEnvironment.sh
file renamed
+17 -14
Automation/Modules/Prepare/Modules/Links/Configs/vimrc Automation/Modules/Prepare/Configs/vimrc
file renamed
file was renamed with no change to the file
Automation/Modules/Prepare/Modules/Locales/locales.sh Automation/Modules/Prepare/prepare.conf.sh
file renamed
+10 -6