Przeglądaj źródła

* merged with apt--mvo

Patches applied:

 * bubulle@debian.org--2005/apt--main--0--patch-96
   Sync with Matt

 * bubulle@debian.org--2005/apt--main--0--patch-97
   Merge with Matt

 * bubulle@debian.org--2005/apt--main--0--patch-98
   Update PO files with the POT

 * bubulle@debian.org--2005/apt--main--0--patch-99
   Added Galician translation

 * bubulle@debian.org--2005/apt--main--0--patch-100
   Completed Danish translation

 * bubulle@debian.org--2005/apt--main--0--patch-101
   Merge with Matt

 * bubulle@debian.org--2005/apt--main--0--patch-102
   Merge with Michael Vogt's archive

 * bubulle@debian.org--2005/apt--main--0--patch-103
   Update the POT files and all PO files to resync with recent code

 * bubulle@debian.org--2005/apt--main--0--patch-104
   French translation completed

 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--base-0
   tag of apt@packages.debian.org/apt--main--0--patch-79

 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-1
   * merged with mainline and apt--fixes--0

 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-2
   * patch from aj (slighly modified to use auto_ptr<>) applied

 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-3
   * changelog updated

 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-4
   * work for arch=all packages too now

 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-5
   * merged with apt--main--0

 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-6
   * fixed a incorrect po/he.po merge

 * michael.vogt@ubuntu.com--2005/apt--cdrom-fallback--0--base-0
   tag of apt@packages.debian.org/apt--main--0--patch-110

 * michael.vogt@ubuntu.com--2005/apt--cdrom-fallback--0--patch-1
   * initial patch to make falling back from cdrom possible

 * michael.vogt@ubuntu.com--2005/apt--cdrom-fallback--0--patch-2
   * fix in methods/cdrom.cc: don't call Fail() but return false so that apt can fallback to a differencent source

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-7
   * fixed incorrect man-page example

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-8
   * changelog udpate

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-9
   * we only need to check once for xmlto

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-10
   * fix a bug in a man-page, fix a problem with overly long lines in apt-cdrom

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-11
   * merged with apt--main--0

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-12
   * fix a incorrect error message (it always added .gz regardless what was downloaded)

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-13
   * merged with main

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-14
   * added Hashsum support for file and cdrom 

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-15
   * added README.arch

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-16
   * merged with main

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-17
   * move the changelog to the right place

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-18
   * Change pkgPolicy::Pin from private to protected 

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-19
   * added a default constructor for PrvIterator 

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-20
   * applied otavios patch to reread the statusFile on debSystem::Initialize

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-33
   * merged with matt's tree

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-34
   * merged with matts tree

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-35
   * build debian and ubuntu package from the same source

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-36
   * added debian/patches dir

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-37
   * fix the breakage from my last commit (note to self: always, _always_ run baz diff before a commit)

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-38
   * removed the lsb_release build patch (nobody except me seems to like it)

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-39
   * merged from main

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-40
   * merged the apt--sane-handle-timeout--0 branch

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-41
   * merged apt--bts225947--0

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-42
   * merged with apt--main

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-43
   * added patch that adds a apt-secure man-page (thanks to jfs@computer.org)

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-44
   * added author credits

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-45
   * added apt-ftparchive.conf example

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-46
   * corrected the utf8 of javier fernandes pena

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-47
   * improve the timeout handling (again)

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-48
   * merged with apt--fixes--0

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-49
   * README.arch updates, comment in apt-pkg/algorithm.h added, apt-pkg/cacheiterators.h order in initlist changed to remove warning

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-50
   * meda-change message is send over status-fd now

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-51
   * include a human readable string for the MediaChange status-fd message as well

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-52
   * finalizing changelog

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-53
   * check ctime as well in cron.daily when cleaning up packages in apt.cron.daily

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-54
   * fix a stupid typo in apt.cron.daily

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-55
   * fix apt-pkg/cdrom.cc to umount the cdrom again if anything fails

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-56
   * merged from apt--cdrom-fallback--0

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-57
   * changelog update

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-58
   * better error string for a failed dpkg-source

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-59
   * make sure that the pkgRecords D'tor does not segfault

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-60
   * merged updated french man-page

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-61
   * merged with bubulle

 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--base-0
   tag of apt@packages.debian.org/apt--main--0--patch-87

 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-1
   * report timeouts (from Connect) and fail if they happen in pkgAcqMetaSig 

 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-2
   * merged with the fixes branch to make it build again

 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-3
   * merged with main

 * otavio@debian.org--2005/apt--fixes--0--patch-28
   Reread status configuration, needed for clients using independent apt ...

 * philippe.batailler@free.fr--2005/VOGTapt--mvo--0--patch-1
   French L10N update

 * philippe.batailler@free.fr--2005/VOGTapt--mvo--0--patch-2
   Generate correctly french manpages
Michael Vogt 21 lat temu
rodzic
commit
bb4fc0a9e4
75 zmienionych plików z 13959 dodań i 6360 usunięć
  1. 12 0
      README.arch
  2. 8 1
      README.progress-reporting
  3. 17 8
      apt-pkg/acquire-item.cc
  4. 3 2
      apt-pkg/acquire-item.h
  5. 1 1
      apt-pkg/acquire-method.cc
  6. 19 0
      apt-pkg/acquire-worker.cc
  7. 2 1
      apt-pkg/algorithms.h
  8. 3 1
      apt-pkg/cacheiterators.h
  9. 17 2
      apt-pkg/cdrom.cc
  10. 6 1
      apt-pkg/deb/debsystem.cc
  11. 4 1
      apt-pkg/pkgrecords.cc
  12. 1 0
      apt-pkg/pkgrecords.h
  13. 2 2
      apt-pkg/policy.h
  14. 10 4
      cmdline/acqprogress.cc
  15. 2 1
      cmdline/apt-get.cc
  16. 1 4
      configure.in
  17. 1 0
      debian/apt-utils.examples
  18. 10 4
      debian/apt.cron.daily
  19. 1 0
      debian/apt.manpages
  20. 41 3
      debian/changelog
  21. 1 0
      debian/rules
  22. 43 4
      doc/apt-key.8.xml
  23. 209 0
      doc/apt-secure.8.xml
  24. 1 1
      doc/apt.conf.5.xml
  25. 49 0
      doc/apt.ent
  26. 1 1
      doc/apt_preferences.5.xml
  27. 46 0
      doc/examples/apt-ftparchive.conf
  28. 2 2
      doc/fr/apt-config.fr.8.xml
  29. 39 5
      doc/fr/apt-key.fr.8.xml
  30. 217 0
      doc/fr/apt-secure.fr.8.xml
  31. 48 0
      doc/fr/apt.ent.fr
  32. 2 2
      doc/fr/apt_preferences.fr.5.xml
  33. 10 2
      doc/fr/makefile
  34. 2 1
      doc/makefile
  35. 6 1
      ftparchive/apt-ftparchive.cc
  36. 38 0
      ftparchive/override.cc
  37. 4 5
      ftparchive/override.h
  38. 33 22
      ftparchive/writer.cc
  39. 5 2
      ftparchive/writer.h
  40. 8 2
      methods/cdrom.cc
  41. 6 1
      methods/connect.cc
  42. 7 1
      methods/file.cc
  43. 310 179
      po/apt-all.pot
  44. 312 179
      po/bs.po
  45. 313 225
      po/ca.po
  46. 318 179
      po/cs.po
  47. 318 179
      po/cy.po
  48. 328 209
      po/da.po
  49. 318 196
      po/de.po
  50. 318 179
      po/el.po
  51. 314 179
      po/en_GB.po
  52. 320 201
      po/es.po
  53. 317 187
      po/eu.po
  54. 318 179
      po/fi.po
  55. 364 439
      po/fr.po
  56. 2691 0
      po/gl.po
  57. 313 179
      po/he.po
  58. 318 179
      po/hu.po
  59. 321 196
      po/it.po
  60. 318 179
      po/ja.po
  61. 318 179
      po/ko.po
  62. 318 179
      po/nb.po
  63. 318 179
      po/nl.po
  64. 318 179
      po/nn.po
  65. 318 179
      po/pl.po
  66. 318 187
      po/pt.po
  67. 318 187
      po/pt_BR.po
  68. 441 307
      po/ro.po
  69. 317 179
      po/ru.po
  70. 318 179
      po/sk.po
  71. 318 179
      po/sl.po
  72. 318 179
      po/sv.po
  73. 318 179
      po/tl.po
  74. 318 179
      po/zh_CN.po
  75. 318 179
      po/zh_TW.po

+ 12 - 0
README.arch

@@ -0,0 +1,12 @@
+
+You can build apt from arch, but this needs the following additional
+packages (in addtion to the usual build-depends):
+xmlto perlsgml sgml2x sgmlspl docbook
+
+then run:
+
+$ debian/rules arch-build
+
+that will build packages in the "debian/arch-build" directory. It will
+honor "DEB_BUILD_PROG_OPTS" as options that are passed to debuild (e.g. -S 
+may be usefull).

+ 8 - 1
README.progress-reporting

@@ -5,7 +5,7 @@ If the apt options: "APT::Status-Fd" is set, apt will send status
 reports to that fd. The status information is seperated with a ':', 
 reports to that fd. The status information is seperated with a ':', 
 there are the following status conditions:
 there are the following status conditions:
 
 
-status = {"pmstatus", "dlstatus", "conffile-prompt", "error" } 
+status = {"pmstatus", "dlstatus", "conffile-prompt", "error", "media-change" } 
 
 
 The reason for using a fd instead of a OpProgress class is that many
 The reason for using a fd instead of a OpProgress class is that many
 apt frontend fork a (vte) terminal for the actual installation.
 apt frontend fork a (vte) terminal for the actual installation.
@@ -47,6 +47,13 @@ pmconffile
 pmconffile:conffile:percent:'current-conffile' 'new-conffile' useredited distedited
 pmconffile:conffile:percent:'current-conffile' 'new-conffile' useredited distedited
 
 
 
 
+media-change
+------------
+media-change:medium:drive:human-readable string
+
+example:
+media-change: Ubuntu 5.10 _Breezy Badger_ - Alpha i386 (20050830):/cdrom/:Please insert the disc labeled: 'Ubuntu 5.10 _Breezy Badger_ - Alpha i386 (20050830)' in the drive '/cdrom/' and press enter.
+
 
 
 dlstatus
 dlstatus
 --------
 --------

+ 17 - 8
apt-pkg/acquire-item.cc

