symlink "$src/$_", "$_" or die "$_ $!";
' "$src";
END_DEEP
+ } elsif ($linkfarm_depth eq 'copy-edit') {
+ $pre .= <<'END_COPY_EDIT';
+ find -lname "$src/*" -print0 | xargs -0r rm --;
+ (set -e; cd "$src"; git ls-files -c -z |
+ cpio --quiet -p0m --no-preserve-owner -u --make-directories "$bld/$sd");
+ clean () {
+ (set -e; cd "$src"; git ls-files -c -z) | xargs -0r rm -f --;
+ };
+END_COPY_EDIT
+ $post .= <<'END_COPY_EDIT_BUNDLE';
+ (set -e; cd "$src"; git ls-files -c -z) |
+ cpio -Hustar -o0 --quiet >"nailing-cargo-update.tar";
+END_COPY_EDIT_BUNDLE
} else {
die "$linkfarm_depth ?";
}
}
}
-sub cargo_lock_update_after () {
- if ($do_cargo_lock && $cargo_lock_update && !$just_linkfarm) {
+sub files_return_after_update () {
+ if ($linkfarm_depth eq 'copy-edit') {
+ system qw(sh -ec), <<'END', 'x', "$build_absdir";
+ git ls-files -c -z | \
+ tar -x --keep-newer-files --no-same-permissions --no-same-owner \
+ --no-acls --no-selinux --no-xattrs --warning=no-ignore-newer \
+ -Hustar --null --files-from=- --force-local \
+ -f "$1/nailing-cargo-update.tar"
+END
+ } elsif ($do_cargo_lock && $cargo_lock_update && !$just_linkfarm) {
# avoids importing File::Copy and the error handling is about as good
$!=0; $?=0;
my $r= system qw(cp --), "$build_absdir/Cargo.lock", "Cargo.lock";
$cargo_lock_update= 1; # will set $linkfarm_detph to 1 by default
} elsif (m{^--linkfarm(?:=(no|shallow|git|full))?$}) {
$linkfarm_depth = $1 || 'git';
+ } elsif (m{^--edits?-sources?$}) {
+ $linkfarm_depth = 'copy-edit';
} elsif (m{^--just-run$}) {
$do_nail = $do_cargo_lock = $do_lock = 0;
} elsif (m{^--(clean|keep)-linkfarm$}) {
print STDERR "$self: invoking: @display_cmd\n" if $verbose;
my $estatus = invoke();
-cargo_lock_update_after();
+files_return_after_update();
uninstall() unless $leave_nailed;
$want_uninstall = 0;