summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-18 01:37:23 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-18 01:37:23 (EDT)
commitefdf6e38bcd85d4f62310a3e33a2e3e144f0a8ee (patch)
tree1975b75ca4cb8698e62c24e95855fde250e7637b /src
parent5ae5470d6f1ffeb12bff4f7f5318f9fc13422ef3 (diff)
ob-buildopk: Declare local variables and wrap long lines
Diffstat (limited to 'src')
-rw-r--r--src/ob-buildopk.sh23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh
index f0758fb..56c10b3 100644
--- a/src/ob-buildopk.sh
+++ b/src/ob-buildopk.sh
@@ -17,14 +17,15 @@
# 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
build_opk()
{
- binary="${1}"
- version="${2}"
- arch="${3}"
- plat="${4}"
+ local binary="${1}"
+ local version="${2}"
+ local arch="${3}"
+ local plat="${4}"
+ shift 4
(cd -- "${binary}.data" && tar -czf '../data.tar.gz' '.')
(cd -- "${binary}.control" && tar -czf '../control.tar.gz' '.')
@@ -38,6 +39,9 @@ build_opk()
main()
{
+ local arch=
+ local plat=
+
if ! ob_set_text_domain 'opkbuild'; then
printf '%s: Error: Failed to load locale messages\n' \
"${0##*/}" >&2
@@ -48,14 +52,17 @@ main()
printf '2.0\n' >'debian-binary'
if [ x"${OB_DO_SOURCE:+set}" = x'set' ]; then
- build_opk "src-${OPK_SOURCE}" "${OPK_SOURCE_VERSION}" 'src' 'all'
+ build_opk "src-${OPK_SOURCE}" "${OPK_SOURCE_VERSION}" \
+ 'src' 'all'
else
for pkg in ${OPK_PACKAGES_REDUCED}; do
- arch="$(ob_get_binary_parameter "${pkg}" 'Architecture')"
+ arch="$(ob_get_binary_parameter "${pkg}" \
+ 'Architecture')"
[ x"${arch}" != x'all' ] && arch="${OPK_HOST_ARCH}"
plat="$(ob_get_binary_parameter "${pkg}" 'Platform')"
[ x"${plat}" != x'all' ] && plat="${OPK_HOST_PLAT}"
- build_opk "${pkg}" "${OPK_BINARY_VERSION}" "${arch}" "${plat}"
+ build_opk "${pkg}" "${OPK_BINARY_VERSION}" \
+ "${arch}" "${plat}"
done
fi
rm 'debian-binary'