#!/bin/sh1#***************************************************************************2# _ _ ____ _3# Project ___| | | | _ \| |4# / __| | | | |_) | |5# | (__| |_| | _ <| |___6# \___|\___/|_| \_\_____|7#8# Copyright (C) Dan Fandrich, <[email protected]>, Viktor Szakats, et al.9#10# This software is licensed as described in the file COPYING, which11# you should have received as part of this distribution. The terms12# are also available at https://curl.se/docs/copyright.html.13#14# You may opt to use, copy, modify, merge, publish, distribute and/or sell15# copies of the Software, and permit persons to whom the Software is16# furnished to do so, under the terms of the COPYING file.17#18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY19# KIND, either express or implied.20#21# SPDX-License-Identifier: curl22#23###########################################################################2425# The xargs invocation is portable, but does not preserve spaces in file names.26# If such a file is ever added, then this can be portably fixed by switching to27# "xargs -I{}" and appending {} to the end of the xargs arguments (which will28# call cmakelint once per file) or by using the GNU extension "xargs -d'\n'".2930set -eu3132cd "$(dirname "$0")"/..3334procs=635command -v nproc >/dev/null && procs="$(nproc)"36echo "parallel: ${procs}"3738{39if [ -n "${1:-}" ]; then40for A in "$@"; do printf "%s\n" "$A"; done41elif git rev-parse --is-inside-work-tree >/dev/null 2>&1; then42{43git ls-files | grep -E '\.(pl|pm)$'44git grep -l -E '^#!/usr/bin/env perl'45} | sort -u46else47# strip off the leading ./ to make the grep regexes work properly48find . -type f \( -name '*.pl' -o -name '*.pm' \) | sed 's@^\./@@'49fi50} | xargs -n 1 -P "${procs}" perl -c -Itests --515253