@@ -142,20 +142,21 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
 {
 {
    Decompression = false;
    Decompression = false;
    Erase = false;
    Erase = false;
-   
+
    DestFile = _config->FindDir("Dir::State::lists") + "partial/";
    DestFile = _config->FindDir("Dir::State::lists") + "partial/";
    DestFile += URItoFileName(URI);
    DestFile += URItoFileName(URI);
 
 
    if(comprExt.empty()) 
    if(comprExt.empty()) 
    {
    {
-      // autoselect 
-      if(FileExists("/usr/bin/bzip2"))
-	 Desc.URI = URI + ".bz2"; 
-      else
-	 Desc.URI = URI + ".gz"; 
+      // autoselect the compression method
+      if(FileExists("/usr/bin/bzip2")) 
+	 CompressionExtension = ".bz2";
+      else 
+	 CompressionExtension = ".gz";
    } else {
    } else {
-      Desc.URI = URI + comprExt; 
+      CompressionExtension = comprExt;
    }
    }
+   Desc.URI = URI + CompressionExtension; 
 
 
    Desc.Description = URIDesc;
    Desc.Description = URIDesc;
    Desc.Owner = this;
    Desc.Owner = this;
@@ -429,6 +430,13 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
    string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
    string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
    unlink(Final.c_str());
    unlink(Final.c_str());
 
 
+   // if we get a timeout if fail
+   if(LookupTag(Message,"FailReason") == "Timeout" || 
+      LookupTag(Message,"FailReason") == "TmpResolveFailure") {
+      Item::Failed(Message,Cnf);
+      return;
+   }
+
    // queue a pkgAcqMetaIndex with no sigfile
    // queue a pkgAcqMetaIndex with no sigfile
    new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
    new pkgAcqMetaIndex(Owner, MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
 		       "", IndexTargets, MetaIndexParser);
 		       "", IndexTargets, MetaIndexParser);
@@ -927,7 +935,8 @@ void pkgAcqArchive::Done(string Message,unsigned long Size,string Md5Hash,
       {
       {
 	 Status = StatError;
 	 Status = StatError;
 	 ErrorText = _("MD5Sum mismatch");
 	 ErrorText = _("MD5Sum mismatch");
-	 Rename(DestFile,DestFile + ".FAILED");
+	 if(FileExists(DestFile))
+	    Rename(DestFile,DestFile + ".FAILED");
 	 return;
 	 return;
       }
       }
    }
    }

+ 3 - 2
apt-pkg/acquire-item.h

@@ -92,7 +92,8 @@ class pkgAcqIndex : public pkgAcquire::Item
    pkgAcquire::ItemDesc Desc;
    pkgAcquire::ItemDesc Desc;
    string RealURI;
    string RealURI;
    string ExpectedMD5;
    string ExpectedMD5;
-   
+   string CompressionExtension;
+
    public:
    public:
    
    
    // Specialized action members
    // Specialized action members
@@ -100,7 +101,7 @@ class pkgAcqIndex : public pkgAcquire::Item
    virtual void Done(string Message,unsigned long Size,string Md5Hash,
    virtual void Done(string Message,unsigned long Size,string Md5Hash,
 		     pkgAcquire::MethodConfig *Cnf);
 		     pkgAcquire::MethodConfig *Cnf);
    virtual string Custom600Headers();
    virtual string Custom600Headers();
-   virtual string DescURI() {return RealURI + ".gz";};
+   virtual string DescURI() {return RealURI + CompressionExtension;};
 
 
    pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc,
    pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc,
 	       string ShortDesct, string ExpectedMD5, string compressExt="");
 	       string ShortDesct, string ExpectedMD5, string compressExt="");

+ 1 - 1
apt-pkg/acquire-method.cc

@@ -277,7 +277,7 @@ bool pkgAcqMethod::MediaFail(string Required,string Drive)
 	    MyMessages.erase(MyMessages.begin());
 	    MyMessages.erase(MyMessages.begin());
 	 }
 	 }
 
 
-	 return !StringToBool(LookupTag(Message,"Fail"),false);
+	 return !StringToBool(LookupTag(Message,"Failed"),false);
       }
       }
       
       
       Messages.push_back(Message);
       Messages.push_back(Message);

+ 19 - 0
apt-pkg/acquire-worker.cc

@@ -25,6 +25,7 @@
 #include <apti18n.h>
 #include <apti18n.h>
 
 
 #include <iostream>
 #include <iostream>
+#include <sstream>
 #include <fstream>
 #include <fstream>
     
     
 #include <sys/stat.h>
 #include <sys/stat.h>
