Blame Scripts/Bash/Functions/Render/render_doCopy.sh

415946
#!/bin/bash
415946
#
415946
# render_doCopy.sh -- This function duplicates rendition stuff.
415946
# Rendition stuff is formed by design models, design images,
415946
# pre-rendition configuration scripts and translations files. This
415946
# way, when we say to duplicate rendition stuff we are saying to
415946
# duplicate these four directory structures (i.e., design models,
415946
# design images, pre-rendition configuration scripts, and related
415946
# translations files).
415946
#
ebe7f2
# When we duplicate directories, inside `trunk/Identity' directory
ebe7f2
# structure, there are two organizational designs we need to be aware
ebe7f2
# of: 
ebe7f2
#
ebe7f2
#   Organization 1: Design models (`Tpl/') and design images (`Img/')
ebe7f2
#   directories share a common parent directory under `trunk/Identity'
ebe7f2
#   directory structure.
ebe7f2
#
ebe7f2
#       trunk/Identity/Widgets
ebe7f2
#       |-- Tpl
ebe7f2
#       |   `-- file.svg
ebe7f2
#       `-- Img
ebe7f2
#           `-- file.png
ebe7f2
#
ebe7f2
#       trunk/Translations/Identity/Widgets
ebe7f2
#       trunk/Scripts/Bash/Functions/Render/Config/Identity/Widgets
ebe7f2
#
ebe7f2
#   Organization 2: Design models and design images don't share a
ebe7f2
#   common parent directory. Instead, design models and design images
ebe7f2
#   are stored separately on their own directory structures under
ebe7f2
#   `trunk/Identity'. 
ebe7f2
#   
ebe7f2
#       trunk/Identity/Themes/Models/Default/Distro/
ebe7f2
#       `-- Anaconda
ebe7f2
#           `-- Header
ebe7f2
#               `-- anaconda_header.svg
ebe7f2
#
ebe7f2
#       trunk/Identity/Themes/Motifs/TreeFlower/Distro/
ebe7f2
#       `-- Anaconda
ebe7f2
#           `-- Header
ebe7f2
#               `-- anaconda_header.png
ebe7f2
#
ebe7f2
#       trunk/Translations/Identity/Themes/Distro/Anaconda/Header/
ebe7f2
#       trunk/Scripts/Bash/Functions/Render/Config/Identity/Themes/Distro/Anaconda/Header/
ebe7f2
#
ebe7f2
#   The "Organization 2" emerged from "Organization 1" to satisfy a
ebe7f2
#   need that "Organization 1" cannot satisfy: The design models
ebe7f2
#   cannot be reused in "Organization 1" but in "Organization 2" they
ebe7f2
#   can be reused indeed.
ebe7f2
# 
ebe7f2
# Another consideration to have, when we duplicate directory
ebe7f2
# structures, is the source location used to perform the duplication
ebe7f2
# action. The source location is relevant to determine the required
ebe7f2
# information inside directory structures (parallel directories) that
ebe7f2
# need to be copied too (otherwise we may end up with orphan directory
ebe7f2
# structures unable to be rendered, due the absence of required
ebe7f2
# information).
ebe7f2
#
ebe7f2
# In order for a renderable directory structure to be valid, the new
ebe7f2
# directory structure copied should match the following conditions:
ebe7f2
#
ebe7f2
#   1. To have a unique directory structure under
ebe7f2
#   `trunk/Identity', organized by any one of the above
ebe7f2
#   organizational designs above.
ebe7f2
#
ebe7f2
#   2. To have a unique directory structure under
ebe7f2
#   `trunk/Translations' to store translation files.
ebe7f2
#
ebe7f2
#   3. To have a unique directory structure under
ebe7f2
#   `trunk/Scripts/Bash/Functions/Render/Config' to set
ebe7f2
#   pre-rendition configuration script.
ebe7f2
#
ebe7f2
# As convenction, the render_doCopy function uses `trunk/Identity'
ebe7f2
# directory structure as source location.  Once the `trunk/Identity'
ebe7f2
# directory structure has been specified and verified, the related
ebe7f2
# path information is built from it and copied automatically to the
ebe7f2
# new location specified by FLAG_TO variable.
ebe7f2
#
ebe7f2
# Organization 1:
ebe7f2
#
ebe7f2
#   Command:
ebe7f2
#   - centos-art render --copy=trunk/Identity/Widgets --to=trunk/Identity/NewDirName
ebe7f2
#
ebe7f2
#   Sources:
ebe7f2
#   - trunk/Identity/Widgets
ebe7f2
#   - trunk/Translations/Identity/Widgets
ebe7f2
#   - trunk/Scripts/Bash/Functions/Render/Config/Identity/Widgets
ebe7f2
#
ebe7f2
#   Targets:
ebe7f2
#   - trunk/Identity/NewDirName
ebe7f2
#   - trunk/Translations/Identity/NewDirName
ebe7f2
#   - trunk/Scripts/Bash/Functions/Render/Config/Identity/NewDirName
ebe7f2
#
ebe7f2
# Organization 2:
ebe7f2
#
ebe7f2
#   Command:
ebe7f2
#   - centos-art render --copy=trunk/Identity/Themes/Motifs/TreeFlower \
ebe7f2
#                         --to=trunk/Identity/Themes/Motifs/NewDirName
ebe7f2
#
ebe7f2
#   Sources:
ebe7f2
#   - trunk/Identity/Themes/Motifs/TreeFlower
ebe7f2
#   - trunk/Translations/Identity/Themes
ebe7f2
#   - trunk/Translations/Identity/Themes/Motifs/TreeFlower
ebe7f2
#   - trunk/Scripts/Bash/Functions/Render/Config/Identity/Themes
ebe7f2
#   - trunk/Scripts/Bash/Functions/Render/Config/Identity/Themes/Motifs/TreeFlower
ebe7f2
#
ebe7f2
#   Targets:
ebe7f2
#   - trunk/Identity/Themes/Motifs/NewDirName
ebe7f2
#   - trunk/Translations/Identity/Themes
ebe7f2
#   - trunk/Translations/Identity/Themes/Motifs/NewDirName
ebe7f2
#   - trunk/Scripts/Bash/Functions/Render/Config/Identity/Themes
ebe7f2
#   - trunk/Scripts/Bash/Functions/Render/Config/Identity/Themes/Motifs/NewDirName
ebe7f2
#
ebe7f2
#   Notice that design models are not included in source or target
ebe7f2
#   locations. This is intentional. In "Organization 2", design models
ebe7f2
#   live by their own, they just exist, they are there, available for
ebe7f2
#   any artistic motif to use. By default `Themes/Models/Default' design
ebe7f2
#   model directory structure is used, but other design models
ebe7f2
#   directory structures (under Themes/Models/) can be created and
ebe7f2
#   used changing the value of THEMEMODEL variable inside the
ebe7f2
#   pre-rendition configuration script of the artistic motif source
ebe7f2
#   location you want to produce.
ebe7f2
#
ebe7f2
#   Notice, also, how translations and pre-rendition configuration
ebe7f2
#   scripts may both be equal in source and target. This is because
ebe7f2
#   such structures are common to all artistic motifs (the default
ebe7f2
#   values to use when no specific values are provided).
ebe7f2
#
ebe7f2
#   - Common directory structures are not copied or deleted. We cannot
ebe7f2
#     copy a directory structure to itself.
ebe7f2
#
ebe7f2
#   - Common directory structures represent the default value to use
ebe7f2
#     when no specific translations and/or pre-rendition configuration
ebe7f2
#     script are provided inside source location.
ebe7f2
#
ebe7f2
#   - Specific directory structures, if present, are both copiable and
ebe7f2
#     removable. This is, when you perform a copy or delete action
ebe7f2
#     from source, that source specific auxiliar directories are
ebe7f2
#     transfered in the copy action to a new location (that specified
ebe7f2
#     by FLAG_TO variable).
ebe7f2
#
ebe7f2
#   - When translations and/or pre-rendition configuration scripts are
ebe7f2
#     found inside the source directory structure, the centos-art.sh
ebe7f2
#     script loads common auxiliar directories first and later
ebe7f2
#     specific auxiliar directories.  This way, identity rendition of
ebe7f2
#     source locations can be customized idividually over the base of
ebe7f2
#     common default values.
ebe7f2
#
ebe7f2
#   - Specific auxiliar directories are optional.
ebe7f2
#
ebe7f2
#   - Common auxiliar directories should be present always. This, in
ebe7f2
#     order to provide the information required by render
ebe7f2
#     functionality (i.e., to make it functional).
ebe7f2
#
ebe7f2
# Notice that, the duplication process is done from `trunk/Identity'
ebe7f2
# on, not the oposite. If you try to duplicate a translation structure
ebe7f2
# (or similar auxiliar directory structures like pre-rendition
ebe7f2
# configuration scripts), the `trunk/Identity' for that translation is
ebe7f2
# not created. This limitation is impossed by the fact that many
ebe7f2
# `trunk/Identity' directory structures may reuse/share the same
ebe7f2
# translation directory structure. We cannot delete one translation
ebe7f2
# (or similar) directory structures while a related `trunk/Identity/'
ebe7f2
# directory structure is still in need of it.
ebe7f2
#
415946
# Copyright (C) 2009-2011 Alain Reguera Delgado
415946
# 
415946
# This program is free software; you can redistribute it and/or
415946
# modify it under the terms of the GNU General Public License as
415946
# published by the Free Software Foundation; either version 2 of the
415946
# License, or (at your option) any later version.
415946
# 
415946
# This program is distributed in the hope that it will be useful, but
415946
# WITHOUT ANY WARRANTY; without even the implied warranty of
415946
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
415946
# General Public License for more details.
415946
#
415946
# You should have received a copy of the GNU General Public License
415946
# along with this program; if not, write to the Free Software
415946
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
415946
# USA.
415946
# 
415946
# ----------------------------------------------------------------------
415946
# $Id$
415946
# ----------------------------------------------------------------------
415946
415946
function render_doCopy {
415946
415946
    # Verify target directory.
415946
    cli_checkRepoDirTarget
415946
ebe7f2
    # Determine what directory structure we are duplicating.
415946
415946
}