summaryrefslogtreecommitdiffstats
path: root/lib/package/2.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/package/2.sh')
-rw-r--r--lib/package/2.sh99
1 files changed, 43 insertions, 56 deletions
diff --git a/lib/package/2.sh b/lib/package/2.sh
index b3dfc52..25c4865 100644
--- a/lib/package/2.sh
+++ b/lib/package/2.sh
@@ -32,62 +32,56 @@ _OB_CURRENT_PACKAGE_2=
_ob_parse_package_metadata_2()
{
- _ob_local _obppm2_pkg
+ local pkg=
ob_parse_control "${_OB_PACKAGE_DIR}/control" _ob_srcfield_2 \
"${_OB_SOURCE_FIELDS_REQUIRED_2}" "${_OB_SOURCE_FIELDS_OPTIONAL_2}"
ob_parse_changelog "${_OB_PACKAGE_DIR}/changelog" _ob_change_2
- for _obppm2_pkg in $(ob_get_binary_packages); do
- _OB_CURRENT_PACKAGE_2="${_obppm2_pkg}"
- ob_parse_control "${_OB_PACKAGE_DIR}/${_obppm2_pkg}.pkg/control" \
+ for pkg in $(ob_get_binary_packages); do
+ _OB_CURRENT_PACKAGE_2="${pkg}"
+ ob_parse_control "${_OB_PACKAGE_DIR}/${pkg}.pkg/control" \
_ob_binfield_2 \
"${_OB_BINARY_FIELDS_REQUIRED_2}" "${_OB_BINARY_FIELDS_OPTIONAL_2}"
done
- _ob_return 0
- return ${?}
+ return 0
}
_ob_get_binary_packages_2()
{
- _ob_local _obgbp2_pkgs _obgbp2_pkg_control
+ local pkgs=
+ local pkg_control=
- for _obgbp2_pkg_control in "${_OB_PACKAGE_DIR}/"*'.pkg/control'; do
+ for pkg_control in "${_OB_PACKAGE_DIR}/"*'.pkg/control'; do
- if [ ! -f "${_obgbp2_pkg_control}" ]; then
+ if [ ! -f "${pkg_control}" ]; then
continue
fi
- _obgbp2_pkg_control="${_obgbp2_pkg_control%.pkg/control}"
- _obgbp2_pkg_control="${_obgbp2_pkg_control##*/}"
+ pkg_control="${pkg_control%.pkg/control}"
+ pkg_control="${pkg_control##*/}"
- ob_validate_binary_name "${_obgbp2_pkg_control}"
+ ob_validate_binary_name "${pkg_control}"
- _obgbp2_pkgs="${_obgbp2_pkgs} ${_obgbp2_pkg_control}"
+ pkgs="${pkgs} ${pkg_control}"
done
- _ob_set_binary_packages "${_obgbp2_pkgs}"
+ _ob_set_binary_packages "${pkgs}"
- _ob_return 0
- return ${?}
+ return 0
}
_ob_srcfield_2()
{
- _ob_local
-
_ob_set_source_parameter "${OB_CONTROL_NAME}" "${OB_CONTROL_VALUE}"
- _ob_return 0
- return ${?}
+ return 0
}
_ob_change_2()
{
- _ob_local
-
_ob_set_source_parameter Source "${OB_CHANGELOG_SOURCE}"
_ob_set_source_parameter Version "${OB_CHANGELOG_VERSION}"
_ob_set_source_parameter Distribution "${OB_CHANGELOG_DISTRIBUTION}"
@@ -96,75 +90,69 @@ _ob_change_2()
_ob_set_source_parameter Date "${OB_CHANGELOG_DATE}"
# Parse only the first changelog entry.
- _ob_return 1
- return ${?}
+ return 1
}
_ob_binfield_2()
{
- _ob_local
-
_ob_set_binary_parameter "${_OB_CURRENT_PACKAGE_2}" "${OB_CONTROL_NAME}" \
"${OB_CONTROL_VALUE}"
- _ob_return 0
- return ${?}
+ return 0
}
_ob_get_doc_package_2()
{
- _ob_local _obgdp2_pkg _obgdp2_doc_pkg
+ local pkg=
+ local doc_pkg=
- for _obgdp2_pkg in $(ob_get_binary_packages); do
- if [ -r "${_OB_PACKAGE_DIR}/${_obgdp2_pkg}.pkg/docs" ]; then
- if [ -n "${_obgdp2_doc_pkg}" ]; then
- _ob_return 1
- return ${?}
+ for pkg in $(ob_get_binary_packages); do
+ if [ -r "${_OB_PACKAGE_DIR}/${pkg}.pkg/docs" ]; then
+ if [ -n "${doc_pkg}" ]; then
+ return 1
fi
- _obgdp2_doc_pkg="${_obgdp2_pkg}"
+ doc_pkg="${pkg}"
fi
done
- if [ -z "${_obgdp2_doc_pkg}" ]; then
- _ob_return 1
- return ${?}
+ if [ -z "${doc_pkg}" ]; then
+ return 1
fi
- echo "${_obgdp2_doc_pkg}"
+ echo "${doc_pkg}"
- _ob_return 0
- return ${?}
+ return 0
}
_ob_get_doc_files_2()
{
- _ob_local _obgdf2_arch _obgdf2_plat _obgdf2_doc_pkg
+ local arch=
+ local plat=
+ local doc_pkg=
- _obgdf2_arch="${1}"
- _obgdf2_plat="${2}"
+ arch="${1}"
+ plat="${2}"
- _obgdf2_doc_pkg="$(_ob_get_doc_package_2)"
+ doc_pkg="$(_ob_get_doc_package_2)"
cat <<-EOF
../copyright
../changelog changelog.dist
../README README.dist
EOF
- cat "${_OB_PACKAGE_DIR}/${_obgdf2_doc_pkg}.pkg/docs"
+ cat "${_OB_PACKAGE_DIR}/${doc_pkg}.pkg/docs"
- _ob_return 0
- return ${?}
+ return 0
}
_ob_set_package_substvars_2()
{
- _ob_local _obspsv2_pkg
+ local pkg=
if [ ${#} -eq 1 ]; then
- _obspsv2_pkg="${1}"
+ pkg="${1}"
else
- _ob_return 125
- return ${?}
+ return 125
fi
if [ -f "${_OB_PACKAGE_DIR}/substvars" ]; then
@@ -175,14 +163,13 @@ _ob_set_package_substvars_2()
ob_set_substvar 'Binary-Version' "$(ob_get_source_parameter 'Version')"
ob_set_substvar 'Host-Arch' "${OPK_HOST_ARCH}"
ob_set_substvar 'Host-Plat' "${OPK_HOST_PLAT}"
+
+ return 0
}
_ob_substvar_2()
{
- _ob_local
-
ob_set_substvar "${OB_CONTROL_NAME}" "${OB_CONTROL_VALUE}"
- _ob_return 0
- return ${?}
+ return 0
}