#
# Miscellaneous routines.
#
# Copyright (C) 2014 Red Hat
#
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [ -z ${_MISC_SH+set} ]; then
# Remove files and directories recursively, forcing write permissions on
# directories.
# Args: path...
{
}
# Extract line and function coverage percentage from a "genhtml" or "lcov
# --summary" output.
# Input: "genhtml" or "lcov --summary" output
# Output: lines funcs
{
tr -d '\n'
echo
}
# Check if a "genhtml" or "lcov --summary" output has a minimum coverage
# percentage of lines and functions.
# Input: "genhtml" or "lcov --summary" output
# Args: min_lines min_funcs
{
read -r lines funcs < <(lcov_summary)
}
# Check if the current user belongs to a group.
# Args: group_name
{
declare -r group_name="$1"
return 0
fi
done
return 1
}
fi # _MISC_SH