Kaynağa Gözat

Keep track whether a package was added directly through a requires section (or the command line) or indirectly.

fpkg.pas, tpackageentry:
  + new field "direct"
pkgutil.pas:
  + add_package: new parameter "direct" which sets the "direct" field of the new package entry
options.pas:
  * TOption.interpret_option & read_arguments: adjust call to add_package()
pmodules.pas:
  * proc_package: adjust call to add_package()

git-svn-id: branches/svenbarth/packages@32508 -
svenbarth 9 yıl önce
ebeveyn
işleme
ac6ba043e1
4 değiştirilmiş dosya ile 7 ekleme ve 5 silme
  1. 1 0
      compiler/fpkg.pas
  2. 2 2
      compiler/options.pas
  3. 3 2
      compiler/pkgutil.pas
  4. 1 1
      compiler/pmodules.pas

+ 1 - 0
compiler/fpkg.pas

@@ -56,6 +56,7 @@ interface
       package : tpackage;
       realpkgname : string;
       usedunits : longint;
+      direct : boolean;
     end;
     ppackageentry=^tpackageentry;
 

+ 2 - 2
compiler/options.pas

@@ -1250,7 +1250,7 @@ begin
                      if ispara then
                        parapackages.add(more,nil)
                      else
-                       add_package(more,true);
+                       add_package(more,true,true);
                    end;
                  'p' :
                    begin
@@ -3294,7 +3294,7 @@ begin
   FrameworkSearchPath.AddList(option.ParaFrameworkPath,true);
   packagesearchpath.addlist(option.parapackagepath,true);
   for j:=0 to option.parapackages.count-1 do
-    add_package(option.parapackages.NameOfIndex(j),true);
+    add_package(option.parapackages.NameOfIndex(j),true,true);
 
   { add unit environment and exepath to the unit search path }
   if inputfilepath<>'' then

+ 3 - 2
compiler/pkgutil.pas

@@ -33,7 +33,7 @@ interface
   Function RewritePPU(const PPUFn:String;OutStream:TCStream):Boolean;
   procedure export_unit(u:tmodule);
   procedure load_packages;
-  procedure add_package(const name:string;ignoreduplicates:boolean);
+  procedure add_package(const name:string;ignoreduplicates:boolean;direct:boolean);
   procedure add_package_unit_ref(package:tpackage);
   procedure add_package_libs(l:tlinker);
 
@@ -419,7 +419,7 @@ implementation
     end;
 
 
-  procedure add_package(const name:string;ignoreduplicates:boolean);
+  procedure add_package(const name:string;ignoreduplicates:boolean;direct:boolean);
     var
       entry : ppackageentry;
       i : longint;
@@ -437,6 +437,7 @@ implementation
       entry^.package:=nil;
       entry^.realpkgname:=name;
       entry^.usedunits:=0;
+      entry^.direct:=direct;
       packagelist.add(upper(name),entry);
     end;
 

+ 1 - 1
compiler/pmodules.pas

@@ -1424,7 +1424,7 @@ type
                          module_name:=module_name+'.'+orgpattern;
                          consume(_ID);
                        end;
-                     add_package(module_name,false);
+                     add_package(module_name,false,true);
                    end
                  else
                    consume(_ID);