summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2016-12-08 01:50:49 +0000
committerBen Hutchings <ben@decadent.org.uk>2016-12-08 02:05:58 +0000
commit385e3fce65f6cde81afa4034e7278fe767a34f1a (patch)
tree0fa3bd1dfa6abe849438f34e17e97ad065ee56d1
parent30dfbbd105c411329ad2e4e16da6eabf953db121 (diff)
hook-functions: Make copy_file return 0 on creating a link to an existing file
If copy_file copies a symlink, it then moves on to copying the link-target. It returns 1 if that already exists in the initramfs. This is not obvious from the documentation and it's causing breakage now. It seems to make more sense to return 0 in this case and reserve 1 for the case that nothing at all was copied. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Closes: #847325
-rw-r--r--hook-functions2
1 files changed, 1 insertions, 1 deletions
diff --git a/hook-functions b/hook-functions
index 9ef9c31..b36d855 100644
--- a/hook-functions
+++ b/hook-functions
@@ -149,7 +149,7 @@ copy_file() {
# Copy the link target if it doesn't already exist
src="${link_target}"
target="${link_target}"
- [ -e "${DESTDIR}/${target}" ] && return 1
+ [ -e "${DESTDIR}/${target}" ] && return 0
mkdir -p "${DESTDIR}/${target%/*}"
fi