Explorar el Código

merged from debian-sid branch

Michael Vogt hace 15 años
padre
commit
61153c284c
Se han modificado 96 ficheros con 23661 adiciones y 16546 borrados
  1. 11 7
      apt-pkg/acquire-item.cc
  2. 4 4
      apt-pkg/acquire.cc
  3. 19 10
      apt-pkg/algorithms.cc
  4. 22 3
      apt-pkg/contrib/fileutl.cc
  5. 1 1
      apt-pkg/contrib/fileutl.h
  6. 2 2
      apt-pkg/contrib/strutl.cc
  7. 13 9
      apt-pkg/deb/debindexfile.cc
  8. 6 0
      apt-pkg/deb/deblistparser.cc
  9. 1 1
      apt-pkg/deb/dpkgpm.cc
  10. 12 1
      apt-pkg/depcache.cc
  11. 1 1
      apt-pkg/depcache.h
  12. 1 1
      apt-pkg/indexcopy.cc
  13. 1 2
      apt-pkg/init.cc
  14. 1 1
      apt-pkg/init.h
  15. 3 3
      apt-pkg/packagemanager.cc
  16. 1 0
      apt-pkg/pkgcache.cc
  17. 1 1
      apt-pkg/pkgcache.h
  18. 5 4
      apt-pkg/policy.cc
  19. 2 2
      buildlib/debiandoc.mak
  20. 1 1
      buildlib/po4a_manpage.mak
  21. 2 2
      cmdline/apt-cache.cc
  22. 12 0
      cmdline/apt-get.cc
  23. 2 0
      cmdline/apt-key
  24. 1 1
      configure.in
  25. 15 28
      debian/apt.cron.daily
  26. 147 15
      debian/changelog
  27. 1 1
      debian/control
  28. 292 590
      doc/po/de.po
  29. 328 590
      doc/po/es.po
  30. 32 29
      doc/po/fr.po
  31. 795 1854
      doc/po/ja.po
  32. 6 1
      ftparchive/apt-ftparchive.cc
  33. 11 8
      ftparchive/writer.cc
  34. 3 6
      methods/bzip2.cc
  35. 3 6
      methods/gzip.cc
  36. 279 267
      po/apt-all.pot
  37. 279 267
      po/ar.po
  38. 300 288
      po/ast.po
  39. 279 267
      po/bg.po
  40. 279 267
      po/bs.po
  41. 461 395
      po/ca.po
  42. 279 267
      po/cs.po
  43. 279 267
      po/cy.po
  44. 769 1048
      po/da.po
  45. 443 419
      po/de.po
  46. 279 267
      po/dz.po
  47. 279 267
      po/el.po
  48. 279 267
      po/es.po
  49. 279 267
      po/eu.po
  50. 279 267
      po/fi.po
  51. 279 269
      po/fr.po
  52. 279 267
      po/gl.po
  53. 2 2
      po/he.po
  54. 279 267
      po/hu.po
  55. 285 273
      po/it.po
  56. 279 267
      po/ja.po
  57. 279 267
      po/km.po
  58. 279 267
      po/ko.po
  59. 279 267
      po/ku.po
  60. 279 267
      po/lt.po
  61. 279 267
      po/mr.po
  62. 799 755
      po/nb.po
  63. 279 267
      po/ne.po
  64. 281 269
      po/nl.po
  65. 279 267
      po/nn.po
  66. 279 267
      po/pl.po
  67. 280 268
      po/pt.po
  68. 279 267
      po/pt_BR.po
  69. 279 267
      po/ro.po
  70. 280 268
      po/ru.po
  71. 279 267
      po/sk.po
  72. 279 267
      po/sl.po
  73. 279 267
      po/sv.po
  74. 279 267
      po/th.po
  75. 279 267
      po/tl.po
  76. 279 267
      po/uk.po
  77. 544 536
      po/vi.po
  78. 279 274
      po/zh_CN.po
  79. 279 267
      po/zh_TW.po
  80. 30 0
      test/integration/Packages-bug-598669-install-postfix-gets-exim-heavy
  81. 12 0
      test/integration/Packages-policy-pinning
  82. 1819 0
      test/integration/Packages-ubuntu-bug-614993
  83. 27 1
      test/integration/framework
  84. 1 1
      test/integration/run-tests
  85. 30 0
      test/integration/status-bug-598669-install-postfix-gets-exim-heavy
  86. 5894 0
      test/integration/status-ubuntu-bug-614993
  87. 33 9
      test/integration/test-autoremove
  88. 1 1
      test/integration/test-bug-590438-broken-provides-thanks-to-remove-order
  89. 5 5
      test/integration/test-bug-591882-conkeror
  90. 91 0
      test/integration/test-bug-595691-empty-and-broken-archive-files
  91. 19 0
      test/integration/test-bug-598669-install-postfix-gets-exim-heavy
  92. 1 1
      test/integration/test-compressed-indexes
  93. 1 1
      test/integration/test-disappearing-packages
  94. 1 1
      test/integration/test-pdiff-usage
  95. 228 0
      test/integration/test-policy-pinning
  96. 59 0
      test/integration/test-ubuntu-bug-614993

+ 11 - 7
apt-pkg/acquire-item.cc

