From bbb96d7c6324aecf305809af959fb405d30ef355 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 04 Aug 2019 14:00:31 -0400 Subject: ob-buildopk: Check for touch -d at run time --- (limited to 'src') 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 -- cgit v0.9.1