diff options
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | src/oh-gencontrol.sh | 13 |
2 files changed, 10 insertions, 4 deletions
@@ -1,5 +1,4 @@ For 2.0.0: - * Handle maintainer scripts, conffiles, and md5sums in oh-gencontrol. * Write substitution variable library functions. * Do substitutions in control generation. * Write new architecture library functions. diff --git a/src/oh-gencontrol.sh b/src/oh-gencontrol.sh index 06e01d5..9b2718e 100644 --- a/src/oh-gencontrol.sh +++ b/src/oh-gencontrol.sh @@ -77,10 +77,9 @@ install_maintainer_scripts() gen_conffiles() { if [ -d "${OH_SOURCE_DIR}/tmp/${pkg}.data/etc" ]; then - >"${OH_SOURCE_DIR}/tmp/${pkg}.control/conffiles" find "${OH_SOURCE_DIR}/tmp/${pkg}.data/etc" -type f | \ sed "^@"${OH_SOURCE_DIR}/tmp/${pkg}.data"@@" \ - >>"${OH_SOURCE_DIR}/tmp/${pkg}.control/conffiles" + >"${OH_SOURCE_DIR}/tmp/${pkg}.control/conffiles" if [ -z "$(head -n 1 \ "${OH_SOURCE_DIR}/tmp/${pkg}.control/conffiles")" ]; then rm -f "${OH_SOURCE_DIR}/tmp/${pkg}.control/conffiles" @@ -92,7 +91,15 @@ gen_conffiles() gen_md5sums() { - : + find "${OH_SOURCE_DIR}/tmp/${pkg}.data" -type f | sort | xargs md5sum | \ + sed "^@"${OH_SOURCE_DIR}/tmp/${pkg}.data"@@" \ + >"${OH_SOURCE_DIR}/tmp/${pkg}.control/md5sums" + if [ -z "$(head -n 1 \ + "${OH_SOURCE_DIR}/tmp/${pkg}.control/md5sums")" ]; then + rm -f "${OH_SOURCE_DIR}/tmp/${pkg}.control/md5sums" + else + chmod 644 "${OH_SOURCE_DIR}/tmp/${pkg}.control/md5sums" + fi } main "${@}" |