[Rpm-maint] [rpm-software-management/rpm] Allow file namesakes on symlink->dir replacement (#1684)

Panu Matilainen notifications at github.com
Tue May 18 09:24:49 UTC 2021


@pmatilai commented on this pull request.



> @@ -633,7 +633,17 @@ assert(otherFi != NULL);
 		rConflicts = handleColorConflict(ts, fs, fi, i,
 						otherFs, otherFi, otherFileNum);
 
-		if (rConflicts && reportConflicts) {
+		/*
+		 * This may be a false positive (two separate files) if a
+		 * symlink is being replaced by a directory in one of these two
+		 * paths.  This check extends the one for removal conflicts in
+		 * handleInstInstalledFile().
+		 */
+		int reportThis = !(p == otherTe &&
+				   rpmtsFlags(ts) & RPMTRANS_FLAG_TEST &&
+				   rpmteHaveTransScript(p, RPMTAG_PRETRANS));

Mostly stylistic, but I'd prefer doing this similar to the related check in handleInstInstalledFile(), set rConflicts to 0 on the heuristics rather than add a new variable to the scene. You could even add a tiny helper function for the common part of the heuristics, which would help keep them in sync across any future changes.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1684#pullrequestreview-661846993
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210518/9cebba2e/attachment.html>


More information about the Rpm-maint mailing list