diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-08-04 14:00:31 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-08-04 14:00:59 (EDT) |
commit | bbb96d7c6324aecf305809af959fb405d30ef355 (patch) | |
tree | ab899bd6c2f6e332b986f462b0508e8ea97981d0 /src | |
parent | e896bac2af929d6c59e6fdad20b41d69d32848fd (diff) |
ob-buildopk: Check for touch -d at run time
Diffstat (limited to 'src')
-rw-r--r-- | src/ob-buildopk.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh index 1e661cc..5dd7917 100644 --- a/src/ob-buildopk.sh +++ b/src/ob-buildopk.sh @@ -1,6 +1,6 @@ # Pack binary package files into an opk file # -# Copyright (C) 2012 Patrick McDermott +# Copyright (C) 2012, 2019 Patrick McDermott # # This file is part of opkbuild. # @@ -34,18 +34,23 @@ build_opk() ob_info "$(ob_get_msg 'build_opk')" \ "${binary}_${version}_${arch}_${plat}.opk" + mkdir -p '.opkbuild' + # 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 + rm -f '.opkbuild/touch-noderef.none' '.opkbuild/touch-noderef.link' + ln -s '.opkbuild/touch-noderef.none' '.opkbuild/touch-noderef.link' + ${TOUCH} -h '.opkbuild/touch-noderef.link' 1>/dev/null 2>/dev/null || : + if ! test -f '.opkbuild/touch-noderef.none'; then find_not_link='' touch_noderef='-h' else find_not_link='! -type l' touch_noderef='' fi + rm -f '.opkbuild/touch-noderef.none' '.opkbuild/touch-noderef.link' # Detect whether BusyBox tar inserts files listed with -T in reverse # order. - mkdir -p '.opkbuild' touch '.opkbuild/a' '.opkbuild/b' if [ x"$(printf '.opkbuild/a\n.opkbuild/b\n' | ${TAR} -c -T - | \ ${TAR} -t | head -n 1)" = x'b' ]; then |