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 --- diff --git a/NEWS b/NEWS index 364d868..8bc1eba 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,10 @@ Utilities: install and uninstall cleanly due to data files being stored after the directories that contain them. This bug was exposed by changes in opkbuild version 4.1.0. + * ob-buildopk now checks for the "touch" utility's "-h" option at run + time instead of configure checking for it at build time. This will + allow ob-buildopk to detect and make use of changes to BusyBox's + configuration. opkbuild version 4.1.2 ---------------------- diff --git a/config.sh.in b/config.sh.in index 7e9ebe5..c7fc608 100644 --- a/config.sh.in +++ b/config.sh.in @@ -5,4 +5,3 @@ OPKG='@OPKG@' TOUCH='@TOUCH@' TAR='@TAR@' GZIP='@GZIP@' -HAVE_TOUCH_NODEREF='@HAVE_TOUCH_NODEREF@' diff --git a/configure.ac b/configure.ac index df02367..f241f94 100644 --- a/configure.ac +++ b/configure.ac @@ -150,20 +150,6 @@ AC_ARG_WITH( fi ] ) -AC_MSG_CHECKING([whether touch accepts -h]) -ln -s conftest.none conftest.link 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD -if ${TOUCH} -h conftest.link 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then - if test -f conftest.none; then - AC_MSG_RESULT([no]) - AC_SUBST([HAVE_TOUCH_NODEREF], [false]) - else - AC_MSG_RESULT([yes]) - AC_SUBST([HAVE_TOUCH_NODEREF], [true]) - fi -else - AC_MSG_RESULT([no]) - AC_SUBST([HAVE_TOUCH_NODEREF], [false]) -fi AC_ARG_WITH( [tar], 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