releasing/blocks/cclient/patches/linux/apt-ftp-archive-ret.patch
changeset 632 934f9131337b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/releasing/blocks/cclient/patches/linux/apt-ftp-archive-ret.patch	Thu Sep 02 15:02:14 2010 +0800
@@ -0,0 +1,245 @@
+*** apt-0.7.20.2/apt-pkg/contrib/error.cc	2009-02-07 17:09:35.000000000 +0200
+--- apt-0.7.20.2-rhel/apt-pkg/contrib/error.cc	2010-01-08 20:16:34.000000000 +0200
+***************
+*** 205,210 ****
+--- 205,226 ----
+  	 cerr << "W: " << Err << endl;
+     }
+  }
++ 
++ string GlobalError::GetErrorDump()
++ {
++    string err;
++    Item *item = List;
++    while (item)
++    {
++       if (item->Error)
++          err += "E: ";
++       else
++ 	 err += "W: ";
++       err += item->Text + "\n";
++       item = item->Next;
++    }
++    return err;
++ }
+  									/*}}}*/
+  // GlobalError::Discard - Discard									/*{{{*/
+  // ---------------------------------------------------------------------
+*** apt-0.7.20.2/apt-pkg/contrib/error.h	2009-02-07 17:09:35.000000000 +0200
+--- apt-0.7.20.2-rhel/apt-pkg/contrib/error.h	2010-01-08 20:16:35.000000000 +0200
+***************
+*** 87,92 ****
+--- 87,93 ----
+  
+     // Usefull routine to dump to cerr
+     void DumpErrors();
++    string GetErrorDump();
+     
+     GlobalError();
+  };
+*** apt-0.7.20.2/ftparchive/apt-ftparchive.cc	2009-02-07 17:09:35.000000000 +0200
+--- apt-0.7.20.2-rhel/ftparchive/apt-ftparchive.cc	2010-01-08 20:16:59.000000000 +0200
+***************
+*** 729,739 ****
+     if (CmdL.FileSize() <= 2)
+     {
+        for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+! 	 if (I->GenPackages(Setup,Stats) == false)
+! 	    _error->DumpErrors();
+        for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+! 	 if (I->GenSources(Setup,SrcStats) == false)
+! 	    _error->DumpErrors();
+     }
+     else
+     {
+--- 729,737 ----
+     if (CmdL.FileSize() <= 2)
+     {
+        for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+! 	 			I->GenPackages(Setup,Stats);
+        for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+! 	 			I->GenSources(Setup,SrcStats);
+     }
+     else
+     {
+***************
+*** 758,764 ****
+  	 delete [] List;
+  	 return _error->Error(_("No selections matched"));
+        }
+-       _error->DumpErrors();
+        
+        // Do the generation for Packages
+        for (End = List; End->Str != 0; End++)
+--- 756,761 ----
+***************
+*** 769,776 ****
+  	 PackageMap *I = (PackageMap *)End->UserData;
+  	 if (I->PkgDone == true)
+  	    continue;
+! 	 if (I->GenPackages(Setup,Stats) == false)
+! 	    _error->DumpErrors();
+        }
+        
+        // Do the generation for Sources
+--- 766,772 ----
+  	 PackageMap *I = (PackageMap *)End->UserData;
+  	 if (I->PkgDone == true)
+  	    continue;
+! 	 		I->GenPackages(Setup,Stats);
+        }
+        
+        // Do the generation for Sources
+***************
+*** 782,789 ****
+  	 PackageMap *I = (PackageMap *)End->UserData;
+  	 if (I->SrcDone == true)
+  	    continue;
+! 	 if (I->GenSources(Setup,SrcStats) == false)
+! 	    _error->DumpErrors();
+        }
+        
+        delete [] List;
+--- 778,784 ----
+  	 PackageMap *I = (PackageMap *)End->UserData;
+  	 if (I->SrcDone == true)
+  	    continue;
+! 	 		I->GenSources(Setup,SrcStats);
+        }
+        
+        delete [] List;
+***************
+*** 837,845 ****
+  	    continue;
+        }
+        
+!       if (I->GenContents(Setup,PkgList.begin(),PkgList.end(),
+! 			 MaxContentsChange) == false)
+! 	 _error->DumpErrors();
+        
+        // Hit the limit?
+        if (MaxContentsChange == 0)
+--- 832,838 ----
+  	    continue;
+        }
+        
+!       I->GenContents(Setup,PkgList.begin(),PkgList.end(), MaxContentsChange);
+        
+        // Hit the limit?
+        if (MaxContentsChange == 0)
+***************
+*** 885,892 ****
+     {
+        c0out << I->BinCacheDB << endl;
+        CacheDB DB(flCombine(CacheDir,I->BinCacheDB));
+!       if (DB.Clean() == false)
+! 	 _error->DumpErrors();
+        
+        string CacheDB = I->BinCacheDB;
+        for (; I != PkgList.end() && I->BinCacheDB == CacheDB; I++);
+--- 878,884 ----
+     {
+        c0out << I->BinCacheDB << endl;
+        CacheDB DB(flCombine(CacheDir,I->BinCacheDB));
+!       DB.Clean();
+        
+        string CacheDB = I->BinCacheDB;
+        for (; I != PkgList.end() && I->BinCacheDB == CacheDB; I++);
+***************
+*** 955,961 ****
+     {
+        bool Errors = _error->PendingError();
+        _error->DumpErrors();
+!       return Errors == true?100:0;
+     }
+     return 0;
+  }
+--- 947,953 ----
+     {
+        bool Errors = _error->PendingError();
+        _error->DumpErrors();
+!       return Errors == true ? 100 : 0;
+     }
+     return 0;
+  }
+*** apt-0.7.20.2/ftparchive/multicompress.cc	2009-02-07 17:09:35.000000000 +0200
+--- apt-0.7.20.2-rhel/ftparchive/multicompress.cc	2010-01-08 20:16:59.000000000 +0200
+***************
+*** 178,184 ****
+        Child(Pipe[0]);
+        if (_error->PendingError() == true)
+        {
+- 	 _error->DumpErrors();
+  	 _exit(100);
+        }      
+        _exit(0);
+--- 178,183 ----
+*** apt-0.7.20.2/ftparchive/writer.cc	2009-02-07 17:09:35.000000000 +0200
+--- apt-0.7.20.2-rhel/ftparchive/writer.cc	2010-01-08 20:17:00.000000000 +0200
+***************
+*** 118,145 ****
+     else
+        Owner->DoPackage(File);
+     
+!    if (_error->empty() == false)
+     {
+!       // Print any errors or warnings found
+!       string Err;
+!       bool SeenPath = false;
+!       while (_error->empty() == false)
+!       {
+! 	 Owner->NewLine(1);
+! 	 
+! 	 bool Type = _error->PopMessage(Err);
+! 	 if (Type == true)
+! 	    cerr << _("E: ") << Err << endl;
+! 	 else
+! 	    cerr << _("W: ") << Err << endl;
+! 	 
+! 	 if (Err.find(File) != string::npos)
+! 	    SeenPath = true;
+!       }      
+!       
+!       if (SeenPath == false)
+! 	 cerr << _("E: Errors apply to file ") << "'" << File << "'" << endl;
+!       return 0;
+     }
+     
+     return 0;
+--- 118,132 ----
+     else
+        Owner->DoPackage(File);
+     
+!    if (!_error->empty())
+     {
+!       Owner->NewLine(1); // is this needed?
+! 	
+!       // HH: Show which file is involved in error if it's not found
+!       // from previous errors 
+!       string errdump = _error->GetErrorDump();
+!       if (errdump.find(File) == string::npos)
+! 	 _error->Error("Errors apply to file '%s'", File);
+     }
+     
+     return 0;
+***************
+*** 320,327 ****
+  
+     if (ExtOverrides.empty() == false)
+        Over.ReadExtraOverride(ExtOverrides);
+- 
+-    _error->DumpErrors();
+  }
+                                                                          /*}}}*/
+  // FTWScanner::SetExts - Set extensions to support                      /*{{{*/
+--- 307,312 ----
+***************
+*** 794,800 ****
+        if (_error->empty() == false)
+        {
+  	 _error->Error("Errors apply to file '%s'",File.c_str());
+- 	 _error->DumpErrors();
+        }
+     }
+     
+--- 779,784 ----