Kaynağa Gözat

merge with debian/sid

David Kalnischkies 15 yıl önce
ebeveyn
işleme
afd7b358f9
90 değiştirilmiş dosya ile 733 ekleme ve 2234 silme
  1. 3 2
      Makefile
  2. 22 25
      apt-pkg/acquire-item.cc
  3. 4 0
      apt-pkg/acquire.cc
  4. 14 0
      apt-pkg/cachefile.cc
  5. 1 0
      apt-pkg/cachefile.h
  6. 16 5
      apt-pkg/indexrecords.cc
  7. 53 17
      apt-pkg/orderlist.cc
  8. 3 1
      apt-pkg/orderlist.h
  9. 28 6
      apt-pkg/packagemanager.cc
  10. 1 1
      apt-pkg/pkgcache.cc
  11. 2 2
      buildlib/defaults.mak
  12. 14 6
      cmdline/apt-get.cc
  13. 1 1
      cmdline/apt-key
  14. 42 0
      debian/changelog
  15. 6 1
      debian/libapt-pkg4.11.symbols
  16. 6 1
      debian/rules
  17. 17 8
      doc/apt.conf.5.xml
  18. 16 0
      test/Makefile
  19. 0 25
      test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Packages
  20. 0 13
      test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Release
  21. 0 7
      test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Release.gpg
  22. 0 25
      test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Packages
  23. 0 13
      test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Release
  24. 0 7
      test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Release.gpg
  25. 0 2
      test/authReliability/sources.list.failure
  26. 0 2
      test/authReliability/sources.list.good
  27. 0 37
      test/conf.cc
  28. 0 23
      test/conf_clear.cc
  29. 0 16
      test/fake-status
  30. 46 24
      test/integration/framework
  31. 10 0
      test/integration/makefile
  32. 17 4
      test/integration/run-tests
  33. 0 1
      test/integration/test-bug-254770-segfault-if-cache-not-buildable
  34. 0 2
      test/integration/test-bug-590438-broken-provides-thanks-to-remove-order
  35. 1 1
      test/integration/test-bug-595691-empty-and-broken-archive-files
  36. 1 1
      test/integration/test-bug-601016-description-translation
  37. 2 2
      test/integration/test-bug-618288-multiarch-same-lockstep
  38. 8 8
      test/integration/test-bug-632221-cross-dependency-satisfaction
  39. 1 1
      test/integration/test-bug-633350-do-not-kill-last-char-in-Release
  40. 8 9
      test/integration/test-compressed-indexes
  41. 4 4
      test/integration/test-disappearing-packages
  42. 0 2
      test/integration/test-hashsum-verification
  43. 0 7
      test/integration/test-policy-pinning
  44. 95 0
      test/integration/test-releasefile-valid-until
  45. 1 2
      test/integration/test-releasefile-verification
  46. 24 0
      test/integration/test-ubuntu-bug-802901-multiarch-early-remove
  47. 31 0
      test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first
  48. 0 0
      test/interactive-helper/extract-control.cc
  49. 3 34
      test/makefile
  50. 0 0
      test/interactive-helper/mthdcat.cc
  51. 0 0
      test/interactive-helper/networkless-install-fixes/README
  52. 0 0
      test/interactive-helper/networkless-install-fixes/sources.test.list
  53. 0 0
      test/interactive-helper/networkless-install-fixes/test.sh
  54. 0 0
      test/interactive-helper/rpmver.cc
  55. 1 2
      test/test_udevcdrom.cc
  56. 0 0
      test/interactive-helper/testdeb.cc
  57. 0 0
      test/interactive-helper/testextract.cc
  58. 5 2
      test/libapt/compareversion_test.cc
  59. 78 0
      test/libapt/configuration_test.cc
  60. 1 1
      test/libapt/globalerror_test.cc
  61. 16 0
      test/libapt/makefile
  62. 19 7
      test/libapt/run-tests
  63. 112 0
      test/libapt/uri_test.cc
  64. 0 0
      test/libapt/versions.lst
  65. 0 11
      test/local-repo/Packages
  66. BIN
      test/local-repo/Packages.gz
  67. BIN
      test/local-repo/Packages.gz.save
  68. 0 13
      test/local-repo/Release
  69. 0 7
      test/local-repo/Release.gpg
  70. BIN
      test/local-repo/gdebi-test4.deb
  71. 0 266
      test/pre-upload-check.py
  72. 0 105
      test/scratch.cc
  73. 0 235
      test/test-indexes.sh
  74. 0 1182
      test/testkeys/mvo.key
  75. 0 2
      test/testsources.list/sources.list.all-gpg-broken
  76. 0 2
      test/testsources.list/sources.list.all-gpg-ok
  77. 0 1
      test/testsources.list/sources.list.all-release-broken
  78. 0 1
      test/testsources.list/sources.list.all-release-ok
  79. 0 1
      test/testsources.list/sources.list.all-validuntil-broken
  80. 0 2
      test/testsources.list/sources.list.md5-package-broken
  81. 0 2
      test/testsources.list/sources.list.md5-package-ok
  82. 0 1
      test/testsources.list/sources.list.md5-release-broken
  83. 0 1
      test/testsources.list/sources.list.md5-release-ok
  84. 0 1
      test/testsources.list/sources.list.sha1-release-broken
  85. 0 1
      test/testsources.list/sources.list.sha1-release-ok
  86. 0 2
      test/testsources.list/sources.list.sha256-package-broken
  87. 0 2
      test/testsources.list/sources.list.sha256-package-ok
  88. 0 1
      test/testsources.list/sources.list.sha256-release-broken
  89. 0 1
      test/testsources.list/sources.list.sha256-release-ok
  90. 0 34
      test/uri.cc

+ 3 - 2
Makefile

@@ -9,8 +9,8 @@ endif
 .PHONY: default
 default: startup all
 
-.PHONY: headers library clean veryclean all binary program doc
-all headers library clean veryclean binary program doc dirs:
+.PHONY: headers library clean veryclean all binary program doc test
+all headers library clean veryclean binary program doc dirs test:
 	$(MAKE) -C apt-pkg $@
 	$(MAKE) -C apt-inst $@
 	$(MAKE) -C methods $@
@@ -19,6 +19,7 @@ all headers library clean veryclean binary program doc dirs:
 	$(MAKE) -C dselect $@
 	$(MAKE) -C doc $@
 	$(MAKE) -C po $@
+	$(MAKE) -C test $@
 
 # Some very common aliases
 .PHONY: maintainer-clean dist-clean distclean pristine sanity 

+ 22 - 25
apt-pkg/acquire-item.cc

@@ -1268,9 +1268,9 @@ void pkgAcqMetaIndex::Done(string Message,unsigned long long Size,string Hash,	/
       if (SigFile == "")
       {
          // There was no signature file, so we are finished.  Download
-         // the indexes and do only hashsum verification
+         // the indexes and do only hashsum verification if possible
          MetaIndexParser->Load(DestFile);
-         QueueIndexes(true);
+         QueueIndexes(false);
       }
       else
       {
@@ -1388,33 +1388,30 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify)				/*{{{*/
         ++Target)
    {
       HashString ExpectedIndexHash;
-      if (verify)
+      const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey);
+      if (Record == NULL)
       {
-	 const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey);
-	 if (Record == NULL)
+	 if (verify == true && (*Target)->IsOptional() == false)
 	 {
-	    if ((*Target)->IsOptional() == false)
-	    {
-	       Status = StatAuthError;
-	       strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str());
-	       return;
-	    }
+	    Status = StatAuthError;
+	    strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str());
+	    return;
 	 }
-	 else
+      }
+      else
+      {
+	 ExpectedIndexHash = Record->Hash;
+	 if (_config->FindB("Debug::pkgAcquire::Auth", false))
 	 {
-	    ExpectedIndexHash = Record->Hash;
-	    if (_config->FindB("Debug::pkgAcquire::Auth", false))
-	    {
-	       std::cerr << "Queueing: " << (*Target)->URI << std::endl;
-	       std::cerr << "Expected Hash: " << ExpectedIndexHash.toStr() << std::endl;
-	       std::cerr << "For: " << Record->MetaKeyFilename << std::endl;
-	    }
-	    if (ExpectedIndexHash.empty() == true && (*Target)->IsOptional() == false)
-	    {
-	       Status = StatAuthError;
-	       strprintf(ErrorText, _("Unable to find hash sum for '%s' in Release file"), (*Target)->MetaKey.c_str());
-	       return;
-	    }
+	    std::cerr << "Queueing: " << (*Target)->URI << std::endl;
+	    std::cerr << "Expected Hash: " << ExpectedIndexHash.toStr() << std::endl;
+	    std::cerr << "For: " << Record->MetaKeyFilename << std::endl;
+	 }
+	 if (verify == true && ExpectedIndexHash.empty() == true && (*Target)->IsOptional() == false)
+	 {
+	    Status = StatAuthError;
+	    strprintf(ErrorText, _("Unable to find hash sum for '%s' in Release file"), (*Target)->MetaKey.c_str());
+	    return;
 	 }
       }
 

+ 4 - 0
apt-pkg/acquire.cc

@@ -447,6 +447,10 @@ pkgAcquire::Worker *pkgAcquire::WorkerStep(Worker *I)
    if it is part of the download set. */
 bool pkgAcquire::Clean(string Dir)
 {
+   // non-existing directories are by definition clean…
+   if (DirectoryExists(Dir) == false)
+      return true;
+
    DIR *D = opendir(Dir.c_str());   
    if (D == 0)
       return _error->Errno("opendir",_("Unable to read %s"),Dir.c_str());

+ 14 - 0
apt-pkg/cachefile.cc

@@ -165,6 +165,20 @@ bool pkgCacheFile::Open(OpProgress *Progress, bool WithLock)
    return true;
 }
 									/*}}}*/
+// CacheFile::RemoveCaches - remove all cache files from disk		/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+void pkgCacheFile::RemoveCaches()
+{
+   std::string const pkgcache = _config->FindFile("Dir::cache::pkgcache");
+   std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache");
+
+   if (pkgcache.empty() == false && RealFileExists(pkgcache) == true)
+      unlink(pkgcache.c_str());
+   if (srcpkgcache.empty() == false && RealFileExists(srcpkgcache) == true)
+      unlink(srcpkgcache.c_str());
+}
+									/*}}}*/
 // CacheFile::Close - close the cache files				/*{{{*/
 // ---------------------------------------------------------------------
 /* */

+ 1 - 0
apt-pkg/cachefile.h

@@ -60,6 +60,7 @@ class pkgCacheFile
    bool Open(OpProgress *Progress = NULL, bool WithLock = true);
    inline bool ReadOnlyOpen(OpProgress *Progress = NULL) { return Open(Progress, false); };
    __deprecated bool Open(OpProgress &Progress,bool const &WithLock = true) { return Open(&Progress, WithLock); };
+   static void RemoveCaches();
    void Close();
 
    inline pkgCache* GetPkgCache() { BuildCaches(NULL, false); return Cache; };

+ 16 - 5
apt-pkg/indexrecords.cc

@@ -115,10 +115,14 @@ bool indexRecords::Load(const string Filename)				/*{{{*/
    }
    // get the user settings for this archive and use what expires earlier
    int MaxAge = _config->FindI("Acquire::Max-ValidTime", 0);
-   if (Label.empty() == true)
+   if (Label.empty() == false)
       MaxAge = _config->FindI(string("Acquire::Max-ValidTime::" + Label).c_str(), MaxAge);
+   int MinAge = _config->FindI("Acquire::Min-ValidTime", 0);
+   if (Label.empty() == false)
+      MinAge = _config->FindI(string("Acquire::Min-ValidTime::" + Label).c_str(), MinAge);
 
-   if(MaxAge == 0) // No user settings, use the one from the Release file
+   if(MaxAge == 0 &&
+      (MinAge == 0 || ValidUntil == 0)) // No user settings, use the one from the Release file
       return true;
 
    time_t date;
@@ -127,10 +131,17 @@ bool indexRecords::Load(const string Filename)				/*{{{*/
       strprintf(ErrorText, _("Invalid 'Date' entry in Release file %s"), Filename.c_str());
       return false;
    }
-   date += 24*60*60*MaxAge;
 
-   if (ValidUntil == 0 || ValidUntil > date)
-      ValidUntil = date;
+   if (MinAge != 0 && ValidUntil != 0) {
+      time_t const min_date = date + MinAge;
+      if (ValidUntil < min_date)
+	 ValidUntil = min_date;
+   }
+   if (MaxAge != 0) {
+      time_t const max_date = date + MaxAge;
+      if (ValidUntil == 0 || ValidUntil > max_date)
+	 ValidUntil = max_date;
+   }
 
    return true;
 }

+ 53 - 17
apt-pkg/orderlist.cc

@@ -154,7 +154,7 @@ bool pkgOrderList::DoRun()
    iterator OldEnd = End;
    End = NList;
    for (iterator I = List; I != OldEnd; ++I)
