|
Alain Reguera Delgado |
786ac0 |
#!/bin/bash
|
|
Alain Reguera Delgado |
5f643d |
######################################################################
|
|
Alain Reguera Delgado |
5f643d |
#
|
|
Alain Reguera Delgado |
5f643d |
# directory.sh -- This module standardize localization of directory
|
|
Alain Reguera Delgado |
5f643d |
# structures inside the repository.
|
|
Alain Reguera Delgado |
5f643d |
#
|
|
Alain Reguera Delgado |
5f643d |
# Written by:
|
|
Alain Reguera Delgado |
5f643d |
# * Alain Reguera Delgado <al@centos.org.cu>, 2009-2013
|
|
Alain Reguera Delgado |
5f643d |
#
|
|
Alain Reguera Delgado |
bb076b |
# Copyright (C) 2009-2013 The CentOS Artwork SIG
|
|
Alain Reguera Delgado |
5f643d |
#
|
|
Alain Reguera Delgado |
5f643d |
# This program is free software; you can redistribute it and/or modify
|
|
Alain Reguera Delgado |
5f643d |
# it under the terms of the GNU General Public License as published by
|
|
Alain Reguera Delgado |
bb076b |
# the Free Software Foundation; either version 2 of the License, or (at
|
|
Alain Reguera Delgado |
bb076b |
# your option) any later version.
|
|
Alain Reguera Delgado |
5f643d |
#
|
|
Alain Reguera Delgado |
5f643d |
# This program is distributed in the hope that it will be useful, but
|
|
Alain Reguera Delgado |
5f643d |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Alain Reguera Delgado |
5f643d |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Alain Reguera Delgado |
5f643d |
# General Public License for more details.
|
|
Alain Reguera Delgado |
5f643d |
#
|
|
Alain Reguera Delgado |
5f643d |
# You should have received a copy of the GNU General Public License
|
|
Alain Reguera Delgado |
5f643d |
# along with this program; if not, write to the Free Software
|
|
Alain Reguera Delgado |
5f643d |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
Alain Reguera Delgado |
5f643d |
#
|
|
Alain Reguera Delgado |
5f643d |
######################################################################
|
|
Alain Reguera Delgado |
dad262 |
|
|
Alain Reguera Delgado |
bd3978 |
function directory {
|
|
Alain Reguera Delgado |
786ac0 |
|
|
Alain Reguera Delgado |
786ac0 |
# Sanitate non-option arguments to be sure they match the
|
|
Alain Reguera Delgado |
786ac0 |
# directory conventions established by centos-art.sh script
|
|
Alain Reguera Delgado |
786ac0 |
# against source directory locations in the working copy.
|
|
Alain Reguera Delgado |
786ac0 |
local DIRECTORY=$(tcar_checkRepoDirSource ${1})
|
|
Alain Reguera Delgado |
786ac0 |
|
|
Alain Reguera Delgado |
786ac0 |
# Retrieve list of configuration files from directory.
|
|
Alain Reguera Delgado |
786ac0 |
local CONFIGURATIONS=$(tcar_getFilesList ${DIRECTORY} \
|
|
Alain Reguera Delgado |
786ac0 |
--pattern=".+/.+\.conf$" --type="f")
|
|
Alain Reguera Delgado |
786ac0 |
|
|
Alain Reguera Delgado |
786ac0 |
# Verify non-option arguments passed to centos-art.sh
|
|
Alain Reguera Delgado |
786ac0 |
# command-line. The path provided as argument must exist in the
|
|
Alain Reguera Delgado |
786ac0 |
# repository. Otherwise, it would be possible to create arbitrary
|
|
Alain Reguera Delgado |
786ac0 |
# directories inside the repository without any meaning. In order
|
|
Alain Reguera Delgado |
786ac0 |
# to be sure all required directories are available in the
|
|
Alain Reguera Delgado |
786ac0 |
# repository it is necessary use the prepare functionality.
|
|
Alain Reguera Delgado |
786ac0 |
tcar_checkFiles -ef ${CONFIGURATIONS}
|
|
Alain Reguera Delgado |
786ac0 |
|
|
Alain Reguera Delgado |
786ac0 |
# Process each configuration file.
|
|
Alain Reguera Delgado |
786ac0 |
for CONFIGURATION in ${CONFIGURATIONS};do
|
|
Alain Reguera Delgado |
06ab0f |
directory_getConfiguration "${CONFIGURATION}"
|
|
Alain Reguera Delgado |
786ac0 |
done
|
|
Alain Reguera Delgado |
786ac0 |
|
|
Alain Reguera Delgado |
786ac0 |
}
|