|
|
878a2b |
#!/bin/bash
|
|
|
878a2b |
#
|
|
|
878a2b |
# centos-art.sh -- The CentOS Artwork Repository automation tool.
|
|
|
878a2b |
#
|
|
|
03486a |
# Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project
|
|
|
878a2b |
#
|
|
|
878a2b |
# This program is free software; you can redistribute it and/or modify
|
|
|
878a2b |
# it under the terms of the GNU General Public License as published by
|
|
|
03486a |
# the Free Software Foundation; either version 2 of the License, or (at
|
|
|
03486a |
# your option) any later version.
|
|
|
878a2b |
#
|
|
|
878a2b |
# This program is distributed in the hope that it will be useful, but
|
|
|
878a2b |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
878a2b |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
878a2b |
# General Public License for more details.
|
|
|
878a2b |
#
|
|
|
878a2b |
# You should have received a copy of the GNU General Public License
|
|
|
878a2b |
# along with this program; if not, write to the Free Software
|
|
|
878a2b |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
878a2b |
#
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
# $Id$
|
|
|
878a2b |
# ----------------------------------------------------------------------
|
|
|
878a2b |
|
|
|
218057 |
# Initialize absolute path to the working copy.
|
|
|
d97f4e |
if [[ ! $TCAR_WORKDIR ]] || [[ $TCAR_WORKDIR == "" ]];then
|
|
|
d97f4e |
TCAR_WORKDIR=${HOME}/artwork
|
|
|
d97f4e |
fi
|
|
|
d97f4e |
|
|
|
819c26 |
# Redefine the working copy absolute path considering the previous
|
|
|
819c26 |
# directory structures used in the repository.
|
|
|
819c26 |
if [[ -d ${TCAR_WORKDIR}/trunk ]];then
|
|
|
819c26 |
TCAR_WORKDIR=${TCAR_WORKDIR}/trunk
|
|
|
819c26 |
fi
|
|
|
819c26 |
|
|
|
2ab0b2 |
# Initialize repository brand information.
|
|
|
2ab0b2 |
if [[ ! $TCAR_BRAND ]] || [[ $TCAR_BRAND == "" ]] ;then
|
|
|
2ab0b2 |
TCAR_BRAND='centos'
|
|
|
2ab0b2 |
fi
|
|
|
2ab0b2 |
|
|
|
218057 |
# Initialize script-specific configuration variables.
|
|
|
2ab0b2 |
declare -xr CLI_NAME="${TCAR_BRAND}-art"
|
|
|
4df0dd |
declare -xr CLI_VERSION='0.0.4'
|
|
|
218057 |
declare -xr CLI_LANG_LC=$(echo ${LANG} | cut -d'.' -f1)
|
|
|
218057 |
declare -xr CLI_LANG_LL=$(echo ${CLI_LANG_LC} | cut -d'_' -f1)
|
|
|
218057 |
declare -xr CLI_LANG_CC=$(echo ${CLI_LANG_LC} | cut -d'_' -f2)
|
|
|
819c26 |
declare -xr CLI_BASEDIR="${TCAR_WORKDIR}/Scripts/Bash"
|
|
|
2a2d9c |
declare -xr CLI_FUNCDIR="${CLI_BASEDIR}/Functions"
|
|
|
878a2b |
|
|
|
819c26 |
# Initialize internationalization through GNU gettext.
|
|
|
8f84ba |
. gettext.sh
|
|
|
1d56ce |
declare -xr TEXTDOMAIN=${CLI_NAME}.sh
|
|
|
819c26 |
declare -xr TEXTDOMAINDIR=${TCAR_WORKDIR}/Locales/Scripts/Bash
|
|
|
8f84ba |
|
|
|
218057 |
# Initialize absolute path to temporal directory.
|
|
|
218057 |
declare -xr TMPDIR="$(mktemp -p /tmp -d ${CLI_NAME}.sh-XXXXXX)"
|
|
|
218057 |
|
|
|
878a2b |
# Initialize command-line interface.
|
|
|
8d8a61 |
if [[ -x ${CLI_FUNCDIR}/Commons/cli.sh ]];then
|
|
|
8d8a61 |
. ${CLI_FUNCDIR}/Commons/cli.sh; export -f 'cli'; cli "$@"
|
|
|
f97c6b |
fi
|