-      if (VisitNode(PkgIterator(Cache,*I)) == false)
+      if (VisitNode(PkgIterator(Cache,*I), "DoRun") == false)
       {
 	 End = OldEnd;
 	 return false;
@@ -497,33 +497,69 @@ bool pkgOrderList::VisitRProvides(DepFunc F,VerIterator Ver)
 									/*}}}*/
 // OrderList::VisitProvides - Visit all of the providing packages	/*{{{*/
 // ---------------------------------------------------------------------
-/* This routine calls visit on all providing packages. */
+/* This routine calls visit on all providing packages.
+
+   If the dependency is negative it first visits packages which are
+   intended to be removed and after that all other packages.
+   It does so to avoid situations in which this package is used to
+   satisfy a (or-group/provides) dependency of another package which
+   could have been satisfied also by upgrading another package -
+   otherwise we have more broken packages dpkg needs to auto-
+   deconfigure and in very complicated situations it even decides
+   against it! */
 bool pkgOrderList::VisitProvides(DepIterator D,bool Critical)
-{   
+{
    SPtrArray<Version *> List = D.AllTargets();
-   for (Version **I = List; *I != 0; I++)
+   for (Version **I = List; *I != 0; ++I)
    {
       VerIterator Ver(Cache,*I);
       PkgIterator Pkg = Ver.ParentPkg();
 
+      if (D.IsNegative() == true && Cache[Pkg].Delete() == false)
+	 continue;
+
       if (Cache[Pkg].Keep() == true && Pkg.State() == PkgIterator::NeedsNothing)
 	 continue;
-      
+
       if (D.IsNegative() == false &&
 	  Cache[Pkg].InstallVer != *I)
 	 continue;
-      
+
       if (D.IsNegative() == true &&
 	  (Version *)Pkg.CurrentVer() != *I)
 	 continue;
-      
+
+      // Skip over missing files
+      if (Critical == false && IsMissing(D.ParentPkg()) == true)
+	 continue;
+
+      if (VisitNode(Pkg, "Provides-1") == false)
+	 return false;
+   }
+   if (D.IsNegative() == false)
+      return true;
+   for (Version **I = List; *I != 0; ++I)
+   {
+      VerIterator Ver(Cache,*I);
+      PkgIterator Pkg = Ver.ParentPkg();
+
+      if (Cache[Pkg].Delete() == true)
+	 continue;
+
+      if (Cache[Pkg].Keep() == true && Pkg.State() == PkgIterator::NeedsNothing)
+	 continue;
+
+      if ((Version *)Pkg.CurrentVer() != *I)
+	 continue;
+
       // Skip over missing files
       if (Critical == false && IsMissing(D.ParentPkg()) == true)
 	 continue;
 
-      if (VisitNode(Pkg) == false)
+      if (VisitNode(Pkg, "Provides-2") == false)
 	 return false;
    }
+
    return true;
 }
 									/*}}}*/
@@ -532,7 +568,7 @@ bool pkgOrderList::VisitProvides(DepIterator D,bool Critical)
 /* This is the core ordering routine. It calls the set dependency
    consideration functions which then potentialy call this again. Finite
    depth is achived through the colouring mechinism. */
-bool pkgOrderList::VisitNode(PkgIterator Pkg)
+bool pkgOrderList::VisitNode(PkgIterator Pkg, char const* from)
 {
    // Looping or irrelevent.
    // This should probably trancend not installed packages
@@ -543,7 +579,7 @@ bool pkgOrderList::VisitNode(PkgIterator Pkg)
    if (Debug == true)
    {
       for (int j = 0; j != Depth; j++) clog << ' ';
-      clog << "Visit " << Pkg.FullName() << endl;
+      clog << "Visit " << Pkg.FullName() << " from " << from << endl;
    }
    
    Depth++;
@@ -638,7 +674,7 @@ bool pkgOrderList::DepUnPackCrit(DepIterator D)
 	 if (CheckDep(D) == true)
 	    continue;
 
-	 if (VisitNode(D.ParentPkg()) == false)
+	 if (VisitNode(D.ParentPkg(), "UnPackCrit") == false)
 	    return false;
       }
       else
@@ -813,7 +849,7 @@ bool pkgOrderList::DepUnPackDep(DepIterator D)
 	    if (IsMissing(D.ParentPkg()) == true)
 	       continue;
 	    
-	    if (VisitNode(D.ParentPkg()) == false)
+	    if (VisitNode(D.ParentPkg(), "UnPackDep-Parent") == false)
 	       return false;
 	 }
 	 else
@@ -827,7 +863,7 @@ bool pkgOrderList::DepUnPackDep(DepIterator D)
 	       if (CheckDep(D) == true)
 		 continue;
 
-	       if (VisitNode(D.TargetPkg()) == false)
+	       if (VisitNode(D.TargetPkg(), "UnPackDep-Target") == false)
 		 return false;
 	    }
 	 }
@@ -926,7 +962,7 @@ bool pkgOrderList::DepRemove(DepIterator D)
 			if (IsFlag(P, InList) == true &&
 			    IsFlag(P, AddPending) == false &&
 			    Cache[P].InstallVer != 0 &&
-			    VisitNode(P) == true)
+			    VisitNode(P, "Remove-P") == true)
 			{
 			   Flag(P, Immediate);
 			   tryFixDeps = false;
@@ -962,7 +998,7 @@ bool pkgOrderList::DepRemove(DepIterator D)
 		  if (IsFlag(F.TargetPkg(), InList) == true &&
 		      IsFlag(F.TargetPkg(), AddPending) == false &&
 		      Cache[F.TargetPkg()].InstallVer != 0 &&
-		      VisitNode(F.TargetPkg()) == true)
+		      VisitNode(F.TargetPkg(), "Remove-Target") == true)
 		  {
 		     Flag(F.TargetPkg(), Immediate);
 		     tryFixDeps = false;
@@ -976,7 +1012,7 @@ bool pkgOrderList::DepRemove(DepIterator D)
 			if (IsFlag(Prv.OwnerPkg(), InList) == true &&
 			    IsFlag(Prv.OwnerPkg(), AddPending) == false &&
 			    Cache[Prv.OwnerPkg()].InstallVer != 0 &&
-			    VisitNode(Prv.OwnerPkg()) == true)
+			    VisitNode(Prv.OwnerPkg(), "Remove-Owner") == true)
 			{
 			   Flag(Prv.OwnerPkg(), Immediate);
 			   tryFixDeps = false;
@@ -996,7 +1032,7 @@ bool pkgOrderList::DepRemove(DepIterator D)
 	 if (IsMissing(D.ParentPkg()) == true)
 	    continue;
 	 
-	 if (VisitNode(D.ParentPkg()) == false)
+	 if (VisitNode(D.ParentPkg(), "Remove-Parent") == false)
 	    return false;
       }
    

+ 3 - 1
apt-pkg/orderlist.h

@@ -18,6 +18,7 @@
 
 
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/macros.h>
 
 class pkgDepCache;
 class pkgOrderList : protected pkgCache::Namespace
@@ -45,7 +46,8 @@ class pkgOrderList : protected pkgCache::Namespace
    bool Debug;
    
    // Main visit function
-   bool VisitNode(PkgIterator Pkg);
+   __deprecated bool VisitNode(PkgIterator Pkg) { return VisitNode(Pkg, "UNKNOWN"); };
+   bool VisitNode(PkgIterator Pkg, char const* from);
    bool VisitDeps(DepFunc F,PkgIterator Pkg);
    bool VisitRDeps(DepFunc F,PkgIterator Pkg);
    bool VisitRProvides(DepFunc F,VerIterator Ver);

+ 28 - 6
apt-pkg/packagemanager.cc

@@ -600,22 +600,44 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
    
    for (PrvIterator P = instVer.ProvidesList();
 	P.end() == false; ++P)
-      CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
+      if (Pkg->Group != P.OwnerPkg()->Group)
+	 CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
 
    List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
 
