<commit_before>#!/bin/sh
#
# create_core_pkg.sh
#
# part of pfSense (https://www.pfsense.org)
# Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin

scripts_path=$(dirname $(realpath $0))

if [ ! -f "${scripts_path}/common.subr" ]; then
	echo >&2 "ERROR: common.subr is missing"
	exit 1
fi

. ${scripts_path}/common.subr

usage() {
	cat >&2 <<END
Usage: $(basename $0) -t template -d destdir [-h]

Options:
	-t template  -- Path to package template directory
	-f flavor    -- package flavor
	-v version   -- package version
	-r root      -- root directory containing package files
	-s search    -- search path
	-F filter    -- filter pattern to exclude files from plist
	-d destdir   -- Destination directory to create package
	-h           -- Show this help and exit

Environment:
	TMPDIR       -- Temporary directory (default: /tmp)
	PRODUCT_NAME -- Product name (default: pfSense)
	PRODUCT_URL  -- Product URL (default: https://www.pfsense.org)
END
	exit 1
}

while getopts t:f:v:r:F:d:h opt; do
	case "$opt" in
		t)
			template=$OPTARG
			;;
		f)
			flavor=$OPTARG
			;;
		v)
			version=$OPTARG
			;;
		r)
			root=$OPTARG
			;;
		s)
			findroot=$OPTARG
			;;
		F)
			filter=$OPTARG
			;;
		d)
			destdir=$OPTARG
			;;
		*)
			usage
			;;<commit_msg>Fix the build, add the new getopt option.<commit_after>#!/bin/sh
#
# create_core_pkg.sh
#
# part of pfSense (https://www.pfsense.org)
# Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin

scripts_path=$(dirname $(realpath $0))

if [ ! -f "${scripts_path}/common.subr" ]; then
	echo >&2 "ERROR: common.subr is missing"
	exit 1
fi

. ${scripts_path}/common.subr

usage() {
	cat >&2 <<END
Usage: $(basename $0) -t template -d destdir [-h]

Options:
	-t template  -- Path to package template directory
	-f flavor    -- package flavor
	-v version   -- package version
	-r root      -- root directory containing package files
	-s search    -- search path
	-F filter    -- filter pattern to exclude files from plist
	-d destdir   -- Destination directory to create package
	-h           -- Show this help and exit

Environment:
	TMPDIR       -- Temporary directory (default: /tmp)
	PRODUCT_NAME -- Product name (default: pfSense)
	PRODUCT_URL  -- Product URL (default: https://www.pfsense.org)
END
	exit 1
}

while getopts s:t:f:v:r:F:d:h opt; do
	case "$opt" in
		t)
			template=$OPTARG
			;;
		f)
			flavor=$OPTARG
			;;
		v)
			version=$OPTARG
			;;
		r)
			root=$OPTARG
			;;
		s)
			findroot=$OPTARG
			;;
		F)
			filter=$OPTARG
			;;
		d)
			destdir=$OPTARG
			;;
		*)
			usage
			;;
{'fraction_non_alphanumeric': 0.11971830985915492, 'fraction_numerical': 0.009389671361502348, 'mean_word_length': 3.1192266380236306, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1188199', 'n_tokens_mistral': 1370, 'n_tokens_neox': 1255, 'n_words': 439}