From a6b59a4a0283546e4e596be39f3c7e8fed8cb114 Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Sun, 28 Sep 2008 11:42:53 -0700 Subject: Dereference symlinks when copying hooks. (closes: #499358) I keep a number of different hooks in my $HOME/.pbuilder/hooks/ directory, and some are symlinks to files outside that directory. When 'pbuilder-runhooks' copies the hooks, it copies them without dereference, which fails inside the chroot since the referenced files are not found. The attached patch, generated using 'git format-patch', fixes this by using the '-L' ('--dereference') option to 'cp' when copying the hook files into the pbuilder chroot. --- pbuilder-runhooks | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pbuilder-runhooks') diff --git a/pbuilder-runhooks b/pbuilder-runhooks index 1bf66b7..ac500a2 100644 --- a/pbuilder-runhooks +++ b/pbuilder-runhooks @@ -37,8 +37,8 @@ function loadhooks () { fi if [ -d "$HOOKDIR" ]; then mkdir -p "$BUILDPLACE/$hooks" - if ! cp -a "$HOOKDIR/"* "$BUILDPLACE/$hooks"; then - echo "W: no hooks found on the hookdir" >&2 + if ! cp -aL "$HOOKDIR/"* "$BUILDPLACE/$hooks"; then + echo "W: no hooks found in the hookdir '$HOOKDIR'" >&2 fi fi } -- cgit v1.2.3