-   if ((instVer->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+   if (Immediate == true && instVer->MultiArch == pkgCache::Version::Same)
+   {
+      /* Do lockstep M-A:same unpacking in two phases:
+	 First unpack all installed architectures, then the not installed.
+	 This way we avoid that M-A: enabled packages are installed before
+	 their older non-M-A enabled packages are replaced by newer versions */
+      bool const installed = Pkg->CurrentVer != 0;
+      if (installed == true && Install(Pkg,FileNames[Pkg->ID]) == false)
+	 return false;
       for (PkgIterator P = Pkg.Group().PackageList();
 	   P.end() == false; P = Pkg.Group().NextPkg(P))
       {
-	 if (Pkg == P || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
+	 if (P->CurrentVer == 0 || P == Pkg || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
 	     Cache[P].InstallVer == 0 || (P.CurrentVer() == Cache[P].InstallVer &&
 	      (Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall))
 	    continue;
-	 SmartUnPack(P, false);
+	 if (SmartUnPack(P, false) == false)
+	    return false;
       }
-
-   if(Install(Pkg,FileNames[Pkg->ID]) == false)
+      if (installed == false && Install(Pkg,FileNames[Pkg->ID]) == false)
+	 return false;
+      for (PkgIterator P = Pkg.Group().PackageList();
+	   P.end() == false; P = Pkg.Group().NextPkg(P))
+      {
+	 if (P->CurrentVer != 0 || P == Pkg || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
+	     Cache[P].InstallVer == 0 || (P.CurrentVer() == Cache[P].InstallVer &&
+	      (Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall))
+	    continue;
+	 if (SmartUnPack(P, false) == false)
+	    return false;
+      }
+   }
+   else if (Install(Pkg,FileNames[Pkg->ID]) == false)
       return false;
 
    // Perform immedate configuration of the package.

+ 1 - 1
apt-pkg/pkgcache.cc

@@ -638,7 +638,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const
 	    continue;
 	 
 	 if (IsNegative() == true &&
-	     ParentPkg() == I.OwnerPkg())
+	     ParentPkg()->Group == I.OwnerPkg()->Group)
 	    continue;
 	 
 	 Size++;

+ 2 - 2
buildlib/defaults.mak

@@ -118,10 +118,10 @@ MKDIRS := $(BIN)
 # list
 .PHONY: headers library clean veryclean all binary program doc dirs
 .PHONY: maintainer-clean dist-clean distclean pristine sanity
-all: binary doc
+all: dirs binary doc
 binary: library program
 maintainer-clean dist-clean distclean pristine sanity: veryclean
-headers library clean veryclean program:
+headers library clean veryclean program test:
 
 veryclean:
 	echo Very Clean done for $(SUBDIR)

+ 14 - 6
cmdline/apt-get.cc

@@ -1625,7 +1625,8 @@ bool DoUpdate(CommandLine &CmdL)
    if (_config->FindB("APT::Get::Download",true) == true)
        ListUpdate(Stat, *List);
 
-   // Rebuild the cache.   
+   // Rebuild the cache.
+   pkgCacheFile::RemoveCaches();
    if (Cache.BuildCaches() == false)
       return false;
    
@@ -2205,10 +2206,14 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
 /* */
 bool DoClean(CommandLine &CmdL)
 {
+   std::string const archivedir = _config->FindDir("Dir::Cache::archives");
+   std::string const pkgcache = _config->FindFile("Dir::cache::pkgcache");
+   std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache");
+
    if (_config->FindB("APT::Get::Simulate") == true)
    {
-      cout << "Del " << _config->FindDir("Dir::Cache::archives") << "* " <<
-	 _config->FindDir("Dir::Cache::archives") << "partial/*" << endl;
+      cout << "Del " << archivedir << "* " << archivedir << "partial/*"<< endl
+	   << "Del " << pkgcache << " " << srcpkgcache << endl;
       return true;
    }
    
@@ -2216,14 +2221,17 @@ bool DoClean(CommandLine &CmdL)
    FileFd Lock;
    if (_config->FindB("Debug::NoLocking",false) == false)
    {
-      Lock.Fd(GetLock(_config->FindDir("Dir::Cache::Archives") + "lock"));
+      Lock.Fd(GetLock(archivedir + "lock"));
       if (_error->PendingError() == true)
 	 return _error->Error(_("Unable to lock the download directory"));
    }
    
    pkgAcquire Fetcher;
-   Fetcher.Clean(_config->FindDir("Dir::Cache::archives"));
-   Fetcher.Clean(_config->FindDir("Dir::Cache::archives") + "partial/");
+   Fetcher.Clean(archivedir);
+   Fetcher.Clean(archivedir + "partial/");
+
+   pkgCacheFile::RemoveCaches();
+
    return true;
 }
 									/*}}}*/

+ 1 - 1
cmdline/apt-key

@@ -152,7 +152,7 @@ if [ "$1" = "--keyring" ]; then
         #echo "keyfile given"
 	shift
 	TRUSTEDFILE="$1"
-	if [ -r "$TRUSTEDFILE" ]; then
+	if [ -r "$TRUSTEDFILE" ] || [ "$2" = 'add' ]; then
 		GPG="$GPG --keyring $TRUSTEDFILE --primary-keyring $TRUSTEDFILE"
 	else
 		echo >&2 "Error: The specified keyring »$TRUSTEDFILE« is missing or not readable"

+ 42 - 0
debian/changelog

@@ -124,6 +124,48 @@ apt (0.8.16~exp1) experimental; urgency=low
 
  -- Michael Vogt <mvo@debian.org>  Wed, 29 Jun 2011 12:40:31 +0200
 
+apt (0.8.15.7) unstable; urgency=low
+
+  [ David Kalnischkies ]
+  * apt-pkg/packagemanager.cc, apt-pkg/pkgcache.cc:
+    - ignore "self"-conflicts for all architectures of a package
+      instead of just for the architecture of the package look at
+      in the ordering of installations, too (LP: #802901)
+    - M-A:same lockstep unpack should operate on installed
+      packages first (LP: #835625)
+  * test/*
+    - reorganize the various testcases and helper we have and
+      integrate them better into the buildsystem
+    - run the test/libapt testcases at package build-time
+  * debian/apt.symbols:
+    - add the newly added symbols since 0.8.15.3
+  * cmdline/apt-get.cc:
+    - remove the binary caches in 'apt-get clean' as it is the first
+      thing recommend by many supporters in case of APT segfaults
+    - remove the caches in 'apt-get update', too, as they will be
+      invalid in most cases anyway
+  * apt-pkg/acquire-item.cc:
+    - if no Release.gpg file is found try to verify with hashes,
+      but do not fail if a hash can't be found
+  * apt-pkg/acquire.cc:
+    - non-existing directories are by definition clean
+  * cmdline/apt-key:
+    - if command is 'add' do not error out if the specified
+      keyring doesn't exist, it will be created by gpg
+  * apt-pkg/orderlist.cc:
+    - prefer visiting packages marked for deletion in VisitProvides
+      if we are operating on a negative dependency so that we can
+      deal early with the fallout of this remove
+  * apt-pkg/indexrecords.cc:
+    - fix Acquire::Max-ValidTime option by interpreting it really
+      as seconds as specified in the manpage and not as days
+    - add an Acquire::Min-ValidTime option (Closes: #640122)
+  * doc/apt.conf.5.xml:
+    - reword Acquire::Max-ValidTime documentation to make clear
+      that it doesn't provide the new Min-ValidTime functionality
+
+ -- Michael Vogt <mvo@debian.org>  Mon, 12 Sep 2011 16:38:46 +0200
+
 apt (0.8.15.6) unstable; urgency=low
 
   [ Michael Vogt ]

+ 6 - 1
debian/libapt-pkg4.11.symbols

@@ -562,7 +562,6 @@ libapt-pkg.so.4.11 libapt-pkg4.11 #MINVER#
  (c++)"pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.8.0
  (c++)"pkgCacheGenerator::ListParser::CollectFileProvides(pkgCache&, pkgCache::VerIterator&)@Base" 0.8.0
  (c++)"pkgCacheGenerator::ListParser::~ListParser()@Base" 0.8.0
- (c++)"pkgCacheGenerator::NewDepends(pkgCache::PkgIterator&, pkgCache::VerIterator&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int const&, unsigned int const&, unsigned int*)@Base" 0.8.0
  (c++)"pkgCacheGenerator::NewFileVer(pkgCache::VerIterator&, pkgCacheGenerator::ListParser&)@Base" 0.8.0
  (c++)"pkgCacheGenerator::NewPackage(pkgCache::PkgIterator&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.8.0
  (c++)"pkgCacheGenerator::NewVersion(pkgCache::VerIterator&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)@Base" 0.8.0
@@ -1327,3 +1326,9 @@ libapt-pkg.so.4.11 libapt-pkg4.11 #MINVER#
  (c++)"pkgDepCache::IsModeChangeOk(pkgDepCache::ModeList, pkgCache::PkgIterator const&, unsigned long, bool)@Base" 0.8.13.2
  (c++)"pkgPackageManager::SmartUnPack(pkgCache::PkgIterator, bool)@Base" 0.8.15~exp1
  (c++)"pkgCache::DepIterator::IsNegative() const@Base" 0.8.15~exp1
+ (c++)"Configuration::CndSet(char const*, int)@Base" 0.8.15.3
+ (c++)"pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator)@Base" 0.8.15.3
+ (c++)"DeEscapeString(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.8.15.4
+ (c++)"GetModificationTime(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.8.15.6
+ (c++)"pkgSourceList::GetLastModifiedTime()@Base" 0.8.15.6
+ (c++)"pkgCacheGenerator::NewDepends(pkgCache::PkgIterator&, pkgCache::VerIterator&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int const&, unsigned int const&, unsigned int*&)@Base" 0.8.15.6

+ 6 - 1
debian/rules

@@ -100,7 +100,12 @@ build/build-stamp: build/configure-stamp
 	# compat symlink for the locale split
 	mkdir -p build/usr/share 
 	cd build/usr/share && ln -f -s ../../locale .
-	# done here
+	# compile and run tests
+ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
+	$(MAKE) test
+else
+	@echo "Tests DISABLED"
+endif
 	touch $@
 
 build/build-doc-stamp: build/configure-stamp

+ 17 - 8
doc/apt.conf.5.xml

@@ -267,14 +267,23 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
 
      <varlistentry><term>Max-ValidTime</term>
 	 <listitem><para>Seconds the Release file should be considered valid after
-	 it was created. The default is "for ever" (0) if the Release file of the
-	 archive doesn't include a <literal>Valid-Until</literal> header.
-	 If it does then this date is the default. The date from the Release file or
-	 the date specified by the creation time of the Release file
-	 (<literal>Date</literal> header) plus the seconds specified with this
-	 options are used to check if the validation of a file has expired by using
-	 the earlier date of the two. Archive specific settings can be made by
-	 appending the label of the archive to the option name.
+	 it was created (indicated by the <literal>Date</literal> header).
+	 If the Release file itself includes a <literal>Valid-Until</literal> header
+	 the earlier date of the two is used as the expiration date.
+	 The default value is <literal>0</literal> which stands for "for ever".
+	 Archive specific settings can be made by appending the label of the archive
+	 to the option name.
+	 </para></listitem>
+     </varlistentry>
+
+     <varlistentry><term>Min-ValidTime</term>
+	 <listitem><para>Minimum of seconds the Release file should be considered
+	 valid after it was created (indicated by the <literal>Date</literal> header).
+	 Use this if you need to use a seldomly updated (local) mirror of a more
+	 regular updated archive with a <literal>Valid-Until</literal> header
+	 instead of competely disabling the expiration date checking.
+	 Archive specific settings can and should be used by appending the label of
+	 the archive to the option name.
 	 </para></listitem>
      </varlistentry>
 

+ 16 - 0
test/Makefile

@@ -0,0 +1,16 @@
+# -*- make -*-
+
+# This is the top level test makefile for APT, it recurses to each lower
+# level make file and runs it with the proper target
+ifndef NOISY
+.SILENT:
+endif
+
+.PHONY: headers library clean veryclean all binary program doc test
+all clean veryclean binary program dirs test:
+	$(MAKE) -C libapt $@
+	$(MAKE) -C interactive-helper $@
+
+# Some very common aliases
+.PHONY: maintainer-clean dist-clean distclean pristine sanity
+maintainer-clean dist-clean distclean pristine sanity: veryclean

+ 0 - 25
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Packages

@@ -1,25 +0,0 @@
-Package: libglib2.0-data
-Priority: optional
-Section: misc
-Installed-Size: 2288
-Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
-Original-Maintainer: Loic Minier <lool@dooz.org>
-Architecture: all
-Source: glib2.0
-Version: 2.13.6-1ubuntu1
-Replaces: libglib1.3, libglib1.3-data
-Depends: libglib2.0-0 (>= 2.13.6-1ubuntu1)
-Conflicts: libglib1.3-data
-Filename: ./libglib2.0-data_2.13.6-1ubuntu1_all.deb
-Size: 958
-MD5sum: 803fc5e2e31a4345b3e9c771e1eae49f
-SHA1: 75b2c62b21bae60c58e694dd40ed6d4df946e304
-SHA256: 142d8466eac252f06bc957d76fe1bb87f86f2d3512b99c8d4b08c1ad79fbe59e
-Description: Common files for GLib library
- GLib is a library containing many useful C routines for things such
- as trees, hashes, lists, and strings.  It is a useful general-purpose
- C library used by projects such as GTK+, GIMP, and GNOME.
- .
- This package is needed for the runtime libraries to display messages in
- languages other than English.
-

+ 0 - 13
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Release

@@ -1,13 +0,0 @@
-Date: Fri, 27 Jul 2007 14:39:41 UTC
-MD5Sum:
- 4672dadea6a144839f823c9f3d5fd44b              934 Packages
- 82ebcf09a8d78a2b9cf7759349da4936              603 Packages.gz
- d41d8cd98f00b204e9800998ecf8427e                0 Release
-SHA1:
- fa0f294aa30789529371066b10e9497be1284d26              934 Packages
- f4032808663b2810d87b4a4dab6f5ae4a1e8fa8e              603 Packages.gz
- da39a3ee5e6b4b0d3255bfef95601890afd80709                0 Release
-SHA256:
- 92c9b605480dc74e6be79c0ddc24738bfcbd6dd3148af531acd68717de528049              934 Packages
- 659ccc0d07ff21f0247f9fa5abe149221c90d5e17da52c7afddb035b93c23d39              603 Packages.gz
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855                0 Release

+ 0 - 7
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Release.gpg

@@ -1,7 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-iD8DBQBGqgOwliSD4VZixzQRAs6jAJ9p7Aiob9gzkUNCtoW8UPrBo0E/YwCdEaz0
-CQJszU6fRYX5jGWXSWzfc5c=
-=ugH0
------END PGP SIGNATURE-----

+ 0 - 25
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Packages

@@ -1,25 +0,0 @@
-Package: libglib2.0-data
-Priority: optional
-Section: misc
-Installed-Size: 2288
-Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
-Original-Maintainer: Loic Minier <lool@dooz.org>
-Architecture: all
-Source: glib2.0
-Version: 2.13.6-1ubuntu1
-Replaces: libglib1.3, libglib1.3-data
-Depends: libglib2.0-0 (>= 2.13.6-1ubuntu1)
-Conflicts: libglib1.3-data
-Filename: ./libglib2.0-data_2.13.6-1ubuntu1_all.deb
-Size: 958
-MD5sum: 803fc5e2e31a4345b3e9c771e1eae49f
-SHA1: 75b2c62b21bae60c58e694dd40ed6d4df946e304
-SHA256: 142d8466eac252f06bc957d76fe1bb87f86f2d3512b99c8d4b08c1ad79fbe59e
-Description: Common files for GLib library
- GLib is a library containing many useful C routines for things such
- as trees, hashes, lists, and strings.  It is a useful general-purpose
- C library used by projects such as GTK+, GIMP, and GNOME.
- .
- This package is needed for the runtime libraries to display messages in
- languages other than English.
-

+ 0 - 13
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Release

@@ -1,13 +0,0 @@
-Date: Fri, 27 Jul 2007 14:39:41 UTC
-MD5Sum:
- 4672dadea6a144839f823c9f3d5fd44b              934 Packages
- 82ebcf09a8d78a2b9cf7759349da4936              603 Packages.gz
- d41d8cd98f00b204e9800998ecf8427e                0 Release
-SHA1:
- fa0f294aa30789529371066b10e9497be1284d26              934 Packages
- f4032808663b2810d87b4a4dab6f5ae4a1e8fa8e              603 Packages.gz
- da39a3ee5e6b4b0d3255bfef95601890afd80709                0 Release
-SHA256:
- 92c9b605480dc74e6be79c0ddc24738bfcbd6dd3148af531acd68717de528049              934 Packages
- 659ccc0d07ff21f0247f9fa5abe149221c90d5e17da52c7afddb035b93c23d39              603 Packages.gz
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855                0 Release

+ 0 - 7
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Release.gpg

@@ -1,7 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-iD8DBQBGqgOwliSD4VZixzQRAs6jAJ9p7Aiob9gzkUNCtoW8UPrBo0E/YwCdEaz0
-CQJszU6fRYX5jGWXSWzfc5c=
-=ugH0
------END PGP SIGNATURE-----

+ 0 - 2
test/authReliability/sources.list.failure

@@ -1,2 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/gpg-package-broken/ /
-

+ 0 - 2
test/authReliability/sources.list.good

@@ -1,2 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/gpg-package-ok/ /
-

+ 0 - 37
test/conf.cc

@@ -1,37 +0,0 @@
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/error.h>
-
-using namespace std;
-
-int main(int argc,const char *argv[])
-{
-   Configuration Cnf;
-   
-   ReadConfigFile(Cnf,argv[1],true);
-   
-   // Process 'simple-key' type sections
-   const Configuration::Item *Top = Cnf.Tree("simple-key");
-   for (Top = (Top == 0?0:Top->Child); Top != 0; Top = Top->Next)
-   {
-      Configuration Block(Top);
-      
-      string VendorID = Top->Tag;
-      string FingerPrint = Block.Find("Fingerprint");
-      string Name = Block.Find("Name"); // Description?
-      
-      if (FingerPrint.empty() == true || Name.empty() == true)
-	 _error->Error("Block %s is invalid",VendorID.c_str());
-      
-      cout << VendorID << ' ' << FingerPrint << ' ' << Name << endl;
-   }   
-	 
-   // Print any errors or warnings found during parsing
-   if (_error->empty() == false)
-   {
-      bool Errors = _error->PendingError();
-      _error->DumpErrors();
-      return Errors == true?100:0;
-   }
-   
-   return 0;
-}

+ 0 - 23
test/conf_clear.cc

@@ -1,23 +0,0 @@
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/error.h>
-
-using namespace std;
-
-int main(int argc,const char *argv[])
-{
-   Configuration Cnf;
-
-   cout << "adding elements" << endl;
-   Cnf.Set("APT::Keep-Fds::",28);
-   Cnf.Set("APT::Keep-Fds::",17);
-   Cnf.Set("APT::Keep-Fds::",47);
-   Cnf.Dump();
-
-   cout << "Removing  elements" << endl;
-   Cnf.Clear("APT::Keep-Fds",17);
-   Cnf.Clear("APT::Keep-Fds",28);
-   Cnf.Clear("APT::Keep-Fds",47);
-   Cnf.Dump();
-
-   return 0;
-}

+ 0 - 16
test/fake-status

@@ -1,16 +0,0 @@
-Package: libglib2.0-0
-Status: install ok installed
-Priority: optional
-Section: libs
-Installed-Size: 1376
-Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
-Architecture: all
-Source: glib2.0
-Version: 2.13.7-1ubuntu1
-Description: The GLib library of C routines
- GLib is a library containing many useful C routines for things such
- as trees, hashes, lists, and strings.  It is a useful general-purpose
- C library used by projects such as GTK+, GIMP, and GNOME.
- .
- This package contains the shared libraries.
-Original-Maintainer: Loic Minier <lool@dooz.org>

+ 46 - 24
test/integration/framework

@@ -1,16 +1,19 @@
 #!/bin/sh -- # no runable script, just for vi
 
 # we all like colorful messages
-CERROR="" # red
-CWARNING="" # yellow
-CMSG="" # green
-CINFO="" # light blue
-CDEBUG="" # blue
-CNORMAL="" # default system console color
-CDONE="" # green
-CPASS="" # green
-CFAIL="" # red
-CCMD="" # pink
+if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null && \
+   expr match "$(readlink -f /proc/$$/fd/2)" '/dev/pts/[0-9]\+' > /dev/null; then
+	CERROR="" # red
+	CWARNING="" # yellow
+	CMSG="" # green
+	CINFO="" # light blue
+	CDEBUG="" # blue
+	CNORMAL="" # default system console color
+	CDONE="" # green
+	CPASS="" # green
+	CFAIL="" # red
+	CCMD="" # pink
+fi
 
 msgdie() { echo "${CERROR}E: $1${CNORMAL}" >&2; exit 1; }
 msgwarn() { echo "${CWARNING}W: $1${CNORMAL}" >&2; }
@@ -42,7 +45,11 @@ if [ $MSGLEVEL -le 2 ]; then
 	msgtest() { true; }
 	msgpass() { echo -n " ${CPASS}P${CNORMAL}" >&2; }
 	msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; }
-	msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; }
+	if [ -n "$CFAIL" ]; then
+		msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; }
+	else
+		msgfail() { echo -n " ###FAILED###" >&2; }
+	fi
 fi
 if [ $MSGLEVEL -le 3 ]; then
 	msginfo() { true; }
@@ -506,10 +513,12 @@ buildaptarchivefromfiles() {
 # can be overridden by testcases for their pleasure
 getcodenamefromsuite() { echo -n "$1"; }
 getreleaseversionfromsuite() { true; }
+getlabelfromsuite() { true; }
 
 generatereleasefiles() {
+	# $1 is the Date header and $2 is the ValidUntil header to be set
+	# both should be given in notation date/touch can understand
 	msgninfo "\tGenerate Release files… "
-	local DATE="${1:-now}"
 	if [ -e aptarchive/dists ]; then
 		for dir in $(find ./aptarchive/dists -mindepth 3 -maxdepth 3 -type d -name 'i18n'); do
 			aptftparchive -qq release $dir -o APT::FTPArchive::Release::Patterns::='Translation-*' > $dir/Index
@@ -518,27 +527,35 @@ generatereleasefiles() {
 			local SUITE="$(echo "$dir" | cut -d'/' -f 4)"
 			local CODENAME="$(getcodenamefromsuite $SUITE)"
 			local VERSION="$(getreleaseversionfromsuite $SUITE)"
-			if [ -z "$VERSION" ]; then
-				aptftparchive -qq release $dir \
-					-o APT::FTPArchive::Release::Suite="${SUITE}" \
-					-o APT::FTPArchive::Release::Codename="${CODENAME}" \
-						| sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
-			else
-				aptftparchive -qq release $dir \
-					-o APT::FTPArchive::Release::Suite="${SUITE}" \
-					-o APT::FTPArchive::Release::Codename="${CODENAME}" \
-					-o APT::FTPArchive::Release::Version="${VERSION}" \
-						| sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
+			local LABEL="$(getlabelfromsuite $SUITE)"
+			if [ -n "$VERSION" ]; then
+				VERSION="-o APT::FTPArchive::Release::Version=${VERSION}"
+			fi
+			if [ -n "$LABEL" ]; then
+				LABEL="-o APT::FTPArchive::Release::Label=${LABEL}"
 			fi
+			aptftparchive -qq release $dir \
+				-o APT::FTPArchive::Release::Suite="${SUITE}" \
+				-o APT::FTPArchive::Release::Codename="${CODENAME}" \
+				${LABEL} \
+				${VERSION} \
+					| sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
 			if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then
 				sed -i '/^Date: / a\
 NotAutomatic: yes' $dir/Release
 			fi
+			if [ -n "$1" -a "$1" != "now" ]; then
+				sed -i "s/^Date: .*$/Date: $(date -d "$1" '+%a, %d %b %Y %H:%M:%S %Z')/" $dir/Release
+			fi
+			if [ -n "$2" ]; then
+				sed -i "/^Date: / a\
+Valid-Until: $(date -d "$2" '+%a, %d %b %Y %H:%M:%S %Z')" $dir/Release
+			fi
 		done
 	else
 		aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference
 	fi
-	if [ "$DATE" != "now" ]; then
+	if [ -n "$1" -a "$1" != "now" ]; then
 		for release in $(find ./aptarchive -name 'Release'); do
 			touch -d "$1" $release
 		done
@@ -612,6 +629,11 @@ changetowebserver() {
 	if which weborf > /dev/null; then
 		weborf -xb aptarchive/ 2>&1 > /dev/null &
 		addtrap "kill $!;"
+	elif which gatling > /dev/null; then
+		cd aptarchive
+		gatling -p 8080 -F -S 2>&1 > /dev/null &
+		addtrap "kill $!;"
+		cd - > /dev/null
 	elif which lighttpd > /dev/null; then
 		echo "server.document-root = \"$(readlink -f ./aptarchive)\"
 server.port = 8080

+ 10 - 0
test/integration/makefile

@@ -0,0 +1,10 @@
+# -*- make -*-
+BASE=../..
+SUBDIR=test/integration
+
+# Bring in the default rules
+include ../../buildlib/defaults.mak
+
+.PHONY: test
+test:
+	./run-tests

+ 17 - 4
test/integration/run-tests

@@ -8,17 +8,30 @@ if [ "$1" = "-q" ]; then
 elif [ "$1" = "-v" ]; then
 	export MSGLEVEL=4
 fi
+
+if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then
+	CTEST='\033[1;32m'
+	CHIGH='\033[1;35m'
+	CRESET='\033[0m'
+elif [ -z "${MSGLEVEL}" ]; then
+	export MSGLEVEL=2
+fi
+
+if [ -z "$MSGLEVEL" ]; then
+	MSGLEVEL=5
+fi
+
 for testcase in $(run-parts --list $DIR | grep '/test-'); do
-	if [ "$1" = "-q" ]; then
-		echo -n "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m"
+	if [ "$MSGLEVEL" -le 2 ]; then
+		echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
 	else
-		echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m"
+		echo "${CTEST}Run Testcase ${CHIGH}$(basename ${testcase})${CRESET}"
 	fi
 	if ! ${testcase}; then
                  FAIL=$((FAIL+1))
                  echo "$(basename $testcase) ... FAIL"
         fi
-	if [ "$1" = "-q" ]; then
+	if [ "$MSGLEVEL" -le 2 ]; then
 		echo
 	fi
 done

+ 0 - 1
test/integration/test-bug-254770-segfault-if-cache-not-buildable

@@ -12,7 +12,6 @@ trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
 chmod a-x rootdir/var/lib/dpkg
 
 testsegfault() {
-	rm -f rootdir/var/cache/apt/*.bin
 	msgtest "No segfault in" "$*"
 	local TEST="$($* 2>&1 | grep -v 'E:')"
 	if [ -z "$TEST" ]; then

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

@@ -25,7 +25,6 @@ MD5sum: 8489687ce10e656babd467c9ee389349
 Description-de: Verschiedene Dateien für das Basis-System von Debian"
 
 predependsgawk() {
-	rm rootdir/var/cache/apt/*.bin
 	cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status
 	echo "$pkgbasefile
 Pre-Depends: $1
@@ -57,7 +56,6 @@ predependsgawk "awk | aawk"
 predependsgawk "awk"
 
 predependsgawk2() {
-	rm rootdir/var/cache/apt/*.bin
 	cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status
 	echo "$pkgbasefile
 Pre-Depends: $1

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

@@ -11,7 +11,7 @@ touch aptarchive/Packages
 setupflataptarchive
 
 testaptgetupdate() {
-	rm -rf rootdir/var/lib/apt rootdir/var/cache/apt
+	rm -rf rootdir/var/lib/apt
 	aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true
 	sed -i -e '/^Fetched / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
 	GIVEN="$1"

+ 1 - 1
test/integration/test-bug-601016-description-translation

@@ -57,7 +57,7 @@ Description-${LOCALE}: Mächtige Oberfläche für dpkg
 testrun() {
 	echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
 	export LC_ALL=""
-	rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/
+	rm -rf rootdir/var/lib/apt/lists
 	setupaptarchive
 	testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE}
 	testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE}

+ 2 - 2
test/integration/test-bug-618288-multiarch-same-lockstep

@@ -22,8 +22,8 @@ Building dependency tree...
 The following packages will be upgraded:
   apt:i386 apt2 libsame libsame:i386
 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-Inst libsame [1] (2 unstable [amd64]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:i386 apt2:amd64 ]
-Inst libsame:i386 [1] (2 unstable [i386]) [apt2:amd64 apt:i386 ]
+Inst libsame:i386 [1] (2 unstable [i386]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:amd64 apt:i386 ]
+Inst libsame [1] (2 unstable [amd64]) [apt2:amd64 apt:i386 ]
 Conf libsame:i386 (2 unstable [i386]) [apt2:amd64 apt:i386 ]
 Conf libsame (2 unstable [amd64]) [apt2:amd64 apt:i386 ]
 Inst apt2 [1] (2 unstable [amd64]) [apt:i386 ]

+ 8 - 8
test/integration/test-bug-632221-cross-dependency-satisfaction

@@ -47,10 +47,10 @@ Inst amdboot (1.0 unstable [amd64])
 Inst cool (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
 Inst foreigner (1.0 unstable [amd64])
-Inst libc6:armel (1.0 unstable [armel])
 Inst libc6 (1.0 unstable [amd64])
-Inst libc6-dev:armel (1.0 unstable [armel])
+Inst libc6:armel (1.0 unstable [armel])
 Inst libc6-dev (1.0 unstable [amd64])
+Inst libc6-dev:armel (1.0 unstable [armel])
 Conf amdboot (1.0 unstable [amd64])
 Conf cool (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
@@ -90,10 +90,10 @@ Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst cool (1.0 unstable [armel])
 Inst doxygen (1.0 unstable [armel])
 Inst foreigner (1.0 unstable [armel])
-Inst libc6 (1.0 unstable [armel])
 Inst libc6:amd64 (1.0 unstable [amd64])
-Inst libc6-dev (1.0 unstable [armel])
+Inst libc6 (1.0 unstable [armel])
 Inst libc6-dev:amd64 (1.0 unstable [amd64])
+Inst libc6-dev (1.0 unstable [armel])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf cool (1.0 unstable [armel])
 Conf doxygen (1.0 unstable [armel])
@@ -129,10 +129,10 @@ The following NEW packages will be installed:
 0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
 Inst amdboot (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [amd64])
-Inst libc6:armel (1.0 unstable [armel])
 Inst libc6 (1.0 unstable [amd64])
-Inst libc6-dev:armel (1.0 unstable [armel])
+Inst libc6:armel (1.0 unstable [armel])
 Inst libc6-dev (1.0 unstable [amd64])
+Inst libc6-dev:armel (1.0 unstable [armel])
 Conf amdboot (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [amd64])
 Conf libc6 (1.0 unstable [amd64])
@@ -169,10 +169,10 @@ The following NEW packages will be installed:
 0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
 Inst amdboot:amd64 (1.0 unstable [amd64])
 Inst doxygen (1.0 unstable [armel])
-Inst libc6 (1.0 unstable [armel])
 Inst libc6:amd64 (1.0 unstable [amd64])
-Inst libc6-dev (1.0 unstable [armel])
+Inst libc6 (1.0 unstable [armel])
 Inst libc6-dev:amd64 (1.0 unstable [amd64])
+Inst libc6-dev (1.0 unstable [armel])
 Conf amdboot:amd64 (1.0 unstable [amd64])
 Conf doxygen (1.0 unstable [armel])
 Conf libc6:amd64 (1.0 unstable [amd64])

+ 1 - 1
test/integration/test-bug-633350-do-not-kill-last-char-in-Release

@@ -15,7 +15,7 @@ echo 'NotAutomatic: yes' >> aptarchive/dists/unstable/Release
 signreleasefiles
 find aptarchive/dists -name 'InRelease' -delete
 
-rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt
+rm -rf rootdir/var/lib/apt/lists
 
 OUTPUT="$(aptget update 2>&1)"
 msgtest 'Check that parsing happens without warnings' 'with missing newline'

+ 8 - 9
test/integration/test-compressed-indexes

@@ -10,10 +10,10 @@ configarchitecture "i386"
 buildsimplenativepackage "testpkg" "i386" "1.0"
 setupaptarchive
 
-local GOODSHOW="$(aptcache show testpkg)
+GOODSHOW="$(aptcache show testpkg)
 "
-local GOODPOLICY="$(aptcache policy testpkg)"
-local GOODSHOWSRC="$(aptcache showsrc testpkg)
+GOODPOLICY="$(aptcache policy testpkg)"
+GOODSHOWSRC="$(aptcache showsrc testpkg)
 "
 
 test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3 || msgdie 'show is broken'
@@ -51,17 +51,16 @@ testrun() {
 		aptget clean
 		msgtest "\tdeb file is gone"; ! test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail
 	fi
-	rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
+	rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
 	testequal "$GOODSHOW" aptcache show testpkg
 	testequal "$GOODSHOW" aptcache show testpkg
-	rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
+	rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
 	testequal "$GOODPOLICY" aptcache policy testpkg
 	testequal "$GOODPOLICY" aptcache policy testpkg
-	rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
+	rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
 	testequal "$GOODSHOWSRC" aptcache showsrc testpkg
 	testequal "$GOODSHOWSRC" aptcache showsrc testpkg
-	rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
-	rm -rf rootdir/var/cache/apt/archives
+	aptget clean
 	msgtest "Check if the source is aptgetable"
 	aptget source testpkg -qq 2> /dev/null > /dev/null && msgpass || msgfail
 	msgtest "\tdsc file is present"; test -f testpkg_1.0.dsc && msgpass || msgfail
@@ -100,7 +99,7 @@ testrun "compressed"
 rm rootdir/etc/apt/apt.conf.d/02compressindex
 changetowebserver
 aptget update -qq
-local GOODPOLICY="$(aptcache policy testpkg)"
+GOODPOLICY="$(aptcache policy testpkg)"
 test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^  Candidate:' -e '^  Installed: (none)' -e '500 http://' | wc -l) -eq 4
 testequal "$GOODPOLICY" aptcache policy testpkg
 

+ 4 - 4
test/integration/test-disappearing-packages

@@ -12,13 +12,13 @@ buildsimplenativepackage "unrelated" "all" "0.5" "unstable"
 setupsimplenativepackage "new-pkg" "i386" "2.0" "unstable" "Provides: old-pkg
 Replaces: old-pkg
 Conflicts: old-pkg (<< 2.0)"
-local BUILDDIR="incoming/new-pkg-2.0"
+BUILDDIR="incoming/new-pkg-2.0"
 echo "/usr/share/doc/new-pkg /usr/share/doc/old-pkg" > ${BUILDDIR}/debian/new-pkg.links
 buildpackage "$BUILDDIR" "unstable" "main"
 rm -rf "$BUILDDIR"
 
 setupsimplenativepackage "old-pkg" "all" "2.0" "unstable" "Depends: new-pkg"
-local BUILDDIR="incoming/old-pkg-2.0"
+BUILDDIR="incoming/old-pkg-2.0"
 echo "/usr/share/doc/new-pkg /usr/share/doc/old-pkg" > ${BUILDDIR}/debian/old-pkg.links
 echo "
 override_dh_link:
@@ -33,9 +33,9 @@ aptget install old-pkg=1.0 --trivial-only -qq 2>&1 > /dev/null
 
 testmarkedauto # old-pkg is manual installed
 
-local CMD="aptget dist-upgrade -y -q=0"
+CMD="aptget dist-upgrade -y -q=0"
 msgtest "Test for equality of" "$CMD"
-local COMPAREFILE=$(mktemp)
+COMPAREFILE=$(mktemp)
 echo "The following package disappeared from your system as
 all files have been overwritten by other packages:
   old-pkg

+ 0 - 2
test/integration/test-hashsum-verification

@@ -19,8 +19,6 @@ prepare() {
 	for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do
 		touch -d 'now - 6 hours' $release
 	done
-	rm -rf rootdir/var/cache/apt/archives
-	rm -f rootdir/var/cache/apt/*.bin
 	cp $1 aptarchive/Packages
 	find aptarchive -name 'Release' -delete
 	cat aptarchive/Packages | gzip > aptarchive/Packages.gz

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

@@ -30,21 +30,18 @@ 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
@@ -135,7 +132,6 @@ Pin-Priority: -1" > rootdir/etc/apt/preferences
 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
@@ -164,7 +160,6 @@ testequalpolicycoolstuff "" "1.0" 1 990 600 "2.0~bpo1" -o Test=NotAutomatic -t s
 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
@@ -211,7 +206,6 @@ 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
@@ -220,7 +214,6 @@ testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=N
 
 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

+ 95 - 0
test/integration/test-releasefile-valid-until

@@ -0,0 +1,95 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'i386'
+
+insertpackage 'wheezy' 'apt' 'all' '0.8.15'
+
+getlabelfromsuite() {
+	echo -n 'Testcases'
+}
+
+
+setupaptarchive
+
+setupreleasefile() {
+	rm -rf rootdir/var/lib/apt/lists
+	aptget clean
+	generatereleasefiles "$1" "$2"
+	signreleasefiles
+}
+
+aptgetupdate() {
+	if aptget update $* 2>&1 | grep -q 'is expired'; then
+		return 1
+	else
+		return 0
+	fi
+}
+
+setupreleasefile
+msgtest 'Release file is accepted as it has' 'no Until'
+aptgetupdate && msgpass || msgfail
+
+setupreleasefile
+msgtest 'Release file is accepted as it has' 'no Until and good Max-Valid'
+aptgetupdate -o Acquire::Max-ValidTime=3600 && msgpass || msgfail
+
+setupreleasefile 'now - 2 days'
+msgtest 'Release file is rejected as it has' 'no Until, but bad Max-Valid'
+aptgetupdate -o Acquire::Max-ValidTime=3600 && msgfail || msgpass
+
+setupreleasefile 'now - 3 days' 'now + 1 day'
+msgtest 'Release file is accepted as it has' 'good Until'
+aptgetupdate && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now - 4 days'
+msgtest 'Release file is rejected as it has' 'bad Until'
+aptgetupdate && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now - 4 days'
+msgtest 'Release file is rejected as it has' 'bad Until (ignore good Max-Valid)'
+aptgetupdate -o Acquire::Max-ValidTime=1209600 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now - 4 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until)'
+aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now + 4 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (good Until)'
+aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now + 4 days'
+msgtest 'Release file is accepted as it has' 'good labeled Max-Valid'
+aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600 && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now + 4 days'
+msgtest 'Release file is rejected as it has' 'bad labeled Max-Valid'
+aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now + 1 days'
+msgtest 'Release file is accepted as it has' 'good Until (good Min-Valid, no Max-Valid)'
+aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now - 4 days'
+msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, no Max-Valid)'
+aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now - 2 days'
+msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, good Max-Valid) <'
+aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200 && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now - 2 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, good Min-Valid) >'
+aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now - 2 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) <'
+aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now - 2 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) >'
+aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 && msgfail || msgpass

+ 1 - 2
test/integration/test-releasefile-verification

@@ -19,8 +19,7 @@ prepare() {
 	for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do
 		touch -d 'now - 6 hours' $release
 	done
-	rm -rf rootdir/var/cache/apt/archives
-	rm -f rootdir/var/cache/apt/*.bin
+	aptget clean
 	cp $1 aptarchive/Packages
 	find aptarchive -name 'Release' -delete
 	cat aptarchive/Packages | gzip > aptarchive/Packages.gz

+ 24 - 0
test/integration/test-ubuntu-bug-802901-multiarch-early-remove

@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertinstalledpackage 'libgl1-mesa-glx' 'amd64' '2.0' 'Multi-Arch: same
+Provides: libgl1
+Conflicts: libgl1'
+insertpackage 'unstable' 'libgl1-mesa-glx' 'i386,amd64' '2.0' 'Multi-Arch: same
+Provides: libgl1
+Conflicts: libgl1'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  libgl1-mesa-glx:i386
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst libgl1-mesa-glx:i386 (2.0 unstable [i386])
+Conf libgl1-mesa-glx:i386 (2.0 unstable [i386])' aptget install libgl1-mesa-glx:i386 -s

+ 31 - 0
test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first

@@ -0,0 +1,31 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertinstalledpackage 'libsame' 'i386' '1'
+insertinstalledpackage 'apt' 'i386' '1' 'Depends: libsame (= 1)'
+
+insertpackage 'unstable' 'libsame' 'i386,amd64' '2' 'Multi-Arch: same'
+insertpackage 'unstable' 'apt' 'i386' '2' 'Depends: libsame (= 2)'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  apt:i386 libsame:i386
+The following NEW packages will be installed:
+  libsame
+The following packages will be upgraded:
+  apt:i386 libsame:i386
+2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst libsame:i386 [1] (2 unstable [i386]) [apt:i386 ]
+Inst libsame (2 unstable [amd64]) [apt:i386 ]
+Conf libsame:i386 (2 unstable [i386]) [apt:i386 ]
+Conf libsame (2 unstable [amd64]) [apt:i386 ]
+Inst apt:i386 [1] (2 unstable [i386])
+Conf apt:i386 (2 unstable [i386])' aptget install libsame:amd64 -s

test/extract-control.cc → test/interactive-helper/extract-control.cc


+ 3 - 34
test/makefile

@@ -1,9 +1,9 @@
 # -*- make -*-
-BASE=..
-SUBDIR=test
+BASE=../..
+SUBDIR=test/interactive-helper
 
 # Bring in the default rules
-include ../buildlib/defaults.mak
+include ../../buildlib/defaults.mak
 
 # Program for testing methods
 PROGRAM=mthdcat
@@ -11,19 +11,6 @@ SLIBS =
 SOURCE = mthdcat.cc
 include $(PROGRAM_H)
 
-# Program for testing methods
-PROGRAM=uritest
-SLIBS = -lapt-pkg
-SOURCE = uri.cc
-include $(PROGRAM_H)
-
-# Scratch program to test incomplete code fragments in
-PROGRAM=scratch-test
-SLIBS = -lapt-inst -lapt-pkg
-LIB_MAKES = apt-pkg/makefile apt-inst/makefile
-SOURCE = scratch.cc
-include $(PROGRAM_H)
-
 # Version compare tester
 PROGRAM=testextract
 SLIBS = -lapt-pkg -lapt-inst
@@ -31,18 +18,6 @@ LIB_MAKES = apt-pkg/makefile apt-inst/makefile
 SOURCE = testextract.cc
 include $(PROGRAM_H)
 
-# Program for testing the config file parser
-PROGRAM=conftest_clear
-SLIBS = -lapt-pkg
-SOURCE = conf_clear.cc
-include $(PROGRAM_H)
-
-# Program for testing the config file parser
-PROGRAM=conftest
-SLIBS = -lapt-pkg
-SOURCE = conf.cc
-include $(PROGRAM_H)
-
 # Program for testing the tar/deb extractor
 PROGRAM=testdeb
 SLIBS = -lapt-pkg -lapt-inst
@@ -55,12 +30,6 @@ SLIBS = -lapt-pkg -lapt-inst
 SOURCE = extract-control.cc
 include $(PROGRAM_H)
 
-# Program for testing hashes
-PROGRAM=hash
-SLIBS = -lapt-pkg 
-SOURCE = hash.cc
-include $(PROGRAM_H)
-
 # Program for testing udevcdrom
 PROGRAM=test_udevcdrom
 SLIBS = -lapt-pkg 

test/mthdcat.cc → test/interactive-helper/mthdcat.cc


test/networkless-install-fixes/README → test/interactive-helper/networkless-install-fixes/README


test/networkless-install-fixes/sources.test.list → test/interactive-helper/networkless-install-fixes/sources.test.list


test/networkless-install-fixes/test.sh → test/interactive-helper/networkless-install-fixes/test.sh


test/rpmver.cc → test/interactive-helper/rpmver.cc


+ 1 - 2
test/test_udevcdrom.cc

@@ -4,14 +4,13 @@
 
 int main()
 {
-   int i;
    pkgUdevCdromDevices c;
    assert(c.Dlopen());
 
    vector<CdromDevice> l;
    l = c.Scan();
    assert(l.empty() == false);
-   for (i=0;i<l.size();i++)
+   for (size_t i = 0; i < l.size(); ++i)
       std::cerr << l[i].DeviceName << " " 
 		<< l[i].Mounted << " " 
 		<< l[i].MountPath << std::endl;

test/testdeb.cc → test/interactive-helper/testdeb.cc


test/testextract.cc → test/interactive-helper/testextract.cc


+ 5 - 2
test/libapt/compareversion_test.cc

@@ -63,6 +63,9 @@ void assertVersion(int const &CurLine, string const &A, string const &B, int con
 
 bool RunTest(const char *File)
 {
+   if (FileExists(File) == false)
+      return _error->Error("Versiontestfile %s doesn't exist!", File);
+
    ifstream F(File,ios::in);
    if (!F != 0)
       return false;
@@ -112,8 +115,8 @@ bool RunTest(const char *File)
 
 int main(int argc, char *argv[])
 {
-   if (argc <= 1)
-      RunTest("../versions.lst");
+   if (argc != 2)
+      return 1;
    else
       RunTest(argv[1]);
 

+ 78 - 0
test/libapt/configuration_test.cc

@@ -0,0 +1,78 @@
+#include <apt-pkg/configuration.h>
+
+#include <string>
+#include <vector>
+
+#include "assert.h"
+
+int main(int argc,const char *argv[]) {
+	Configuration Cnf;
+	std::vector<std::string> fds;
+
+	Cnf.Set("APT::Keep-Fds::",28);
+	Cnf.Set("APT::Keep-Fds::",17);
+	Cnf.Set("APT::Keep-Fds::2",47);
+	Cnf.Set("APT::Keep-Fds::","broken");
+	fds = Cnf.FindVector("APT::Keep-Fds");
+	equals(fds[0], "28");
+	equals(fds[1], "17");
+	equals(fds[2], "47");
+	equals(fds[3], "broken");
+	equals(fds.size(), 4);
+	equals(Cnf.Exists("APT::Keep-Fds::2"), true);
+	equals(Cnf.Find("APT::Keep-Fds::2"), "47");
+	equals(Cnf.FindI("APT::Keep-Fds::2"), 47);
+	equals(Cnf.Exists("APT::Keep-Fds::3"), false);
+	equals(Cnf.Find("APT::Keep-Fds::3"), "");
+	equals(Cnf.FindI("APT::Keep-Fds::3", 56), 56);
+	equals(Cnf.Find("APT::Keep-Fds::3", "not-set"), "not-set");
+
+	Cnf.Clear("APT::Keep-Fds::2");
+	fds = Cnf.FindVector("APT::Keep-Fds");
+	equals(fds[0], "28");
+	equals(fds[1], "17");
+	equals(fds[2], "");
+	equals(fds[3], "broken");
+	equals(fds.size(), 4);
+	equals(Cnf.Exists("APT::Keep-Fds::2"), true);
+
+	Cnf.Clear("APT::Keep-Fds",28);
+	fds = Cnf.FindVector("APT::Keep-Fds");
+	equals(fds[0], "17");
+	equals(fds[1], "");
+	equals(fds[2], "broken");
+	equals(fds.size(), 3);
+
+	Cnf.Clear("APT::Keep-Fds","");
+	equals(Cnf.Exists("APT::Keep-Fds::2"), false);
+
+	Cnf.Clear("APT::Keep-Fds",17);
+	Cnf.Clear("APT::Keep-Fds","broken");
+	fds = Cnf.FindVector("APT::Keep-Fds");
+	equals(fds.empty(), true);
+
+	Cnf.Set("APT::Keep-Fds::",21);
+	Cnf.Set("APT::Keep-Fds::",42);
+	fds = Cnf.FindVector("APT::Keep-Fds");
+	equals(fds[0], "21");
+	equals(fds[1], "42");
+	equals(fds.size(), 2);
+
+	Cnf.Clear("APT::Keep-Fds");
+	fds = Cnf.FindVector("APT::Keep-Fds");
+	equals(fds.empty(), true);
+
+	Cnf.CndSet("APT::Version", 42);
+	Cnf.CndSet("APT::Version", "66");
+	equals(Cnf.Find("APT::Version"), "42");
+	equals(Cnf.FindI("APT::Version"), 42);
+	equals(Cnf.Find("APT::Version", "33"), "42");
+	equals(Cnf.FindI("APT::Version", 33), 42);
+	equals(Cnf.Find("APT2::Version", "33"), "33");
+	equals(Cnf.FindI("APT2::Version", 33), 33);
+
+	//FIXME: Test for configuration file parsing;
+	// currently only integration/ tests test them implicitly
+
+	return 0;
+}

+ 1 - 1
test/libapt/globalerror_test.cc

@@ -101,7 +101,7 @@ int main(int argc,char *argv[])
 	longText.clear();
 	for (size_t i = 0; i < 50; ++i)
 		longText.append("РезийбёбAZ");
-	equals(_error->Warning(longText.c_str()), false);
+	equals(_error->Warning("%s", longText.c_str()), false);
 	equals(_error->PopMessage(text), false);
 	equals(text, longText);
 

+ 16 - 0
test/libapt/makefile

@@ -6,6 +6,10 @@ BASENAME=_libapt_test
 # Bring in the default rules
 include ../../buildlib/defaults.mak
 
+.PHONY: test
+test:
+	./run-tests
+
 # Program for testing getLanguageCode
 PROGRAM = getLanguages${BASENAME}
 SLIBS = -lapt-pkg
@@ -58,3 +62,15 @@ PROGRAM = StrUtil${BASENAME}
 SLIBS = -lapt-pkg
 SOURCE = strutil_test.cc
 include $(PROGRAM_H)
+
+# test the URI parsing stuff
+PROGRAM = URI${BASENAME}
+SLIBS = -lapt-pkg
+SOURCE = uri_test.cc
+include $(PROGRAM_H)
+
+# test the Configuration class
+PROGRAM = Configuration${BASENAME}
+SLIBS = -lapt-pkg
+SOURCE = configuration_test.cc
+include $(PROGRAM_H)

+ 19 - 7
test/libapt/run-tests

@@ -3,19 +3,32 @@ set -e
 
 DIR=$(readlink -f $(dirname $0))
 echo "Compiling the tests …"
-test -d "$DIR/../../build/obj/test/libapt/" || mkdir -p "$DIR/../../build/obj/test/libapt/"
 (cd $DIR && make)
 echo "Running all testcases …"
 LDPATH="$DIR/../../build/bin"
 EXT="_libapt_test"
+
+# detect if output is on a terminal (colorful) or better not
+if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then
+	COLHIGH='\033[1;35m'
+	COLRESET='\033[0m'
+	TESTOKAY='\033[1;32mOKAY\033[0m'
+	TESTFAIL='\033[1;31mFAILED\033[0m'
+else
+	COLHIGH=''
+	COLRESET=''
+	TESTOKAY='OK'
+	TESTFAIL='###FAILED###'
+fi
+
 for testapp in $(ls ${LDPATH}/*$EXT)
 do
 	name=$(basename ${testapp})
+	NAME="${COLHIGH}${name}${COLRESET}"
 	tmppath=""
 
 	if [ $name = "GetListOfFilesInDir${EXT}" ]; then
 		# TODO: very-low: move env creation to the actual test-app
-		echo "Prepare Testarea for \033[1;35m$name\033[0m ..."
 		tmppath=$(mktemp -d)
 		touch "${tmppath}/anormalfile" \
 			"${tmppath}/01yet-anothernormalfile" \
@@ -47,7 +60,6 @@ do
 		ln -s "${tmppath}/anormalfile" "${tmppath}/linkedfile.list"
 		ln -s "${tmppath}/non-existing-file" "${tmppath}/brokenlink.list"
 	elif [ $name = "getLanguages${EXT}" ]; then
-		echo "Prepare Testarea for \033[1;35m$name\033[0m ..."
 		tmppath=$(mktemp -d)
 		touch "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-tr" \
 			"${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-pt" \
@@ -60,14 +72,14 @@ do
 		LD_LIBRARY_PATH=${LDPATH} ${testapp} $TMP $(md5sum $TMP | cut -d' ' -f 1) $(sha1sum $TMP | cut -d' ' -f 1) $(sha256sum $TMP | cut -d' ' -f 1) $(sha512sum $TMP | cut -d' ' -f 1) && echo "\033[1;32mOKAY\033[0m" || echo "\033[1;31mFAILED\033[0m"
 		rm $TMP
 		continue
+	elif [ $name = "CompareVersion${EXT}" ]; then
+		tmppath="${DIR}/versions.lst"
 	fi
 
-	echo -n "Testing with \033[1;35m${name}\033[0m ... "
-	LD_LIBRARY_PATH=${LDPATH} ${testapp} ${tmppath} && echo "\033[1;32mOKAY\033[0m" || echo "\033[1;31mFAILED\033[0m"
+	echo -n "Testing with ${NAME} "
+	LD_LIBRARY_PATH=${LDPATH} ${testapp} ${tmppath} && echo "$TESTOKAY" || echo "$TESTFAIL"
 
 	if [ -n "$tmppath" -a -d "$tmppath" ]; then
-		echo "Cleanup Testarea after \033[1;35m$name\033[0m ..."
 		rm -rf "$tmppath"
 	fi
-
 done

+ 112 - 0
test/libapt/uri_test.cc

@@ -0,0 +1,112 @@
+#include <apt-pkg/strutl.h>
+
+#include "assert.h"
+
+int main() {
+	// Basic stuff
+	{
+	URI U("http://www.debian.org:90/temp/test");
+	equals("http", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(90, U.Port);
+	equals("www.debian.org", U.Host);
+	equals("/temp/test", U.Path);
+	} {
+	URI U("http://jgg:foo@ualberta.ca/blah");
+	equals("http", U.Access);
+	equals("jgg", U.User);
+	equals("foo", U.Password);
+	equals(0, U.Port);
+	equals("ualberta.ca", U.Host);
+	equals("/blah", U.Path);
+	} {
+	URI U("file:/usr/bin/foo");
+	equals("file", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(0, U.Port);
+	equals("", U.Host);
+	equals("/usr/bin/foo", U.Path);
+	} {
+	URI U("cdrom:Moo Cow Rom:/debian");
+	equals("cdrom", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(0, U.Port);
+	equals("Moo Cow Rom", U.Host);
+	equals("/debian", U.Path);
+	} {
+	URI U("gzip:./bar/cow");
+	equals("gzip", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(0, U.Port);
+	equals(".", U.Host);
+	equals("/bar/cow", U.Path);
+	} {
+	URI U("ftp:ftp.fr.debian.org/debian/pool/main/x/xtel/xtel_3.2.1-15_i386.deb");
+	equals("ftp", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(0, U.Port);
+	equals("ftp.fr.debian.org", U.Host);
+	equals("/debian/pool/main/x/xtel/xtel_3.2.1-15_i386.deb", U.Path);
+	}
+
+	// RFC 2732 stuff
+	{
+	URI U("http://[1080::8:800:200C:417A]/foo");
+	equals("http", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(0, U.Port);
+	equals("1080::8:800:200C:417A", U.Host);
+	equals("/foo", U.Path);
+	} {
+	URI U("http://[::FFFF:129.144.52.38]:80/index.html");
+	equals("http", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(80, U.Port);
+	equals("::FFFF:129.144.52.38", U.Host);
+	equals("/index.html", U.Path);
+	} {
+	URI U("http://[::FFFF:129.144.52.38:]:80/index.html");
+	equals("http", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(80, U.Port);
+	equals("::FFFF:129.144.52.38:", U.Host);
+	equals("/index.html", U.Path);
+	} {
+	URI U("http://[::FFFF:129.144.52.38:]/index.html");
+	equals("http", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(0, U.Port);
+	equals("::FFFF:129.144.52.38:", U.Host);
+	equals("/index.html", U.Path);
+	}
+	/* My Evil Corruption of RFC 2732 to handle CDROM names! Fun for
+	   the whole family! */
+	{
+	URI U("cdrom:[The Debian 1.2 disk, 1/2 R1:6]/debian/");
+	equals("cdrom", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(0, U.Port);
+	equals("The Debian 1.2 disk, 1/2 R1:6", U.Host);
+	equals("/debian/", U.Path);
+	} {
+	URI U("cdrom:Foo Bar Cow/debian/");
+	equals("cdrom", U.Access);
+	equals("", U.User);
+	equals("", U.Password);
+	equals(0, U.Port);
+	equals("Foo Bar Cow", U.Host);
+	equals("/debian/", U.Path);
+	}
+
+	return 0;
+}

test/versions.lst → test/libapt/versions.lst


+ 0 - 11
test/local-repo/Packages

@@ -1,11 +0,0 @@
-Package: gdebi-test4
-Architecture: all
-Version: 1.0
-Conflicts: apt (<= 0.1)
-Filename: ./gdebi-test4.deb
-Size: 2306
-MD5sum: 0952a2b4a566215e0794c7603f3fcfcc
-SHA1: 318688ea2d53352a1bdb669ebd2cd4847f6c4e7c
-SHA256: 35f600b57253cef807a1da7c5deb06e7821de9223842a310a77b4da87cf51e2c
-Description: testpackage for gdebi - Conflicts: apt (<= 0.1)
-

BIN
test/local-repo/Packages.gz


BIN
test/local-repo/Packages.gz.save


+ 0 - 13
test/local-repo/Release

@@ -1,13 +0,0 @@
-Date: Thu, 09 Aug 2007 10:13:06 UTC
-MD5Sum:
- 29f79161fafe1f0c393e7fc6ddcb99b5              338 Packages
- 2f885b2ebdb77d3354ba63d8b5aad614              269 Packages.gz
- d41d8cd98f00b204e9800998ecf8427e                0 Release
-SHA1:
- d8860d409a8b0db443fbf254e2d6afbfc9bc04a8              338 Packages
- 8b668a7b730ceb4d702737a13a723959c20b67df              269 Packages.gz
- da39a3ee5e6b4b0d3255bfef95601890afd80709                0 Release
-SHA256:
- 39aa9fc59d868a71030d24aeaa4b574d7a11a10ea79491a0881f8d755b36a06d              338 Packages
- 62898623498ebf8304647db1ba2d33e4d8ec0e3e45250c2b66907c812b099297              269 Packages.gz
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855                0 Release

+ 0 - 7
test/local-repo/Release.gpg

@@ -1,7 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-iD8DBQBGuui6liSD4VZixzQRApSlAJ9D6G1QXvtXH1jH1I4SStsb1VsImQCbBPfp
-+1p0bDANcBVY+GckjJvFRkY=
-=a0AR
------END PGP SIGNATURE-----

BIN
test/local-repo/gdebi-test4.deb


+ 0 - 266
test/pre-upload-check.py

@@ -1,266 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import os
-import glob
-import os.path
-import shutil
-import time
-from subprocess import call, PIPE
-
-import unittest
-
-stdout = os.open("/dev/null",0) #sys.stdout
-stderr = os.open("/dev/null",0) # sys.stderr
-
-apt_args = [] 
-#apt_args = ["-o","Debug::pkgAcquire::Auth=true"]
-
-class testAptAuthenticationReliability(unittest.TestCase):
-    """
-    test if the spec https://wiki.ubuntu.com/AptAuthenticationReliability 
-    is properly implemented
-    """
-    #apt = "../bin/apt-get"
-    apt = "apt-get"
-
-    def setUp(self):
-        if os.path.exists("/tmp/autFailure"):
-            os.unlink("/tmp/authFailure");
-        if os.path.exists("/tmp/autFailure2"):
-            os.unlink("/tmp/authFailure2");
-    def testRepositorySigFailure(self):
-        """
-        test if a repository that used to be authenticated and fails on
-        apt-get update refuses to update and uses the old state
-        """
-        # copy valid signatures into lists (those are ok, even
-        # if the name is "-broken-" ...
-        for f in glob.glob("./authReliability/lists/*"):
-            shutil.copy(f,"/var/lib/apt/lists")
-            # ensure we do *not* get a I-M-S hit
-            os.utime("/var/lib/apt/lists/%s" % os.path.basename(f), (0,0))
-        res = call([self.apt,
-                    "update",
-                    "-o","Dir::Etc::sourcelist=./authReliability/sources.list.failure", 
-                    "-o",'APT::Update::Auth-Failure::=touch /tmp/authFailure',
-                   ] + apt_args,
-                   stdout=stdout, stderr=stderr)
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Release.gpg"),
-                     "The gpg file disappeared, this should not happen")
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Packages"),
-                     "The Packages file disappeared, this should not happen")
-        self.assert_(os.path.exists("/tmp/authFailure"),
-                     "The APT::Update::Auth-Failure script did not run (1)")
-        # the same with i-m-s hit this time
-        for f in glob.glob("./authReliability/lists/*"):
-            shutil.copy(f,"/var/lib/apt/lists")
-            os.utime("/var/lib/apt/lists/%s" % os.path.basename(f), (time.time(),time.time()))
-        res = call([self.apt,
-                    "update",
-                    "-o","Dir::Etc::sourcelist=./authReliability/sources.list.failure",
-                    "-o",'APT::Update::Auth-Failure::=touch /tmp/authFailure2',
-                   ] + apt_args,
-                   stdout=stdout, stderr=stderr)
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Release.gpg"),
-                     "The gpg file disappeared, this should not happen")
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Packages"),
-                     "The Packages file disappeared, this should not happen")
-        self.assert_(os.path.exists("/tmp/authFailure2"),
-                     "The APT::Update::Auth-Failure script did not run (2)")
-    def testRepositorySigGood(self):
-        """
-        test that a regular repository with good data stays good
-        """
-        res = call([self.apt,
-                    "update",
-                    "-o","Dir::Etc::sourcelist=./authReliability/sources.list.good"
-                   ] + apt_args,
-                   stdout=stdout, stderr=stderr)
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Release.gpg"),
-                     "The gpg file disappeared after a regular download, this should not happen")
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Packages"),
-                     "The Packages file disappeared, this should not happen")
-        # test good is still good after non I-M-S hit and a previous files in lists/
-        for f in glob.glob("./authReliability/lists/*"):
-            shutil.copy(f,"/var/lib/apt/lists")
-            # ensure we do *not* get a I-M-S hit
-            os.utime("/var/lib/apt/lists/%s" % os.path.basename(f), (0,0))
-        res = call([self.apt,
-                    "update",
-                    "-o","Dir::Etc::sourcelist=./authReliability/sources.list.good"
-                   ] + apt_args,
-                   stdout=stdout, stderr=stderr)
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Release.gpg"),
-                     "The gpg file disappeared after a I-M-S hit, this should not happen")
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Packages"),
-                     "The Packages file disappeared, this should not happen")
-        # test good is still good after I-M-S hit
-        for f in glob.glob("./authReliability/lists/*"):
-            shutil.copy(f,"/var/lib/apt/lists")
-            # ensure we do get a I-M-S hit
-            os.utime("/var/lib/apt/lists/%s" % os.path.basename(f), (time.time(),time.time()))
-        res = call([self.apt,
-                    "update",
-                    "-o","Dir::Etc::sourcelist=./authReliability/sources.list.good"
-                   ] + apt_args,
-                   stdout=stdout, stderr=stderr)
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Release.gpg"),
-                     "The gpg file disappeared, this should not happen")
-        self.assert_(os.path.exists("/var/lib/apt/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Packages"),
-                     "The Packages file disappeared, this should not happen")
-
-
-class testAuthentication(unittest.TestCase):
-    """
-    test if the authentication is working, the repository
-    of the test-data can be found here:
-    bzr get http://people.ubuntu.com/~mvo/bzr/apt/apt-auth-test-suit/
-    """
-    
-    # some class wide data
-    apt = "apt-get"
-    pkg = "libglib2.0-data"
-    pkgver = "2.13.6-1ubuntu1"
-    pkgpath = "/var/cache/apt/archives/libglib2.0-data_2.13.6-1ubuntu1_all.deb"
-
-    def setUp(self):
-        for f in glob.glob("testkeys/*,key"):
-            call(["apt-key", "add", f], stdout=stdout, stderr=stderr)
-
-    def _cleanup(self):
-        " make sure we get new lists and no i-m-s "
-        call(["rm","-f", "/var/lib/apt/lists/*"])
-        if os.path.exists(self.pkgpath):
-            os.unlink(self.pkgpath)
-
-    def _expectedRes(self, resultstr):
-        if resultstr == 'ok':
-            return 0
-        elif resultstr == 'broken':
-            return 100
-        
-
-    def testPackages(self):
-        for f in glob.glob("testsources.list/sources.list*package*"):
-            self._cleanup()
-            (prefix, testtype, result) = f.split("-")
-            expected_res = self._expectedRes(result)
-            # update first
-            call([self.apt,"update",
-                  "-o","Dir::Etc::sourcelist=./%s" % f]+apt_args,
-                 stdout=stdout, stderr=stderr)
-            # then get the pkg
-            cmd = ["install", "-y", "-d", "--reinstall",
-                   "%s=%s" % (self.pkg, self.pkgver),
-                   "-o","Dir::state::Status=./fake-status"]
-            res = call([self.apt, "-o","Dir::Etc::sourcelist=./%s" % f]+cmd+apt_args,
-                       stdout=stdout, stderr=stderr)
-            self.assert_(res == expected_res,
-                         "test '%s' failed (got %s expected %s" % (f,res,expected_res))
-            
-
-    def testGPG(self):
-        for f in glob.glob("testsources.list/sources.list*gpg*"):
-            self._cleanup()
-            (prefix, testtype, result) = f.split("-")
-            expected_res = self._expectedRes(result)
-            # update first
-            call([self.apt,"update",
-                  "-o","Dir::Etc::sourcelist=./%s" % f]+apt_args,
-                 stdout=stdout, stderr=stderr)
-            cmd = ["install", "-y", "-d", "--reinstall",
-                   "%s=%s" % (self.pkg, self.pkgver),
-                   "-o","Dir::state::Status=./fake-status"]
-            res = call([self.apt, "-o","Dir::Etc::sourcelist=./%s" % f]+
-                       cmd+apt_args,
-                       stdout=stdout, stderr=stderr)
-            self.assert_(res == expected_res,
-                         "test '%s' failed (got %s expected %s" % (f,res,expected_res))
-
-    def testRelease(self):
-        for f in glob.glob("testsources.list/sources.list*release*"):
-            self._cleanup()
-            (prefix, testtype, result) = f.split("-")
-            expected_res = self._expectedRes(result)
-            cmd = ["update"]
-            res = call([self.apt,"-o","Dir::Etc::sourcelist=./%s" % f]+cmd+apt_args,
-                       stdout=stdout, stderr=stderr)
-            self.assert_(res == expected_res,
-                         "test '%s' failed (got %s expected %s" % (f,res,expected_res))
-            if expected_res == 0:
-                self.assert_(len(glob.glob("/var/lib/apt/lists/partial/*")) == 0,
-                             "partial/ dir has leftover files: %s" % glob.glob("/var/lib/apt/lists/partial/*"))
-
-    def testValid(self):
-        for f in glob.glob("testsources.list/sources.list*validuntil*"):
-            self._cleanup()
-            (prefix, testtype, result) = f.split("-")
-            expected_res = self._expectedRes(result)
-            cmd = ["update"]
-            res = call([self.apt,"-o","Dir::Etc::sourcelist=./%s" % f]+cmd+apt_args,
-                       stdout=stdout, stderr=stderr)
-            self.assert_(res == expected_res,
-                         "test '%s' failed (got %s expected %s" % (f,res,expected_res))
-            if expected_res == 0:
-                self.assert_(len(glob.glob("/var/lib/apt/lists/partial/*")) == 0,
-                             "partial/ dir has leftover files: %s" % glob.glob("/var/lib/apt/lists/partial/*"))
-
-
-class testLocalRepositories(unittest.TestCase):
-    " test local repository regressions "
-
-    repo_dir = "local-repo"
-    apt = "apt-get"
-    pkg = "gdebi-test4"
-
-    def setUp(self):
-        self.repo = os.path.abspath(os.path.join(os.getcwd(), self.repo_dir))
-        self.sources = os.path.join(self.repo, "sources.list")
-        s = open(self.sources,"w")
-        s.write("deb file://%s/ /\n" % self.repo)
-        s.close()
-
-    def testLocalRepoAuth(self):
-        # two times to get at least one i-m-s hit
-        for i in range(2):
-            self.assert_(os.path.exists(self.sources))
-            cmd = [self.apt,"update","-o", "Dir::Etc::sourcelist=%s" % self.sources]+apt_args
-            res = call(cmd, stdout=stdout, stderr=stderr)
-            self.assertEqual(res, 0, "local repo test failed")
-            self.assert_(os.path.exists(os.path.join(self.repo,"Packages.gz")),
-                         "Packages.gz vanished from local repo")
-
-    def testInstallFromLocalRepo(self):
-        apt = [self.apt,"-o", "Dir::Etc::sourcelist=%s"% self.sources]+apt_args
-        cmd = apt+["update"]
-        res = call(cmd, stdout=stdout, stderr=stderr)
-        self.assertEqual(res, 0)
-        res = call(apt+["-y","install","--reinstall",self.pkg],
-                   stdout=stdout, stderr=stderr)
-        self.assert_(res == 0,
-                     "installing %s failed (got %s)" % (self.pkg, res))
-        res = call(apt+["-y","remove",self.pkg],
-                   stdout=stdout, stderr=stderr)
-        self.assert_(res == 0,
-                     "removing %s failed (got %s)" % (self.pkg, res))
-
-    def testPythonAptInLocalRepo(self):
-        import apt, apt_pkg
-        apt_pkg.Config.Set("Dir::Etc::sourcelist",self.sources)
-        cache = apt.Cache()
-        cache.update()
-        pkg = cache["apt"]
-        self.assert_(pkg.name == 'apt')
-        
-
-
-if __name__ == "__main__":
-    print "Runing simple testsuit on current apt-get and libapt"
-    if len(sys.argv) > 1 and sys.argv[1] == "-v":
-        stdout = sys.stdout
-        stderr = sys.stderr
-    
-    # run only one for now
-    #unittest.main(defaultTest="testAptAuthenticationReliability")
-    unittest.main()

