#!/bin/bash
# dev/package/config - package configuration file support

set -e

lib_load 'dev/package/versions'


######
# Library Settings

dev_package_versions_config_init() {
	script_setting_vars package_config_list_sort
	package_config_list_sort=true
}


######
# Package configuration

package_config() {
	local version
	version=$(package_version_build_full)
	cat<<CONFIG
# package.i7 - MCSH (i7 $package_version) package configuration
PKG="$PKG"
VERSION=$version

CONFIG

	[ -z "$SITE_BRANCH" ] || echo "SITE_BRANCH=$SITE_BRANCH"
	[ -z "$SITE_VERSION" ] || echo "SITE_VERSION=$SITE_VERSION"

	cat<<CONFIG
AUTHOR="$AUTHOR"
URL="$URL"
SUPPORT_NAME="$SUPPORT_NAME"
SUPPORT_EMAIL="$SUPPORT_EMAIL"

RUNTIME=$RUNTIME
CONFIG

	package_config_list APPS "${APPS[@]}"
	package_config_list LIBS "${LIBS[@]}"
	package_config_list CONF "${CONF[@]}"
	local package_config_list_sort=false
	package_config_list DIST "${DIST[@]}"

	echo -e "\n\n# vim: syntax=sh"
}

package_config_list() {
	local name=$1
	shift
	local -a names=( "$@" )
	! $package_config_list_sort || qsort_list names
	echo -e "\n$name=("
	for_each package_config_list_value "${names[@]}"
	echo $'\t'")"
}

package_config_list_value() { echo $'\t'"$1"; }

View the Script Reference Index


Generated on Tue Apr 25 21:20:34 PDT 2017 by mcsh i7 v0.18.0.