summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2014-11-13 10:52:35 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2014-11-13 14:51:04 +0100
commit6fe3789a0979ea80db8788ccfbef9d57da37b556 (patch)
tree1bd488917bc85054ea11ffa31a318cb923f1313d /scripts
parentf09675cfdc41b728d368ab86ede208ca547ed035 (diff)
downloadptxdist-6fe3789a0979ea80db8788ccfbef9d57da37b556.tar.gz
ptxdist-6fe3789a0979ea80db8788ccfbef9d57da37b556.tar.xz
ptxd_make_xpkg_pkg: handle old touch without support for --no-dereference
Reported-by: Jon Ringle <jringle@gridpoint.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/ptxd_make_image_prepare_work_dir.sh3
-rw-r--r--scripts/lib/ptxd_make_xpkg_pkg.sh14
2 files changed, 13 insertions, 4 deletions
diff --git a/scripts/lib/ptxd_make_image_prepare_work_dir.sh b/scripts/lib/ptxd_make_image_prepare_work_dir.sh
index 8abfb11dd..3f64a3d40 100644
--- a/scripts/lib/ptxd_make_image_prepare_work_dir.sh
+++ b/scripts/lib/ptxd_make_image_prepare_work_dir.sh
@@ -25,7 +25,6 @@ ptxd_make_image_extract_xpkg_files() {
local src="/etc/ipkg.conf"
local xpkg_conf="${PTXDIST_TEMPDIR}/${FUNCNAME}_xpkg.conf"
local work_dir="$1"
- local timestamp="${PTXDIST_VERSION_YEAR}${PTXDIST_VERSION_MONTH}010000"
local -a list ptxd_reply
if ptxd_get_ptxconf "PTXCONF_HOST_PACKAGE_MANAGEMENT_OPKG" > /dev/null; then
echo "option force_postinstall 1" > "${xpkg_conf}"
@@ -65,7 +64,7 @@ ${list[*]}
${ptx_xpkg_type}-cl -f "${xpkg_conf}" -o "${work_dir}" \
install "${ptxd_reply_ipkg_files[@]}" &&
- find "${work_dir}" -print0 | xargs -0 touch --no-dereference -c -t "${timestamp}"
+ ptxd_install_fixup_timestamps "${work_dir}"
}
export -f ptxd_make_image_extract_xpkg_files
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
index 5c5ce6759..f637113f8 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -787,14 +787,24 @@ executing '${pkg_label}.${1}'
}
export -f ptxd_install_run
+ptxd_install_fixup_timestamps() {
+ local timestamp="${PTXDIST_VERSION_YEAR}${PTXDIST_VERSION_MONTH}010000"
+ local touch_args
+ if touch --help | grep -q -- --no-dereference &> /dev/null; then
+ touch_args="--no-dereference"
+ fi
+
+ find "${1}" -print0 | xargs -0 touch ${touch_args} -c -t "${timestamp}"
+}
+export -f ptxd_install_fixup_timestamps
+
ptxd_make_xpkg_pkg() {
local pkg_xpkg_tmp="$1"
local pkg_xpkg_cmds="$2"
local pkg_xpkg_perms="$3"
- local timestamp="${PTXDIST_VERSION_YEAR}${PTXDIST_VERSION_MONTH}010000"
. "${pkg_xpkg_cmds}" &&
- find "${pkg_xpkg_tmp}" -print0 | xargs -0 touch --no-dereference -c -t "${timestamp}"
+ ptxd_install_fixup_timestamps "${pkg_xpkg_tmp}"
}
export -f ptxd_make_xpkg_pkg