+ 0 - 105
test/scratch.cc

@@ -1,105 +0,0 @@
-#include <apt-pkg/dpkgdb.h>
-#include <apt-pkg/debfile.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/extract.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/fileutl.h>
-
-using namespace std;
-
-int main(int argc,char *argv[])
-{
-   pkgInitConfig(*_config);
-   pkgInitSystem(*_config,_system);
-
-//   cout << flNoLink(argv[1]) << endl;
-   
-//   #if 0
-/*   DynamicMMap *FileMap = new DynamicMMap(MMap::Public);
-   pkgFLCache *FList = new pkgFLCache(*FileMap);
-   
-   char *Name = "/tmp/test";
-   pkgFLCache::PkgIterator Pkg(*FList,0);
-   pkgFLCache::NodeIterator Node = FList->GetNode(Name,Name+strlen(Name),Pkg.Offset(),true,false);
-   cout << (pkgFLCache::Node *)Node << endl;
-   Node = FList->GetNode(Name,Name+strlen(Name),Pkg.Offset(),true,false);
-   cout << (pkgFLCache::Node *)Node << endl;
-*/
-//   #if 0
-   _config->Set("Dir::State::status","/tmp/testing/status");
-
-   debDpkgDB Db;
-   
-   {
-      OpTextProgress Prog;
-      
-      if (Db.ReadyPkgCache(Prog) == false)
-	 cerr << "Error!" << endl;
-      Prog.Done();
-      
-      if (Db.ReadyFileList(Prog) == false)
-	 cerr << "Error!" << endl;
-   }
-   
-   if (_error->PendingError() == true)
-   {
-      _error->DumpErrors();
-      return 0;
-   }
-   
-/*   Db.GetFLCache().BeginDiverLoad();
-   pkgFLCache::PkgIterator Pkg(Db.GetFLCache(),0);
-   if (Db.GetFLCache().AddDiversion(Pkg,"/usr/include/linux/kerneld.h","/usr/bin/nslookup") == false)
-      cerr << "Error!" << endl;
-
-   const char *Tmp = "/usr/include/linux/kerneld.h";
-   pkgFLCache::NodeIterator Nde = Db.GetFLCache().GetNode(Tmp,Tmp+strlen(Tmp),0,false,false);
-   map_ptrloc Loc = Nde->File;
-      
-   for (; Nde.end() == false && Nde->File == Loc; Nde++)
-      cout << Nde->Flags << ',' << Nde->Pointer << ',' << Nde.File() << endl;
-   Db.GetFLCache().FinishDiverLoad();*/
-
-/*   unsigned int I = 0;
-   pkgFLCache &Fl = Db.GetFLCache();
-   while (I < Fl.HeaderP->HashSize)
-   {
-      cout << I << endl;
-      pkgFLCache::NodeIterator Node(Fl,Fl.NodeP + Fl.HeaderP->FileHash + I++);
-      if (Node->Pointer == 0)
-	 continue;
-      for (; Node.end() == false; Node++)
-      {
-	 cout << Node.DirN() << '/' << Node.File();
-	 if (Node->Flags == pkgFLCache::Node::Diversion)
-	    cout << " (div)";
-	 if (Node->Flags == pkgFLCache::Node::ConfFile)
-	    cout << " (conf)";
-	 cout << endl;
-      }
-   }*/
-
-   for (int I = 1; I < argc; I++)
-   {
-      FileFd F(argv[I],FileFd::ReadOnly);
-      debDebFile Deb(F);
-      
-      if (Deb.ExtractControl(Db) == false)
-	 cerr << "Error!" << endl;
-      cout << argv[I] << endl;
-      
-      pkgCache::VerIterator Ver = Deb.MergeControl(Db);
-      if (Ver.end() == true)
-	 cerr << "Failed" << endl;
-      else
-	 cout << Ver.ParentPkg().Name() << ' ' << Ver.VerStr() << endl;
-      
-      pkgExtract Extract(Db.GetFLCache(),Ver);
-      Deb.ExtractArchive(Extract);
-   }
-//   #endif
-//#endif      
-   _error->DumpErrors();
-}

