summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-06-16 17:22:43 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-06-16 17:22:43 (EDT)
commitdb775e408e259af7228b6b0f5b1eeddb87e60b46 (patch)
tree7c948f89a6cc06fb689e4e04f8804de87b8c7199 /src
parent8448a05d9e85c35f03267218aa8da2382a6169d3 (diff)
ob-buildopk: Use ${HAVE_TOUCH_NODEREF}
Diffstat (limited to 'src')
-rw-r--r--src/ob-buildopk.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh
index 9c318a3..1bf53a2 100644
--- a/src/ob-buildopk.sh
+++ b/src/ob-buildopk.sh
@@ -27,14 +27,27 @@ build_opk()
local plat="${4}"
local date="${5}"
shift 5
+ local find_not_link=
+ local touch_noderef=
ob_info "$(ob_get_msg 'build_opk')" \
"${binary}_${version}_${arch}_${plat}.opk"
- find "${binary}.control" "${binary}.data" | xargs ${TOUCH} -d "${date}"
+ # Don't dereference symbolic links. They might be absolute paths, and
+ # we don't want to attempt to affect the system on which we're building.
+ # Also, we want to set the mtimes of the links themselves, if possible.
+ if ${HAVE_TOUCH_NODEREF}; then
+ find_not_link='' touch_noderef='-h'
+ else
+ find_not_link='! -type l' touch_noderef=''
+ fi
+ find "${binary}.control" "${binary}.data" ${find_not_link} | xargs \
+ ${TOUCH} ${touch_noderef} -d "${date}"
+
# This utility runs with (fake) privileges, so we can chown what we're
# about to tar.
find "${binary}.control" "${binary}.data" | xargs chown 0:0
+
(cd -- "${binary}.control" && find '.' \! -type d | LC_ALL=C sort | \
tar -czf '../control.tar.gz' -T -)
(cd -- "${binary}.data" && find '.' \! -type d | LC_ALL=C sort | \