diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-06-18 01:14:19 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-06-18 01:14:19 (EDT) |
commit | c589ff445c5a959bb19fefc559fd9042dfb72c8e (patch) | |
tree | 7677be66e85bc719fe4bb7f2a038ab83049700c3 | |
parent | 5ab540bc36ef272b3d9096f204ebad61e6a5c51a (diff) |
ob-buildopk, ob-unpacksource, tests: Use ${TAR}
-rw-r--r-- | src/ob-buildopk.sh | 6 | ||||
-rw-r--r-- | src/ob-unpacksource.sh | 4 | ||||
-rwxr-xr-x | tests/exe/ob-buildopk.sh | 4 | ||||
-rwxr-xr-x | tests/exe/ob-unpacksource.sh | 2 | ||||
-rwxr-xr-x | tests/exe/opkbuild.sh | 4 | ||||
-rw-r--r-- | tests/local.mk | 1 |
6 files changed, 11 insertions, 10 deletions
diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh index 859097a..57b3688 100644 --- a/src/ob-buildopk.sh +++ b/src/ob-buildopk.sh @@ -49,12 +49,12 @@ build_opk() find "${binary}.control" "${binary}.data" | xargs chown -h 0:0 (cd -- "${binary}.control" && find '.' | LC_ALL=C sort | \ - tar -czf '../control.tar.gz' --no-recursion -T -) + ${TAR} -czf '../control.tar.gz' --no-recursion -T -) (cd -- "${binary}.data" && find '.' | LC_ALL=C sort | \ - tar -czf '../data.tar.gz' --no-recursion -T -) + ${TAR} -czf '../data.tar.gz' --no-recursion -T -) ${TOUCH} -d "${date}" 'control.tar.gz' 'data.tar.gz' - tar -czf "../../${binary}_${version}_${arch}_${plat}.opk" \ + ${TAR} -czf "../../${binary}_${version}_${arch}_${plat}.opk" \ 'debian-binary' 'control.tar.gz' 'data.tar.gz' rm -Rf 'control.tar.gz' 'data.tar.gz' diff --git a/src/ob-unpacksource.sh b/src/ob-unpacksource.sh index fe53db9..59e1307 100644 --- a/src/ob-unpacksource.sh +++ b/src/ob-unpacksource.sh @@ -92,7 +92,7 @@ get_upstream_dir() { local dir_count= - upstream_ar_dir="$(tar "-t${upstream_ar_z}f" "${upstream_ar}" | \ + upstream_ar_dir="$(${TAR} "-t${upstream_ar_z}f" "${upstream_ar}" | \ sed -n 's|^\(\./\)\{0,1\}\([^/]\{1,\}\).*$|\2|p' | sort | uniq)" dir_count="$(printf '%s\n' "${upstream_ar_dir}" | wc -l)" case "${dir_count}" in @@ -112,7 +112,7 @@ get_upstream_dir() extract_upstream() { ob_info "$(ob_get_msg 'unpacking_upstream')" - if ! tar "-x${upstream_ar_z}f" "${upstream_ar}"; then + if ! ${TAR} "-x${upstream_ar_z}f" "${upstream_ar}"; then ob_error "$(ob_get_msg 'cant_unpack_upstream')" return 1 fi diff --git a/tests/exe/ob-buildopk.sh b/tests/exe/ob-buildopk.sh index 3b211f2..020824a 100755 --- a/tests/exe/ob-buildopk.sh +++ b/tests/exe/ob-buildopk.sh @@ -27,7 +27,7 @@ ls_outer() local opk="${1}" shift 1 - tar -tzf "${opk}" + ${TAR} -tzf "${opk}" } ls_inner() @@ -36,7 +36,7 @@ ls_inner() local mbr="${2}" shift 2 - tar -xzOf "${opk}" "${mbr}" | tar -tz + ${TAR} -xzOf "${opk}" "${mbr}" | ${TAR} -tz } plan_ 9 diff --git a/tests/exe/ob-unpacksource.sh b/tests/exe/ob-unpacksource.sh index fbe94a2..901c221 100755 --- a/tests/exe/ob-unpacksource.sh +++ b/tests/exe/ob-unpacksource.sh @@ -34,7 +34,7 @@ cmd_is 'native sources unpacked' cat 'src/src/foo.sh' <<-EOF rm -Rf 'src/' mv '../src/' 'foo/' -tar -czf '../foo-1.0.orig.tar.gz' 'foo/' +${TAR} -czf '../foo-1.0.orig.tar.gz' 'foo/' rm -Rf 'foo/' command_ok_ 'ob-unpacksource exit status' ob-unpacksource diff --git a/tests/exe/opkbuild.sh b/tests/exe/opkbuild.sh index 6baeab0..b569986 100755 --- a/tests/exe/opkbuild.sh +++ b/tests/exe/opkbuild.sh @@ -27,7 +27,7 @@ ls_outer() local opk="${1}" shift 1 - tar -tzf "${opk}" + ${TAR} -tzf "${opk}" } ls_inner() @@ -36,7 +36,7 @@ ls_inner() local mbr="${2}" shift 2 - tar -xzOf "${opk}" "${mbr}" | tar -tz + ${TAR} -xzOf "${opk}" "${mbr}" | ${TAR} -tz } plan_ 12 diff --git a/tests/local.mk b/tests/local.mk index 3796ca6..b872909 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -31,6 +31,7 @@ SH_LOG_DRIVER = \ OB_BINDIR="$(abs_top_builddir)/src" \ PATH="$(abs_top_builddir)/src:$${PATH}" \ FAKEROOT='$(FAKEROOT)' \ + TAR='$(TAR)' \ $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh EXTRA_DIST += \ $(TESTS) \ |