diff options
author | P. J. McDermott <pjm@nac.net> | 2012-08-03 04:36:05 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-08-03 04:36:05 (EDT) |
commit | 8cccff5322665d9c870f319f5122eeaa28331adc (patch) | |
tree | 6da6d0751ebd14de321d329cce2df73542426cd4 | |
parent | 8e459b36af624dce696c9ccd516a7ecbddb79fad (diff) |
"Finish" oh-gencontrol (still rather ugly).opkhelper-2.0.x
-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 "${@}" |