diff options
Diffstat (limited to 'lib/package')
-rw-r--r-- | lib/package/2.sh | 57 |
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 ${?} +} |