summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-06-18 10:52:33 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-06-18 10:52:33 (EDT)
commitb3b32327e371d87a4ef36727b840c0e844b6f148 (patch)
tree6ceb582293fb9c943b0fa24e5864051ddeeb55e1
parentb7775e4610de8d92d73a1321f3127f1646c76762 (diff)
ob-buildopk: Use touch -t
-rw-r--r--NEWS6
-rw-r--r--src/ob-buildopk.sh10
2 files changed, 11 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 97e598c..a845c6d 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,12 @@ opkbuild version 4.1.1
Released: ????-??-??
+Utilities:
+
+ * ob-buildopk now uses the "touch" utility's "-t" option instead of
+ "-d". Both are required by POSIX, but BusyBox supports only the
+ argument format of the former.
+
libopkbuild:
* A new function ob_touch_t_gmtime() has been added.
diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh
index cea74ab..dc630d1 100644
--- a/src/ob-buildopk.sh
+++ b/src/ob-buildopk.sh
@@ -42,7 +42,7 @@ build_opk()
find_not_link='! -type l' touch_noderef=''
fi
find "${binary}.control" "${binary}.data" ${find_not_link} | xargs \
- ${TOUCH} ${touch_noderef} -d "${date}"
+ ${TOUCH} ${touch_noderef} -t "${date}"
# This utility runs with (fake) privileges, so we can chown what we're
# about to tar.
@@ -52,13 +52,13 @@ build_opk()
${TAR} -cf '../control.tar' --no-recursion -T -)
(cd -- "${binary}.data" && find '.' | LC_ALL=C sort | \
${TAR} -cf '../data.tar' --no-recursion -T -)
- ${TOUCH} -d "${date}" 'control.tar' 'data.tar'
+ ${TOUCH} -t "${date}" 'control.tar' 'data.tar'
${GZIP} 'control.tar' 'data.tar'
${TAR} -cf "../../${binary}_${version}_${arch}_${plat}.tar" \
'debian-binary' 'control.tar.gz' 'data.tar.gz'
rm -Rf 'control.tar.gz' 'data.tar.gz'
- ${TOUCH} -d "${date}" "../../${binary}_${version}_${arch}_${plat}.tar"
+ ${TOUCH} -t "${date}" "../../${binary}_${version}_${arch}_${plat}.tar"
${GZIP} "../../${binary}_${version}_${arch}_${plat}.tar"
mv "../../${binary}_${version}_${arch}_${plat}.tar.gz" \
"../../${binary}_${version}_${arch}_${plat}.opk"
@@ -80,10 +80,10 @@ main()
fi
ob_init_package '..' || return 1
- date="$(ob_iso8601_gmtime "${SOURCE_DATE_EPOCH}")"
+ date="$(ob_touch_t_gmtime "${SOURCE_DATE_EPOCH}")"
printf '2.0\n' >'debian-binary'
- ${TOUCH} -d "${date}" 'debian-binary'
+ ${TOUCH} -t "${date}" 'debian-binary'
if [ x"${OB_DO_SOURCE:+set}" = x'set' ]; then
build_opk "src-${OPK_SOURCE}" "${OPK_SOURCE_VERSION}" \
'src' 'all' "${date}"