Commits

a4z committed 61135c7

re-activated destdir check

Comments (0)

Files changed (2)

src/cli/report.cpp

 #include <tuple>
 #include <iterator>
 
-#include <thread>
-#include <mutex>
-
 
 namespace sbbdep {
 namespace cli{
   using namespace a4sqlt3;
 
   NotFoundMap not_found;
+
+  utils::StringSet notFoundIgnore;
+  if(pkg.getType() == PkgType::DestDir)
+    {
+        for(auto& f : pkg.getDynLinked())
+          {
+            if(f.soName()!="")
+              notFoundIgnore.insert(f.soName());
+          }
+    }
+
+
   utils::ReportSet rs {{ "pkgname", "filename", "soname" , "requiredby" } };
 
 
       utils::StringSet rem_so; // for delete an insert as problems
       for(auto so_needed : ldmap)
         { // is 'not found', but search for on "/"
-          if( so_needed.second.find("/") == std::string::npos ) {
-              rem_so.insert(so_needed.first); // bookmark for later delete from map
-          }
+          if( so_needed.second.find("/") == std::string::npos )
+            {
+              if( notFoundIgnore.find(so_needed.first) == notFoundIgnore.end() )
+                rem_so.insert(so_needed.first); // bookmark for later delete from map
+            }
         }
 
       if(not rem_so.empty())
 
   NotFoundMap not_found;
 
+  utils::StringSet notFoundIgnore;
+  if(pkg.getType() == PkgType::DestDir)
+    {
+        for(auto& f : pkg.getDynLinked())
+          {
+            if(f.soName()!="")
+              notFoundIgnore.insert(f.soName());
+          }
+    }
+
+
+
+
   utils::ReportSet rs {{ "pkgname", "filename", "soname" , "requiredby" } };
 
   for(const ElfFile& elf : pkg.getDynLinked())
 
       // if something was not found, it's now at the begin
       utils::StringSet notFounds;
-      notFounds.insert(needed.begin(), notfound_end);
+
+      auto nfiter = needed.begin();
+      while(nfiter != notfound_end)
+        {
+          if(notFoundIgnore.find(*nfiter) == notFoundIgnore.end())
+            notFounds.insert(*nfiter);
+          ++nfiter;
+        }
+
+
+
       if(not notFounds.empty())
           not_found.insert(NotFoundMap::value_type(elf.getName().Str(), notFounds));
 
 
   if( pkg.getType() == PkgType::BinLib )
     {
+      a4sqlt3::Dataset ds = getPkgsOfFile( pkg.getPath(), pkg.getArch() ) ;
+      Log::AppMessage() << "\n" ;
+      Log::AppMessage() << "check " << pkg.getPath() ;
+      Log::AppMessage() << ", " << pkg.getDynLinked().begin()->getArch() << "bit " ;
+      if(pkg.getDynLinked().begin()->getType() == ElfFile::Binary)
+        Log::AppMessage() << "binary " ;
+      else if(pkg.getDynLinked().begin()->getType() == ElfFile::Library)
+        Log::AppMessage() << "library (" << pkg.getDynLinked().begin()->soName()  << ")" ;
 
-      //a4sqlt3::Dataset ds = getPkgsOfFile( pkg.getPath(), pkg.getArch() ) ;
-      // TODO , add some infos about the file
+      Log::AppMessage() << std::endl ;
 
+      if(ds.getRowCount()==0)
+        {
+          Log::AppMessage() << " .. not in a known package" << std::endl;
+        }
+      else
+        {
+          for(auto flds : ds)
+            Log::AppMessage() << " .. from package " <<  flds.getField(0).getString() <<std::endl;
+
+        }
+      Log::AppMessage() << std::endl ;
     }
 
   auto makename = [addversion, xdl](const std::string val)
     Log::AppMessage() << std::endl;
 
 
+
     if(not notFounds.empty())
       {
         Log::AppMessage() <<std::endl;
         Log::AppMessage() << std::endl;
       }
 
-
+    Log::AppMessage() << std::endl;
 }
 
 

src/sbbdep/pkg.cpp

 Pkg::doLoadDestDir()
 {
   // recursive go through given dir, check for dynlinked in it, if found , added to m_dlinfos
-  std::function<void(const std::string&)> checkdir =
-      [this, checkdir ]( const std::string& dname ) -> void
+  std::function<void(const std::string&)> checkdir;
+  checkdir = [this, &checkdir ]( const std::string& dname ) -> void
   {
     DirContent dcont(dname);
     dcont.Open(); // TODO , could throw