* [PATCH] lei_mirror: don't symlink(2) over bad links
@ 2024-07-02 21:35 Eric Wong
2024-07-02 23:56 ` [PATCH 2/1] lei_mirror: show FS path for symlink conflicts Eric Wong
0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2024-07-02 21:35 UTC (permalink / raw)
To: meta
We don't want to autodie on symlink(2) failures here. Instead,
just note the {badlink} and display it at the end instead of
bailing out early.
---
lib/PublicInbox/LeiMirror.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index e7c265bd..57b2d32b 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -795,6 +795,7 @@ sub update_ent {
unlink($ln);
} else {
push @{$self->{chg}->{badlink}}, $p;
+ next;
}
}
symlink($tgt, $ln);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/1] lei_mirror: show FS path for symlink conflicts
2024-07-02 21:35 [PATCH] lei_mirror: don't symlink(2) over bad links Eric Wong
@ 2024-07-02 23:56 ` Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2024-07-02 23:56 UTC (permalink / raw)
To: meta
Seeing the URI path component is confusing the problem needs to
be dealt with on the local FS.
---
lib/PublicInbox/LeiMirror.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index 57b2d32b..fb0295da 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -794,7 +794,7 @@ sub update_ent {
next if readlink($ln) eq $tgt;
unlink($ln);
} else {
- push @{$self->{chg}->{badlink}}, $p;
+ push @{$self->{chg}->{badlink}}, $ln;
next;
}
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-02 23:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 21:35 [PATCH] lei_mirror: don't symlink(2) over bad links Eric Wong
2024-07-02 23:56 ` [PATCH 2/1] lei_mirror: show FS path for symlink conflicts Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).