Blame Scripts/Bash/Functions/Vcs/Subversion/subversion_isVersioned.sh

4debce
#!/bin/bash
4debce
#
3b9515
# subversion_isVersioned.sh -- This function determines whether a
3b9515
# location is under version control or not. When the location is under
3b9515
# version control, this function returns `0'. When the location isn't
3b9515
# under version control, this function returns `1'.
4debce
#
e6bbbf
# Copyright (C) 2009-2013 The CentOS Project
4debce
#
4debce
# This program is free software; you can redistribute it and/or modify
4debce
# it under the terms of the GNU General Public License as published by
4debce
# the Free Software Foundation; either version 2 of the License, or (at
4debce
# your option) any later version.
4debce
#
4debce
# This program is distributed in the hope that it will be useful, but
4debce
# WITHOUT ANY WARRANTY; without even the implied warranty of
4debce
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4debce
# General Public License for more details.
4debce
#
4debce
# You should have received a copy of the GNU General Public License
4debce
# along with this program; if not, write to the Free Software
4debce
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
4debce
#
4debce
# ----------------------------------------------------------------------
4debce
# $Id$
4debce
# ----------------------------------------------------------------------
4debce
3b9515
function subversion_isVersioned {
4debce
3b9515
    # Define the location absolute path we want to determine whether
3b9515
    # it is under version control or not. Only the first non-option
3b9515
    # argument passed to centos-art.sh command-line will be used.
ace272
    local LOCATION=$(cli_checkRepoDirSource "${1}")
5c230a
3b9515
    # Use Subversion to determine whether the location is under
4debce
    # version control or not.
3b9515
    ${COMMAND} info ${LOCATION} > /dev/null 2>&1
4debce
3b9515
    # Verify Subversion's exit status.
3b9515
    if [[ $? -ne 0 ]];then
3b9515
        cli_printMessage "${LOCATION} `gettext "isn't under version control."`" --as-error-line
3b9515
    fi
4debce
4debce
}