@@ -1060,12 +1060,6 @@ void pkgAcqMetaIndex::Done(string Message,unsigned long Size,string Hash,	/*{{{*
 
       // all cool, move Release file into place
       Complete = true;
-
-      string FinalFile = _config->FindDir("Dir::State::lists");
-      FinalFile += URItoFileName(RealURI);
-      Rename(DestFile,FinalFile);
-      chmod(FinalFile.c_str(),0644);
-      DestFile = FinalFile;
    }
    else
    {
@@ -1092,8 +1086,18 @@ void pkgAcqMetaIndex::Done(string Message,unsigned long Size,string Hash,	/*{{{*
          Desc.URI = "gpgv:" + SigFile;
          QueueURI(Desc);
          Mode = "gpgv";
+	 return;
       }
    }
+
+   if (Complete == true)
+   {
+      string FinalFile = _config->FindDir("Dir::State::lists");
+      FinalFile += URItoFileName(RealURI);
+      Rename(DestFile,FinalFile);
+      chmod(FinalFile.c_str(),0644);
+      DestFile = FinalFile;
+   }
 }
 									/*}}}*/
 void pkgAcqMetaIndex::RetrievalDone(string Message)			/*{{{*/
@@ -1323,7 +1327,7 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 	 Status = StatTransientNetworkError;
 	 _error->Warning(_("A error occurred during the signature "
 			   "verification. The repository is not updated "
-			   "and the previous index files will be used."
+			   "and the previous index files will be used. "
 			   "GPG error: %s: %s\n"),
 			 Desc.Description.c_str(),
 			 LookupTag(Message,"Message").c_str());

+ 4 - 4
apt-pkg/acquire.cc

@@ -74,12 +74,12 @@ bool pkgAcquire::Setup(pkgAcquireStatus *Progress, string const &Lock)
    string const archivesDir = _config->FindDir("Dir::Cache::Archives");
    string const partialArchivesDir = archivesDir + "partial/";
 
-   if (CheckDirectory(_config->FindDir("Dir::State"), partialListDir) == false &&
-       CheckDirectory(listDir, partialListDir) == false)
+   if (CreateAPTDirectoryIfNeeded(_config->FindDir("Dir::State"), partialListDir) == false &&
+       CreateAPTDirectoryIfNeeded(listDir, partialListDir) == false)
       return _error->Errno("Acquire", _("List directory %spartial is missing."), listDir.c_str());
 
-   if (CheckDirectory(_config->FindDir("Dir::Cache"), partialArchivesDir) == false &&
-       CheckDirectory(archivesDir, partialArchivesDir) == false)
+   if (CreateAPTDirectoryIfNeeded(_config->FindDir("Dir::Cache"), partialArchivesDir) == false &&
+       CreateAPTDirectoryIfNeeded(archivesDir, partialArchivesDir) == false)
       return _error->Errno("Acquire", _("Archives directory %spartial is missing."), archivesDir.c_str());
 
    if (Lock.empty() == true || _config->FindB("Debug::NoLocking", false) == true)

+ 19 - 10
apt-pkg/algorithms.cc

@@ -987,6 +987,23 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
 	       pkgCache::VerIterator Ver(Cache,*V);
 	       pkgCache::PkgIterator Pkg = Ver.ParentPkg();
 
+               /* This is a conflicts, and the version we are looking
+                  at is not the currently selected version of the 
+                  package, which means it is not necessary to 
+                  remove/keep */
+               if (Cache[Pkg].InstallVer != Ver &&
+                   (Start->Type == pkgCache::Dep::Conflicts ||
+                    Start->Type == pkgCache::Dep::DpkgBreaks ||
+                    Start->Type == pkgCache::Dep::Obsoletes)) 
+               {
+                  if (Debug) 
+                     clog << "  Conflicts//Breaks against version " 
+                          << Ver.VerStr() << " for " << Pkg.Name() 
+                          << " but that is not InstVer, ignoring"
+                          << endl;
+                  continue;
+               }
+
 	       if (Debug == true)
 		  clog << "  Considering " << Pkg.FullName(false) << ' ' << (int)Scores[Pkg->ID] <<
 		  " as a solution to " << I.FullName(false) << ' ' << (int)Scores[I->ID] << endl;
@@ -1069,22 +1086,14 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
 	       }
 	       else
 	       {
-		  /* This is a conflicts, and the version we are looking
-		     at is not the currently selected version of the 
-		     package, which means it is not necessary to 
-		     remove/keep */
-		  if (Cache[Pkg].InstallVer != Ver &&
-		      (Start->Type == pkgCache::Dep::Conflicts ||
-		       Start->Type == pkgCache::Dep::Obsoletes))
-		     continue;
-
 		  if (Start->Type == pkgCache::Dep::DpkgBreaks)
 		  {
 		     // first, try upgradring the package, if that
 		     // does not help, the breaks goes onto the
 		     // kill list
+                     //
 		     // FIXME: use DoUpgrade(Pkg) instead?
-		     if (Cache[End] & pkgDepCache::DepGCVer) 
+		     if (Cache[End] & pkgDepCache::DepGCVer)
 		     {
 			if (Debug)
 			   clog << "  Upgrading " << Pkg.FullName(false) << " due to Breaks field in " << I.FullName(false) << endl;

+ 22 - 3
apt-pkg/contrib/fileutl.cc

@@ -251,11 +251,11 @@ bool CreateDirectory(string const &Parent, string const &Path)
    return true;
 }
 									/*}}}*/
-// CheckDirectory - ensure that the given directory exists		/*{{{*/
+// CreateAPTDirectoryIfNeeded - ensure that the given directory exists		/*{{{*/
 // ---------------------------------------------------------------------
 /* a small wrapper around CreateDirectory to check if it exists and to
    remove the trailing "/apt/" from the parent directory if needed */
-bool CheckDirectory(string const &Parent, string const &Path)
+bool CreateAPTDirectoryIfNeeded(string const &Parent, string const &Path)
 {
    if (DirectoryExists(Path) == true)
       return true;
@@ -915,8 +915,27 @@ unsigned long FileFd::Tell()
 /* */
 unsigned long FileFd::Size()
 {
-   //TODO: For gz, do we need the actual file size here or the uncompressed length?
    struct stat Buf;
+   long size;
+   off_t orig_pos;
+
+   if (gz)
+   {
+       /* unfortunately zlib.h doesn't provide a gzsize(), so we have to do
+	* this ourselves; the original (uncompressed) file size is the last 32
+	* bits of the file */
+       orig_pos = lseek(iFd, 0, SEEK_CUR);
+       if (lseek(iFd, -4, SEEK_END) < 0)
+	   return _error->Errno("lseek","Unable to seek to end of gzipped file");
+       if (read(iFd, &size, 4) != 4)
+	   return _error->Errno("read","Unable to read original size of gzipped file");
+       size &= 0xFFFFFFFF;
+
+       if (lseek(iFd, orig_pos, SEEK_SET) < 0)
+	   return _error->Errno("lseek","Unable to seek in gzipped file");
+       return size;
+   }
+
    if (fstat(iFd,&Buf) != 0)
       return _error->Errno("fstat","Unable to determine the file size");
    return Buf.st_size;

+ 1 - 1
apt-pkg/contrib/fileutl.h

@@ -101,7 +101,7 @@ bool CreateDirectory(string const &Parent, string const &Path);
  *  /apt/ will be removed before CreateDirectory call.
  *  \param Path which should exist after (successful) call
  */
-bool CheckDirectory(string const &Parent, string const &Path);
+bool CreateAPTDirectoryIfNeeded(string const &Parent, string const &Path);
 
 std::vector<string> GetListOfFilesInDir(string const &Dir, string const &Ext,
 					bool const &SortList, bool const &AllowNoExt=false);

+ 2 - 2
apt-pkg/contrib/strutl.cc

@@ -340,13 +340,13 @@ string SizeToStr(double Size)
    {
       if (ASize < 100 && I != 0)
       {
-         sprintf(S,"%'.1f%c",ASize,Ext[I]);
+         sprintf(S,"%'.1f %c",ASize,Ext[I]);
 	 break;
       }
       
       if (ASize < 10000)
       {
-         sprintf(S,"%'.0f%c",ASize,Ext[I]);
+         sprintf(S,"%'.0f %c",ASize,Ext[I]);
 	 break;
       }
       ASize /= 1000.0;

+ 13 - 9
apt-pkg/deb/debindexfile.cc

@@ -149,10 +149,11 @@ bool debSourcesIndex::Exists() const
 /* */
 unsigned long debSourcesIndex::Size() const
 {
-   struct stat S;
-   if (stat(IndexFile("Sources").c_str(),&S) != 0)
+   FileFd f = FileFd (IndexFile("Sources"), FileFd::ReadOnlyGzip);
+
+   if (f.Failed())
       return 0;
-   return S.st_size;
+   return f.Size();
 }
 									/*}}}*/
 
@@ -268,10 +269,11 @@ bool debPackagesIndex::Exists() const
 /* This is really only used for progress reporting. */
 unsigned long debPackagesIndex::Size() const
 {
-   struct stat S;
-   if (stat(IndexFile("Packages").c_str(),&S) != 0)
+   FileFd f = FileFd (IndexFile("Packages"), FileFd::ReadOnlyGzip);
+
+   if (f.Failed())
       return 0;
-   return S.st_size;
+   return f.Size();
 }
 									/*}}}*/
 // PackagesIndex::Merge - Load the index file into a cache		/*{{{*/
@@ -458,10 +460,12 @@ bool debTranslationsIndex::Exists() const
 /* This is really only used for progress reporting. */
 unsigned long debTranslationsIndex::Size() const
 {
-   struct stat S;
-   if (stat(IndexFile(Language).c_str(),&S) != 0)
+   FileFd f = FileFd (IndexFile(Language), FileFd::ReadOnlyGzip);
+
+   if (f.Failed())
       return 0;
-   return S.st_size;
+
+   return f.Size();
 }
 									/*}}}*/
 // TranslationsIndex::Merge - Load the index file into a cache		/*{{{*/

+ 6 - 0
apt-pkg/deb/deblistparser.cc

@@ -815,6 +815,12 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
    if (Section.FindFlag("NotAutomatic",FileI->Flags,
 			pkgCache::Flag::NotAutomatic) == false)
       _error->Warning("Bad NotAutomatic flag");
+   if (Section.FindFlag("ButAutomaticUpgrades",FileI->Flags,
+			pkgCache::Flag::ButAutomaticUpgrades) == false)
+      _error->Warning("Bad ButAutomaticUpgrades flag");
+   // overrule the NotAutomatic setting if needed as they are both present for compatibility
+   else if ((FileI->Flags & pkgCache::Flag::ButAutomaticUpgrades) == pkgCache::Flag::ButAutomaticUpgrades)
+      FileI->Flags &= ~pkgCache::Flag::NotAutomatic;
 
    return !_error->PendingError();
 }

+ 1 - 1
apt-pkg/deb/dpkgpm.cc

@@ -641,7 +641,7 @@ void pkgDPkgPM::WriteHistoryTag(string const &tag, string value)
 bool pkgDPkgPM::OpenLog()
 {
    string const logdir = _config->FindDir("Dir::Log");
-   if(CheckDirectory(logdir, logdir) == false)
+   if(CreateAPTDirectoryIfNeeded(logdir, logdir) == false)
       // FIXME: use a better string after freeze
       return _error->Error(_("Directory '%s' missing"), logdir.c_str());
 

+ 12 - 1
apt-pkg/depcache.cc

@@ -1192,6 +1192,16 @@ bool pkgDepCache::IsDeleteOk(PkgIterator const &Pkg,bool rPurge,
 	 std::clog << OutputInDepth(Depth) << "Hold prevents MarkDelete of " << Pkg << " FU=" << FromUser << std::endl;
       return false;
    }
+   else if (FromUser == false && Pkg->CurrentVer == 0)
+   {
+      StateCache &P = PkgState[Pkg->ID];
+      if (P.InstallVer != 0 && P.Status == 2 && (P.Flags & Flag::Auto) != Flag::Auto)
+      {
+	 if (DebugMarker == true)
+	    std::clog << OutputInDepth(Depth) << "Manual install request prevents MarkDelete of " << Pkg << std::endl;
+	 return false;
+      }
+   }
    return true;
 }
 									/*}}}*/
@@ -1615,7 +1625,8 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator const &Pk
 
 	 /* Stash the highest version of a not-automatic source, we use it
 	    if there is nothing better */
-	 if ((J.File()->Flags & Flag::NotAutomatic) != 0)
+	 if ((J.File()->Flags & Flag::NotAutomatic) != 0 ||
+	     (J.File()->Flags & Flag::ButAutomaticUpgrades) != 0)
 	 {
 	    if (Last.end() == true)
 	       Last = I;

+ 1 - 1
apt-pkg/depcache.h

@@ -189,7 +189,7 @@ class pkgDepCache : protected pkgCache::Namespace
      DefaultRootSetFunc() : Configuration::MatchAgainstConfig("APT::NeverAutoRemove") {};
      virtual ~DefaultRootSetFunc() {};
 
-     bool InRootSet(const pkgCache::PkgIterator &pkg) { return pkg.end() == true && Match(pkg.Name()); };
+     bool InRootSet(const pkgCache::PkgIterator &pkg) { return pkg.end() == false && Match(pkg.Name()); };
    };
 
    struct StateCache

+ 1 - 1
apt-pkg/indexcopy.cc

@@ -666,7 +666,7 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG,
 {
    string const gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv");
    // FIXME: remove support for deprecated APT::GPGV setting
-   string const trustedFile = _config->FindFile("Dir::Etc::Trusted");
+   string const trustedFile = _config->Find("APT::GPGV::TrustedKeyring", _config->FindFile("Dir::Etc::Trusted"));
    string const trustedPath = _config->FindDir("Dir::Etc::TrustedParts");
 
    bool const Debug = _config->FindB("Debug::Acquire::gpgv", false);

+ 1 - 2
apt-pkg/init.cc

@@ -70,8 +70,7 @@ bool pkgInitConfig(Configuration &Cnf)
    Cnf.Set("Dir::Etc::parts","apt.conf.d");
    Cnf.Set("Dir::Etc::preferences","preferences");
    Cnf.Set("Dir::Etc::preferencesparts","preferences.d");
-   string const deprecated = _config->Find("APT::GPGV::TrustedKeyring");
-   Cnf.Set("Dir::Etc::trusted", deprecated.empty() ? "trusted.gpg" : deprecated);
+   Cnf.Set("Dir::Etc::trusted", "trusted.gpg");
    Cnf.Set("Dir::Etc::trustedparts","trusted.gpg.d");
    Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods");
    Cnf.Set("Dir::Media::MountPath","/media/apt");

+ 1 - 1
apt-pkg/init.h

@@ -23,7 +23,7 @@
 // See also buildlib/libversion.mak
 #define APT_PKG_MAJOR 4
 #define APT_PKG_MINOR 10
-#define APT_PKG_RELEASE 0
+#define APT_PKG_RELEASE 1
     
 extern const char *pkgVersion;
 extern const char *pkgLibVersion;

+ 3 - 3
apt-pkg/packagemanager.cc

@@ -328,7 +328,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
 
    // Sanity Check
    if (List->IsFlag(Pkg,pkgOrderList::Configured) == false)
-      return _error->Error(_("Could not perform immediate configuration on '%s'."
+      return _error->Error(_("Could not perform immediate configuration on '%s'. "
 			"Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.Name(),1);
 
    return true;
@@ -492,7 +492,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
       List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
       if (List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
 	 if (SmartConfigure(Pkg) == false)
-	    return _error->Error(_("Could not perform immediate configuration on already unpacked '%s'."
+	    return _error->Error(_("Could not perform immediate configuration on already unpacked '%s'. "
 			"Please see man 5 apt.conf under APT::Immediate-Configure for details."),Pkg.Name());
       return true;
    }
@@ -613,7 +613,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
    // Perform immedate configuration of the package.
    if (List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
       if (SmartConfigure(Pkg) == false)
-	 return _error->Error(_("Could not perform immediate configuration on '%s'."
+	 return _error->Error(_("Could not perform immediate configuration on '%s'. "
 			"Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.Name(),2);
    
    return true;

+ 1 - 0
apt-pkg/pkgcache.cc

@@ -731,6 +731,7 @@ bool pkgCache::VerIterator::Automatic() const
 {
    VerFileIterator Files = FileList();
    for (; Files.end() == false; Files++)
+      // Do not check ButAutomaticUpgrades here as it is kind of automatic…
       if ((Files.File()->Flags & pkgCache::Flag::NotAutomatic) != pkgCache::Flag::NotAutomatic)
 	 return true;
    return false;

+ 1 - 1
apt-pkg/pkgcache.h

@@ -146,7 +146,7 @@ class pkgCache								/*{{{*/
    struct Flag
    {
       enum PkgFlags {Auto=(1<<0),Essential=(1<<3),Important=(1<<4)};
-      enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1)};
+      enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1),ButAutomaticUpgrades=(1<<2)};
    };
    
    protected:

+ 5 - 4
apt-pkg/policy.cc

@@ -16,7 +16,7 @@
    990         = Config file override package files
    989         = Start for preference auto-priorities
    500         = Default package files
-   100         = The status file
+   100         = The status file and ButAutomaticUpgrades sources
    0 -> 100    = NotAutomatic sources like experimental
    -inf -> 0   = Never selected   
    
@@ -70,9 +70,10 @@ bool pkgPolicy::InitDefaults()
       PFPriority[I->ID] = 500;
       if ((I->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource)
 	 PFPriority[I->ID] = 100;
-      else
-	 if ((I->Flags & pkgCache::Flag::NotAutomatic) == pkgCache::Flag::NotAutomatic)
-	    PFPriority[I->ID] = 1;
+      else if ((I->Flags & pkgCache::Flag::ButAutomaticUpgrades) == pkgCache::Flag::ButAutomaticUpgrades)
+	 PFPriority[I->ID] = 100;
+      else if ((I->Flags & pkgCache::Flag::NotAutomatic) == pkgCache::Flag::NotAutomatic)
+	 PFPriority[I->ID] = 1;
    }
 
    // Apply the defaults..

+ 2 - 2
buildlib/debiandoc.mak

@@ -27,7 +27,7 @@ vpath %.sgml $(SUBDIRS)
 $(DOC)/%.html: %.sgml
 	echo Creating html for $< to $@
 	-rm -rf $@
-	(HERE=`pwd`; cd $(@D) && $(DEBIANDOC_HTML) $(DEBIANDOC_HTML_OPTIONS) $$HERE/$<)
+	(HERE=`pwd`; cd $(@D) && $(DEBIANDOC_HTML) $(DEBIANDOC_HTML_OPTIONS) $$HERE/$<) || exit 199
 
 # Clean rule
 .PHONY: veryclean/html/$(LOCAL)
@@ -48,7 +48,7 @@ veryclean: veryclean/text/$(LOCAL)
 vpath %.sgml $(SUBDIRS)
 $(DOC)/%.text: %.sgml
 	echo Creating text for $< to $@
-	$(DEBIANDOC_TEXT) -O $< > $@
+	$(DEBIANDOC_TEXT) -O $< > $@ || exit 198
 
 # Clean rule
 .PHONY: veryclean/text/$(LOCAL)

+ 1 - 1
buildlib/po4a_manpage.mak

@@ -27,7 +27,7 @@ veryclean: veryclean/$(LOCAL)
 
 $($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
 	echo Creating man page $@
-	$(XSLTPROC) -o $@ $(STYLESHEET) $< # why xsltproc doesn't respect the -o flag here???
+	$(XSLTPROC) -o $@ $(STYLESHEET) $< || exit 200 # why xsltproc doesn't respect the -o flag here???
 	test -f $(subst .$(LC),,$@) || echo FIXME: xsltproc respect the -o flag now, workaround can be removed
 	mv -f $(subst .$(LC),,$@) $@
 

+ 2 - 2
cmdline/apt-cache.cc

@@ -1321,7 +1321,7 @@ bool Search(CommandLine &CmdL)
 	 continue;
       pkgCache::VerIterator V = Plcy->GetCandidateVer(P);
       if (V.end() == false)
-	 DFList[G->ID].Df = V.DescriptionList().FileList();
+	 DFList[G->ID].Df = V.TranslatedDescription().FileList();
 
       if (DFList[G->ID].NameMatch == false)
 	 continue;
@@ -1334,7 +1334,7 @@ bool Search(CommandLine &CmdL)
 	    continue;
 
 	 unsigned long id = Prv.OwnerPkg().Group()->ID;
-	 DFList[id].Df = V.DescriptionList().FileList();
+	 DFList[id].Df = V.TranslatedDescription().FileList();
 	 DFList[id].NameMatch = true;
       }
    }

+ 12 - 0
cmdline/apt-get.cc

@@ -1106,17 +1106,25 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
    
    // Number of bytes
    if (DebBytes != FetchBytes)
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("Need to get %sB/%sB of archives.\n"),
 	       SizeToStr(FetchBytes).c_str(),SizeToStr(DebBytes).c_str());
    else if (DebBytes != 0)
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("Need to get %sB of archives.\n"),
 	       SizeToStr(DebBytes).c_str());
 
    // Size delta
    if (Cache->UsrSize() >= 0)
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("After this operation, %sB of additional disk space will be used.\n"),
 	       SizeToStr(Cache->UsrSize()).c_str());
    else
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("After this operation, %sB disk space will be freed.\n"),
 	       SizeToStr(-1*Cache->UsrSize()).c_str());
 
@@ -2340,9 +2348,13 @@ bool DoSource(CommandLine &CmdL)
    
    // Number of bytes
    if (DebBytes != FetchBytes)
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("Need to get %sB/%sB of source archives.\n"),
 	       SizeToStr(FetchBytes).c_str(),SizeToStr(DebBytes).c_str());
    else
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("Need to get %sB of source archives.\n"),
 	       SizeToStr(DebBytes).c_str());
    

+ 2 - 0
cmdline/apt-key

@@ -147,11 +147,13 @@ else
 	#echo "generate list"
 	TRUSTEDFILE="/etc/apt/trusted.gpg"
 	eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
+	eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
 	if [ -r "$TRUSTEDFILE" ]; then
 		GPG="$GPG --keyring $TRUSTEDFILE"
 	fi
 	GPG="$GPG --primary-keyring $TRUSTEDFILE"
 	TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
+	eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)
 	if [ -d "$TRUSTEDPARTS" ]; then
 		#echo "parts active"
 		for trusted in $(run-parts --list $TRUSTEDPARTS --regex '^.*\.gpg$'); do

+ 1 - 1
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)
 
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.8.1")
+AC_DEFINE_UNQUOTED(VERSION,"0.8.2")
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)

+ 15 - 28
debian/apt.cron.daily

@@ -11,7 +11,7 @@
 #  Dir::Cache "var/apt/cache/";
 #  - Set apt package cache directory
 #
-#  Dir::Cache::Archive "archives/";
+#  Dir::Cache::Archives "archives/";
 #  - Set package archive directory
 #
 #  APT::Periodic::Enable "1";
@@ -147,21 +147,14 @@ check_size_constraints()
     eval $(apt-config shell MaxSize APT::Archives::MaxSize)
     eval $(apt-config shell MaxSize APT::Periodic::MaxSize)
 
-    CacheDir="var/cache/apt/"
-    eval $(apt-config shell CacheDir Dir::Cache)
-    CacheDir=${CacheDir%/}
-
-    CacheArchive="archives/"
-    eval $(apt-config shell CacheArchive Dir::Cache::archives)
-    CacheArchive=${CacheArchive%/}
+    Cache="/var/cache/apt/archives/"
+    eval $(apt-config shell Cache Dir::Cache::archives/d)
 
     # sanity check
-    if [ -z "$CacheDir" -o -z "$CacheArchive" ]; then
-	echo "empty Dir::Cache or Dir::Cache::archives, exiting"
+    if [ -z "$Cache" ]; then
+	echo "empty Dir::Cache::archives, exiting"
 	exit
     fi
-    
-    Cache="${Dir%/}/${CacheDir%/}/${CacheArchive%/}/"
 
     # check age
     if [ ! $MaxAge -eq 0 ] && [ ! $MinAge -eq 0 ]; then
@@ -225,22 +218,17 @@ do_cache_backup()
     fi
 
     # Set default values and normalize
-    Dir="/"
-    eval $(apt-config shell Dir Dir)
-    Dir=${Dir%/}
-
-    CacheDir="var/cache/apt/"
-    eval $(apt-config shell CacheDir Dir::Cache)
+    CacheDir="/var/cache/apt"
+    eval $(apt-config shell CacheDir Dir::Cache/d)
     CacheDir=${CacheDir%/}
     if [ -z "$CacheDir" ]; then
 	debug_echo "practically empty Dir::Cache, exiting"
 	return 0
     fi
 
-    CacheArchive="archives/"
-    eval $(apt-config shell CacheArchive Dir::Cache::Archives)
-    CacheArchive=${CacheArchive%/}
-    if [ -z "$CacheArchive" ]; then
+    Cache="${CacheDir}/archives/"
+    eval $(apt-config shell Cache Dir::Cache::Archives/d)
+    if [ -z "$Cache" ]; then
 	debug_echo "practically empty Dir::Cache::archives, exiting"
 	return 0
     fi
@@ -251,16 +239,15 @@ do_cache_backup()
 	BackupLevel=2 ; 
     fi
     
-    CacheBackup="backup/"
-    eval $(apt-config shell CacheBackup Dir::Cache::Backup)
-    CacheBackup=${CacheBackup%/}
-    if [ -z "$CacheBackup" ]; then
+    Back="${CacheDir}/backup/"
+    eval $(apt-config shell Back Dir::Cache::Backup/d)
+    if [ -z "$Back" ]; then
 	echo "practically empty Dir::Cache::Backup, exiting" 1>&2
 	return
     fi
 
-    Cache="${Dir}/${CacheDir}/${CacheArchive}/"
-    Back="${Dir}/${CacheDir}/${CacheBackup}/"
+    CacheArchive="$(basename "${Cache}")"
+    test -n "${CacheArchive}" || CacheArchive="archives"
     BackX="${Back}${CacheArchive}/"
     for x in $(seq 0 1 $((${BackupLevel}-1))); do 
 	eval "Back${x}=${Back}${x}/"

+ 147 - 15
debian/changelog

@@ -1,22 +1,154 @@
-apt (0.8.2) unstable; urgency=low
+apt (0.8.7) UNRELEASED; urgency=low
 
-  * apt-pkg/indexcopy.cc:
-    - only use trusted.gpg.d directory if it exists
-    - do not replace /dev/null when running in APT::CDROM::NoAct
-      mode (LP: #612666), thanks to Colin Watson
+  [ Manpages translations ]
+  * Typo fixed in French (extra "Z"). Thanks to Florentin Duneau.
+  * Another typo fixed in French ("Anfin"). Thanks to bubulle
+  * Wrong translation for "showauto" fixed. Thanks to Raphaël Hertzog
+    Closes: #599265
+  
+  [ Michael Vogt ]
+  * debian/apt.cron.daily:
+    - source /etc/default/locale (if available) so that the 
+      apt-get update cron job fetches the right translated package
+      descriptions
+  * fix test failure on amd64
+  * apt-pkg/deb/debsystem.cc:
+    - fix issues with dir::state::status and dir::state::extended_states
+      when alternative rootdirs are used
+
+  [ Martin Pitt ]
+  * apt-pkg/deb/debindexfile.cc:
+    - Use FileFd::Size() instead of stat()ing the sources/binary/translations
+      indexes directly, so that we have transparent handling of gzipped
+      indexes.
+  * apt-pkg/contrib/fileutl.cc:
+    - Fix FileFd::Size() for gzipped files to give the size of the
+      uncompressed data. This fixes cache building progress going way
+      over 100%.
+
+ -- Christian Perrier <bubulle@debian.org>  Tue, 05 Oct 2010 05:35:58 +0200
+
+apt (0.8.6) unstable; urgency=low
+
+  [ Programs translations ]
+  * Vietnamese update by Clytie Siddall (Closes: #598489)
+  * Asturian update by Maacub (Closes: #599057)
+
+  [ David Kalnischkies ]
+  * cmdline/apt-cache.cc:
+    - use the TranslatedDescription for searching and not the first
+      available one as it is maybe not an expected language (Closes: #597925)
+  * apt-pkg/contrib/strutl.cc:
+    - add a space between number and unit as required by SI (Closes: #598352)
+  * apt-pkg/depcache.cc:
+    - do not check endpointer packages instead of only those which prevented
+      NeverAutoRemove settings from having an effect (Closes: #598452)
+    - do not remove packages which the user requested for installation
+      explicitly while satisfying other install requests (Closes: #598669)
+  * apt-pkg/packagemanager.cc:
+    - Add a space between period and 'Please' and unfuzzy all translations
+  * doc/po/de.po:
+    - remove the duplicated "angefertigt" in translation-holder string
+
+ -- Michael Vogt <mvo@debian.org>  Mon, 04 Oct 2010 11:52:19 +0200
+
+apt (0.8.5) unstable; urgency=low
+
+  [ Manpages translations ]
+  * German (Chris Leick). Closes: #597163
+
+  [ Michael Vogt ]
+  * merged lp:~mvo/apt/conflicts-on-virtuals to better deal with
+    conflicts/breaks against virtual packages (LP: #614993)
+
+  [ David Kalnischkies ]
+  * apt-pkg/policy.cc:
+    - support 100-pinning in Release file with ButAutomaticUpgrades
+      as requested by the backports crew (Closes: #596097)
+  * apt-pkg/deb/deblistparser.cc:
+    - overrule NotAutomatic in case of ButAutomaticUpgrades
+  * debian/apt.cron.daily:
+    - handle absolut directory paths correctly by loading directories
+      directly instead of building the paths on our own (Closes: #596421)
+  * debian/control:
+    - build-depend on docbook-xml to ensure that the xml DTDs are always
+      available on the buildds (Closes: #597145)
+  * buildlib/debiandoc.mak, buildlib/po4a_manpage.mak:
+    - ensure that the build fails if documentation building fails
+  * doc/po/fr.po:
+    - correct two syntax issues to ensure we can build fine
+
+ -- Michael Vogt <mvo@debian.org>  Fri, 17 Sep 2010 22:05:06 +0200
+
+apt (0.8.4) unstable; urgency=low
+
+  [ Michael vogt ]
+  * ftparchive/writer.cc:
+    - write out {Files,Checksum-Sha1,Checksum-Sha256} only if
+      available LP: #633967. Thanks to Colin Watson
   * apt-pkg/contrib/cdromutl.cc:
     - if apt-cdrom is used on writable media (like usb-sticks), do
       not use the root directory to identify the medium (as all 
       changes there change the ident id). Use the .disk directory 
       instead 
-  * debian/apt.cron.daily:
-    - source /etc/default/locale (if available) so that the 
-      apt-get update cron job fetches the right translated package
-      descriptions
 
- -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 03 Sep 2010 20:21:43 +0200
+  [ David Kalnischkies ]
+  * ftparchive/writer.cc:
+    - null the valid string instead of the date if Valid-Until is not set
+  * apt-pkg/acquire-item.cc:
+    - use also unsigned Release files again (Closes: #596189)
+
+  [ Christian Perrier ]
+  * Fix missing space after dot in a message from apt-pkg
+    Translations unfuzzied. Thanks to Holger Wansing.
+
+ -- Michael Vogt <mvo@debian.org>  Fri, 10 Sep 2010 20:45:15 +0200
+
+apt (0.8.3) unstable; urgency=low
+
+  [ Programs translations ]
+  * German (Holger Wansing). Closes: #596141
+
+  [ Manpages translations ]
+  * Japanese (KURASAWA Nozomu). Closes: #595862
+
+  [ Michael Vogt ]
+  * apt-pkg/indexcopy.cc:
+    - only use trusted.gpg.d directory if it exists
+    - do not replace /dev/null when running in APT::CDROM::NoAct
+      mode (LP: #612666), thanks to Colin Watson
+
+  [ David Kalnischkies ]
+  * ftparchive/apt-ftparchive.cc:
+    - ensure that BinDirectory as well as Tree settings get
+      the correct default FileMode setting (Closes: #595922)
+
+ -- Michael Vogt <mvo@debian.org>  Tue, 07 Sep 2010 15:28:41 +0200
 
-apt (0.8.1) UNRELEASED; urgency=low
+apt (0.8.2) unstable; urgency=low
+
+  [ Manpages translations ]
+  * Spanish (Omar Campagne). Closes: #595557
+
+  [ David Kalnischkies ]
+  * apt-pkg/versionmatch.cc:
+    - do not accept 'Pin: origin "' (missing closing ") as a valid
+      way to pin a local archive: either "" or none…
+  * apt-pkg/deb/dpkgpm.cc:
+    - create Dir::Log if needed to support /var/log as tmpfs or similar,
+      inspired by Thomas Bechtold, thanks! (Closes: #523919, LP: #220239)
+  * apt-pkg/indexcopy.cc:
+    - support really still the APT::GPGV::TrustedKeyring setting,
+      as it breaks d-i badly otherwise (Closes: #595428)
+  * cmdline/apt-key:
+    - support also Dir::Etc::Trusted so that apt-key works in the same
+      way as the library part which works with the trusted files
+  * methods/{gzip,bzip2}.cc:
+    - empty files can never be valid archives (Closes: #595691)
+
+ -- Michael Vogt <mvo@debian.org>  Mon, 06 Sep 2010 18:10:06 +0200
+
+apt (0.8.1) unstable; urgency=low
 
   [ Programs translations ]
   * Thai (Theppitak Karoonboonyanan). Closes: #592695
@@ -30,6 +162,9 @@ apt (0.8.1) UNRELEASED; urgency=low
   * Bulgarian (Damyan Ivanov). Closes: #594627
   * Portuguese (Miguel Figueiredo). Closes: #594668
   * Korean (Changwoo Ryu). Closes: #594809
+  * Norwegian Bokmål (Hans Nordhaug). Closes: #595182
+  * Danish (Joe Hansen). Closes: #595176
+  * Catalan (Agustí Grau). Closes: #595234
 
   [ Christian Perrier ]
   * Fix spelling error in cmdline/apt-get.cc. Thanks to Osamu Aoki
@@ -58,11 +193,8 @@ apt (0.8.1) UNRELEASED; urgency=low
     - let the pin origin actually work as advertised in the manpage
       which means "" are optional and pinning a local archive does
       work - even if it is a non-flat archive (Closes: #594435)
-  * apt-pkg/deb/dpkgpm.cc:
-    - create Dir::Log if needed to support /var/log as tmpfs or similar,
-      inspired by Thomas Bechtold, thanks! (Closes: #523919, LP: #220239)
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 02 Sep 2010 12:41:32 +0200
+ -- Michael Vogt <mvo@debian.org>  Fri, 03 Sep 2010 18:36:11 +0200
 
 apt (0.8.0) unstable; urgency=low
 

+ 1 - 1
debian/control

@@ -6,7 +6,7 @@ Uploaders: Michael Vogt <mvo@debian.org>, Otavio Salvador <otavio@debian.org>,
  Christian Perrier <bubulle@debian.org>, Daniel Burrows <dburrows@debian.org>,
  Luca Bruno <lethalman88@gmail.com>, Julian Andres Klode <jak@debian.org>
 Standards-Version: 3.9.0
-Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.0), zlib1g-dev | libz-dev, debiandoc-sgml, xsltproc, docbook-xsl, po4a (>= 0.34-2), autotools-dev, autoconf, automake, doxygen
+Build-Depends: debhelper (>= 5.0), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.0), zlib1g-dev | libz-dev, debiandoc-sgml, xsltproc, docbook-xsl, docbook-xml, po4a (>= 0.34-2), autotools-dev, autoconf, automake, doxygen
 Build-Conflicts: autoconf2.13, automake1.4
 Vcs-Bzr: http://bzr.debian.org/apt/debian-sid/
 

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 292 - 590
doc/po/de.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 328 - 590
doc/po/es.po


+ 32 - 29
doc/po/fr.po

@@ -10,7 +10,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "POT-Creation-Date: 2010-08-23 18:46-0300\n"
-"PO-Revision-Date: 2010-08-23 14:04-0400\n"
+"PO-Revision-Date: 2010-10-06 22:33+0200\n"
 "Last-Translator: Christian Perrier <bubulle@debian.org>\n"
 "Language-Team: French <debian-l10n-french@lists.debian.org>\n"
 "Language: \n"
@@ -936,7 +936,7 @@ msgid ""
 "     </varlistentry>\n"
 "\">\n"
 msgstr ""
-"Z     <varlistentry><term><filename>&cachedir;/archives/partial/</filename></term>\n"
+"     <varlistentry><term><filename>&cachedir;/archives/partial/</filename></term>\n"
 "     <listitem><para>Zone de stockage pour les paquets en transit.\n"
 "     Élément de configuration : <literal>Dir::Cache::Archives</literal> (implicitement, partial). </para></listitem>\n"
 "     </varlistentry>\n"
@@ -1095,6 +1095,7 @@ msgstr ""
 "     <listitem><para>Liste d'état des paquets installés automatiquement.\n"
 "     Élément de configuration : <literal>Dir::State::extended_states</literal>.</para></listitem>\n"
 "     </varlistentry>\n"
+"\">\n"
 
 #. type: Plain text
 #: apt.ent:377
@@ -3882,30 +3883,32 @@ msgid ""
 "</group> </arg> </group>"
 msgstr ""
 "<command>apt-get</command> <arg><option>-sqdyfmubV</option></arg> <arg> "
-"<option>-o= <replaceable>option_de_configuration</replaceable> </option> </"
+"<option>-o= <replaceable>options_de_configuration</replaceable> </option> </"
 "arg> <arg> <option>-c= <replaceable>fichier_de_configuration</replaceable> </"
-"option> </arg> <arg> <option>-t=</option> <group choice='req'> <arg "
-"choice='plain'> <replaceable>nom_version_cible</replaceable> </arg> <group "
-"choice=\"req\"> <arg choice='plain'>update</arg> <arg "
-"choice='plain'>upgrade</arg> <arg choice='plain'>dselect-upgrade</arg> <arg "
-"choice='plain'>dist-upgrade</arg> <arg choice='plain'>install <arg choice="
-"\"plain\" rep=\"repeat\"><replaceable>pkg</replaceable> <arg> <group "
-"choice='req'> <arg choice='plain'> =<replaceable>numero_version_paquet</"
-"replaceable> </arg> <arg choice='plain'> /<replaceable>nom_version_cible</"
-"replaceable> </arg> <arg choice='plain'>remove <arg choice=\"plain\" rep="
-"\"repeat\"><replaceable>pkg</replaceable></arg></arg> <arg "
-"choice='plain'>purge <arg choice=\"plain\" rep=\"repeat\"><replaceable>pkg</"
-"replaceable></arg></arg> <arg choice='plain'>source <arg choice=\"plain\" "
-"rep=\"repeat\"><replaceable>paquet</replaceable> <arg> "
-"=<replaceable>numéro_version_paquet</replaceable> </arg> </arg> </arg> <arg "
-"choice='plain'>build-dep <arg choice=\"plain\" rep=\"repeat"
-"\"><replaceable>paquet</replaceable></arg></arg> <arg choice='plain'>check</"
-"arg> <arg choice='plain'>clean</arg> <arg choice='plain'>autoclean</arg> "
-"<arg choice='plain'>autoremove</arg> <arg choice='plain'> <group "
-"choice='req'> <arg choice='plain'>-v</arg> <arg choice='plain'>--version</"
-"arg> </group> </arg> <arg choice='plain'> <group choice='req'> <arg "
-"choice='plain'>-h</arg> <arg choice='plain'>--help</arg> </group> </arg> </"
-"group>"
+"option> </arg> <arg> <option>-t=</option> <arg choice='plain'> "
+"<replaceable>nom_version_cible</replaceable> </arg> </arg> <group choice="
+"\"req\"> <arg choice='plain'>update</arg> <arg choice='plain'>upgrade</arg> "
+"<arg choice='plain'>dselect-upgrade</arg> <arg choice='plain'>dist-upgrade</"
+"arg> <arg choice='plain'>install <arg choice=\"plain\" rep=\"repeat"
+"\"><replaceable>paquet</replaceable> <arg> <group choice='req'> <arg "
+"choice='plain'> =<replaceable>numéro_version_paquet</replaceable> </arg> "
+"<arg choice='plain'> /<replaceable>nom_version_cible</replaceable> </arg> </"
+"group> </arg> </arg> </arg> <arg choice='plain'>remove <arg choice=\"plain\" "
+"rep=\"repeat\"><replaceable>paquet</replaceable></arg></arg> <arg "
+"choice='plain'>purge <arg choice=\"plain\" rep=\"repeat"
+"\"><replaceable>paquet</replaceable></arg></arg> <arg choice='plain'>source "
+"<arg choice=\"plain\" rep=\"repeat\"><replaceable>paquet</replaceable> <arg> "
+"<group choice='req'> <arg choice='plain'> "
+"=<replaceable>numéro_version_paquet</replaceable> </arg> <arg "
+"choice='plain'> /<replaceable>nom_version_cible</replaceable> </arg> </"
+"group> </arg> </arg> </arg> <arg choice='plain'>build-dep <arg choice=\"plain"
+"\" rep=\"repeat\"><replaceable>paquet</replaceable></arg></arg> <arg "
+"choice='plain'>check</arg> <arg choice='plain'>clean</arg> <arg "
+"choice='plain'>autoclean</arg> <arg choice='plain'>autoremove</arg> <arg "
+"choice='plain'> <group choice='req'> <arg choice='plain'>-v</arg> <arg "
+"choice='plain'>--version</arg> </group> </arg> <arg choice='plain'> <group "
+"choice='req'> <arg choice='plain'>-h</arg> <arg choice='plain'>--help</arg> "
+"</group> </arg> </group>"
 
 #. type: Content of: <refentry><refsect1><para>
 #: apt-get.8.xml:112
@@ -5321,8 +5324,8 @@ msgid ""
 "<literal>showauto</literal> is used to print a list of automatically "
 "installed packages with each package on a new line."
 msgstr ""
-"<literal>showauto</literal>, affiche les paquets installés manuellement, un "
-"paquet par ligne."
+"<literal>showauto</literal>, affiche les paquets installés automatiquement, "
+"un paquet par ligne."
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
 #: apt-mark.8.xml:93
@@ -7150,7 +7153,7 @@ msgstr ""
 "La liste <literal>Ignore-Files-Silently</literal> permet d'indiquer quels "
 "sont les fichiers qu'APT peut ignorer sans avertissement dans les "
 "répertoires contenant des fragments de configuration. Par défaut, les "
-"fichiers qui se terminent par literal>.disabled</literal>, <literal>~</"
+"fichiers qui se terminent par <literal>.disabled</literal>, <literal>~</"
 "literal>, <literal>.bak</literal> ou <literal>.dpkg-[a-z]+</literal> sont "
 "ignorés. Comme cela est visible dans le dernier élément de cette liste, il "
 "est possible d'utiliser la syntaxe des expressions rationnelles."
@@ -10801,7 +10804,7 @@ msgstr "Résumé final"
 msgid ""
 "Finally, APT will print out a summary of all the changes that will occur."
 msgstr ""
-"Anfin, APT affichera un résumé de toutes les opérations qui prendront place."
+"Enfin, APT affichera un résumé de toutes les opérations qui prendront place."
 
 #. type: <example></example>
 #: guide.sgml:452

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 795 - 1854
doc/po/ja.po


+ 6 - 1
ftparchive/apt-ftparchive.cc

@@ -135,6 +135,8 @@ void PackageMap::GetGeneral(Configuration &Setup,Configuration &Block)
    PkgExt = Block.Find("Packages::Extensions",
 		       Setup.Find("Default::Packages::Extensions",".deb").c_str());
    
+   Permissions = Setup.FindI("Default::FileMode",0644);
+
    if (FLFile.empty() == false)
       FLFile = flCombine(Setup.Find("Dir::FileListDir"),FLFile);
    
@@ -457,7 +459,7 @@ void LoadTree(vector<PackageMap> &PkgList,Configuration &Setup)
    string DFLFile = Setup.Find("TreeDefault::FileList", "");
    string DSFLFile = Setup.Find("TreeDefault::SourceFileList", "");
 
-   int const Permissions = Setup.FindI("Default::FileMode",0644);
+   mode_t const Permissions = Setup.FindI("Default::FileMode",0644);
 
    bool const LongDescription = Setup.FindB("Default::LongDescription",
 					_config->FindB("APT::FTPArchive::LongDescription", true));
@@ -548,6 +550,8 @@ void LoadTree(vector<PackageMap> &PkgList,Configuration &Setup)
 /* */
 void LoadBinDir(vector<PackageMap> &PkgList,Configuration &Setup)
 {
+   mode_t const Permissions = Setup.FindI("Default::FileMode",0644);
+
    // Process 'bindirectory' type sections
    const Configuration::Item *Top = Setup.Tree("bindirectory");
    for (Top = (Top == 0?0:Top->Child); Top != 0;)
@@ -567,6 +571,7 @@ void LoadBinDir(vector<PackageMap> &PkgList,Configuration &Setup)
       Itm.InternalPrefix = Block.Find("InternalPrefix",Top->Tag.c_str());
       Itm.Contents = Block.Find("Contents");
       Itm.ContentsHead = Block.Find("Contents::Header");
+      Itm.Permissions = Block.FindI("FileMode", Permissions);
       
       Itm.GetGeneral(Setup,Block);
       PkgList.push_back(Itm);

+ 11 - 8
ftparchive/writer.cc

@@ -708,18 +708,21 @@ bool SourcesWriter::DoPackage(string FileName)
    // Add the dsc to the files hash list
    string const strippedName = flNotDir(FileName);
    std::ostringstream ostreamFiles;
-   ostreamFiles << "\n " << string(MD5.Result()) << " " << St.st_size << " "
-		<< strippedName << "\n " << Tags.FindS("Files");
+   if (Tags.Exists("Files"))
+      ostreamFiles << "\n " << string(MD5.Result()) << " " << St.st_size << " "
+		   << strippedName << "\n " << Tags.FindS("Files");
    string const Files = ostreamFiles.str();
 
    std::ostringstream ostreamSha1;
-   ostreamSha1 << "\n " << string(SHA1.Result()) << " " << St.st_size << " "
-		<< strippedName << "\n " << Tags.FindS("Checksums-Sha1");
+   if (Tags.Exists("Checksums-Sha1"))
+      ostreamSha1 << "\n " << string(SHA1.Result()) << " " << St.st_size << " "
+		   << strippedName << "\n " << Tags.FindS("Checksums-Sha1");
    string const ChecksumsSha1 = ostreamSha1.str();
 
    std::ostringstream ostreamSha256;
-   ostreamSha256 << "\n " << string(SHA256.Result()) << " " << St.st_size << " "
-		<< strippedName << "\n " << Tags.FindS("Checksums-Sha256");
+   if (Tags.Exists("Checksums-Sha256"))
+      ostreamSha256 << "\n " << string(SHA256.Result()) << " " << St.st_size << " "
+		   << strippedName << "\n " << Tags.FindS("Checksums-Sha256");
    string const ChecksumsSha256 = ostreamSha256.str();
 
    // Strip the DirStrip prefix from the FileName and add the PathPrefix
@@ -925,12 +928,12 @@ ReleaseWriter::ReleaseWriter(string const &DB)
    }
 
    time_t const validuntil = now + _config->FindI("APT::FTPArchive::Release::ValidTime", 0);
-   char validstr[128] = "";
+   char validstr[128];
    if (now == validuntil ||
        strftime(validstr, sizeof(validstr), "%a, %d %b %Y %H:%M:%S UTC",
                 gmtime(&validuntil)) == 0)
    {
-      datestr[0] = '\0';
+      validstr[0] = '\0';
    }
 
    map<string,string> Fields;

+ 3 - 6
methods/bzip2.cc

@@ -56,12 +56,9 @@ bool Bzip2Method::Fetch(FetchItem *Itm)
    // Open the source and destination files
    FileFd From(Path,FileFd::ReadOnly);
 
-   // if the file is empty, just rename it and return
-   if(From.Size() == 0) 
-   {
-      rename(Path.c_str(), Itm->DestFile.c_str());
-      return true;
-   }
+   // FIXME add an error message saying that empty files can't be valid archives
+   if(From.Size() == 0)
+      return false;
 
    int GzOut[2];   
    if (pipe(GzOut) < 0)

+ 3 - 6
methods/gzip.cc

@@ -48,12 +48,9 @@ bool GzipMethod::Fetch(FetchItem *Itm)
    // Open the source and destination files
    FileFd From(Path,FileFd::ReadOnlyGzip);
 
-   // if the file is empty, just rename it and return
-   if(From.Size() == 0) 
-   {
-      rename(Path.c_str(), Itm->DestFile.c_str());
-      return true;
-   }
+   // FIXME add an error message saying that empty files can't be valid archives
+   if(From.Size() == 0)
+      return false;
 
    FileFd To(Itm->DestFile,FileFd::WriteAtomic);   
    To.EraseOnFailure();

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/apt-all.pot


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/ar.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 300 - 288
po/ast.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/bg.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/bs.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 461 - 395
po/ca.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/cs.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/cy.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 769 - 1048
po/da.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 443 - 419
po/de.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/dz.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/el.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/es.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/eu.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/fi.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 269
po/fr.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/gl.po


+ 2 - 2
po/he.po

@@ -2319,7 +2319,7 @@ msgstr ""
 #: apt-pkg/packagemanager.cc:324 apt-pkg/packagemanager.cc:586
 #, c-format
 msgid ""
-"Could not perform immediate configuration on '%s'.Please see man 5 apt.conf "
+"Could not perform immediate configuration on '%s'. Please see man 5 apt.conf "
 "under APT::Immediate-Configure for details. (%d)"
 msgstr ""
 
@@ -2334,7 +2334,7 @@ msgstr ""
 #: apt-pkg/packagemanager.cc:478
 #, c-format
 msgid ""
-"Could not perform immediate configuration on already unpacked '%s'.Please "
+"Could not perform immediate configuration on already unpacked '%s'. Please "
 "see man 5 apt.conf under APT::Immediate-Configure for details."
 msgstr ""
 

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/hu.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 285 - 273
po/it.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/ja.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/km.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/ko.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/ku.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/lt.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/mr.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 799 - 755
po/nb.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/ne.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 281 - 269
po/nl.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/nn.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/pl.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 280 - 268
po/pt.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/pt_BR.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/ro.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 280 - 268
po/ru.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/sk.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/sl.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/sv.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/th.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/tl.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/uk.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 544 - 536
po/vi.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 274
po/zh_CN.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 279 - 267
po/zh_TW.po


+ 30 - 0
test/integration/Packages-bug-598669-install-postfix-gets-exim-heavy

@@ -0,0 +1,30 @@
+Package: exim4-daemon-heavy
+Priority: optional
+Section: mail
+Installed-Size: 1060
+Maintainer: Exim4 Maintainers <pkg-exim4-maintainers@lists.alioth.debian.org>
+Architecture: i386
+Source: exim4
+Version: 4.72-1
+Replaces:  mail-transport-agent
+Provides:  mail-transport-agent
+Conflicts: mail-transport-agent
+Filename: pool/main/e/exim4/exim4-daemon-heavy_4.72-1_i386.deb
+Size: 508988
+MD5sum: 7adf3b0ef8f134e70d19ee216e6f4452
+Description: Exim MTA (v4) daemon with extended features, including exiscan-acl
+
+Package: postfix
+Priority: extra
+Section: mail
+Installed-Size: 3196
+Maintainer: LaMont Jones <lamont@debian.org>
+Architecture: i386
+Version: 2.7.1-1
+Replaces:  mail-transport-agent
+Provides:  mail-transport-agent
+Conflicts: mail-transport-agent
+Filename: pool/main/p/postfix/postfix_2.7.1-1_i386.deb
+Size: 1325662
+MD5sum: 1ef63b6a62b4be120a9cdc312b81a698
+Description: High-performance mail transport agent

+ 12 - 0
test/integration/Packages-policy-pinning

@@ -0,0 +1,12 @@
+Package: oldstuff
+Version: 1.0
+Architecture: i386
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 100
+Filename: pool/oldstuff_1.0_i386.deb
+Size: 100000
+MD5sum: 311aeeadf78324aaff54c9b4e1f76671
+SHA1: 3c695e028f74d5c544deeddaaa1242desa81088c
+SHA256: b46fd1546151c545fe4bfa56a5cc0e7deaef23e2da3e4f129727fd660f28f050
+Description: some old but cool stuff
+ This package will disappear in the next mirror update

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1819 - 0
test/integration/Packages-ubuntu-bug-614993


+ 27 - 1
test/integration/framework

@@ -74,6 +74,7 @@ aptconfig() { runapt apt-config $*; }
 aptcache() { runapt apt-cache $*; }
 aptget() { runapt apt-get $*; }
 aptftparchive() { runapt apt-ftparchive $*; }
+aptkey() { runapt apt-key $*; }
 dpkg() {
 	$(which dpkg) --root=${TMPWORKINGDIRECTORY}/rootdir --force-not-root --force-bad-path --log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log $*
 }
@@ -112,6 +113,7 @@ setupenvironment() {
 	cp $(find $TESTDIR -name '*.pub' -o -name '*.sec') keys/
 	ln -s ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 	echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf
+	echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf
 	echo "Debug::NoLocking \"true\";" >> aptconfig.conf
 	echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
 	echo "Dir::Bin::dpkg \"fakeroot\";" >> aptconfig.conf
@@ -212,7 +214,7 @@ buildpackage() {
 	fi
 	local BUILT="$(dpkg-buildpackage -uc -us -a$ARCH 2> /dev/null)"
 	local PKGS="$( echo "$BUILT" | grep '^dpkg-deb: building package' | cut -d'/' -f 2 | sed -e "s#'\.##")"
-	local SRCS="$( echo "$BUILT" | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._-]*$')"
+	local SRCS="$( echo "$BUILT" | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._+~-]*$')"
 	cd - > /dev/null
 	for PKG in $PKGS; do
 		echo "pool/${PKG}" >> ${TMPWORKINGDIRECTORY}/incoming/${RELEASE}.${SECTION}.pkglist
@@ -500,3 +502,27 @@ testnopackage() {
 	fi
 	msgpass
 }
+
+testdpkginstalled() {
+	msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
+	local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^i]' | wc -l)"
+	if [ "$PKGS" != 0 ]; then
+		echo $PKGS
+		dpkg -l $* | grep '^[a-z]'
+		msgfail
+		return 1
+	fi
+	msgpass
+}
+
+testdpkgnoninstalled() {
+	msgtest "Test for correctly non-installed package(s) with" "dpkg -l $*"
+	local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^u]' | wc -l)"
+	if [ "$PKGS" != 0 ]; then
+		echo
+		dpkg -l $* | grep '^[a-z]'
+		msgfail
+		return 1
+	fi
+	msgpass
+}

+ 1 - 1
test/integration/run-tests

@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-local DIR=$(readlink -f $(dirname $0))
+DIR=$(readlink -f $(dirname $0))
 for testcase in $(run-parts --list $DIR | grep '/test-'); do
 	echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m"
 	${testcase}

+ 30 - 0
test/integration/status-bug-598669-install-postfix-gets-exim-heavy

@@ -0,0 +1,30 @@
+Package: exim4-daemon-light
+Status: install ok installed
+Priority: standard
+Section: mail
+Installed-Size: 952
+Maintainer: Exim4 Maintainers <pkg-exim4-maintainers@lists.alioth.debian.org>
+Architecture: i386
+Source: exim4
+Version: 4.72-1
+Replaces:  mail-transport-agent
+Provides:  mail-transport-agent
+Conflicts: mail-transport-agent
+Filename: pool/main/e/exim4/exim4-daemon-light_4.72-1_i386.deb
+Size: 459500
+MD5sum: f32ccafef44bed2efcd526cd6501307d
+Description: lightweight Exim MTA (v4) daemon
+
+Package: exim4
+Status: install ok installed
+Priority: standard
+Section: mail
+Installed-Size: 60
+Maintainer: Exim4 Maintainers <pkg-exim4-maintainers@lists.alioth.debian.org>
+Architecture: all
+Version: 4.72-1
+Depends: exim4-daemon-light | exim4-daemon-heavy
+Filename: pool/main/e/exim4/exim4_4.72-1_all.deb
+Size: 7738
+MD5sum: 2f473b82bbabac9718ff3e755eaf85c1
+Description: metapackage to ease Exim MTA (v4) installation

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 5894 - 0
test/integration/status-ubuntu-bug-614993


+ 33 - 9
test/integration/test-autoremove

@@ -1,29 +1,53 @@
 #!/bin/sh
 set -e
 
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
 . $TESTDIR/framework
 setupenvironment
-configarchitecture "i386"
+configarchitecture 'i386'
 
-buildsimplenativepackage "unrelated" "all" "1" "unstable"
-buildsimplenativepackage "po-debconf" "all" "1.0.16" "unstable"
-buildsimplenativepackage "debhelper" "all" "8.0.0" "unstable" "Depends: po-debconf"
+buildsimplenativepackage 'unrelated' 'all' '1' 'unstable'
+buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable'
+buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf'
 setupaptarchive
 
 aptget install unrelated debhelper -qq 2>&1 > /dev/null
+testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
 
-testfileequal "rootdir/var/lib/apt/extended_states" "Package: po-debconf
+testfileequal 'rootdir/var/lib/apt/extended_states' 'Package: po-debconf
 Architecture: i386
 Auto-Installed: 1
-"
+'
 aptget remove debhelper -y -qq 2>&1 > /dev/null
+testdpkgnoninstalled 'debhelper'
+testdpkginstalled 'po-debconf unrelated'
+
+echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
+testequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following packages will be REMOVED:
+  po-debconf
+0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
+Remv po-debconf [1.0.16]' aptget autoremove -s
+testdpkginstalled 'po-debconf'
+
+echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
 aptget autoremove -y -qq 2>&1 > /dev/null
+testdpkginstalled 'po-debconf'
 
-testfileequal "rootdir/var/lib/apt/extended_states" ""
+echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
+aptget autoremove -y -qq 2>&1 > /dev/null
+testdpkginstalled "po-debconf"
+
+rm rootdir/etc/apt/apt.conf.d/00autoremove
+aptget autoremove -y -qq 2>&1 > /dev/null
+testdpkgnoninstalled 'po-debconf'
+
+testfileequal 'rootdir/var/lib/apt/extended_states' ''
 
 sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
-testfileequal "rootdir/var/log/apt/history.log" '
+testfileequal 'rootdir/var/log/apt/history.log' '
 Install: unrelated:i386 (1), debhelper:i386 (8.0.0), po-debconf:i386 (1.0.16, automatic)
 
 Remove: debhelper:i386 (8.0.0)

+ 1 - 1
test/integration/test-bug-590438-broken-provides-thanks-to-remove-order

@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
 . $TESTDIR/framework
 
 setupenvironment

+ 5 - 5
test/integration/test-bug-591882-conkeror

@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
 . $TESTDIR/framework
 setupenvironment
 configarchitecture "i386"
@@ -34,8 +34,8 @@ The following packages will be upgraded:
   perl-base perl-modules readline-common sed ttf-dejavu-core ucf whiptail
   x11-common zlib1g
 87 upgraded, 26 newly installed, 5 to remove and 0 not upgraded.
-Need to get 0B/54.4MB of archives.
-After this operation, 12.4MB of additional disk space will be used.
+Need to get 0 B/54.4 MB of archives.
+After this operation, 12.4 MB of additional disk space will be used.
 E: Trivial Only specified but this is not a trivial operation."
 
 UPGRADESUCCESS="Reading package lists...
@@ -66,8 +66,8 @@ The following packages will be upgraded:
   perl-base perl-modules readline-common sed ttf-dejavu-core ucf whiptail
   x11-common zlib1g
 88 upgraded, 30 newly installed, 4 to remove and 0 not upgraded.
-Need to get 0B/62.9MB of archives.
-After this operation, 36.0MB of additional disk space will be used.
+Need to get 0 B/62.9 MB of archives.
+After this operation, 36.0 MB of additional disk space will be used.
 E: Trivial Only specified but this is not a trivial operation."
 
 # Test that the old behavior can be restored with the option

+ 91 - 0
test/integration/test-bug-595691-empty-and-broken-archive-files

@@ -0,0 +1,91 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+buildaptarchive
+setupflataptarchive
+
+testaptgetupdate() {
+	aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true
+	sed -i -e '/^Fetched / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
+	GIVEN="$1"
+	shift
+	msgtest "Test for correctness of" "apt-get update with $*"
+	if [ -z "$GIVEN" ]; then
+		echo -n "" | checkdiff - testaptgetupdate.diff && msgpass || msgfail
+	else
+		echo "$GIVEN" | checkdiff - testaptgetupdate.diff && msgpass || msgfail
+	fi
+	rm testaptgetupdate.diff
+}
+
+touch aptarchive/en.bz2
+
+testaptgetupdate "Ign file:  Release.gpg
+Ign file:$(readlink -f aptarchive)/  Translation-en
+Get:1 file:  Release []
+Reading package lists..." "empty file en.bz2 over file"
+
+rm aptarchive/en.bz2
+echo -n "" | bzip2 > aptarchive/en.bz2
+
+testaptgetupdate "Ign file:  Release.gpg
+Get:1 file:  Release []
+Reading package lists..." "empty archive en.bz2 over file"
+
+rm aptarchive/en.bz2
+
+# do the same again with http instead of file
+changetowebserver
+
+touch aptarchive/en.bz2
+
+testaptgetupdate "Ign http://localhost  Release.gpg
+Get:1 http://localhost/  Translation-en
+Get:2 http://localhost  Release []
+Ign http://localhost/  Translation-en
+Get:3 http://localhost  Packages []
+Reading package lists..." "empty file en.bz2 over http"
+
+rm aptarchive/en.bz2
+echo -n "" | bzip2 > aptarchive/en.bz2
+
+testaptgetupdate "Ign http://localhost  Release.gpg
+Get:1 http://localhost/  Translation-en []
+Get:2 http://localhost  Release []
+Ign http://localhost  Packages/DiffIndex
+Get:3 http://localhost  Packages []
+Reading package lists..." "empty archive en.bz2 over http"
+
+rm aptarchive/en.bz2
+
+rm aptarchive/Packages
+touch aptarchive/Packages
+buildaptarchivefromfiles
+
+testaptgetupdate "Ign http://localhost  Release.gpg
+Ign http://localhost/  Translation-en
+Get:1 http://localhost  Release []
+Ign http://localhost  Packages/DiffIndex
+Get:2 http://localhost  Packages []
+Reading package lists..." "empty archive Packages over http"
+
+find aptarchive/ -name 'Packages*' -type f -delete
+touch aptarchive/Packages.bz2
+aptftparchive release aptarchive/ > aptarchive/Release
+
+#FIXME: we should response with a good error message instead
+testaptgetupdate "Ign http://localhost  Release.gpg
+Ign http://localhost/  Translation-en
+Get:1 http://localhost  Release []
+Ign http://localhost  Packages/DiffIndex
+Get:2 http://localhost  Packages
+Err http://localhost  Packages
+  Undetermined Error
+W: Failed to fetch http://localhost:8080/Packages.bz2  Undetermined Error
+
+E: Some index files failed to download, they have been ignored, or old ones used instead." "empty file Packages over http"

+ 19 - 0
test/integration/test-bug-598669-install-postfix-gets-exim-heavy

@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+setupaptarchive
+
+testequal "Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+  exim4 exim4-daemon-light
+The following NEW packages will be installed:
+  postfix
+0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
+Need to get 0 B/1326 kB of archives.
+After this operation, 2236 kB of additional disk space will be used.
+E: Trivial Only specified but this is not a trivial operation." aptget install postfix --trivial-only

+ 1 - 1
test/integration/test-compressed-indexes

@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
 . $TESTDIR/framework
 
 setupenvironment

+ 1 - 1
test/integration/test-disappearing-packages

@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
 . $TESTDIR/framework
 setupenvironment
 configarchitecture "i386"

+ 1 - 1
test/integration/test-pdiff-usage

@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
 . $TESTDIR/framework
 
 setupenvironment

+ 228 - 0
test/integration/test-policy-pinning

@@ -0,0 +1,228 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+buildaptarchive
+setupflataptarchive
+
+STATUS=$(readlink -f rootdir/var/lib/dpkg/status)
+APTARCHIVE=$(readlink -f aptarchive)
+
+testequalpolicy() {
+	local SP="$1"
+	local AP="$2"
+	shift 2
+	testequal "Package files:
+ $(echo "$SP" | awk '{ printf("%3s\n",$0) }') ${STATUS}
+     release a=now
+ $(echo "$AP" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/  Packages
+     release c=
+Pinned packages:" aptcache policy $*
+}
+
+aptget update -qq
+testequalpolicy 100 500
+testequalpolicy 990 500 -t now
+
+sed -i aptarchive/Release -e 1i"NotAutomatic: yes"
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicy 100 1 -o Test=NotAutomatic
+testequalpolicy 990 1 -o Test=NotAutomatic -t now
+
+sed -i aptarchive/Release -e 1i"ButAutomaticUpgrades: yes"
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicy 100 100 -o Test=ButAutomaticUpgrades
+testequalpolicy 990 100 -o Test=ButAutomaticUpgrades -t now
+
+sed -i aptarchive/Release -e 's#NotAutomatic: yes#NotAutomatic: no#' -e '/ButAutomaticUpgrades: / d'
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicy 100 500 -o Test=Automatic
+testequalpolicy 990 500 -o Test=Automatic -t now
+
+buildsimplenativepackage "coolstuff" "all" "1.0" "stable"
+buildsimplenativepackage "coolstuff" "all" "2.0~bpo1" "backports"
+
+setupaptarchive
+
+testequalpolicycoolstuff() {
+	local INSTALLED="${1:-(none)}"
+	local CANDIDATE="${2:-(none)}"
+	local AB="$3"
+	local AS="$4"
+	local PB="$5"
+	local PINVERSION="$6"
+	if [ -n "$PINVERSION" ]; then
+		PINVERSION="Package pin: $PINVERSION
+  "
+	fi
+	local IS=""
+	local IB=""
+	local SB=""
+	local SS=""
+	[ "$1" = "2.0~bpo1" ] && IB="***" && SB="
+        100 $STATUS" || IB="   "
+	[ "$1" = "1.0" ] && IS="***" && SS="
+        100 $STATUS" || IS="   "
+	local BPO1ARCHIVE=""
+	local BPO2ARCHIVE=""
+	if [ ! "$7" = "2.0~bpo2" ]; then
+		BPO1ARCHIVE="        $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages"
+	else
+		BPO2ARCHIVE="
+     2.0~bpo2 $PB
+        $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages"
+		SB="$(echo "$SB" | tail -n 1)"
+		shift
+	fi
+	shift 6
+	testequal "coolstuff:
+  Installed: $INSTALLED
+  Candidate: $CANDIDATE
+  ${PINVERSION}Version table:${BPO2ARCHIVE}
+ $IB 2.0~bpo1 $PB
+${BPO1ARCHIVE}$SB
+ $IS 1.0 $PB
+        $(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ stable/main i386 Packages$SS" \
+		aptcache policy coolstuff -o Policy=${INSTALLED}-${CANDIDATE}-${AB}-${AS}-${PB} $*
+}
+
+testequalpolicycoolstuff "" "2.0~bpo1" 500 500 0 ""
+testequalpolicycoolstuff "" "1.0" 500 990 0 "" -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -t backports
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=GlobalPin
+testequalpolicycoolstuff "" "1.0" 200 990 0 "" -o Test=GlobalPin -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=GlobalPin -t backports
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=GlobalPin
+testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=GlobalPin -t stable
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+#FIXME: policy can't differentiate between two sources where one has a package specific pin in place
+# testequalpolicycoolstuff "" "1.0" 500 500 200 "2.0~bpo1" -o Test=PackagePin
+# testequalpolicycoolstuff "" "1.0" 990 500 200 "2.0~bpo1" -o Test=PackagePin -t backports
+testequalpolicycoolstuff "" "1.0" 500 990 200 "2.0~bpo1" -o Test=PackagePin -t stable
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 500 500 600 "2.0~bpo1" -o Test=PackagePin
+testequalpolicycoolstuff "" "1.0" 500 990 600 "2.0~bpo1" -o Test=PackagePin -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test=PackagePin -t backports
+
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: -1" > rootdir/etc/apt/preferences
+# testequalpolicycoolstuff "" "1.0" 500 500 -1 "2.0~bpo1" -o Test=PackagePin
+# testequalpolicycoolstuff "" "1.0" 990 500 -1 "2.0~bpo1" -o Test=PackagePin -t backports
+# testequalpolicycoolstuff "" "1.0" 500 990 -1 "2.0~bpo1" -o Test=PackagePin -t stable
+
+rm rootdir/etc/apt/preferences
+sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes"
+signreleasefiles
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicycoolstuff "" "1.0" 1 500 0 "" -o Test=NotAutomatic
+testequalpolicycoolstuff "" "1.0" 1 990 0 "" -o Test=NotAutomatic -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=NotAutomatic -t backports
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=NotAutomatic
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=NotAutomatic
+testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=NotAutomatic -t stable
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 1 500 200 "2.0~bpo1" -o Test=NotAutomatic
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 1 500 600 "2.0~bpo1" -o Test=NotAutomatic
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test=NotAutomatic -t backports
+testequalpolicycoolstuff "" "1.0" 1 990 600 "2.0~bpo1" -o Test=NotAutomatic -t stable
+
+rm rootdir/etc/apt/preferences
+sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes"
+signreleasefiles
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicycoolstuff "" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=ButAutomaticUpgrades
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=ButAutomaticUpgrades -t stable
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 100 500 200 "2.0~bpo1" -o Test=ButAutomaticUpgrades
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 100 500 600 "2.0~bpo1" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test=ButAutomaticUpgrades -t backports
+testequalpolicycoolstuff "" "1.0" 100 990 600 "2.0~bpo1" -o Test=ButAutomaticUpgrades -t stable
+
+rm rootdir/etc/apt/preferences
+aptget install coolstuff -qq > /dev/null 2> /dev/null
+testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
+aptget dist-upgrade -qq > /dev/null 2> /dev/null
+testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "1.0" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "1.0" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports
+
+aptget install coolstuff -t backports -qq > /dev/null 2> /dev/null
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades
+aptget dist-upgrade -qq > /dev/null 2> /dev/null
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports
+
+rm incoming/backports.main.pkglist incoming/backports.main.srclist
+buildsimplenativepackage "coolstuff" "all" "2.0~bpo2" "backports"
+setupaptarchive
+
+sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes"
+signreleasefiles
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 500 0 "" "2.0~bpo2" -o Test=NotAutomatic
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 990 0 "" "2.0~bpo2" -o Test=NotAutomatic -t stable
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=NotAutomatic -t backports
+
+sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes"
+signreleasefiles
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 990 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t backports

+ 59 - 0
test/integration/test-ubuntu-bug-614993

@@ -0,0 +1,59 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "amd64"
+setupaptarchive
+
+# test success
+UPGRADE="Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  libdrm-intel1 libdrm-nouveau1 libmtdev1 libutouch-grail1 libx11-xcb1
+  libxcb-aux0 libxcb-dri2-0 libxfont1 xserver-common xserver-xorg-core
+  xserver-xorg-input-evdev xserver-xorg-input-mouse
+  xserver-xorg-input-synaptics xserver-xorg-input-vmmouse
+  xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-apm
+  xserver-xorg-video-ark xserver-xorg-video-ati xserver-xorg-video-chips
+  xserver-xorg-video-cirrus xserver-xorg-video-fbdev xserver-xorg-video-i128
+  xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga
+  xserver-xorg-video-neomagic xserver-xorg-video-nouveau xserver-xorg-video-nv
+  xserver-xorg-video-openchrome xserver-xorg-video-r128
+  xserver-xorg-video-radeon xserver-xorg-video-rendition xserver-xorg-video-s3
+  xserver-xorg-video-s3virge xserver-xorg-video-savage
+  xserver-xorg-video-siliconmotion xserver-xorg-video-sis
+  xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident
+  xserver-xorg-video-tseng xserver-xorg-video-vesa xserver-xorg-video-vmware
+  xserver-xorg-video-voodoo
+Suggested packages:
+  xfonts-scalable gpointing-device-settings touchfreeze firmware-linux
+Recommended packages:
+  xauth intel-gpu-tools
+The following packages will be REMOVED:
+  xserver-xorg-video-v4l
+The following NEW packages will be installed:
+  libmtdev1 libutouch-grail1 libx11-xcb1 libxcb-aux0 libxcb-dri2-0
+The following packages will be upgraded:
+  libdrm-intel1 libdrm-nouveau1 libxfont1 xserver-common xserver-xorg
+  xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-mouse
+  xserver-xorg-input-synaptics xserver-xorg-input-vmmouse
+  xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-apm
+  xserver-xorg-video-ark xserver-xorg-video-ati xserver-xorg-video-chips
+  xserver-xorg-video-cirrus xserver-xorg-video-fbdev xserver-xorg-video-i128
+  xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga
+  xserver-xorg-video-neomagic xserver-xorg-video-nouveau xserver-xorg-video-nv
+  xserver-xorg-video-openchrome xserver-xorg-video-r128
+  xserver-xorg-video-radeon xserver-xorg-video-rendition xserver-xorg-video-s3
+  xserver-xorg-video-s3virge xserver-xorg-video-savage
+  xserver-xorg-video-siliconmotion xserver-xorg-video-sis
+  xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident
+  xserver-xorg-video-tseng xserver-xorg-video-vesa xserver-xorg-video-vmware
+  xserver-xorg-video-voodoo
+41 upgraded, 5 newly installed, 1 to remove and 3 not upgraded.
+Need to get 0 B/5505 kB of archives.
+After this operation, 2294 kB disk space will be freed.
+E: Trivial Only specified but this is not a trivial operation."
+testequal "$UPGRADE" aptget install xserver-xorg --trivial-only
+