Blame Scripts/Bash/Functions/Locale/locale_prepareWorkingDirectory.sh

d799f8
#!/bin/bash
d799f8
#
d799f8
# locale_prepareWorkingDirectory.sh -- This function prepares the
d799f8
# working directory where translation files should be stored.
d799f8
#
e6bbbf
# Copyright (C) 2009-2013 The CentOS Project
d799f8
#
d799f8
# This program is free software; you can redistribute it and/or modify
d799f8
# it under the terms of the GNU General Public License as published by
d799f8
# the Free Software Foundation; either version 2 of the License, or (at
d799f8
# your option) any later version.
d799f8
#
d799f8
# This program is distributed in the hope that it will be useful, but
d799f8
# WITHOUT ANY WARRANTY; without even the implied warranty of
d799f8
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
d799f8
# General Public License for more details.
d799f8
#
d799f8
# You should have received a copy of the GNU General Public License
d799f8
# along with this program; if not, write to the Free Software
d799f8
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
d799f8
#
d799f8
# ----------------------------------------------------------------------
d799f8
# $Id$
d799f8
# ----------------------------------------------------------------------
d799f8
d799f8
function locale_prepareWorkingDirectory {
d799f8
e424a6
    local L10N_WORKDIR=$1
e424a6
d799f8
    if [[ ! -d ${L10N_WORKDIR} ]];then
d799f8
d799f8
        # Create localization working directory making parent
d799f8
        # directories as needed. Subversion doesn't create directories
d799f8
        # recursively, so we use the system's `mkdir' command and then
d799f8
        # subversion to register the changes.
d799f8
        mkdir -p ${L10N_WORKDIR}
d799f8
d799f8
        # Commit changes from working copy to central repository only.
d799f8
        # At this point, changes in the repository are not merged in
d799f8
        # the working copy, but chages in the working copy do are
f63b91
        # committed up to central repository.
ed3c5b
        cli_synchronizeRepoChanges "${L10N_BASEDIR}"
d799f8
e424a6
    elif [[ $L10N_WORKDIR == '' ]];then
e424a6
    
e424a6
        cli_printMessage "`gettext "The variable L10N_WORKDIR cannot be empty."`" --as-error-line
e424a6
        
d799f8
    fi
d799f8
d799f8
}