From 40502c667e1207023e81de17ae378de908ac0632 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 17 Jun 2020 14:07:47 -0400 Subject: ob-genchanges: Use "Section" field when present --- diff --git a/NEWS b/NEWS index 6d6937e..fd7a007 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ Utilities: binary package. * ob-genchanges now organizes source packages into section "src" instead of "base". + * ob-genchanges now organizes binary packages into sections specified + by "Section" field when present. libopkbuild: diff --git a/src/ob-genchanges.sh b/src/ob-genchanges.sh index b427bc3..8290de6 100644 --- a/src/ob-genchanges.sh +++ b/src/ob-genchanges.sh @@ -76,6 +76,7 @@ write_files_bin() local pkg= local arch= local plat= + local sect= local file= printf 'Files:\n' >&3 @@ -84,10 +85,12 @@ write_files_bin() [ x"${arch}" != x'all' ] && arch="${OPK_HOST_ARCH}" plat="$(ob_get_binary_parameter "${pkg}" 'Platform')" [ x"${plat}" != x'all' ] && plat="${OPK_HOST_PLAT}" + sect="$(ob_get_binary_parameter "${pkg}" 'Section')" + [ x"${sect}" = x'' ] && sect='base' file="${pkg}_${OPK_BINARY_VERSION}_${arch}_${plat}.opk" printf ' %s %s %s\n' \ "$(wc -c "../../${file}" | cut -d ' ' -f 1)" \ - 'base' "${file}" >&3 + "${sect}" "${file}" >&3 done return 0 diff --git a/tests/exe/ob-genchanges.sh b/tests/exe/ob-genchanges.sh index c0e38fc..1b8e951 100755 --- a/tests/exe/ob-genchanges.sh +++ b/tests/exe/ob-genchanges.sh @@ -48,7 +48,7 @@ cmd_is 'changes file' cat '../../foo_1.0-1_i686-linux-glibc_x60.changes' <<-EOF foo (1.0-1) trunk * Initial release. Files: - 0 base foo_1.0-1_i686-linux-glibc_all.opk + 0 libdev foo_1.0-1_i686-linux-glibc_all.opk 0 base baz-qux_1.0-1_all_all.opk - 0 base bar_1.0-1_all_all.opk + 0 utils bar_1.0-1_all_all.opk EOF -- cgit v0.9.1