diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ob-buildopk.sh | 15 |
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 | \ |