summaryrefslogtreecommitdiffstats
path: root/lib/package
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-09-28 20:03:16 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-09-28 20:03:16 (EDT)
commitc4ea2e678ab347cbdd80b9e1692c36d6a4b55529 (patch)
tree1a90cd8602923ab616d8b27673260accddfd1d16 /lib/package
parent90de501005537b8d8164316dc6116c9431d58a53 (diff)
Implement _ob_parse_package_metadata_2() and CBs.
Diffstat (limited to 'lib/package')
-rw-r--r--lib/package/2.sh57
1 files changed, 55 insertions, 2 deletions
diff --git a/lib/package/2.sh b/lib/package/2.sh
index 99397f2..2969515 100644
--- a/lib/package/2.sh
+++ b/lib/package/2.sh
@@ -20,11 +20,27 @@
[ -n "${_OB_PACKAGE_2_SM}" ] && return 0
_OB_PACKAGE_2_SM='true'
+_OB_SOURCE_FIELDS_REQUIRED_2='Maintainer'
+_OB_SOURCE_FIELDS_OPTIONAL_2='Build-Depends Homepage'
+_OB_BINARY_FIELDS_REQUIRED_2='Architecture Platform Description'
+_OB_BINARY_FIELDS_OPTIONAL_2='Essential Depends Recommends Suggests '\
+'Pre-Depends Conflicts Provides Replaces'
+_OB_CURRENT_PACKAGE_2=
+
_ob_parse_package_metadata_2()
{
- _ob_local
+ _ob_local _obppm2_pkg
- # XXX: Stub.
+ 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" \
+ _ob_binfield_2 \
+ "${_OB_BINARY_FIELDS_REQUIRED_2}" "${_OB_BINARY_FIELDS_OPTIONAL_2}"
+ done
_ob_return 0
return ${?}
@@ -50,3 +66,40 @@ _ob_get_binary_packages_2()
_ob_return 0
return ${?}
}
+
+_ob_srcfield_2()
+{
+ _ob_local
+
+ _ob_set_source_parameter "${OB_CONTROL_NAME}" "${OB_CONTROL_VALUE}"
+
+ _ob_return 0
+ return ${?}
+}
+
+_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}"
+ _ob_set_source_parameter Changes "${OB_CHANGELOG_CHANGES}"
+ _ob_set_source_parameter Maintainer "${OB_CHANGELOG_MAINTAINER}"
+ _ob_set_source_parameter Date "${OB_CHANGELOG_DATE}"
+
+ # Parse only the first changelog entry.
+ _ob_return 1
+ return ${?}
+}
+
+_ob_binfield_2()
+{
+ _ob_local
+
+ _ob_set_binary_parameter "${_OB_CURRENT_PACKAGE_2}" "${OB_CONTROL_NAME}" \
+ "${OB_CONTROL_VALUE}"
+
+ _ob_return 0
+ return ${?}
+}