Hello Thomas,
> Does fcopy works for you without this change for broken/relative symlinks?
Yes. We just revert the change since bookworm.
> Does fcopy handles relative symlinks diffrently than absolute
symlinks?
No, AFAIK. Just that absolute symlinks which might work in a running system
won't during installation.
> Do you have any suggestion how fcopy should behave for symlinks?
For symlinks as source (dead or alive) when called with -HS: copy the symlink
as-is and don't do substitutions. Figuring out the canonical path in the target
tree at this stage (and which file to do substitutions on) is out of scope of
fcopy i think, because the actual target file might appear in the same run of
fcopy later, or in another run of fcopy, or in a hook or script..., one would
need to correct for path offsets because of classes and different root during
installation.
For dead symlinks as source without -H: just die like in do_substitutions
(having a dead symlink in the context of the configspace should be an
configuration error), or continue with a warning (no strong preference there).
For healthy symlinks without -H and with -S: do substitutions as normal.
I attached an untested patch which might do that; Will test the next days.
Kind regards,
Victor
diff --git a/bin/fcopy b/bin/fcopy
index 595bd1ec..cbcd3df9 100755
--- a/bin/fcopy
+++ b/bin/fcopy
@@ -135,12 +135,9 @@ sub copy_one {
ewarn("reading symlink $sourcefile failed. $!") ;
return;
}
- }
-
- # handle broken symlink
- unless (stat($sourcefile)) {
- ewarn("$sourcefile is a broken symlink\n");
- return;
+ } elsif (-l $sourcefile and !stat($sourcefile)) { # handle broken symlink
+ ewarn("$sourcefile is a broken symlink\n");
+ return;
}
# do we need a tmpfile
@@ -149,7 +146,7 @@ sub copy_one {
$preinst = 1; # a tmpfile is used because of preinst script
}
- if ($substitute or -f "$ps/_substitute") {
+ if (!defined($sourcelink) and ($substitute or -f "$ps/_substitute")) { # substitution, but not when installing symlinks as is with -H
warn "Enable substitution. Copying $sourcefile to $tmpfile" if $debug;
do_substitution($sourcefile,$tmpfh);