[vala/0.50] vala: Improve detection of duplicate package source files



commit 22f50d1767832290ff84730255b5889fc0477ee1
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Jan 12 10:24:13 2021 +0100

    vala: Improve detection of duplicate package source files

 vala/valacodecontext.vala | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index 6b6665274..dd1c6db12 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -395,7 +395,13 @@ public class Vala.CodeContext {
 
                add_package (pkg);
 
-               add_source_file (new SourceFile (this, SourceFileType.PACKAGE, path));
+               var rpath = realpath (path);
+               var source_file = new SourceFile (this, SourceFileType.PACKAGE, path);
+
+               add_source_file (source_file);
+               if (rpath != path) {
+                       source_files_map.set (rpath, source_file);
+               }
 
                if (verbose_mode) {
                        stdout.printf ("Loaded package `%s'\n", path);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]