From e09df586ce9f9bab4c66779fd189017c8c3341c0 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 01 Aug 2012 08:40:57 -0400 Subject: Write oh_control_gen_*() and fix tr commands. --- (limited to 'lib') diff --git a/lib/control.sh b/lib/control.sh index ca11999..e193d86 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -58,6 +58,25 @@ oh_control_parse_binary() _control_parse "${OH_SOURCE_DIR}/${1}.pkg/control" 'BINARY' } +oh_control_gen_source() +{ + _old_arch="${OH_CONTROL_BINARY_FIELD_ARCHITECTURE}" + _old_desc="${OH_CONTROL_BINARY_FIELD_DESCRIPTION}" + + OH_CONTROL_BINARY_FIELD_ARCHITECTURE='all' + OH_CONTROL_BINARY_FIELD_DESCRIPTION="${OH_SOURCE} source package" + + _control_gen 'SOURCE' "src:${OH_SOURCE}.control/control" + + OH_CONTROL_BINARY_FIELD_ARCHITECTURE="${_old_arch}" + OH_CONTROL_BINARY_FIELD_DESCRIPTION="${_old_desc}" +} + +oh_control_gen_binary() +{ + _control_gen 'BINARY' "${1}.control/control" +} + _control_parse() { _control="${1}" @@ -105,8 +124,8 @@ _control_parse() else _got="${_got}${_field} " fi - _param="OH_CONTROL_${_type}_FIELD_$(LC_CTYPE=C \ - tr '[:lower:]-' '[:upper:]_')" + _param="OH_CONTROL_${_type}_FIELD_$(echo "${_name}" | \ + LC_CTYPE=C tr '[:lower:]-' '[:upper:]_')" eval "${_param}=\"${_value}\"" else # Continuation line. @@ -146,3 +165,39 @@ _control_parse_error() fi oh_warn "${_file_info} ${_error}" "${@}" } + +_control_gen() +{ + _type="${1}" + _control="${2}" + + # TODO: Handle platforms and architectures like "any" and "any-linux-any". + # TODO: Calculate installed size. + + cat >"${_control}" <"${_control}" + fi + done + + cat >"${_control}" <"${_control}" + fi +} -- cgit v0.9.1