summaryrefslogtreecommitdiffstats
path: root/scripts/libptxdist.sh
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-08-15 11:20:25 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-08-15 11:25:19 +0200
commit15d3a688eec47893eac6d09894683dccbf50d14c (patch)
tree6004ad2b44e2658497b136579b4c4450a0e55d7e /scripts/libptxdist.sh
parent18398cddc1a684424e798d0c27c6e7bc44af4ed3 (diff)
downloadptxdist-15d3a688eec47893eac6d09894683dccbf50d14c.tar.gz
ptxdist-15d3a688eec47893eac6d09894683dccbf50d14c.tar.xz
ptxd_replace_link: don't do anything if the link is already correct
Most links are created during wrapper setup. So most of the time the links are already correct. This saves a bit of time during startup. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/libptxdist.sh')
-rw-r--r--scripts/libptxdist.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh
index dc67bc17b..ee0ba39d3 100644
--- a/scripts/libptxdist.sh
+++ b/scripts/libptxdist.sh
@@ -315,6 +315,10 @@ ptxd_dumpstack() {
ptxd_replace_link() {
test -e "${2}" -a ! -L "${2}" && ptxd_bailout "'${2}' is not a link"
+ if [ "${1}" -ef "${2}" ]; then
+ return
+ fi
+
ln -sfT "${1}" "${2}.tmp"
mv -T "${2}.tmp" "${2}"
}