+ 0 - 235
test/test-indexes.sh

@@ -1,235 +0,0 @@
-#!/bin/sh -e
-
-# Test behaviour of index retrieval and usage, in particular with uncompressed
-# and gzip compressed indexes.
-# Author: Martin Pitt <martin.pitt@ubuntu.com>
-# (C) 2010 Canonical Ltd.
-
-BUILDDIR=$(readlink -f $(dirname $0)/../build)
-
-TEST_SOURCE="http://ftp.debian.org/debian unstable contrib"
-GPG_KEYSERVER=gpg-keyserver.de
-# should be a small package with dependencies satisfiable in TEST_SOURCE, i. e.
-# ideally no depends at all
-TEST_PKG="python-psyco-doc"
-
-export LD_LIBRARY_PATH=$BUILDDIR/bin
-
-OPTS="-qq -o Dir::Bin::Methods=$BUILDDIR/bin/methods -o Debug::NoLocking=true"
-DEBUG=""
-#DEBUG="-o Debug::pkgCacheGen=true"
-#DEBUG="-o Debug::pkgAcquire=true"
-APT_GET="$BUILDDIR/bin/apt-get $OPTS $DEBUG"
-APT_CACHE="$BUILDDIR/bin/apt-cache $OPTS $DEBUG"
-APT_FTPARCHIVE="$BUILDDIR/bin/apt-ftparchive"
-
-[ -x "$BUILDDIR/bin/apt-get" ] || {
-    echo "please build the tree first" >&2
-    exit 1
-}
-
-check_update() {
-    echo "--- apt-get update $@ (no trusted keys)"
-
-    rm -f etc/apt/trusted.gpg etc/apt/secring.gpg
-    touch etc/apt/trusted.gpg etc/apt/secring.gpg
-    find var/lib/apt/lists/ -type f | xargs -r rm
-
-    # first attempt should fail, no trusted GPG key
-    out=$($APT_GET "$@" update 2>&1)
-    echo "$out" | grep -q NO_PUBKEY
-    key=$(echo "$out" | sed -n '/NO_PUBKEY/ { s/^.*NO_PUBKEY \([[:alnum:]]\+\)$/\1/; p}')
-
-    # get keyring
-    gpg -q --no-options --no-default-keyring --secret-keyring etc/apt/secring.gpg --trustdb-name etc/apt/trustdb.gpg --keyring etc/apt/trusted.gpg --primary-keyring etc/apt/trusted.gpg --keyserver $GPG_KEYSERVER --recv-keys $key
-
-    # now it should work
-    echo "--- apt-get update $@ (with trusted keys)"
-    find var/lib/apt/lists/ -type f | xargs -r rm
-    $APT_GET "$@" update
-}
-
-# if $1 == "compressed", check that we have compressed indexes, otherwise
-# uncompressed ones
-check_indexes() {
-    echo "--- only ${1:-uncompressed} index files present"
-    local F
-    if [ "$1" = "compressed" ]; then
-	! test -e var/lib/apt/lists/*_Packages || F=1
-	! test -e var/lib/apt/lists/*_Sources || F=1
-	test -e var/lib/apt/lists/*_Packages.gz || F=1
-	test -e var/lib/apt/lists/*_Sources.gz || F=1
-    else
-	test -e var/lib/apt/lists/*_Packages || F=1
-	test -e var/lib/apt/lists/*_Sources || F=1
-	! test -e var/lib/apt/lists/*_Packages.gz || F=1
-	! test -e var/lib/apt/lists/*_Sources.gz || F=1
-    fi
-
-    if [ -n "$F" ]; then
-	ls -laR var/lib/apt/lists/
-	exit 1
-    fi
-}
-
-# test apt-cache commands
-check_cache() {
-    echo "--- apt-cache commands"
-
-    $APT_CACHE show $TEST_PKG | grep -q ^Version:
-    # again (with cache)
-    $APT_CACHE show $TEST_PKG | grep -q ^Version:
-    rm var/cache/apt/*.bin
-    $APT_CACHE policy $TEST_PKG | egrep -q '500 (http://|file:/)'
-    # again (with cache)
-    $APT_CACHE policy $TEST_PKG | egrep -q '500 (http://|file:/)'
-
-    TEST_SRC=`$APT_CACHE show $TEST_PKG | grep ^Source: | awk '{print $2}'`
-    rm var/cache/apt/*.bin
-    $APT_CACHE showsrc $TEST_SRC | grep -q ^Binary:
-    # again (with cache)
-    $APT_CACHE showsrc $TEST_SRC | grep -q ^Binary:
-}
-
-# test apt-get install
-check_install() {
-    echo "--- apt-get install"
-
-    $APT_GET install -d $TEST_PKG 
-    test -e var/cache/apt/archives/$TEST_PKG*.deb
-    $APT_GET clean
-    ! test -e var/cache/apt/archives/$TEST_PKG*.deb
-}
-
-# test apt-get source
-check_get_source() {
-    echo "--- apt-get source"
-    # quiesce: it'll complain about not being able to verify the signature
-    $APT_GET source $TEST_PKG >/dev/null 2>&1
-    test -f $TEST_SRC_*.dsc
-    test -d $TEST_SRC-*
-    rm -r $TEST_SRC*
-}
-
-############################################################################
-# main
-############################################################################
-
-echo "===== building sandbox ====="
-WORKDIR=$(mktemp -d)
-trap "cd /; rm -rf $WORKDIR" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
-cd $WORKDIR
-
-rm -fr etc var
-rm -f home
-ln -s /home home
-mkdir -p etc/apt/preferences.d etc/apt/trusted.gpg.d etc/apt/apt.conf.d var/cache/apt/archives/partial var/lib/apt/lists/partial var/lib/dpkg
-cp /etc/apt/trusted.gpg etc/apt
-touch var/lib/dpkg/status
-echo "deb $TEST_SOURCE" > etc/apt/sources.list
-echo "deb-src $TEST_SOURCE" >> etc/apt/sources.list
-
-# specifying -o RootDir at the command line does not work for
-# etc/apt/apt.conf.d/ since it is parsed after pkgInitConfig(); $APT_CONFIG is
-# checked first, so this works
-echo "RootDir \"$WORKDIR\";" > apt_config
-export APT_CONFIG=`pwd`/apt_config
-
-echo "==== no indexes ===="
-echo '--- apt-get check works without indexes'
-[ -z `$APT_GET check` ]
-echo '--- apt-cache policy works without indexes'
-$APT_CACHE policy bash >/dev/null
-echo '--- apt-cache show works without indexes'
-! LC_MESSAGES=C $APT_CACHE show bash 2>&1| grep -q 'E: No packages found'
-
-echo "===== uncompressed indexes ====="
-echo 'Acquire::GzipIndexes "false";' > etc/apt/apt.conf.d/02compress-indexes
-check_update
-check_indexes
-check_cache
-check_install
-check_get_source
-
-echo "--- apt-get update with preexisting indexes"
-$APT_GET update
-check_indexes
-check_cache
-
-echo "--- apt-get update with preexisting indexes and pdiff mode"
-$APT_GET -o Acquire::PDiffs=true update
-check_indexes
-check_cache
-
-echo "===== compressed indexes (CLI option) ====="
-check_update -o Acquire::GzipIndexes=true
-check_indexes compressed
-check_cache
-check_install
-check_get_source
-
-echo "--- apt-get update with preexisting indexes"
-$APT_GET -o Acquire::GzipIndexes=true update
-check_indexes compressed
-check_cache
-
-echo "--- apt-get update with preexisting indexes and pdiff mode"
-$APT_GET -o Acquire::GzipIndexes=true -o Acquire::PDiffs=true update
-check_indexes compressed
-check_cache
-
-echo "===== compressed indexes (apt.conf.d option) ====="
-cat <<EOF > etc/apt/apt.conf.d/02compress-indexes
-Acquire::GzipIndexes "true";
-Acquire::CompressionTypes::Order:: "gz";
-EOF
-
-check_update
-check_indexes compressed
-check_cache
-check_install
-check_get_source
-
-echo "--- apt-get update with preexisting indexes"
-$APT_GET update
-check_indexes compressed
-check_cache
-
-echo "--- apt-get update with preexisting indexes and pdiff mode"
-$APT_GET -o Acquire::PDiffs=true update
-check_indexes compressed
-check_cache
-
-rm etc/apt/apt.conf.d/02compress-indexes
-
-echo "==== apt-ftparchive ===="
-mkdir arch
-$APT_GET install -d $TEST_PKG 
-cp var/cache/apt/archives/$TEST_PKG*.deb arch/
-cd arch
-$APT_GET source -d $TEST_PKG >/dev/null 2>&1
-$APT_FTPARCHIVE packages . | gzip -9 > Packages.gz
-$APT_FTPARCHIVE sources . | gzip -9 > Sources.gz
-cd ..
-
-echo "deb file://$WORKDIR/arch /
-deb-src file://$WORKDIR/arch /" > etc/apt/sources.list
-$APT_GET clean
-
-echo "==== uncompressed indexes from local file:// archive ===="
-echo "--- apt-get update"
-$APT_GET update
-check_indexes
-check_cache
-check_get_source
-
-echo "==== compressed indexes from local file:// archive ===="
-echo "--- apt-get update"
-$APT_GET -o Acquire::GzipIndexes=true update
-# EXFAIL: file:/ URIs currently decompress even with above option
-#check_indexes compressed
-check_indexes
-check_cache
-check_get_source
-
-echo "===== ALL TESTS PASSED ====="

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 1182
test/testkeys/mvo.key


+ 0 - 2
test/testsources.list/sources.list.all-gpg-broken

@@ -1,2 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/gpg-package-broken/ /
-

+ 0 - 2
test/testsources.list/sources.list.all-gpg-ok

@@ -1,2 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/gpg-package-ok/ /
-

+ 0 - 1
test/testsources.list/sources.list.all-release-broken

@@ -1 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/all-release-broken/ /

+ 0 - 1
test/testsources.list/sources.list.all-release-ok

@@ -1 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/all-release-ok/ /

+ 0 - 1
test/testsources.list/sources.list.all-validuntil-broken

@@ -1 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/all-validuntil-broken/ /

+ 0 - 2
test/testsources.list/sources.list.md5-package-broken

@@ -1,2 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/md5-package-broken/ /
-

+ 0 - 2
test/testsources.list/sources.list.md5-package-ok

@@ -1,2 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/md5-package-ok/ /
-

+ 0 - 1
test/testsources.list/sources.list.md5-release-broken

@@ -1 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/md5-release-broken/ /

+ 0 - 1
test/testsources.list/sources.list.md5-release-ok

@@ -1 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/md5-release-ok/ /

+ 0 - 1
test/testsources.list/sources.list.sha1-release-broken

@@ -1 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/sha1-release-broken/ /

+ 0 - 1
test/testsources.list/sources.list.sha1-release-ok

@@ -1 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/sha1-release-ok/ /

+ 0 - 2
test/testsources.list/sources.list.sha256-package-broken

@@ -1,2 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/sha256-package-broken/ /
-

+ 0 - 2
test/testsources.list/sources.list.sha256-package-ok

@@ -1,2 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/sha256-package-ok/ /
-

+ 0 - 1
test/testsources.list/sources.list.sha256-release-broken

@@ -1 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/sha256-release-broken/ /

+ 0 - 1
test/testsources.list/sources.list.sha256-release-ok

@@ -1 +0,0 @@
-deb http://people.ubuntu.com/~mvo/apt/auth-test-suit/sha256-release-ok/ /

+ 0 - 34
test/uri.cc

@@ -1,34 +0,0 @@
-#include <apt-pkg/strutl.h>
-#include <stdio.h>
-
-void Test(const char *Foo)
-{
-   URI U(Foo);
-   
-   printf("%s a='%s' u='%s' p='%s' port='%u'\n   h='%s' p='%s'\n",
-	  Foo,U.Access.c_str(),U.User.c_str(),U.Password.c_str(),
-	  U.Port,U.Host.c_str(),U.Path.c_str());
-}
-
-int main()
-{
-   // Basic stuff
-   Test("http://www.debian.org:90/temp/test");
-   Test("http://jgg:foo@ualberta.ca/blah");
-   Test("file:/usr/bin/foo");
-   Test("cdrom:Moo Cow Rom:/debian");
-   Test("gzip:./bar/cow");
-	   
-   // RFC 2732 stuff
-   Test("http://[1080::8:800:200C:417A]/foo");
-   Test("http://[::FFFF:129.144.52.38]:80/index.html");
-   Test("http://[::FFFF:129.144.52.38:]:80/index.html");
-   Test("http://[::FFFF:129.144.52.38:]/index.html");
-   
-   /* My Evil Corruption of RFC 2732 to handle CDROM names! Fun for 
-      the whole family! */
-   Test("cdrom:[The Debian 1.2 disk, 1/2 R1:6]/debian/");
-   Test("cdrom:Foo Bar Cow/debian/");
-      
-   Test("ftp:ftp.fr.debian.org/debian/pool/main/x/xtel/xtel_3.2.1-15_i386.deb");
-}