diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-18 02:03:42 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-18 02:03:42 (EDT) |
commit | 30c58cf4caab89257d8f3f9f14d06b542227cf7a (patch) | |
tree | 76ea3cfc491c699bd6774d4cd2f99364001133e7 /src | |
parent | 576b9069b263fc32aa3d6791c247c5863c9fb28a (diff) |
ob-genchanges: set -u and declare local variables
Diffstat (limited to 'src')
-rw-r--r-- | src/ob-genchanges.sh | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/ob-genchanges.sh b/src/ob-genchanges.sh index 0102805..38603d3 100644 --- a/src/ob-genchanges.sh +++ b/src/ob-genchanges.sh @@ -1,4 +1,4 @@ -# Generates a changes file to describe binary packages and their changes +# Generate a changes file to describe binary packages and their changes # # Copyright (C) 2013 Patrick McDermott # @@ -17,13 +17,16 @@ # You should have received a copy of the GNU General Public License # along with opkbuild. If not, see <http://www.gnu.org/licenses/>. -set -e +set -eu write_changes() { - version="${1}" - arch="${2}" - plat="${3}" + local version="${1}" + local arch="${2}" + local plat="${3}" + shift 3 + local pkg= + local desc= printf 'Format: 1.0\n' >&3 @@ -57,6 +60,8 @@ write_changes() write_files_src() { + local file= + printf 'Files:\n' >&3 file="src-${OPK_SOURCE}_${OPK_SOURCE_VERSION}_src_all.opk" printf ' %s %s %s\n' \ @@ -68,6 +73,11 @@ write_files_src() write_files_bin() { + local pkg= + local arch= + local plat= + local file= + printf 'Files:\n' >&3 for pkg in ${OPK_PACKAGES_REDUCED}; do arch="$(ob_get_binary_parameter "${pkg}" 'Architecture')" @@ -85,6 +95,8 @@ write_files_bin() main() { + local changes= + if ! ob_set_text_domain 'opkbuild'; then printf '%s: Error: Failed to load locale messages\n' \ "${0##*/}" >&2 |