@@ -367,6 +368,24 @@ bool pkgAcquire::Worker::Capabilities(string Message)
 /* */
 /* */
 bool pkgAcquire::Worker::MediaChange(string Message)
 bool pkgAcquire::Worker::MediaChange(string Message)
 {
 {
+   int status_fd = _config->FindI("APT::Status-Fd",-1);
+   if(status_fd > 0) 
+   {
+      string Media = LookupTag(Message,"Media");
+      string Drive = LookupTag(Message,"Drive"); 
+      ostringstream msg,status;
+      ioprintf(msg,_("Please insert the disc labeled: "
+		     "'%s' "
+		     "in the drive '%s' and press enter."),
+	       Media.c_str(),Drive.c_str());
+      status << "media-change: "  // message
+	     << Media  << ":"     // media
+	     << Drive  << ":"     // drive
+	     << msg.str()         // l10n message
+	     << endl;
+      write(status_fd, status.str().c_str(), status.str().size());
+   }
+
    if (Log == 0 || Log->MediaChange(LookupTag(Message,"Media"),
    if (Log == 0 || Log->MediaChange(LookupTag(Message,"Media"),
 				    LookupTag(Message,"Drive")) == false)
 				    LookupTag(Message,"Drive")) == false)
    {
    {

+ 2 - 1
apt-pkg/algorithms.h

@@ -118,7 +118,8 @@ class pkgProblemResolver
    
    
    // Try to resolve problems only by using keep
    // Try to resolve problems only by using keep
    bool ResolveByKeep();
    bool ResolveByKeep();
-   
+
+   // Install all protected packages   
    void InstallProtect();   
    void InstallProtect();   
    
    
    pkgProblemResolver(pkgDepCache *Cache);
    pkgProblemResolver(pkgDepCache *Cache);

+ 3 - 1
apt-pkg/cacheiterators.h

@@ -267,7 +267,7 @@ class pkgCache::PrvIterator
    void operator ++(int) {if (Prv != Owner->ProvideP) Prv = Owner->ProvideP +
    void operator ++(int) {if (Prv != Owner->ProvideP) Prv = Owner->ProvideP +
 	(Type == PrvVer?Prv->NextPkgProv:Prv->NextProvides);};
 	(Type == PrvVer?Prv->NextPkgProv:Prv->NextProvides);};
    inline void operator ++() {operator ++(0);};
    inline void operator ++() {operator ++(0);};
-   inline bool end() const {return Prv == Owner->ProvideP?true:false;};
+   inline bool end() const {return Owner == 0 || Prv == Owner->ProvideP?true:false;};
    
    
    // Comparison
    // Comparison
    inline bool operator ==(const PrvIterator &B) const {return Prv == B.Prv;};
    inline bool operator ==(const PrvIterator &B) const {return Prv == B.Prv;};
@@ -289,6 +289,8 @@ class pkgCache::PrvIterator
    inline PkgIterator OwnerPkg() {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[Prv->Version].ParentPkg);};
    inline PkgIterator OwnerPkg() {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[Prv->Version].ParentPkg);};
    inline unsigned long Index() const {return Prv - Owner->ProvideP;};
    inline unsigned long Index() const {return Prv - Owner->ProvideP;};
 
 
+   inline PrvIterator() : Prv(0), Type(PrvVer), Owner(0)  {};
+
    inline PrvIterator(pkgCache &Owner,Provides *Trg,Version *) :
    inline PrvIterator(pkgCache &Owner,Provides *Trg,Version *) :
           Prv(Trg), Type(PrvVer), Owner(&Owner) 
           Prv(Trg), Type(PrvVer), Owner(&Owner) 
    {
    {

+ 17 - 2
apt-pkg/cdrom.cc

@@ -446,6 +446,9 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
    {      
    {      
       F.getline(Buffer,sizeof(Buffer));
       F.getline(Buffer,sizeof(Buffer));
       CurLine++;
       CurLine++;
+      if (F.fail() && !F.eof())
+	 return _error->Error(_("Line %u too long in source list %s."),
+			      CurLine,File.c_str());
       _strtabexpand(Buffer,sizeof(Buffer));
       _strtabexpand(Buffer,sizeof(Buffer));
       _strstrip(Buffer);
       _strstrip(Buffer);
             
             
@@ -588,7 +591,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
    string DFile = _config->FindFile("Dir::State::cdroms");
    string DFile = _config->FindFile("Dir::State::cdroms");
    if (FileExists(DFile) == true)
    if (FileExists(DFile) == true)
    {
    {
-      if (ReadConfigFile(Database,DFile) == false)
+      if (ReadConfigFile(Database,DFile) == false) 
 	 return _error->Error("Unable to read the cdrom database %s",
 	 return _error->Error("Unable to read the cdrom database %s",
 			      DFile.c_str());
 			      DFile.c_str());
    }
    }
@@ -674,8 +677,11 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
       log->Update(msg.str(), STEP_SCAN);
       log->Update(msg.str(), STEP_SCAN);
    }
    }
 
 
-   if (List.size() == 0 && SourceList.size() == 0)
+   if (List.size() == 0 && SourceList.size() == 0) 
+   {
+      UnmountCdrom(CDROM);
       return _error->Error("Unable to locate any package files, perhaps this is not a Debian Disc");
       return _error->Error("Unable to locate any package files, perhaps this is not a Debian Disc");
+   }
 
 
    // Check if the CD is in the database
    // Check if the CD is in the database
    string Name;
    string Name;
@@ -711,7 +717,10 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
 	  Name.empty() == true)
 	  Name.empty() == true)
       {
       {
 	 if(!log) 
 	 if(!log) 
+         {
+	    UnmountCdrom(CDROM);
 	    return _error->Error("No disc name found and no way to ask for it");
 	    return _error->Error("No disc name found and no way to ask for it");
+	 }
 
 
 	 while(true) {
 	 while(true) {
 	    if(!log->AskCdromName(Name)) {
 	    if(!log->AskCdromName(Name)) {
@@ -786,7 +795,10 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
    {
    {
       string::size_type Space = (*I).find(' ');
       string::size_type Space = (*I).find(' ');
       if (Space == string::npos)
       if (Space == string::npos)
+      {
+	 UnmountCdrom(CDROM);
 	 return _error->Error("Internal error");
 	 return _error->Error("Internal error");
+      }
 
 
       if(log) {
       if(log) {
 	 msg.str("");
 	 msg.str("");
@@ -800,7 +812,10 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
    {
    {
       string::size_type Space = (*I).find(' ');
       string::size_type Space = (*I).find(' ');
       if (Space == string::npos)
       if (Space == string::npos)
+      {
+	 UnmountCdrom(CDROM);
 	 return _error->Error("Internal error");
 	 return _error->Error("Internal error");
+      }
 
 
       if(log) {
       if(log) {
 	 msg.str("");
 	 msg.str("");

+ 6 - 1
apt-pkg/deb/debsystem.cc

@@ -164,7 +164,12 @@ bool debSystem::Initialize(Configuration &Cnf)
    Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct
    Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct
    Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
    Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
    Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
    Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
-   
+
+   if (StatusFile) {
+     delete StatusFile;
+     StatusFile = 0;
+   }
+
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/

+ 4 - 1
apt-pkg/pkgrecords.cc

@@ -42,6 +42,9 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0)
       if (Files[I->ID] == 0)
       if (Files[I->ID] == 0)
 	 return;
 	 return;
    }   
    }   
+   // We store that to make sure that the destructor won't segfault,
+   // even if the Cache object was destructed before this instance.
+   PackageFileCount = Cache.HeaderP->PackageFileCount;
 }
 }
 									/*}}}*/
 									/*}}}*/
 // Records::~pkgRecords - Destructor					/*{{{*/
 // Records::~pkgRecords - Destructor					/*{{{*/
@@ -49,7 +52,7 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0)
 /* */
 /* */
 pkgRecords::~pkgRecords()
 pkgRecords::~pkgRecords()
 {
 {
-   for (unsigned I = 0; I != Cache.HeaderP->PackageFileCount; I++)
+   for (unsigned I = 0; I != PackageFileCount; I++)
       delete Files[I];
       delete Files[I];
    delete [] Files;
    delete [] Files;
 }
 }

+ 1 - 0
apt-pkg/pkgrecords.h

@@ -33,6 +33,7 @@ class pkgRecords
    
    
    pkgCache &Cache;
    pkgCache &Cache;
    Parser **Files;
    Parser **Files;
+   int PackageFileCount;
       
       
    public:
    public:
 
 

+ 2 - 2
apt-pkg/policy.h

@@ -45,6 +45,8 @@ using std::vector;
 
 
 class pkgPolicy : public pkgDepCache::Policy
 class pkgPolicy : public pkgDepCache::Policy
 {
 {
+   protected:
+
    struct Pin
    struct Pin
    {
    {
       pkgVersionMatch::MatchType Type;
       pkgVersionMatch::MatchType Type;
@@ -58,8 +60,6 @@ class pkgPolicy : public pkgDepCache::Policy
       string Pkg;
       string Pkg;
    };
    };
    
    
-   protected:
-   
    Pin *Pins;
    Pin *Pins;
    signed short *PFPriority;
    signed short *PFPriority;
    vector<Pin> Defaults;
    vector<Pin> Defaults;

+ 10 - 4
cmdline/acqprogress.cc

@@ -274,10 +274,16 @@ bool AcqTextStatus::MediaChange(string Media,string Drive)
 	    Media.c_str(),Drive.c_str());
 	    Media.c_str(),Drive.c_str());
 
 
    char C = 0;
    char C = 0;
+   bool bStatus = true;
    while (C != '\n' && C != '\r')
    while (C != '\n' && C != '\r')
-      read(STDIN_FILENO,&C,1);
-   
-   Update = true;
-   return true;
+   {
+      int len = read(STDIN_FILENO,&C,1);
+      if(C == 'c' || len <= 0)
+	 bStatus = false;
+   }
+
+   if(bStatus)
+      Update = true;
+   return bStatus;
 }
 }
 									/*}}}*/
 									/*}}}*/

+ 2 - 1
cmdline/apt-get.cc

@@ -1659,7 +1659,7 @@ bool DoInstall(CommandLine &CmdL)
    // See if we need to prompt
    // See if we need to prompt
    if (Cache->InstCount() == ExpectedInst && Cache->DelCount() == 0)
    if (Cache->InstCount() == ExpectedInst && Cache->DelCount() == 0)
       return InstallPackages(Cache,false,false);
       return InstallPackages(Cache,false,false);
-   
+
    return InstallPackages(Cache,false);   
    return InstallPackages(Cache,false);   
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -2013,6 +2013,7 @@ bool DoSource(CommandLine &CmdL)
 	    if (system(S) != 0)
 	    if (system(S) != 0)
 	    {
 	    {
 	       fprintf(stderr,_("Unpack command '%s' failed.\n"),S);
 	       fprintf(stderr,_("Unpack command '%s' failed.\n"),S);
+	       fprintf(stderr,_("Check if the 'dpkg-dev' package is installed.\n"));
 	       _exit(1);
 	       _exit(1);
 	    }	    
 	    }	    
 	 }
 	 }

+ 1 - 4
configure.in

@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 
 dnl -- SET THIS TO THE RELEASE VERSION --
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.6.40.2")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.41.1")
 PACKAGE="apt"
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)
 AC_SUBST(PACKAGE)
@@ -181,9 +181,6 @@ AC_PATH_PROG(DOCBOOK2MAN,docbook2man)
 dnl Check for the XML tools needed to build man pages
 dnl Check for the XML tools needed to build man pages
 AC_PATH_PROG(XMLTO,xmlto)
 AC_PATH_PROG(XMLTO,xmlto)
 
 
-dnl Check for the XML tools needed to build man pages
-AC_PATH_PROG(XMLTO,xmlto)
-
 dnl Check for YODL
 dnl Check for YODL
 dnl AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
 dnl AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
 
 

+ 1 - 0
debian/apt-utils.examples

@@ -0,0 +1 @@
+doc/examples/apt-ftparchive.conf

+ 10 - 4
debian/apt.cron.daily

@@ -95,9 +95,9 @@ check_size_constraints()
 
 
     # check age
     # check age
     if [ ! $MaxAge -eq 0 ] && [ ! $MinAge -eq 0 ]; then
     if [ ! $MaxAge -eq 0 ] && [ ! $MinAge -eq 0 ]; then
-	find $Cache -name "*.deb"  -mtime +$MaxAge -and -not -mtime -$MinAge -print0 | xargs -r -0 rm -f
+	find $Cache -name "*.deb"  \( -mtime +$MaxAge -and -ctime +$MaxAge \) -and -not \( -mtime -$MinAge -or -ctime -$MinAge \) -print0 | xargs -r -0 rm -f
     elif [ ! $MaxAge -eq 0 ]; then
     elif [ ! $MaxAge -eq 0 ]; then
-	find $Cache -name "*.deb"  -mtime +$MaxAge -print0 | xargs -r -0 rm -f
+	find $Cache -name "*.deb"  -ctime +$MaxAge -and -mtime +$MaxAge -print0 | xargs -r -0 rm -f
     fi
     fi
     
     
     # check size
     # check size
@@ -120,8 +120,14 @@ check_size_constraints()
 
 
 	    # check for MinAge of the file
 	    # check for MinAge of the file
 	    if [ ! $MinAge -eq 0 ]; then 
 	    if [ ! $MinAge -eq 0 ]; then 
-		mtime=$(date --date=$(date -r $file --iso-8601) +%s)
-		delta=$(($now-$mtime))
+		# check both ctime and mtime 
+		mtime=$(stat -c %Y $file)
+		ctime=$(stat -c %Z $file)
+		if [ $mtime -gt $ctime ]; then
+		    delta=$(($now-$mtime))
+		else
+		    delta=$(($now-$ctime))
+		fi
 		#echo "$file ($delta), $MinAge"
 		#echo "$file ($delta), $MinAge"
 		if [ $delta -le $MinAge ]; then
 		if [ $delta -le $MinAge ]; then
 		    #echo "Skiping $file (delta=$delta)"
 		    #echo "Skiping $file (delta=$delta)"

+ 1 - 0
debian/apt.manpages

@@ -3,6 +3,7 @@ doc/apt-cdrom.8
 doc/apt-config.8
 doc/apt-config.8
 doc/apt-get.8
 doc/apt-get.8
 doc/apt-key.8
 doc/apt-key.8
+doc/apt-secure.8
 doc/apt.8
 doc/apt.8
 doc/apt.conf.5
 doc/apt.conf.5
 doc/apt_preferences.5
 doc/apt_preferences.5

+ 41 - 3
debian/changelog

@@ -1,10 +1,48 @@
-apt (0.6.40.2) unstable; urgency=low
+apt (0.6.41.1) unstable; urgency=low
+
+  * apt-pkg/cdrom.cc:
+    - unmount the cdrom when apt failed to locate any package files
+  * allow cdrom failures and fallback to other sources in that case
+    (closes: #44135)
+  * better error text when dpkg-source fails 
+  * Merge bubulle@debian.org--2005/apt--main--0 up to patch-104:
+    - patch-99: Added Galician translation
+    - patch-100: Completed Danish translation (Closes: #325686)
+    - patch-104: French translation completed
+  * applied frensh man-page update (thanks to Philippe Batailler)
+  
+ -- 
+
+apt (0.6.41) unstable; urgency=low
 
 
   * improved the support for "error" and "conffile" reporting from
   * improved the support for "error" and "conffile" reporting from
     dpkg, added the format to README.progress-reporting
     dpkg, added the format to README.progress-reporting
   * added README.progress-reporting to the apt-doc package
   * added README.progress-reporting to the apt-doc package
-
- --
+  * improved the network timeout handling, if a index file from a 
+    sources.list times out or EAI_AGAIN is returned from getaddrinfo, 
+    don't try to get the other files from that entry
+  * Support architecture-specific extra overrides
+    (closes: #225947). Thanks to  Anthony Towns for idea and
+    the patch, thanks to Colin Watson for testing it.
+  * Javier Fernandez-Sanguino Pen~a:
+    - Added a first version of an apt-secure.8 manpage, and modified
+      apt-key and apt.end accordingly. Also added the 'update'
+      argument to apt-key which was previously not documented 
+      (Closes: #322120)
+  * Andreas Pakulat:
+    - added example apt-ftparchive.conf file to doc/examples 
+      (closes: #322483)
+  * Fix a incorrect example in the man-page (closes: #282918)
+  * Fix a bug for very long lines in the apt-cdrom code (closes: #280356)
+  * Fix a manual page bug (closes: #316314)
+  * Do md5sum checking for file and cdrom method (closes: #319142)
+  * Change pkgPolicy::Pin from private to protected to let subclasses
+    access it too (closes: #321799)
+  * add default constructor for PrvIterator (closes: #322267)
+  * Reread status configuration on debSystem::Initialize() 
+    (needed for apt-proxy, thanks to Otavio for this patch)
+  
+ -- Michael Vogt <mvo@debian.org>  Mon,  5 Sep 2005 22:59:03 +0200
 
 
 apt (0.6.40.1) unstable; urgency=low
 apt (0.6.40.1) unstable; urgency=low
 
 

+ 1 - 0
debian/rules

@@ -269,6 +269,7 @@ apt-utils: build debian/shlibs.local
 
 
 	cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/
 	cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/
 	dh_installdocs -p$@
 	dh_installdocs -p$@
+	dh_installexamples -p$@
 
 
 	# Install the man pages..
 	# Install the man pages..
 	dh_installman -p$@
 	dh_installman -p$@

+ 43 - 4
doc/apt-key.8.xml

@@ -68,17 +68,56 @@
      <para>
      <para>
 
 
        List trusted keys.
        List trusted keys.
+
      </para>
      </para>
 
 
      </listitem>
      </listitem>
      </varlistentry>
      </varlistentry>
+
+     <varlistentry><term>update</term>
+     <listitem>
+     <para>
+
+       Update the local keyring with the keyring of Debian archive
+       keys and removes from the keyring the archive keys which are no
+       longer valid.
+
+     </para>
+
+     </listitem>
+     </varlistentry>
+   </variablelist>
+</refsect1>
+
+ <refsect1><title>Files</title>
+   <variablelist>
+     <varlistentry><term><filename>/etc/apt/trusted.gpg</filename></term>
+     <listitem><para>Keyring of local trusted keys, new keys will be added here.</para></listitem>
+     </varlistentry>
+
+     <varlistentry><term><filename>/etc/apt/trustdb.gpg</filename></term>
+     <listitem><para>Local trust database of archive keys.</para></listitem>
+     </varlistentry>
+
+     <varlistentry><term><filename>/usr/share/keyrings/debian-archive-keyring.gpg</filename></term>
+     <listitem><para>Keyring of Debian archive trusted keys.</para></listitem>
+     </varlistentry>
+
+     <varlistentry><term><filename>/usr/share/keyrings/debian-archive-removed-keys.gpg</filename></term>
+     <listitem><para>Keyring of Debian archive removed trusted keys.</para></listitem>
+     </varlistentry>
+
+
+
    </variablelist>
    </variablelist>
+
 </refsect1>
 </refsect1>
 
 
-<!--  <refsect1><title>See Also</title> -->
-<!--    <para> -->
-<!--    &apt-conf;, &apt-get;, &sources-list; -->
-<!--  </refsect1> -->
+<refsect1><title>See Also</title>
+<para>
+&apt-get;, &apt-secure;
+</para>
+</refsect1>
 
 
  &manbugs;
  &manbugs;
  &manauthor;
  &manauthor;

+ 209 - 0
doc/apt-secure.8.xml

@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!ENTITY % aptent SYSTEM "apt.ent">
+%aptent;
+
+]>
+
+<refentry>
+ &apt-docinfo;
+ 
+ <refmeta>
+   <refentrytitle>apt-secure</refentrytitle>
+   <manvolnum>8</manvolnum>
+ </refmeta>
+
+<!-- NOTE: This manpage has been written based on the
+     Securing Debian Manual ("Debian Security
+     Infrastructure" chapter) and on documentation
+     available at the following sites:
+     http://wiki.debian.net/?apt06
+     http://www.syntaxpolice.org/apt-secure/
+     http://www.enyo.de/fw/software/apt-secure/
+-->
+<!-- TODO: write a more verbose example of how it works with 
+     a sample similar to 
+     http://www.debian-administration.org/articles/174
+     ?
+--> 
+
+ 
+ <!-- Man page title -->
+ <refnamediv>
+    <refname>apt-secure</refname>
+    <refpurpose>Archive authentication support for APT</refpurpose>
+ </refnamediv>
+
+ <refsect1><title>Description</title>
+   <para>
+   Starting with version 0.6, <command>apt</command> contains code
+   that does signature checking of the Release file for all
+   archives. This ensures that packages in the archive can't be
+   modified by people who have no access to the Release file signing
+   key.
+   </para>
+
+   <para>
+   If a package comes from a archive without a signature or with a
+   signature that apt does not have a key for that package is
+   considered untrusted and installing it will result in a big
+   warning. <command>apt-get</command> will currently only warn
+   for unsigned archives, future releases might force all sources
+   to be verified before downloading packages from them.
+   </para>
+
+   <para>
+   The package frontends &apt-get;, &aptitude; and &synaptic; support this new
+   authentication feature.
+   </para>
+</refsect1>
+
+ <refsect1><title>Trusted archives</title> 
+
+   <para> 
+   The chain of trust from an apt archive to the end user is made up of
+   different steps. <command>apt-secure</command> is the last step in
+   this chain, trusting an archive does not mean that the packages
+   that you trust it do not contain malicious code but means that you
+   trust the archive maintainer. Its the archive maintainer
+   responsibility to ensure that the archive integrity is correct.
+   </para>
+
+   <para>apt-secure does not review signatures at a
+   package level. If you require tools to do this you should look at
+   <command>debsig-verify</command> and
+   <command>debsign</command> (provided in the debsig-verify and
+   devscripts packages respectively).</para>
+
+   <para>
+   The chain of trust in Debian starts when a maintainer uploads a new
+   package or a new version of a package to the Debian archive. This
+   upload in order to become effective needs to be signed by a key of
+   a maintainer within the Debian maintainer's keyring (available in
+   the debian-keyring package). Maintainer's keys are signed by
+   other maintainers following pre-established procedures to
+   ensure the identity of the key holder.
+   </para>
+
+   <para>
+   Once the uploaded package is verified and included in the archive,
+   the maintainer signature is stripped off, an MD5 sum of the package
+   is computed and put in the Packages file. The MD5 sum of all of the
+   packages files are then computed and put into the Release file. The
+   Release file is then signed by the archive key (which is created
+   once a year and distributed through the FTP server. This key is
+   also on the Debian keyring.
+   </para>
+
+   <para>
+   Any end user can check the signature of the Release file, extract the MD5
+   sum of a package from it and compare it with the MD5 sum of the
+   package he downloaded. Prior to version 0.6 only the MD5 sum of the
+   downloaded Debian package was checked. Now both the MD5 sum and the
+   signature of the Release file are checked.
+   </para>
+
+   <para>Notice that this is distinct from checking signatures on a
+   per package basis. It is designed to prevent two possible attacks:
+   </para>
+
+    <itemizedlist>
+       <listitem><para><literal>Network "man in the middle"
+       attacks</literal>. Without signature checking, a malicious
+       agent can introduce himself in the package download process and
+       provide malicious software either by controlling a network
+       element (router, switch, etc.) or by redirecting traffic to a
+       rogue server (through arp or DNS spoofing
+       attacks).</para></listitem>
+ 
+       <listitem><para><literal>Mirror network compromise</literal>.
+        Without signature checking, a malicious agent can compromise a
+        mirror host and modify the files in it to propage malicious
+        software to all users downloading packages from that
+        host.</para></listitem>
+    </itemizedlist>
+
+   <para>However, it does not defend against a compromise of the
+   Debian master server itself (which signs the packages) or against a
+   compromise of the key used to sign the Release files. In any case,
+   this mechanism can complement a per-package signature.</para>
+</refsect1>
+
+ <refsect1><title>User configuration</title>
+   <para>
+   <command>apt-key</command> is the program that manages the list
+   of keys used by apt. It can be used to add or remove keys although
+   an installation of this release will automatically provide the
+   default Debian archive signing keys used in the Debian package
+   repositories.
+   </para>
+   <para>
+   In order to add a new key you need to first download it
+   (you should make sure you are using a trusted communication channel
+   when retrieving it), add it with <command>apt-key</command> and
+   then run <command>apt-get update</command> so that apt can download
+   and verify the <filename>Release.gpg</filename> files from the archives you
+   have configured.
+   </para>
+</refsect1>
+
+<refsect1><title>Archive configuration</title>
+   <para>
+   If you want to provide archive signatures in an archive under your
+   maintenance you have to:
+   </para>
+
+     <itemizedlist>
+       <listitem><para><literal>Create a toplevel Release
+       file</literal>.  if it does not exist already. You can do this
+       by running <command>apt-ftparchive release</command> 
+       (provided inftp apt-utils).</para></listitem>
+   
+      <listitem><para><literal>Sign it</literal>. You can do this by running
+      <command>gpg -abs -o Release.gpg Release</command>.</para></listitem>
+
+      <listitem><para><literal>Publish the key fingerprint</literal>,
+      that way your users will know what key they need to import in
+      order to authenticate the files in the
+      archive.</para></listitem>
+
+    </itemizedlist>
+
+    <para>Whenever the contents of the archive changes (new packages
+    are added or removed) the archive maintainer has to follow the
+    first two steps previously outlined.</para>
+
+</refsect1>
+
+<refsect1><title>See Also</title> 
+<para> 
+&apt-conf;, &apt-get;, &sources-list;, &apt-key;, &apt-archive;,
+&debsign; &debsig-verify;, &gpg;
+</para>
+
+<para>For more backgound information you might want to review the
+<ulink
+url="http://www.debian.org/doc/manuals/securing-debian-howto/ch7.en.html">Debian
+Security Infrastructure</ulink> chapter of the Securing Debian Manual
+(available also in the harden-doc package) and the
+<ulink url="http://www.cryptnet.net/fdp/crypto/strong_distro.html"
+>Strong Distribution HOWTO</ulink> by V. Alex Brennen.  </para>
+
+</refsect1>
+
+ &manbugs;
+ &manauthor;
+
+<refsect1><title>Manpage Authors</title> 
+
+<para>This man-page is based on the work of Javier Fernández-Sanguino
+Peña, Isaac Jones, Colin Walters, Florian Weimer and Michael Vogt.
+</para>
+
+</refsect1>
+ 
+
+</refentry>
+

+ 1 - 1
doc/apt.conf.5.xml

@@ -284,7 +284,7 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
    <literal>sourcelist</literal> gives the location of the sourcelist and 
    <literal>sourcelist</literal> gives the location of the sourcelist and 
    <literal>main</literal> is the default configuration file (setting has no effect,
    <literal>main</literal> is the default configuration file (setting has no effect,
    unless it is done from the config file specified by 
    unless it is done from the config file specified by 
-   <envar>APT_CONFIG</envar>.</para>
+   <envar>APT_CONFIG</envar>).</para>
 
 
    <para>The <literal>Dir::Parts</literal> setting reads in all the config fragments in 
    <para>The <literal>Dir::Parts</literal> setting reads in all the config fragments in 
    lexical order from the directory specified. After this is done then the
    lexical order from the directory specified. After this is done then the

+ 49 - 0
doc/apt.ent

@@ -44,6 +44,25 @@
   </citerefentry>"
   </citerefentry>"
 >
 >
 
 
+<!ENTITY apt-key "<citerefentry>
+    <refentrytitle><command>apt-key</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-secure "<citerefentry>
+    <refentrytitle>apt-secure</refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-archive "<citerefentry>
+    <refentrytitle><filename>apt-archive</filename></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+
 <!ENTITY sources-list "<citerefentry>
 <!ENTITY sources-list "<citerefentry>
     <refentrytitle><filename>sources.list</filename></refentrytitle>
     <refentrytitle><filename>sources.list</filename></refentrytitle>
     <manvolnum>5</manvolnum>
     <manvolnum>5</manvolnum>
@@ -91,6 +110,36 @@
     <manvolnum>8</manvolnum>
     <manvolnum>8</manvolnum>
   </citerefentry>"
   </citerefentry>"
 >
 >
+
+<!ENTITY aptitude "<citerefentry>
+    <refentrytitle><command>aptitude</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY synaptic "<citerefentry>
+    <refentrytitle><command>synaptic</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY debsign "<citerefentry>
+    <refentrytitle><command>debsign</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY debsig-verify "<citerefentry>
+    <refentrytitle><command>debsig-verify</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY gpg "<citerefentry>
+    <refentrytitle><command>gpg</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
     
     
 <!-- Boiler plate docinfo section -->
 <!-- Boiler plate docinfo section -->
 <!ENTITY apt-docinfo "
 <!ENTITY apt-docinfo "

+ 1 - 1
doc/apt_preferences.5.xml

@@ -183,7 +183,7 @@ belonging to any distribution whose Archive name is "<literal>unstable</literal>
 <programlisting>
 <programlisting>
 Package: *
 Package: *
 Pin: release a=unstable
 Pin: release a=unstable
-Pin-Priority: 50
+Pin-Priority: 500
 </programlisting>
 </programlisting>
 
 
 <simpara>The following record assigns a high priority to all package versions
 <simpara>The following record assigns a high priority to all package versions

+ 46 - 0
doc/examples/apt-ftparchive.conf

@@ -0,0 +1,46 @@
+// This config is for use with the pool-structure for the packages, thus we
+// don't use a Tree Section in here
+
+// The debian archive should be in the current working dir
+Dir {
+	ArchiveDir ".";
+	CacheDir ".";
+};
+
+// Create Packages, Packages.gz and Packages.bz2, remove what you don't need
+Default {
+	Packages::Compress ". gzip bzip2";
+	Sources::Compress ". gzip bzip2";
+	Contents::Compress ". gzip bzip2";
+};
+
+// Includes the main section. You can structure the directory tree under
+// ./pool/main any way you like, apt-ftparchive will take any deb (and
+// source package) it can find. This creates a Packages a Sources and a
+// Contents file for these in the main section of the sid release
+BinDirectory "pool/main" {
+	Packages "dists/sid/main/binary-i386/Packages";
+	SrcPackages "dists/sid/main/source/Sources";
+	Contents "dists/sid/Contents-i386";
+}
+
+// This is the same for the contrib section
+BinDirectory "pool/contrib" {
+	Packages "dists/sid/contrib/binary-i386/Packages";
+	SrcPackages "dists/sid/contrib/source/Sources";
+	Contents "dists/sid/Contents-i386";
+}
+
+// This is the same for the non-free section
+BinDirectory "pool/non-free" {
+	Packages "dists/sid/non-free/binary-i386/Packages";
+	SrcPackages "dists/sid/non-free/source/Sources";
+	Contents "dists/sid/Contents-i386";
+};
+
+// By default all Packages should have the extension ".deb"
+Default {
+	Packages {
+		Extensions ".deb";
+	};
+};

+ 2 - 2
doc/fr/apt-config.fr.8.xml

@@ -57,7 +57,7 @@ des commandes suivantes doit 
 <listitem><para>
 <listitem><para>
 Le terme shell est utilisé pour accéder aux informations de configuration
 Le terme shell est utilisé pour accéder aux informations de configuration
 depuis un script shell. Deux arguments doivent lui être donnés&nbsp;; le 
 depuis un script shell. Deux arguments doivent lui être donnés&nbsp;; le 
-premier est une variable de shell et le second une valeur de configuration à 
+premier est une variable du shell et le second une valeur de configuration à 
 demander.
 demander.
 La sortie standard consiste en une liste de commandes d'assignation de shell 
 La sortie standard consiste en une liste de commandes d'assignation de shell 
 pour chaque valeur présente. Dans un script shell, cette commande devrait
 pour chaque valeur présente. Dans un script shell, cette commande devrait
@@ -69,7 +69,7 @@ RES=`apt-config shell OPTS MyApp::Options`
 eval $RES
 eval $RES
 </programlisting></informalexample>
 </programlisting></informalexample>
 
 
-<para>La variable d'environnement de shell $OPTS sera définie par la valeur de
+<para>La variable d'environnement du shell $OPTS sera définie par la valeur de
 MyApp::Options ou, par défaut, la valeur -f.
 MyApp::Options ou, par défaut, la valeur -f.
      </para>
      </para>
 <para>
 <para>

+ 39 - 5
doc/fr/apt-key.fr.8.xml

@@ -34,7 +34,7 @@
    <para>
    <para>
    <command>apt-key</command> gère les clés dont se sert apt pour
    <command>apt-key</command> gère les clés dont se sert apt pour
 authentifier les paquets. Les paquets authentifiés par ces clés seront
 authentifier les paquets. Les paquets authentifiés par ces clés seront
-réputés 
+réputés fiables. 
    </para>
    </para>
 </refsect1>
 </refsect1>
 
 
@@ -73,13 +73,47 @@ Afficher la liste des cl
 
 
      </listitem>
      </listitem>
      </varlistentry>
      </varlistentry>
+
+     <varlistentry><term>update</term>
+     <listitem>
+     <para>
+Mettre à jour le trousseau de clés local avec le trousseau de clés de l'archive
+Debian et supprimer les clés qui sont périmées.
+</para>
+	</listitem>
+      </varlistentry>
+
    </variablelist>
    </variablelist>
 </refsect1>
 </refsect1>
 
 
-<!--  <refsect1><title>See Also</title> -->
-<!--    <para> -->
-<!--    &apt-conf;, &apt-get;, &sources-list; -->
-<!--  </refsect1> -->
+ <refsect1><title>Fichiers</title>
+   <variablelist>
+     <varlistentry><term><filename>/etc/apt/trusted.gpg</filename></term>
+<listitem><para>Trousseau de clés locales fiables, les nouvelles clés sont ajoutées ici.</para>
+</listitem>
+     </varlistentry>
+
+     <varlistentry><term><filename>/etc/apt/trustdb.gpg</filename></term>
+     <listitem><para>Base de données locale fiable des clés de l'archive.</para></listitem>
+     </varlistentry>
+
+   <varlistentry><term><filename>/usr/share/keyrings/debian-archive-keyring.gpg</filename></term>
+     <listitem><para>Trousseau des clés fiables de l'archive Debian.</para></listitem>
+     </varlistentry>
+
+     <varlistentry><term><filename>/usr/share/keyrings/debian-archive-removed-keys.gpg</filename>
+</term>
+    <listitem><para>>Trousseau des clés fiables supprimées de l'archive Debian.</para></listitem>
+     </varlistentry>
+
+   </variablelist>
+  </refsect1>
+
+<refsect1><title>Voir aussi</title>
+<para>
+&apt-get;, &apt-secure;
+</para>
+</refsect1>
 
 
  &manbugs;
  &manbugs;
  &manauthor;
  &manauthor;

+ 217 - 0
doc/fr/apt-secure.fr.8.xml

@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="iso-8859-15" standalone="no"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!ENTITY % aptent SYSTEM "apt.ent.fr">
+%aptent;
+
+]>
+
+<refentry lang="fr">
+ &apt-docinfo;
+ 
+ <refmeta>
+   <refentrytitle>apt-secure</refentrytitle>
+   <manvolnum>8</manvolnum>
+ </refmeta>
+
+<!-- NOTE: This manpage has been written based on the
+     Securing Debian Manual ("Debian Security
+     Infrastructure" chapter) and on documentation
+     available at the following sites:
+     http://wiki.debian.net/?apt06
+     http://www.syntaxpolice.org/apt-secure/
+     http://www.enyo.de/fw/software/apt-secure/
+-->
+<!-- TODO: write a more verbose example of how it works with 
+     a sample similar to 
+     http://www.debian-administration.org/articles/174
+     ?
+--> 
+
+ 
+ <!-- Man page title -->
+ <refnamediv>
+    <refname>apt-secure</refname>
+    <refpurpose>Certification d'archive avec APT</refpurpose>
+ </refnamediv>
+
+ <refsect1><title>Description</title>
+   <para>
+   Depuis sa version 0.6, <command>apt</command> sait vérifier 
+la signature du fichier Release de chaque archive. On s'assure ainsi que les
+paquets de cette archive ne peuvent pas être modifiés par quelqu'un qui ne 
+possède pas la clé de la signature du fichier Release.
+   </para>
+
+   <para>
+   Quand un paquet provient d'une archive sans signature ou d'une archive avec 
+une signature dont apt ne possède pas la clé, ce paquet n'est pas considéré 
+comme fiable et son installation provoquera un avertissement. Pour 
+l'instant, <command>apt-get</command> ne signale que les archives sans 
+signature&nbsp;; les prochaines versions pourraient rendre obligatoire la 
+vérification des sources avant tout téléchargement de paquet.
+   </para>
+
+   <para>
+   Les paquets &apt-get;, &aptitude; et &synaptic; possèdent cette nouvelle 
+fonction de certification. 
+
+   </para>
+</refsect1>
+
+ <refsect1><title>Archives fiables</title> 
+
+   <para> 
+   D'une archive apt jusqu'à l'utilisateur, la confiance se construit en 
+plusieurs étapes. <command>Apt-secure</command> est la dernière étape. Faire 
+confiance à une archive ne signifie pas que les paquets qu'elle contient 
+sont exempts de code malveillant, mais signifie que vous faites confiance au 
+responsable de l'archive. C'est ensuite au responsable de l'archive de faire 
+en sorte que l'archive soit fiable. 
+
+   </para>
+
+   <para><command>Apt-secure</command> n'examine pas la signature d'un 
+paquet. Certains programmes peuvent le faire comme 
+<command>debsig-verify</command> ou <command>debsign</command>, qu'on peut 
+trouver dans les paquets debsig-verify et devscripts.
+</para>
+
+   <para>
+   La fiabilisation dans Debian commence quand un responsable de paquet envoie 
+un nouveau paquet ou une nouvelle version d'un paquet dans l'archive. Cet 
+envoi, pour être effectif, doit être signé avec la clé d'un responsable qui 
+se trouve dans le trousseau des responsables Debian (disponible dans le 
+paquet debian-keyring). Les clés des responsables de paquet sont signées par 
+d'autres responsables, suivant des procédures préétablies pour s'assurer de 
+l'identité des propriétaires de la clé.
+
+   </para>
+
+   <para>
+   Une fois le paquet vérifié et archivé, la signature du responsable est 
+enlevée, une somme MD5 du paquet est calculée et mise dans le fichier 
+Packages. Une somme MD5 de tous les paquets est ensuite calculée et mise 
+dans le fichier Release. Ce fichier est signé par la clé de l'archive. Cette 
+clé qui est créée chaque année et distribuée par le serveur FTP se trouve 
+aussi dans le trousseau Debian.
+
+   </para>
+
+   <para>
+   Un utilisateur peut consulter la signature du fichier Release, extraire la 
+somme MD5 d'un paquet et la comparer avec la somme du paquet qu'il a 
+téléchargé. Avant la version 0.6, seule la somme du paquet téléchargé était 
+vérifiée. Maintenant on peut vérifier aussi la signature du fichier Release.
+
+   </para>
+
+   <para>Cette façon de faire est différente d'une vérification de la signature d'un 
+paquet. Elle vise à empêcher deux types d'attaque possibles&nbsp;: 
+
+   </para>
+
+    <itemizedlist>
+       <listitem><para>
+L'attaque de type <quote>homme au milieu</quote>. Sans vérification de 
+signature, quelqu'un de malveillant peut s'introduire au milieu du 
+processus de téléchargement et insérer du code soit en contrôlant un élément 
+du réseau, routeur, commutateur, etc. soit en détournant le trafic vers un 
+serveur fourbe (par usurpation d'adresses).
+</para></listitem>
+ 
+       <listitem><para>
+L'attaque par compromission d'un miroir sur le réseau.  Sans vérification de 
+signature, quelqu'un de malveillant peut compromettre un miroir et modifier 
+les fichiers. Ainsi tous ceux qui téléchargent les paquets de ce miroir 
+propagent du code malveillant.
+</para></listitem>
+    </itemizedlist>
+
+   <para>
+Cependant cette méthode ne garantit pas contre une compromission du serveur 
+Debian lui-même (qui signe les paquets) ni contre la compromission de la clé 
+qui sert à signer les fichiers Release. Mais elle peut compléter la 
+signature des paquets.
+</para>
+</refsect1>
+
+ <refsect1><title>Configuration</title>
+   <para>
+   Le programme qui gère la liste des clés utilisées par apt s'appelle 
+<command>apt-key</command>. Il peut ajouter ou supprimer des clés. Cette 
+version installe automatiquement les clés qui servent à signer l'archive 
+Debian et les différents répertoires de paquets. 
+
+   </para>
+   <para>
+   Pour ajouter une clé, vous devez d'abord la télécharger. Il vaut mieux 
+utiliser un canal fiable pour ce téléchargement. Ensuite vous l'ajoutez avec 
+la commande <command>apt-key</command> et vous lancez la commande 
+<command>apt-get update</command> pour télécharger et vérifier le fichier 
+<filename>Release.gpg</filename> de l'archive que vous avez configurée.
+
+   </para>
+</refsect1>
+
+<refsect1><title>Configuration d'une archive</title>
+   <para>
+   Si vous voulez signer les archives dont vous avez la responsabilité, vous 
+devez&nbsp;:
+
+   </para>
+
+     <itemizedlist>
+       <listitem><para>créer un fichier Release à la racine de l'archive, s'il n'existe pas 
+déjà. Vous pouvez le créer avec la commande <command>apt-ftparchive release</command> 
+(fournie dans le paquet apt-utils)&nbsp;;
+</para></listitem>
+   
+      <listitem><para>
+le signer, avec la commande <command>gpg -abs -o Release.gpg Release</command>&nbsp;;
+</para></listitem>
+
+      <listitem><para>
+publier l'empreinte de la clé. Ainsi les utilisateurs de votre archive 
+connaîtront la clé qu'ils doivent importer pour authentifier les fichiers de 
+l'archive.
+</para></listitem>
+
+    </itemizedlist>
+
+    <para>Chaque fois que le contenu de l'archive change, le responsable doit refaire 
+les deux premières étapes.
+</para>
+
+</refsect1>
+
+<refsect1><title>Voir aussi</title> 
+<para> 
+&apt-conf;, &apt-get;,&sources-list;, &apt-key;, &apt-archive;, &debsign;, 
+&debsig-verify;, &gpg;
+
+</para>
+
+<para>Pour des informations plus substantielles, vous pouvez consulter 
+<ulink url="http://www.debian.org/doc/manuals/securing-debian-howto/ch7.en.html">
+l'infrastructure debian pour la sécurité</ulink> un chapitre du manuel Debian sur la sécurité 
+(disponible dans le paquet harden-doc) et le 
+<ulink url="http://www.cryptnet.net/fdp/crypto/strong_distro.html">Strong Distribution HOWTO</ulink> par V. Alex Brennen.
+  </para>
+
+</refsect1>
+
+ &manbugs;
+ &manauthor;
+
+<refsect1><title>Auteurs</title> 
+
+<para>
+Cette page a été écrite à partir des travaux de Javier Fernández-Sanguino Peña, Isaac 
+Jones, Colin Walters, Florian Weimer et Michael Vogt.
+</para>
+  </refsect1>
+&traducteur;
+ 
+</refentry>

+ 48 - 0
doc/fr/apt.ent.fr

@@ -42,6 +42,24 @@
     <manvolnum>5</manvolnum>
     <manvolnum>5</manvolnum>
   </citerefentry>">
   </citerefentry>">
 
 
+<!ENTITY apt-key "<citerefentry>
+    <refentrytitle><command>apt-key</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-secure "<citerefentry>
+    <refentrytitle>apt-secure</refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-archive "<citerefentry>
+    <refentrytitle><filename>apt-archive</filename></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
 <!ENTITY sources-list "<citerefentry>
 <!ENTITY sources-list "<citerefentry>
     <refentrytitle><filename>sources.list</filename></refentrytitle>
     <refentrytitle><filename>sources.list</filename></refentrytitle>
     <manvolnum>5</manvolnum>
     <manvolnum>5</manvolnum>
@@ -89,6 +107,36 @@
     <manvolnum>8</manvolnum>
     <manvolnum>8</manvolnum>
   </citerefentry>">
   </citerefentry>">
     
     
+<!ENTITY aptitude "<citerefentry>
+    <refentrytitle><command>aptitude</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY synaptic "<citerefentry>
+    <refentrytitle><command>synaptic</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY debsign "<citerefentry>
+    <refentrytitle><command>debsign</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY debsig-verify "<citerefentry>
+    <refentrytitle><command>debsig-verify</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY gpg "<citerefentry>
+    <refentrytitle><command>gpg</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
 <!-- Boiler plate docinfo section -->
 <!-- Boiler plate docinfo section -->
 <!ENTITY apt-docinfo "
 <!ENTITY apt-docinfo "
  <refentryinfo>
  <refentryinfo>

+ 2 - 2
doc/fr/apt_preferences.fr.5.xml

@@ -7,7 +7,7 @@
 
 
 ]>
 ]>
 
 
-<refentry>
+<refentry lang="fr">
 
 
  <refentryinfo>
  <refentryinfo>
    &apt-author.team;
    &apt-author.team;
@@ -208,7 +208,7 @@ d'
 <programlisting>
 <programlisting>
 Package: *
 Package: *
 Pin: release a=unstable
 Pin: release a=unstable
-Pin-Priority: 50
+Pin-Priority: 500
 </programlisting>
 </programlisting>
 
 
 <simpara>L'entrée suivante affecte une priorité haute à toutes les versions
 <simpara>L'entrée suivante affecte une priorité haute à toutes les versions

+ 10 - 2
doc/fr/makefile

@@ -5,11 +5,16 @@ SUBDIR=doc/fr
 # Bring in the default rules
 # Bring in the default rules
 include ../../buildlib/defaults.mak
 include ../../buildlib/defaults.mak
 
 
+# Do not use XMLTO, build the manpages directly with XSLTPROC
+XSLTPROC=/usr/bin/xsltproc
+STYLESHEET=/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
+
+
 # Man pages
 # Man pages
 SOURCE = apt-cache.fr.8 apt-get.fr.8 apt-cdrom.fr.8 apt.conf.fr.5 \
 SOURCE = apt-cache.fr.8 apt-get.fr.8 apt-cdrom.fr.8 apt.conf.fr.5 \
          sources.list.fr.5 apt-config.fr.8 apt-sortpkgs.fr.1 \
          sources.list.fr.5 apt-config.fr.8 apt-sortpkgs.fr.1 \
 	 apt-ftparchive.fr.1 apt_preferences.fr.5 apt-extracttemplates.fr.1 \
 	 apt-ftparchive.fr.1 apt_preferences.fr.5 apt-extracttemplates.fr.1 \
-	 apt-key.fr.8
+	 apt-key.fr.8 apt-secure.fr.8
 
 
 INCLUDES = apt.ent.fr
 INCLUDES = apt.ent.fr
 
 
@@ -17,7 +22,7 @@ doc: $(SOURCE)
 
 
 $(SOURCE) ::  % : %.xml $(INCLUDES)
 $(SOURCE) ::  % : %.xml $(INCLUDES)
 	echo Creating man page $@
 	echo Creating man page $@
-	$(XMLTO) man $<
+	$(XSLTPROC) -o $@ $(STYLESHEET) $<
 
 
 apt-cache.fr.8:: apt-cache.8 
 apt-cache.fr.8:: apt-cache.8 
 	cp $< $@
 	cp $< $@
@@ -52,4 +57,7 @@ apt-extracttemplates.fr.1:: apt-extracttemplates.1
 apt-key.fr.8:: apt-key.8 
 apt-key.fr.8:: apt-key.8 
 	cp $< $@
 	cp $< $@
 
 
+apt-secure.fr.8:: apt-secure.8 
+	cp $< $@
+
 
 

+ 2 - 1
doc/makefile

@@ -14,7 +14,8 @@ include $(DEBIANDOC_H)
 # XML man pages
 # XML man pages
 SOURCE = apt-cache.8 apt-get.8 apt-cdrom.8 apt.conf.5 sources.list.5 \
 SOURCE = apt-cache.8 apt-get.8 apt-cdrom.8 apt.conf.5 sources.list.5 \
          apt-config.8 apt_preferences.5  \
          apt-config.8 apt_preferences.5  \
-         apt-sortpkgs.1 apt-ftparchive.1 apt-extracttemplates.1 apt-key.8
+         apt-sortpkgs.1 apt-ftparchive.1 apt-extracttemplates.1 \
+	 apt-key.8 apt-secure.8
 INCLUDES = apt.ent	 
 INCLUDES = apt.ent	 
 include $(XML_MANPAGE_H)
 include $(XML_MANPAGE_H)
 
 

+ 6 - 1
ftparchive/apt-ftparchive.cc

@@ -56,6 +56,9 @@ struct PackageMap
    string BinCacheDB;
    string BinCacheDB;
    string BinOverride;
    string BinOverride;
    string ExtraOverride;
    string ExtraOverride;
+
+   // We generate for this given arch
+   string Arch;
    
    
    // Stuff for the Source File
    // Stuff for the Source File
    string SrcFile;
    string SrcFile;
@@ -158,7 +161,8 @@ bool PackageMap::GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats)
    // Create a package writer object.
    // Create a package writer object.
    PackagesWriter Packages(flCombine(CacheDir,BinCacheDB),
    PackagesWriter Packages(flCombine(CacheDir,BinCacheDB),
 			   flCombine(OverrideDir,BinOverride),
 			   flCombine(OverrideDir,BinOverride),
-			   flCombine(OverrideDir,ExtraOverride));
+			   flCombine(OverrideDir,ExtraOverride),
+			   Arch);
    if (PkgExt.empty() == false && Packages.SetExts(PkgExt) == false)
    if (PkgExt.empty() == false && Packages.SetExts(PkgExt) == false)
       return _error->Error(_("Package extension list is too long"));
       return _error->Error(_("Package extension list is too long"));
    if (_error->PendingError() == true)
    if (_error->PendingError() == true)
@@ -489,6 +493,7 @@ void LoadTree(vector<PackageMap> &PkgList,Configuration &Setup)
 	       Itm.BaseDir = SubstVar(Block.Find("Directory",DDir.c_str()),Vars);
 	       Itm.BaseDir = SubstVar(Block.Find("Directory",DDir.c_str()),Vars);
 	       Itm.PkgFile = SubstVar(Block.Find("Packages",DPkg.c_str()),Vars);
 	       Itm.PkgFile = SubstVar(Block.Find("Packages",DPkg.c_str()),Vars);
 	       Itm.Tag = SubstVar("$(DIST)/$(SECTION)/$(ARCH)",Vars);
 	       Itm.Tag = SubstVar("$(DIST)/$(SECTION)/$(ARCH)",Vars);
+	       Itm.Arch = Arch;
 	       Itm.Contents = SubstVar(Block.Find("Contents",DContents.c_str()),Vars);
 	       Itm.Contents = SubstVar(Block.Find("Contents",DContents.c_str()),Vars);
 	       Itm.ContentsHead = SubstVar(Block.Find("Contents::Header",DContentsH.c_str()),Vars);
 	       Itm.ContentsHead = SubstVar(Block.Find("Contents::Header",DContentsH.c_str()),Vars);
 	       Itm.FLFile = SubstVar(Block.Find("FileList",DFLFile.c_str()),Vars);
 	       Itm.FLFile = SubstVar(Block.Find("FileList",DFLFile.c_str()),Vars);

+ 38 - 0
ftparchive/override.cc

@@ -207,6 +207,44 @@ bool Override::ReadExtraOverride(string File,bool Source)
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/
+
+// Override::GetItem - Get a architecture specific item 	/*{{{*/
+// ---------------------------------------------------------------------
+/* Returns a override item for the given package and the given architecture.
+ * Treats "all" special
+ */
+Override::Item* Override::GetItem(string Package, string Architecture)
+{
+   map<string,Item>::iterator I = Mapping.find(Package);
+   map<string,Item>::iterator J = Mapping.find(Package + "/" + Architecture);
+
+   if (I == Mapping.end() && J == Mapping.end())
+   {
+      return 0;
+   }
+
+   Item *result = new Item;
+   if (I == Mapping.end()) *result = J->second;
+   else
+   {
+      *result = I->second;
+      if (J != Mapping.end())
+      {
+	 Item *R = &J->second;
+	 if (R->Priority != "") result->Priority = R->Priority;
+	 if (R->OldMaint != "") result->OldMaint = R->OldMaint;
+	 if (R->NewMaint != "") result->NewMaint = R->NewMaint;
+	 for (map<string,string>::iterator foI = R->FieldOverride.begin();
+	      foI != R->FieldOverride.end(); foI++)
+         {
+	    result->FieldOverride[foI->first] = foI->second;
+	 }
+      } 
+   } 
+   return result;
+};
+
+
 // Override::Item::SwapMaint - Swap the maintainer field if necessary	/*{{{*/
 // Override::Item::SwapMaint - Swap the maintainer field if necessary	/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* Returns the new maintainer string after evaluating the rewriting rule. If
 /* Returns the new maintainer string after evaluating the rewriting rule. If

+ 4 - 5
ftparchive/override.h

@@ -34,17 +34,16 @@ class Override
 
 
       map<string,string> FieldOverride;
       map<string,string> FieldOverride;
       string SwapMaint(string Orig,bool &Failed);
       string SwapMaint(string Orig,bool &Failed);
+      ~Item() {};
    };
    };
    
    
    map<string,Item> Mapping;
    map<string,Item> Mapping;
    
    
    inline Item *GetItem(string Package) 
    inline Item *GetItem(string Package) 
    {
    {
-      map<string,Item>::iterator I = Mapping.find(Package);
-      if (I == Mapping.end())
-	 return 0;
-      return &I->second;
-   };
+      return GetItem(Package, "");
+   }
+   Item *GetItem(string Package, string Architecture);
    
    
    bool ReadOverride(string File,bool Source = false);
    bool ReadOverride(string File,bool Source = false);
    bool ReadExtraOverride(string File,bool Source = false);
    bool ReadExtraOverride(string File,bool Source = false);

+ 33 - 22
ftparchive/writer.cc

@@ -36,7 +36,6 @@
 #include "apt-ftparchive.h"
 #include "apt-ftparchive.h"
 #include "multicompress.h"
 #include "multicompress.h"
 									/*}}}*/
 									/*}}}*/
-
 using namespace std;
 using namespace std;
 FTWScanner *FTWScanner::Owner;
 FTWScanner *FTWScanner::Owner;
 
 
@@ -285,8 +284,9 @@ bool FTWScanner::Delink(string &FileName,const char *OriginalPath,
 // PackagesWriter::PackagesWriter - Constructor				/*{{{*/
 // PackagesWriter::PackagesWriter - Constructor				/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
-PackagesWriter::PackagesWriter(string DB,string Overrides,string ExtOverrides) :
-		    Db(DB),Stats(Db.Stats)
+PackagesWriter::PackagesWriter(string DB,string Overrides,string ExtOverrides,
+			       string aArch) :
+   Db(DB),Stats(Db.Stats), Arch(aArch)
 {
 {
    Output = stdout;
    Output = stdout;
    SetExts(".deb .udeb .foo .bar .baz");
    SetExts(".deb .udeb .foo .bar .baz");
@@ -371,14 +371,22 @@ bool PackagesWriter::DoPackage(string FileName)
    // Lookup the overide information
    // Lookup the overide information
    pkgTagSection &Tags = Db.Control.Section;
    pkgTagSection &Tags = Db.Control.Section;
    string Package = Tags.FindS("Package");
    string Package = Tags.FindS("Package");
-   Override::Item Tmp;
-   Override::Item *OverItem = Over.GetItem(Package);
+   string Architecture;
+   // if we generate a Packages file for a given arch, we use it to
+   // look for overrides. if we run in "simple" mode without the 
+   // "Architecures" variable in the config we use the architecure value
+   // from the deb file
+   if(Arch != "")
+      Architecture = Arch;
+   else
+      Architecture = Tags.FindS("Architecture");
+   auto_ptr<Override::Item> OverItem(Over.GetItem(Package,Architecture));
    
    
    if (Package.empty() == true)
    if (Package.empty() == true)
       return _error->Error(_("Archive had no package field"));
       return _error->Error(_("Archive had no package field"));
-   
+
    // If we need to do any rewriting of the header do it now..
    // If we need to do any rewriting of the header do it now..
-   if (OverItem == 0)
+   if (OverItem.get() == 0)
    {
    {
       if (NoOverride == false)
       if (NoOverride == false)
       {
       {
@@ -386,9 +394,9 @@ bool PackagesWriter::DoPackage(string FileName)
 	 ioprintf(c1out, _("  %s has no override entry\n"), Package.c_str());
 	 ioprintf(c1out, _("  %s has no override entry\n"), Package.c_str());
       }
       }
       
       
-      OverItem = &Tmp;
-      Tmp.FieldOverride["Section"] = Tags.FindS("Section");
-      Tmp.Priority = Tags.FindS("Priority");
+      OverItem = auto_ptr<Override::Item>(new Override::Item);
+      OverItem->FieldOverride["Section"] = Tags.FindS("Section");
+      OverItem->Priority = Tags.FindS("Priority");
    }
    }
 
 
    char Size[40];
    char Size[40];
@@ -557,7 +565,7 @@ bool SourcesWriter::DoPackage(string FileName)
    string BestPrio;
    string BestPrio;
    string Bins = Tags.FindS("Binary");
    string Bins = Tags.FindS("Binary");
    char Buffer[Bins.length() + 1];
    char Buffer[Bins.length() + 1];
-   Override::Item *OverItem = 0;
+   auto_ptr<Override::Item> OverItem(0);
    if (Bins.empty() == false)
    if (Bins.empty() == false)
    {
    {
       strcpy(Buffer,Bins.c_str());
       strcpy(Buffer,Bins.c_str());
@@ -570,10 +578,10 @@ bool SourcesWriter::DoPackage(string FileName)
       unsigned char BestPrioV = pkgCache::State::Extra;
       unsigned char BestPrioV = pkgCache::State::Extra;
       for (unsigned I = 0; BinList[I] != 0; I++)
       for (unsigned I = 0; BinList[I] != 0; I++)
       {
       {
-	 Override::Item *Itm = BOver.GetItem(BinList[I]);
-	 if (Itm == 0)
+	 auto_ptr<Override::Item> Itm(BOver.GetItem(BinList[I]));
+	 if (Itm.get() == 0)
 	    continue;
 	    continue;
-	 if (OverItem == 0)
+	 if (OverItem.get() == 0)
 	    OverItem = Itm;
 	    OverItem = Itm;
 
 
 	 unsigned char NewPrioV = debListParser::GetPrio(Itm->Priority);
 	 unsigned char NewPrioV = debListParser::GetPrio(Itm->Priority);
@@ -586,8 +594,7 @@ bool SourcesWriter::DoPackage(string FileName)
    }
    }
    
    
    // If we need to do any rewriting of the header do it now..
    // If we need to do any rewriting of the header do it now..
-   Override::Item Tmp;   
-   if (OverItem == 0)
+   if (OverItem.get() == 0)
    {
    {
       if (NoOverride == false)
       if (NoOverride == false)
       {
       {
@@ -595,15 +602,19 @@ bool SourcesWriter::DoPackage(string FileName)
 	 ioprintf(c1out, _("  %s has no override entry\n"), Tags.FindS("Source").c_str());
 	 ioprintf(c1out, _("  %s has no override entry\n"), Tags.FindS("Source").c_str());
       }
       }
       
       
-      OverItem = &Tmp;
+      OverItem = auto_ptr<Override::Item>(new Override::Item);
    }
    }
    
    
-   Override::Item *SOverItem = SOver.GetItem(Tags.FindS("Source"));
-   if (SOverItem == 0)
+   auto_ptr<Override::Item> SOverItem(SOver.GetItem(Tags.FindS("Source")));
+   const auto_ptr<Override::Item> autoSOverItem(SOverItem);
+   if (SOverItem.get() == 0)
    {
    {
-      SOverItem = BOver.GetItem(Tags.FindS("Source"));
-      if (SOverItem == 0)
-	 SOverItem = OverItem;
+      SOverItem = auto_ptr<Override::Item>(BOver.GetItem(Tags.FindS("Source")));
+      if (SOverItem.get() == 0)
+      {
+	 SOverItem = auto_ptr<Override::Item>(new Override::Item);
+	 *SOverItem = *OverItem;
+      }
    }
    }
    
    
    // Add the dsc to the files hash list
    // Add the dsc to the files hash list

+ 5 - 2
ftparchive/writer.h

@@ -92,13 +92,15 @@ class PackagesWriter : public FTWScanner
    string DirStrip;
    string DirStrip;
    FILE *Output;
    FILE *Output;
    struct CacheDB::Stats &Stats;
    struct CacheDB::Stats &Stats;
-   
+   string Arch;
+
    inline bool ReadOverride(string File) {return Over.ReadOverride(File);};
    inline bool ReadOverride(string File) {return Over.ReadOverride(File);};
    inline bool ReadExtraOverride(string File) 
    inline bool ReadExtraOverride(string File) 
       {return Over.ReadExtraOverride(File);};
       {return Over.ReadExtraOverride(File);};
    virtual bool DoPackage(string FileName);
    virtual bool DoPackage(string FileName);
 
 
-   PackagesWriter(string DB,string Overrides,string ExtOverrides=string());
+   PackagesWriter(string DB,string Overrides,string ExtOverrides=string(),
+		  string Arch=string());
    virtual ~PackagesWriter() {};
    virtual ~PackagesWriter() {};
 };
 };
 
 
@@ -170,6 +172,7 @@ protected:
       string SHA1;
       string SHA1;
       // Limited by FileFd::Size()
       // Limited by FileFd::Size()
       unsigned long size;
       unsigned long size;
+      ~CheckSum() {};
    };
    };
    map<string,struct CheckSum> CheckSums;
    map<string,struct CheckSum> CheckSums;
 };
 };

+ 8 - 2
methods/cdrom.cc

@@ -13,6 +13,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>
@@ -165,8 +166,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
       if (MediaFail(Get.Host,CDROM) == false)
       if (MediaFail(Get.Host,CDROM) == false)
       {
       {
 	 CurrentID = "FAIL";
 	 CurrentID = "FAIL";
-	 Fail(_("Wrong CD-ROM"),true);
-	 return true;
+	 return _error->Error(_("Disk not found."));
       }
       }
    }
    }
    
    
@@ -180,6 +180,12 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
       CurrentID = NewID;
       CurrentID = NewID;
    Res.LastModified = Buf.st_mtime;
    Res.LastModified = Buf.st_mtime;
    Res.Size = Buf.st_size;
    Res.Size = Buf.st_size;
+
+   Hashes Hash;
+   FileFd Fd(Res.Filename, FileFd::ReadOnly);
+   Hash.AddFD(Fd.Fd(), Fd.Size());
+   Res.TakeHashes(Hash);
+
    URIDone(Res);
    URIDone(Res);
    return true;
    return true;
 }
 }

+ 6 - 1
methods/connect.cc

@@ -88,9 +88,11 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
    
    
    /* This implements a timeout for connect by opening the connection
    /* This implements a timeout for connect by opening the connection
       nonblocking */
       nonblocking */
-   if (WaitFd(Fd,true,TimeOut) == false)
+   if (WaitFd(Fd,true,TimeOut) == false) {
+      Owner->SetFailExtraMsg("\nFailReason: Timeout");
       return _error->Error(_("Could not connect to %s:%s (%s), "
       return _error->Error(_("Could not connect to %s:%s (%s), "
 			   "connection timed out"),Host.c_str(),Service,Name);
 			   "connection timed out"),Host.c_str(),Service,Name);
+   }
 
 
    // Check the socket for an error condition
    // Check the socket for an error condition
    unsigned int Err;
    unsigned int Err;
@@ -164,8 +166,11 @@ bool Connect(string Host,int Port,const char *Service,int DefPort,int &Fd,
 	    }
 	    }
 	    
 	    
 	    if (Res == EAI_AGAIN)
 	    if (Res == EAI_AGAIN)
+	    {
+	       Owner->SetFailExtraMsg("\nFailReason: TmpResolveFailure");
 	       return _error->Error(_("Temporary failure resolving '%s'"),
 	       return _error->Error(_("Temporary failure resolving '%s'"),
 				    Host.c_str());
 				    Host.c_str());
+	    }
 	    return _error->Error(_("Something wicked happened resolving '%s:%s' (%i)"),
 	    return _error->Error(_("Something wicked happened resolving '%s:%s' (%i)"),
 				 Host.c_str(),ServStr,Res);
 				 Host.c_str(),ServStr,Res);
 	 }
 	 }

+ 7 - 1
methods/file.cc

@@ -15,6 +15,8 @@
 // Include Files							/*{{{*/
 // Include Files							/*{{{*/
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/hashes.h>
+#include <apt-pkg/fileutl.h>
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>
@@ -75,7 +77,11 @@ bool FileMethod::Fetch(FetchItem *Itm)
    
    
    if (Res.Filename.empty() == true)
    if (Res.Filename.empty() == true)
       return _error->Error(_("File not found"));
       return _error->Error(_("File not found"));
-   
+
+   Hashes Hash;
+   FileFd Fd(Res.Filename, FileFd::ReadOnly);
+   Hash.AddFD(Fd.Fd(), Fd.Size());
+   Res.TakeHashes(Hash);
    URIDone(Res);
    URIDone(Res);
    return true;
    return true;
 }
 }

Plik diff jest za duży
+ 310 - 179
po/apt-all.pot


Plik diff jest za duży
+ 312 - 179
po/bs.po


Plik diff jest za duży
+ 313 - 225
po/ca.po


Plik diff jest za duży
+ 318 - 179
po/cs.po


Plik diff jest za duży
+ 318 - 179
po/cy.po


Plik diff jest za duży
+ 328 - 209
po/da.po


Plik diff jest za duży
+ 318 - 196
po/de.po


Plik diff jest za duży
+ 318 - 179
po/el.po


Plik diff jest za duży
+ 314 - 179
po/en_GB.po


Plik diff jest za duży
+ 320 - 201
po/es.po


Plik diff jest za duży
+ 317 - 187
po/eu.po


Plik diff jest za duży
+ 318 - 179
po/fi.po


Plik diff jest za duży
+ 364 - 439
po/fr.po


Plik diff jest za duży
+ 2691 - 0
po/gl.po


Plik diff jest za duży
+ 313 - 179
po/he.po


Plik diff jest za duży
+ 318 - 179
po/hu.po


Plik diff jest za duży
+ 321 - 196
po/it.po


Plik diff jest za duży
+ 318 - 179
po/ja.po


Plik diff jest za duży
+ 318 - 179
po/ko.po


Plik diff jest za duży
+ 318 - 179
po/nb.po


Plik diff jest za duży
+ 318 - 179
po/nl.po


Plik diff jest za duży
+ 318 - 179
po/nn.po


Plik diff jest za duży
+ 318 - 179
po/pl.po


Plik diff jest za duży
+ 318 - 187
po/pt.po


Plik diff jest za duży
+ 318 - 187
po/pt_BR.po


Plik diff jest za duży
+ 441 - 307
po/ro.po


Plik diff jest za duży
+ 317 - 179
po/ru.po


Plik diff jest za duży
+ 318 - 179
po/sk.po


Plik diff jest za duży
+ 318 - 179
po/sl.po


Plik diff jest za duży
+ 318 - 179
po/sv.po


Plik diff jest za duży
+ 318 - 179
po/tl.po


Plik diff jest za duży
+ 318 - 179
po/zh_CN.po


Plik diff jest za duży
+ 318 - 179
po/zh_TW.po