Procházet zdrojové kódy

merged from debian

Michael Vogt před 15 roky
rodič
revize
58a642755c
50 změnil soubory, kde provedl 10088 přidání a 13672 odebrání
  1. 1 0
      apt-pkg/algorithms.cc
  2. 42 39
      apt-pkg/aptconfiguration.cc
  3. 12 6
      apt-pkg/contrib/fileutl.cc
  4. 1 0
      apt-pkg/contrib/fileutl.h
  5. 35 9
      apt-pkg/deb/debindexfile.cc
  6. 1 0
      apt-pkg/deb/deblistparser.cc
  7. 5 2
      apt-pkg/depcache.cc
  8. 27 7
      apt-pkg/orderlist.cc
  9. 8 7
      apt-pkg/pkgcache.cc
  10. 5 2
      buildlib/po4a_manpage.mak
  11. 60 7
      debian/changelog
  12. 3 0
      doc/apt-cache.8.xml
  13. 3 0
      doc/apt-cdrom.8.xml
  14. 3 0
      doc/apt-config.8.xml
  15. 3 0
      doc/apt-extracttemplates.1.xml
  16. 3 0
      doc/apt-ftparchive.1.xml
  17. 3 0
      doc/apt-get.8.xml
  18. 3 0
      doc/apt-key.8.xml
  19. 3 0
      doc/apt-mark.8.xml
  20. 3 0
      doc/apt-secure.8.xml
  21. 3 0
      doc/apt-sortpkgs.1.xml
  22. 188 0
      doc/apt-verbatim.ent
  23. 0 4
      doc/apt.8
  24. 3 0
      doc/apt.conf.5.xml
  25. 1 191
      doc/apt.ent
  26. 3 0
      doc/apt_preferences.5.xml
  27. 5 5
      doc/examples/apt-https-method-example.conf
  28. 915 1250
      doc/po/apt-doc.pot
  29. 1046 1545
      doc/po/de.po
  30. 939 1438
      doc/po/es.po
  31. 941 1440
      doc/po/fr.po
  32. 937 1272
      doc/po/it.po
  33. 939 1438
      doc/po/ja.po
  34. 939 1436
      doc/po/pl.po
  35. 939 1438
      doc/po/pt.po
  36. 939 1274
      doc/po/pt_BR.po
  37. 3 0
      doc/sources.list.5.xml
  38. 1 1
      methods/bzip2.cc
  39. 1 1
      methods/gzip.cc
  40. 771 805
      po/sl.po
  41. 52 0
      test/integration/Packages-xorg-break-providers
  42. 22 0
      test/integration/status-xorg-break-providers
  43. 2 2
      test/integration/test-bug-590438-broken-provides-thanks-to-remove-order
  44. 108 51
      test/integration/test-bug-595691-empty-and-broken-archive-files
  45. 91 0
      test/integration/test-bug-601016-description-translation
  46. 43 0
      test/integration/test-xorg-break-providers
  47. 24 0
      test/libapt/getlanguages_test.cc
  48. 1 1
      test/libapt/run-tests
  49. 8 0
      test/test-indexes.sh
  50. 0 1
      test/versions.lst

+ 1 - 0
apt-pkg/algorithms.cc

@@ -1062,6 +1062,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
 			else if (TryFixByInstall == true &&
 				 Start.TargetPkg()->CurrentVer == 0 &&
 				 Cache[Start.TargetPkg()].Delete() == false &&
+				 (Flags[Start.TargetPkg()->ID] & ToRemove) != ToRemove &&
 				 Cache.GetCandidateVer(Start.TargetPkg()).end() == false)
 			{
 			   /* Before removing or keeping the package with the broken dependency

+ 42 - 39
apt-pkg/aptconfiguration.cc

@@ -166,17 +166,6 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
 	string const envShort = envLong.substr(0,lenShort);
 	bool envLongIncluded = true;
 
-	// first cornercase: LANG=C, so we use only "en" Translation
-	if (envLong == "C") {
-		codes.push_back("en");
-		allCodes = codes;
-		allCodes.insert(allCodes.end(), builtin.begin(), builtin.end());
-		if (All == true)
-			return allCodes;
-		else
-			return codes;
-	}
-
 	// to save the servers from unneeded queries, we only try also long codes
 	// for languages it is realistic to have a long code translation file…
 	// TODO: Improve translation acquire system to drop them dynamic
@@ -217,37 +206,41 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
 	// It is very likely we will need to environment codes later,
 	// so let us generate them now from LC_MESSAGES and LANGUAGE
 	std::vector<string> environment;
-	// take care of LC_MESSAGES
-	if (envLongIncluded == false)
-		environment.push_back(envLong);
-	environment.push_back(envShort);
-	// take care of LANGUAGE
-	const char *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE");
-	string envLang = Locale == 0 ? language_env : *(Locale+1);
-	if (envLang.empty() == false) {
-		std::vector<string> env = VectorizeString(envLang,':');
-		short addedLangs = 0; // add a maximum of 3 fallbacks from the environment
-		for (std::vector<string>::const_iterator e = env.begin();
-		     e != env.end() && addedLangs < 3; ++e) {
-			if (unlikely(e->empty() == true) || *e == "en")
-				continue;
-			if (*e == envLong || *e == envShort)
-				continue;
-			if (std::find(environment.begin(), environment.end(), *e) != environment.end())
-				continue;
-			if (e->find('_') != string::npos) {
-				// Drop LongCodes here - ShortCodes are also included
-				string const shorty = e->substr(0, e->find('_'));
-				char const **n = needLong;
-				for (; *n != NULL; ++n)
-					if (shorty == *n)
-						break;
-				if (*n == NULL)
+	if (envShort != "C") {
+		// take care of LC_MESSAGES
+		if (envLongIncluded == false)
+			environment.push_back(envLong);
+		environment.push_back(envShort);
+		// take care of LANGUAGE
+		const char *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE");
+		string envLang = Locale == 0 ? language_env : *(Locale+1);
+		if (envLang.empty() == false) {
+			std::vector<string> env = VectorizeString(envLang,':');
+			short addedLangs = 0; // add a maximum of 3 fallbacks from the environment
+			for (std::vector<string>::const_iterator e = env.begin();
+			     e != env.end() && addedLangs < 3; ++e) {
+				if (unlikely(e->empty() == true) || *e == "en")
+					continue;
+				if (*e == envLong || *e == envShort)
+					continue;
+				if (std::find(environment.begin(), environment.end(), *e) != environment.end())
 					continue;
+				if (e->find('_') != string::npos) {
+					// Drop LongCodes here - ShortCodes are also included
+					string const shorty = e->substr(0, e->find('_'));
+					char const **n = needLong;
+					for (; *n != NULL; ++n)
+						if (shorty == *n)
+							break;
+					if (*n == NULL)
+						continue;
+				}
+				++addedLangs;
+				environment.push_back(*e);
 			}
-			++addedLangs;
-			environment.push_back(*e);
 		}
+	} else {
+		environment.push_back("en");
 	}
 
 	// Support settings like Acquire::Translation=none on the command line to
@@ -269,6 +262,16 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
 			return codes;
 	}
 
+	// cornercase: LANG=C, so we use only "en" Translation
+	if (envShort == "C") {
+		allCodes = codes = environment;
+		allCodes.insert(allCodes.end(), builtin.begin(), builtin.end());
+		if (All == true)
+			return allCodes;
+		else
+			return codes;
+	}
+
 	std::vector<string> const lang = _config->FindVector("Acquire::Languages");
 	// the default setting -> "environment, en"
 	if (lang.empty() == true) {

+ 12 - 6
apt-pkg/contrib/fileutl.cc

@@ -910,18 +910,24 @@ unsigned long FileFd::Tell()
    return Res;
 }
 									/*}}}*/
-// FileFd::Size - Return the size of the file				/*{{{*/
+// FileFd::FileSize - Return the size of the file			/*{{{*/
 // ---------------------------------------------------------------------
 /* */
-unsigned long FileFd::Size()
+unsigned long FileFd::FileSize()
 {
    struct stat Buf;
-   unsigned long size;
-   off_t orig_pos;
 
    if (fstat(iFd,&Buf) != 0)
       return _error->Errno("fstat","Unable to determine the file size");
-   size = Buf.st_size;
+   return Buf.st_size;
+}
+									/*}}}*/
+// FileFd::Size - Return the size of the content in the file		/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+unsigned long FileFd::Size()
+{
+   unsigned long size = FileSize();
 
    // only check gzsize if we are actually a gzip file, just checking for
    // "gz" is not sufficient as uncompressed files will be opened with
@@ -931,7 +937,7 @@ unsigned long FileFd::Size()
        /* unfortunately zlib.h doesn't provide a gzsize(), so we have to do
 	* this ourselves; the original (uncompressed) file size is the last 32
 	* bits of the file */
-       orig_pos = lseek(iFd, 0, SEEK_CUR);
+       off_t orig_pos = lseek(iFd, 0, SEEK_CUR);
        if (lseek(iFd, -4, SEEK_END) < 0)
 	   return _error->Errno("lseek","Unable to seek to end of gzipped file");
        if (read(iFd, &size, 4) != 4)

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

@@ -63,6 +63,7 @@ class FileFd
    bool Truncate(unsigned long To);
    unsigned long Tell();
    unsigned long Size();
+   unsigned long FileSize();
    bool Open(string FileName,OpenMode Mode,unsigned long Perms = 0666);
    bool OpenDescriptor(int Fd, OpenMode Mode, bool AutoClose=false);
    bool Close();

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

@@ -149,11 +149,20 @@ bool debSourcesIndex::Exists() const
 /* */
 unsigned long debSourcesIndex::Size() const
 {
+   unsigned long size = 0;
+
+   /* we need to ignore errors here; if the lists are absent, just return 0 */
+   _error->PushToStack();
+
    FileFd f = FileFd (IndexFile("Sources"), FileFd::ReadOnlyGzip);
+   if (!f.Failed())
+      size = f.Size();
 
-   if (f.Failed())
-      return 0;
-   return f.Size();
+   if (_error->PendingError() == true)
+       size = 0;
+   _error->RevertToStack();
+
+   return size;
 }
 									/*}}}*/
 
@@ -269,11 +278,20 @@ bool debPackagesIndex::Exists() const
 /* This is really only used for progress reporting. */
 unsigned long debPackagesIndex::Size() const
 {
+   unsigned long size = 0;
+
+   /* we need to ignore errors here; if the lists are absent, just return 0 */
+   _error->PushToStack();
+
    FileFd f = FileFd (IndexFile("Packages"), FileFd::ReadOnlyGzip);
+   if (!f.Failed())
+      size = f.Size();
 
-   if (f.Failed())
-      return 0;
-   return f.Size();
+   if (_error->PendingError() == true)
+       size = 0;
+   _error->RevertToStack();
+
+   return size;
 }
 									/*}}}*/
 // PackagesIndex::Merge - Load the index file into a cache		/*{{{*/
@@ -460,12 +478,20 @@ bool debTranslationsIndex::Exists() const
 /* This is really only used for progress reporting. */
 unsigned long debTranslationsIndex::Size() const
 {
+   unsigned long size = 0;
+
+   /* we need to ignore errors here; if the lists are absent, just return 0 */
+   _error->PushToStack();
+
    FileFd f = FileFd (IndexFile(Language), FileFd::ReadOnlyGzip);
+   if (!f.Failed())
+      size = f.Size();
 
-   if (f.Failed())
-      return 0;
+   if (_error->PendingError() == true)
+       size = 0;
+   _error->RevertToStack();
 
-   return f.Size();
+   return size;
 }
 									/*}}}*/
 // TranslationsIndex::Merge - Load the index file into a cache		/*{{{*/

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

@@ -481,6 +481,7 @@ const char *debListParser::ConvertRelation(const char *I,unsigned int &Op)
  */
 static string CompleteArch(std::string& arch) {
     if (arch == "armel")              return "linux-arm";
+    if (arch == "armhf")              return "linux-arm";
     if (arch == "lpia")               return "linux-i386";
     if (arch == "powerpcspe")         return "linux-powerpc";
     if (arch == "uclibc-linux-armel") return "linux-arm";

+ 5 - 2
apt-pkg/depcache.cc

@@ -1444,8 +1444,11 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
 	    VerIterator Ver(*this,*I);
 	    PkgIterator Pkg = Ver.ParentPkg();
 
-	    
-	       
+	    /* The List includes all packages providing this dependency,
+	       even providers which are not installed, so skip them. */
+	    if (PkgState[Pkg->ID].InstallVer == 0)
+	       continue;
+
 	    if (PkgState[Pkg->ID].CandidateVer != *I &&
 	        Start->Type == Dep::DpkgBreaks)
 	       MarkInstall(Pkg,true,Depth + 1, false, ForceImportantDeps);

+ 27 - 7
apt-pkg/orderlist.cc

@@ -967,13 +967,33 @@ bool pkgOrderList::DepRemove(DepIterator D)
 	       // start again in the or group and find something which will serve as replacement
 	       for (; F.end() == false && F != S; ++F)
 	       {
-		  if (F.TargetPkg() == D.TargetPkg() ||
-		      IsFlag(F.TargetPkg(), InList) == false ||
-		      VisitNode(F.TargetPkg()) == false)
-		     continue;
-		  Flag(F.TargetPkg(), Immediate);
-		  tryFixDeps = false;
-		  break;
+		  if (IsFlag(F.TargetPkg(), InList) == true &&
+		      IsFlag(F.TargetPkg(), AddPending) == false &&
+		      Cache[F.TargetPkg()].InstallVer != 0 &&
+		      VisitNode(F.TargetPkg()) == true)
+		  {
+		     Flag(F.TargetPkg(), Immediate);
+		     tryFixDeps = false;
+		     break;
+		  }
+		  else if (F.TargetPkg()->ProvidesList != 0)
+		  {
+		     pkgCache::PrvIterator Prv = F.TargetPkg().ProvidesList();
+		     for (; Prv.end() == false; ++Prv)
+		     {
+			if (IsFlag(Prv.OwnerPkg(), InList) == true &&
+			    IsFlag(Prv.OwnerPkg(), AddPending) == false &&
+			    Cache[Prv.OwnerPkg()].InstallVer != 0 &&
+			    VisitNode(Prv.OwnerPkg()) == true)
+			{
+			   Flag(Prv.OwnerPkg(), Immediate);
+			   tryFixDeps = false;
+			   break;
+			}
+		     }
+		     if (Prv.end() == false)
+			break;
+		  }
 	       }
 	       if (tryFixDeps == false)
 		  break;

+ 8 - 7
apt-pkg/pkgcache.cc

@@ -891,18 +891,19 @@ pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const
    for (std::vector<string>::const_iterator l = lang.begin();
 	l != lang.end(); l++)
    {
-      pkgCache::DescIterator DescDefault = DescriptionList();
-      pkgCache::DescIterator Desc = DescDefault;
-
-      for (; Desc.end() == false; Desc++)
+      pkgCache::DescIterator Desc = DescriptionList();
+      for (; Desc.end() == false; ++Desc)
 	 if (*l == Desc.LanguageCode() ||
 	     (*l == "en" && strcmp(Desc.LanguageCode(),"") == 0))
 	    break;
-      if (Desc.end() == true) 
-	 Desc = DescDefault;
+      if (Desc.end() == true)
+	 continue;
       return Desc;
    }
-
+   for (pkgCache::DescIterator Desc = DescriptionList();
+	Desc.end() == false; ++Desc)
+      if (strcmp(Desc.LanguageCode(), "") == 0)
+	 return Desc;
    return DescriptionList();
 };
 

+ 5 - 2
buildlib/po4a_manpage.mak

@@ -11,7 +11,7 @@
 
 # generate a list of accepted man page translations
 SOURCE = $(patsubst %.xml,%,$(wildcard *.$(LC).?.xml))
-INCLUDES = apt.ent
+INCLUDES = apt.ent apt-verbatim.ent
 
 # Do not use XMLTO, build the manpages directly with XSLTPROC
 ifdef XSLTPROC
@@ -25,6 +25,9 @@ $(LOCAL)-LIST := $(SOURCE)
 doc: $($(LOCAL)-LIST)
 veryclean: veryclean/$(LOCAL)
 
+apt-verbatim.ent: ../apt-verbatim.ent
+	cp ../apt-verbatim.ent .
+
 $($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
 	echo Creating man page $@
 	$(XSLTPROC) -o $@ $(STYLESHEET) $< || exit 200 # why xsltproc doesn't respect the -o flag here???
@@ -34,7 +37,7 @@ $($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
 # Clean rule
 .PHONY: veryclean/$(LOCAL)
 veryclean/$(LOCAL):
-	-rm -rf $($(@F)-LIST) apt.ent apt.$(LC).8 \
+	-rm -rf $($(@F)-LIST) apt.ent apt-verbatim.ent apt.$(LC).8 \
 		$(addsuffix .xml,$($(@F)-LIST)) \
 		offline.$(LC).sgml guide.$(LC).sgml
 

+ 60 - 7
debian/changelog

@@ -1,23 +1,64 @@
-apt (0.8.7) UNRELEASED; urgency=low
+apt (0.8.9) UNRELEASED; urgency=low
+
+  [ Christian Perrier ]
+  * Fix "typos" in French manpages translations. Thanks to
+    Cyril Brulebois for bashing me.
+  * Drop useless untranslatable sections from apt.8
+
+  [ Programs translations ]
+  * Slovenian update by Andrej Žnidaršič and Rosetta Slovenian team
+
+  [ David Kalnischkies ]
+  * apt-pkg/aptconfiguration.cc:
+    - evaluate Acquire::Languages= before LANG= (Closes: #602573)
+  * apt-pkg/orderlist.cc:
+    - try fixing before removing even if the fix is hidden in
+      a provides, hidden in the #590438 testcase
+  * apt-pkg/algorithms.cc:
+    - if the package was explicitly marked as ToRemove don't
+      consider it as a candidate for FixByInstall
+  * apt-pkg/depcache.cc:
+    - don't install previously not installed providers in a try
+      to statisfy a "Breaks: provides" dependency by upgrade
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 10 Nov 2010 13:22:39 +0100
+
+apt (0.8.8) unstable; urgency=low
+
+  [ David Kalnischkies ]
+  * apt-pkg/contrib/fileutl.cc:
+    - Add a FileFd::FileSize() method to get the size of the underlying
+      file and not the size of the content in the file as FileFd::Size()
+      does - the sizes can differ since the direct gzip integration
+  * methods/{gzip,bzip2}.cc:
+    - use FileSize() to determine if the file is invalid (Closes: #600852)
+  * apt-pkg/pkgcache.cc:
+    - fallback always to a suitable description (Closes: #601016)
+
+  [ Michael Vogt ]
+  * apt-pkg/deb/dpkgpm.cc:
+    - ensure that history.log gets closed to avoid leaking a FD
+      (closes: #601649)
+
+ -- Michael Vogt <mvo@debian.org>  Thu, 28 Oct 2010 21:22:21 +0200
+
+apt (0.8.7) unstable; urgency=low
 
   [ Manpages translations ]
   * Typo fixed in French (extra "Z"). Thanks to Florentin Duneau.
   * Another typo fixed in French ("Anfin"). Thanks to bubulle
   * Wrong translation for "showauto" fixed. Thanks to Raphaël Hertzog
     Closes: #599265
-  
+
   [ Michael Vogt ]
   * debian/apt.cron.daily:
-    - source /etc/default/locale (if available) so that the 
+    - source /etc/default/locale (if available) so that the
       apt-get update cron job fetches the right translated package
       descriptions
   * fix test failure on amd64
   * apt-pkg/deb/debsystem.cc:
     - fix issues with dir::state::status and dir::state::extended_states
       when alternative rootdirs are used
-  * apt-pkg/deb/dpkgpm.cc:
-    - ensure that history.log gets closed to avoid leaking a FD
-      (closes: #601649)
 
   [ Martin Pitt ]
   * apt-pkg/deb/debindexfile.cc:
@@ -29,7 +70,19 @@ apt (0.8.7) UNRELEASED; urgency=low
       uncompressed data. This fixes cache building progress going way
       over 100%.
 
- -- Christian Perrier <bubulle@debian.org>  Tue, 05 Oct 2010 05:35:58 +0200
+  [ David Kalnischkies ]
+  * apt-pkg/deb/deblistparser.cc:
+    - support ArmHardFloat port in CompleteArch, thanks to Sebastian
+      Andrzej Siewior for the patch!
+  * doc/apt.ent:
+    - move some strings into apt-verbatim.ent to avoid showing them in
+      apt-doc.pot as they are untranslatable anyway (e.g. manpage references)
+  * doc/apt-verbatim.ent:
+    - change the codenames to reflect the situation after squeeze release
+  * doc/examples/apt-https-method-example.conf:
+    - apply various typo fixes by Olly Betts, thanks! (Closes: #600249)
+
+ -- Michael Vogt <mvo@debian.org>  Fri, 15 Oct 2010 18:16:10 +0200
 
 apt (0.8.6) unstable; urgency=low
 

+ 3 - 0
doc/apt-cache.8.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 3 - 0
doc/apt-cdrom.8.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 3 - 0
doc/apt-config.8.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 3 - 0
doc/apt-extracttemplates.1.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 3 - 0
doc/apt-ftparchive.1.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 3 - 0
doc/apt-get.8.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 3 - 0
doc/apt-key.8.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 3 - 0
doc/apt-mark.8.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

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

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 3 - 0
doc/apt-sortpkgs.1.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 188 - 0
doc/apt-verbatim.ent

@@ -0,0 +1,188 @@
+<!-- -*- mode: xml; mode: fold -*- -->
+
+<!-- Some common paths.. -->
+<!ENTITY docdir "/usr/share/doc/apt/">
+<!ENTITY guidesdir "/usr/share/doc/apt-doc/">
+<!ENTITY configureindex "<filename>&docdir;examples/configure-index.gz</filename>">
+<!ENTITY aptconfdir "<filename>/etc/apt.conf</filename>">
+<!ENTITY statedir "/var/lib/apt">
+<!ENTITY cachedir "/var/cache/apt">
+
+<!-- Cross references to other man pages -->
+<!ENTITY apt-conf "<citerefentry>
+    <refentrytitle><filename>apt.conf</filename></refentrytitle>
+    <manvolnum>5</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-get "<citerefentry>
+    <refentrytitle><command>apt-get</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-config "<citerefentry>
+    <refentrytitle><command>apt-config</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-cdrom "<citerefentry>
+    <refentrytitle><command>apt-cdrom</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-cache "<citerefentry>
+    <refentrytitle><command>apt-cache</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-preferences "<citerefentry>
+    <refentrytitle><command>apt_preferences</command></refentrytitle>
+    <manvolnum>5</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-key "<citerefentry>
+    <refentrytitle><command>apt-key</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-secure "<citerefentry>
+    <refentrytitle>apt-secure</refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY apt-ftparchive "<citerefentry>
+    <refentrytitle><filename>apt-ftparchive</filename></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+
+<!ENTITY sources-list "<citerefentry>
+    <refentrytitle><filename>sources.list</filename></refentrytitle>
+    <manvolnum>5</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY reportbug "<citerefentry>
+    <refentrytitle><command>reportbug</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY dpkg "<citerefentry>
+    <refentrytitle><command>dpkg</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY dpkg-buildpackage "<citerefentry>
+    <refentrytitle><command>dpkg-buildpackage</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY gzip "<citerefentry>
+    <refentrytitle><command>gzip</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY dpkg-scanpackages "<citerefentry>
+    <refentrytitle><command>dpkg-scanpackages</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY dpkg-scansources "<citerefentry>
+    <refentrytitle><command>dpkg-scansources</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY dselect "<citerefentry>
+    <refentrytitle><command>dselect</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY aptitude "<citerefentry>
+    <refentrytitle><command>aptitude</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY synaptic "<citerefentry>
+    <refentrytitle><command>synaptic</command></refentrytitle>
+    <manvolnum>8</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY debsign "<citerefentry>
+    <refentrytitle><command>debsign</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY debsig-verify "<citerefentry>
+    <refentrytitle><command>debsig-verify</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY gpg "<citerefentry>
+    <refentrytitle><command>gpg</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!ENTITY wajig "<citerefentry>
+    <refentrytitle><command>wajig</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
+<!-- Boiler plate docinfo section -->
+<!ENTITY apt-email "
+   <address>
+    <email>apt@packages.debian.org</email>
+   </address>
+">
+
+<!ENTITY apt-author.jgunthorpe "
+   <author>
+    <firstname>Jason</firstname>
+    <surname>Gunthorpe</surname>
+    <contrib></contrib>
+   </author>
+">
+
+<!ENTITY apt-author.moconnor "
+   <author>
+    <firstname>Mike</firstname>
+    <surname>O'Connor</surname>
+    <contrib></contrib>
+   </author>
+">
+
+<!ENTITY apt-copyright "
+    <copyright>
+     <holder>Jason Gunthorpe</holder>
+     <year>1998-2001</year>
+    </copyright>
+">
+
+<!ENTITY apt-product "
+   <productname>Linux</productname>
+">
+
+<!-- Codenames for debian releases -->
+<!ENTITY oldstable-codename "lenny">
+<!ENTITY stable-codename "squeeze">
+<!ENTITY testing-codename "wheezy">

+ 0 - 4
doc/apt.8

@@ -28,10 +28,6 @@ for the command line or
 for the X Window System. Some options are only implemented in
 .BR apt-get (8)
 though.
-.SH OPTIONS
-None.
-.SH FILES
-None.
 .SH SEE ALSO
 .BR apt-cache (8),
 .BR apt-get (8),

+ 3 - 0
doc/apt.conf.5.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 1 - 191
doc/apt.ent

@@ -1,153 +1,5 @@
 <!-- -*- mode: sgml; mode: fold -*- -->
 
-<!-- Some common paths.. -->
-<!ENTITY docdir "/usr/share/doc/apt/">
-<!ENTITY guidesdir "/usr/share/doc/apt-doc/">
-<!ENTITY configureindex "<filename>&docdir;examples/configure-index.gz</filename>">
-<!ENTITY aptconfdir "<filename>/etc/apt.conf</filename>">
-<!ENTITY statedir "/var/lib/apt">
-<!ENTITY cachedir "/var/cache/apt">
-
-<!-- Cross references to other man pages -->
-<!ENTITY apt-conf "<citerefentry>
-    <refentrytitle><filename>apt.conf</filename></refentrytitle>
-    <manvolnum>5</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY apt-get "<citerefentry>
-    <refentrytitle><command>apt-get</command></refentrytitle>
-    <manvolnum>8</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY apt-config "<citerefentry>
-    <refentrytitle><command>apt-config</command></refentrytitle>
-    <manvolnum>8</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY apt-cdrom "<citerefentry>
-    <refentrytitle><command>apt-cdrom</command></refentrytitle>
-    <manvolnum>8</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY apt-cache "<citerefentry>
-    <refentrytitle><command>apt-cache</command></refentrytitle>
-    <manvolnum>8</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY apt-preferences "<citerefentry>
-    <refentrytitle><command>apt_preferences</command></refentrytitle>
-    <manvolnum>5</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY apt-key "<citerefentry>
-    <refentrytitle><command>apt-key</command></refentrytitle>
-    <manvolnum>8</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY apt-secure "<citerefentry>
-    <refentrytitle>apt-secure</refentrytitle>
-    <manvolnum>8</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY apt-ftparchive "<citerefentry>
-    <refentrytitle><filename>apt-ftparchive</filename></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-
-<!ENTITY sources-list "<citerefentry>
-    <refentrytitle><filename>sources.list</filename></refentrytitle>
-    <manvolnum>5</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY reportbug "<citerefentry>
-    <refentrytitle><command>reportbug</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY dpkg "<citerefentry>
-    <refentrytitle><command>dpkg</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY dpkg-buildpackage "<citerefentry>
-    <refentrytitle><command>dpkg-buildpackage</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY gzip "<citerefentry>
-    <refentrytitle><command>gzip</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY dpkg-scanpackages "<citerefentry>
-    <refentrytitle><command>dpkg-scanpackages</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY dpkg-scansources "<citerefentry>
-    <refentrytitle><command>dpkg-scansources</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY dselect "<citerefentry>
-    <refentrytitle><command>dselect</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY aptitude "<citerefentry>
-    <refentrytitle><command>aptitude</command></refentrytitle>
-    <manvolnum>8</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY synaptic "<citerefentry>
-    <refentrytitle><command>synaptic</command></refentrytitle>
-    <manvolnum>8</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY debsign "<citerefentry>
-    <refentrytitle><command>debsign</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY debsig-verify "<citerefentry>
-    <refentrytitle><command>debsig-verify</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY gpg "<citerefentry>
-    <refentrytitle><command>gpg</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
-
-<!ENTITY wajig "<citerefentry>
-    <refentrytitle><command>wajig</command></refentrytitle>
-    <manvolnum>1</manvolnum>
-  </citerefentry>"
->
- 
 <!-- Boiler plate docinfo section -->
 <!ENTITY apt-docinfo "
  <refentryinfo>
@@ -159,30 +11,7 @@
    <copyright><year>1998-2001</year> <holder>Jason Gunthorpe</holder></copyright>
    <date>28 October 2008</date>
    <productname>Linux</productname>
-
  </refentryinfo>
-"> 
-
-<!ENTITY apt-email "
-   <address>
-    <email>apt@packages.debian.org</email>
-   </address>
-">
-
-<!ENTITY apt-author.jgunthorpe "
-   <author>
-    <firstname>Jason</firstname>
-    <surname>Gunthorpe</surname>
-    <contrib></contrib>
-   </author>
-">
-
-<!ENTITY apt-author.moconnor "
-   <author>
-    <firstname>Mike</firstname>
-    <surname>O'Connor</surname>
-    <contrib></contrib>
-   </author>
 ">
 
 <!ENTITY apt-author.team "
@@ -192,21 +21,6 @@
    </author>
 ">
 
-<!ENTITY apt-product "
-   <productname>Linux</productname>
-">
-
-<!ENTITY apt-copyright "
-    <copyright>
-     <holder>Jason Gunthorpe</holder>
-     <year>1998-2001</year>
-    </copyright>
-">
-
-<!ENTITY apt-product "
-   <productname>Linux</productname>
-">
-
 <!ENTITY apt-qapage "
 	<para>
 		<ulink url='http://packages.qa.debian.org/a/apt.html'>QA Page</ulink>
@@ -216,7 +30,7 @@
 <!-- Boiler plate Bug reporting section -->
 <!ENTITY manbugs "
  <refsect1><title>Bugs</title>
-   <para><ulink url='http://bugs.debian.org/src:apt'>APT bug page</ulink>. 
+   <para><ulink url='http://bugs.debian.org/src:apt'>APT bug page</ulink>.
    If you wish to report a bug in APT, please see
    <filename>/usr/share/doc/debian/bug-reporting.txt</filename> or the
    &reportbug; command.
@@ -394,7 +208,3 @@
      This is done on purpose, to avoid losing content when the
      translation is lagging behind the original content.
 ">
-
-<!ENTITY oldstable-codename "etch">
-<!ENTITY stable-codename "lenny">
-<!ENTITY testing-codename "squeeze">

+ 3 - 0
doc/apt_preferences.5.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 5 - 5
doc/examples/apt-https-method-example.conf

@@ -6,7 +6,7 @@
    This example file starts with a common setup that voluntarily exhibits
    all available configurations knobs with simple comments. Extended
    comments on the behavior of the option is provided at the end for
-   better readibility. As a matter of fact, a common configuration file
+   better readability. As a matter of fact, a common configuration file
    will certainly contain far less elements and benefit of default values
    for many parameters.
 
@@ -38,12 +38,12 @@
       matches their respective DNS names.
     - We have CRL available for both dom1.tld and dom2.tld PKI, and intend
       to use them.
-    - It somtimes happens that we had other more generic https available
+    - It sometimes happens that we had other more generic https available
       repository to our list. We want the checks to be performed against
       a common list of anchors (like the one provided by ca-certificates
       package for instance)
 
-   The sample configuration below basically covers those simpe needs.
+   The sample configuration below basically covers those simple needs.
 */
 
 
@@ -168,12 +168,12 @@ Acquire::https::secure.dom2.tld::SslKey  "/etc/apt/certs/my-key.pem";
     When the option is set to "SSLv3" to have apt propose SSLv3 (and
     associated sets of ciphersuites) instead of TLSv1 (the default)
     when performing the exchange. This prevents the server to select
-    TLSv1 and use associated cipheruites. You should probably not use
+    TLSv1 and use associated ciphersuites. You should probably not use
     this option except if you know exactly what you are doing.
 
     Note that the default setting does not guarantee that the server
     will not select SSLv3 (for ciphersuites and SSL/TLS version as
-    selectio is always done by the server, in the end). It only means
+    selection is always done by the server, in the end). It only means
     that apt will not advertise TLS support.
 
   Debug::Acquire::https "true";

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 915 - 1250
doc/po/apt-doc.pot


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1046 - 1545
doc/po/de.po


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 939 - 1438
doc/po/es.po


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 941 - 1440
doc/po/fr.po


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 937 - 1272
doc/po/it.po


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 939 - 1438
doc/po/ja.po


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 939 - 1436
doc/po/pl.po


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 939 - 1438
doc/po/pt.po


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 939 - 1274
doc/po/pt_BR.po


+ 3 - 0
doc/sources.list.5.xml

@@ -5,6 +5,9 @@
 <!ENTITY % aptent SYSTEM "apt.ent">
 %aptent;
 
+<!ENTITY % aptverbatiment SYSTEM "apt-verbatim.ent">
+%aptverbatiment;
+
 ]>
 
 <refentry>

+ 1 - 1
methods/bzip2.cc

@@ -57,7 +57,7 @@ bool Bzip2Method::Fetch(FetchItem *Itm)
    FileFd From(Path,FileFd::ReadOnly);
 
    // FIXME add an error message saying that empty files can't be valid archives
-   if(From.Size() == 0)
+   if(From.FileSize() == 0)
       return false;
 
    int GzOut[2];   

+ 1 - 1
methods/gzip.cc

@@ -49,7 +49,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
    FileFd From(Path,FileFd::ReadOnlyGzip);
 
    // FIXME add an error message saying that empty files can't be valid archives
-   if(From.Size() == 0)
+   if(From.FileSize() == 0)
       return false;
 
    FileFd To(Itm->DestFile,FileFd::WriteAtomic);   

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 771 - 805
po/sl.po


+ 52 - 0
test/integration/Packages-xorg-break-providers

@@ -0,0 +1,52 @@
+Package: xserver-xorg-video-intel
+Priority: optional
+Section: x11
+Installed-Size: 1292
+Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
+Architecture: i386
+Version: 2:2.13.901-2
+Provides: xserver-xorg-video-8
+Filename: pool/main/x/xserver-xorg-video-intel/xserver-xorg-video-intel_2.13.901-2_i386.deb
+Size: 586964
+MD5sum: 72527f4b2c9d734e53202736e3177865
+Description: X.Org X server -- Intel i8xx, i9xx display driver
+
+Package: xserver-xorg-video-vesa
+Priority: optional
+Section: x11
+Installed-Size: 104
+Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
+Architecture: i386
+Version: 1:2.3.0-4
+Provides: xserver-xorg-video-8
+Filename: pool/main/x/xserver-xorg-video-vesa/xserver-xorg-video-vesa_2.3.0-4_i386.deb
+Size: 27158
+MD5sum: 77bf2935c40b3b7739d431930e53d185
+Description: X.Org X server -- VESA display driver
+
+Package: xserver-xorg-video-vesa
+Priority: optional
+Section: x11
+Installed-Size: 104
+Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
+Architecture: i386
+Version: 1:2.3.0-3
+Provides: xserver-xorg-video-6
+Filename: pool/main/x/xserver-xorg-video-vesa/xserver-xorg-video-vesa_2.3.0-3_i386.deb
+Size: 27122
+MD5sum: 0cd97be927c7d75f2a7230739f8f866c
+Description: X.Org X server -- VESA display driver
+
+Package: xserver-xorg-core
+Priority: optional
+Section: x11
+Installed-Size: 4436
+Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
+Architecture: i386
+Source: xorg-server
+Version: 2:1.7.7-8
+Breaks: xserver-xorg-video-6
+Filename: pool/main/x/xorg-server/xserver-xorg-core_1.7.7-8_i386.deb
+Size: 2405050
+MD5sum: 976ddb13473e52903dd839d1f7ec390b
+Description: Xorg X server - core server

+ 22 - 0
test/integration/status-xorg-break-providers

@@ -0,0 +1,22 @@
+Package: xserver-xorg-core
+Status: install ok installed
+Priority: optional
+Section: x11
+Installed-Size: 4436
+Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
+Architecture: i386
+Source: xorg-server
+Version: 2:1.7.7-8
+Breaks: xserver-xorg-video-5
+Description: Xorg X server - core server
+
+Package: xserver-xorg-video-intel
+Status: install ok installed
+Priority: optional
+Section: x11
+Installed-Size: 1268
+Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
+Architecture: i386
+Version: 2:2.13.0-2
+Provides: xserver-xorg-video-6
+Description: X.Org X server -- Intel i8xx, i9xx display driver

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

@@ -25,7 +25,7 @@ MD5sum: 8489687ce10e656babd467c9ee389349
 Description-de: Verschiedene Dateien für das Basis-System von Debian"
 
 predependsgawk() {
-# 	rm rootdir/var/cache/apt/*.bin
+	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 +57,7 @@ predependsgawk "awk | aawk"
 predependsgawk "awk"
 
 predependsgawk2() {
-# 	rm rootdir/var/cache/apt/*.bin
+	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

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

@@ -10,6 +10,7 @@ buildaptarchive
 setupflataptarchive
 
 testaptgetupdate() {
+	rm -rf rootdir/var/lib/apt rootdir/var/cache/apt
 	aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true
 	sed -i -e '/^Fetched / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
 	GIVEN="$1"
@@ -23,69 +24,125 @@ testaptgetupdate() {
 	rm testaptgetupdate.diff
 }
 
-touch aptarchive/en.bz2
+createemptyarchive() {
+	find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete
+	if [ "en" = "$1" ]; then
+		echo -n "" | $COMPRESSOR > aptarchive/Packages.$COMPRESS
+	fi
+	touch aptarchive/Packages
+	echo -n "" | $COMPRESSOR > aptarchive/${1}.$COMPRESS
+	aptftparchive release aptarchive/ > aptarchive/Release
+	signreleasefiles
+	rm -f aptarchive/Packages
+}
 
-testaptgetupdate "Ign file:  Release.gpg
-Ign file:$(readlink -f aptarchive)/  Translation-en
-Get:1 file:  Release []
-Reading package lists..." "empty file en.bz2 over file"
+createemptyfile() {
+	find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete
+	if [ "en" = "$1" ]; then
+		echo -n "" | $COMPRESSOR > aptarchive/Packages.$COMPRESS
+	fi
+	touch aptarchive/Packages aptarchive/${1}.$COMPRESS
+	aptftparchive release aptarchive/ > aptarchive/Release
+	signreleasefiles
+	rm -f aptarchive/Packages
+}
 
-rm aptarchive/en.bz2
-echo -n "" | bzip2 > aptarchive/en.bz2
+setupcompressor() {
+	COMPRESSOR="$1"
+	case $COMPRESSOR in
+	gzip) COMPRESS="gz";;
+	bzip2) COMPRESS="bz2";;
+	lzma) COMPRESS="lzma";;
+	esac
+	echo "Acquire::CompressionTypes::Order { \"${COMPRESS}\"; };
+Dir::Bin::gzip \"/does/not/exist\";
+Dir::Bin::bzip2 \"/does/not/exist\";
+Dir::Bin::lzma \"/does/not/exist\";" > rootdir/etc/apt/apt.conf.d/00compressor
+	if [ -e "/bin/${COMPRESSOR}" ]; then
+		echo "Dir::Bin::${COMPRESSOR} \"/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor
+	elif [ -e "/usr/bin/${COMPRESSOR}" ]; then
+		echo "Dir::Bin::${COMPRESSOR} \"/usr/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor
+	else
+		msgtest "Test for availability of compressor" "${COMPRESSOR}"
+		msgfail
+		exit 1
+	fi
+}
 
-testaptgetupdate "Ign file:  Release.gpg
-Get:1 file:  Release []
-Reading package lists..." "empty archive en.bz2 over file"
+testoverfile() {
+	setupcompressor "$1"
 
-rm aptarchive/en.bz2
+	createemptyfile 'en'
+	testaptgetupdate "Get:1 file:  Release.gpg []
+Get:2 file:  Release []
+Ign file:$(readlink -f aptarchive)/  Translation-en
+Reading package lists..." "empty file en.$COMPRESS over file"
+
+	createemptyarchive 'en'
+	testaptgetupdate "Get:1 file:  Release.gpg []
+Get:2 file:  Release []
+Reading package lists..." "empty archive en.$COMPRESS over file"
+
+	createemptyarchive 'Packages'
+	# FIXME: Why omits the file transport the Packages Get line?
+	#Get:3 file:  Packages []
+	testaptgetupdate "Ign file:$(readlink -f aptarchive)/  Translation-en
+Get:1 file:  Release.gpg []
+Get:2 file:  Release []
+Reading package lists..." "empty archive Packages.$COMPRESS over file"
+
+	createemptyfile 'Packages'
+	testaptgetupdate "Ign file:$(readlink -f aptarchive)/  Translation-en
+Get:1 file:  Release.gpg []
+Get:2 file:  Release []
+Err file:  Packages
+  Undetermined Error
+W: Failed to fetch file:$(readlink -f aptarchive/Packages.$COMPRESS)  Undetermined Error
 
-# do the same again with http instead of file
-changetowebserver
+E: Some index files failed to download, they have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over file"
+}
 
-touch aptarchive/en.bz2
+testoverhttp() {
+	setupcompressor "$1"
 
-testaptgetupdate "Ign http://localhost  Release.gpg
-Get:1 http://localhost/  Translation-en
-Get:2 http://localhost  Release []
+	createemptyfile 'en'
+	testaptgetupdate "Get:1 http://localhost  Release.gpg []
+Get:2 http://localhost/  Translation-en
+Get:3 http://localhost  Release []
+Ign http://localhost/  Translation-en
+Get:4 http://localhost  Packages []
+Reading package lists..." "empty file en.$COMPRESS over http"
+
+	createemptyarchive 'en'
+	testaptgetupdate "Get:1 http://localhost  Release.gpg []
+Get:2 http://localhost/  Translation-en []
+Get:3 http://localhost  Release []
+Get:4 http://localhost  Packages []
+Reading package lists..." "empty archive en.$COMPRESS over http"
+
+	createemptyarchive 'Packages'
+	testaptgetupdate "Get:1 http://localhost  Release.gpg []
 Ign http://localhost/  Translation-en
-Get:3 http://localhost  Packages []
-Reading package lists..." "empty file en.bz2 over http"
-
-rm aptarchive/en.bz2
-echo -n "" | bzip2 > aptarchive/en.bz2
-
-testaptgetupdate "Ign http://localhost  Release.gpg
-Get:1 http://localhost/  Translation-en []
 Get:2 http://localhost  Release []
-Ign http://localhost  Packages/DiffIndex
 Get:3 http://localhost  Packages []
-Reading package lists..." "empty archive en.bz2 over http"
-
-rm aptarchive/en.bz2
-
-rm aptarchive/Packages
-touch aptarchive/Packages
-buildaptarchivefromfiles
-
-testaptgetupdate "Ign http://localhost  Release.gpg
-Ign http://localhost/  Translation-en
-Get:1 http://localhost  Release []
-Ign http://localhost  Packages/DiffIndex
-Get:2 http://localhost  Packages []
-Reading package lists..." "empty archive Packages over http"
-
-find aptarchive/ -name 'Packages*' -type f -delete
-touch aptarchive/Packages.bz2
-aptftparchive release aptarchive/ > aptarchive/Release
+Reading package lists..." "empty archive Packages.$COMPRESS over http"
 
-#FIXME: we should response with a good error message instead
-testaptgetupdate "Ign http://localhost  Release.gpg
+	createemptyfile 'Packages'
+	#FIXME: we should response with a good error message instead
+	testaptgetupdate "Get:1 http://localhost  Release.gpg []
 Ign http://localhost/  Translation-en
-Get:1 http://localhost  Release []
-Ign http://localhost  Packages/DiffIndex
-Get:2 http://localhost  Packages
+Get:2 http://localhost  Release []
+Get:3 http://localhost  Packages
 Err http://localhost  Packages
   Undetermined Error
-W: Failed to fetch http://localhost:8080/Packages.bz2  Undetermined Error
+W: Failed to fetch http://localhost:8080/Packages.$COMPRESS  Undetermined Error
+
+E: Some index files failed to download, they have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over http"
+}
+
+for COMPRESSOR in 'gzip' 'bzip2' 'lzma'; do testoverfile $COMPRESSOR; done
+
+# do the same again with http instead of file
+changetowebserver
 
-E: Some index files failed to download, they have been ignored, or old ones used instead." "empty file Packages over http"
+for COMPRESSOR in 'gzip' 'bzip2' 'lzma'; do testoverhttp $COMPRESSOR; done

+ 91 - 0
test/integration/test-bug-601016-description-translation

@@ -0,0 +1,91 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+# we need a valid locale here, otherwise the language configuration
+# will be overridden by LC_ALL=C
+LOCALE="$(echo "$LANG" | cut -d'_' -f 1)"
+
+PACKAGESTANZA="Package: apt
+Priority: important
+Section: admin
+Installed-Size: 5984
+Maintainer: APT Development Team <deity@lists.debian.org>
+Architecture: i386
+Version: 0.8.7
+Filename: pool/main/a/apt/apt_0.8.7_i386.deb
+Size: 2140230
+MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08
+Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c"
+
+
+echo "$PACKAGESTANZA
+Description: Advanced front-end for dpkg" > aptarchive/Packages
+
+echo "Package: apt
+Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
+Description-${LOCALE}: Mächtige Oberfläche für dpkg
+ Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
+ auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
+ APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
+ um Pakete zu installieren und Upgrades durchzuführen." | bzip2 > aptarchive/${LOCALE}.bz2
+
+# the $LOCALE translation file will not be included as it is a flat archive it came from and therefore
+# its name can not be guessed correctly… (in non-flat archives the files are called Translation-*)
+echo 'APT::Cache::Generate "false";' > rootdir/etc/apt/apt.conf.d/00nogenerate
+
+NOLONGSTANZA="$PACKAGESTANZA
+Description: Advanced front-end for dpkg
+"
+
+ENGLISHSTANZA="$PACKAGESTANZA
+Description: Advanced front-end for dpkg
+"
+
+LOCALESTANZA="$PACKAGESTANZA
+Description-${LOCALE}: Mächtige Oberfläche für dpkg
+ Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff
+ auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
+ APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
+ um Pakete zu installieren und Upgrades durchzuführen.
+"
+
+testrun() {
+	echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
+	export LC_ALL=""
+	setupaptarchive
+	testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE}
+	testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE}
+	testequal "$LOCALESTANZA" aptcache show apt -o Acquire::Languages::="ww" -o Test=File-${LOCALE}
+	LC_ALL=C testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-${LOCALE}
+	export LC_ALL=""
+	echo "Acquire::Languages { \"ww\"; \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
+	testequal "$LOCALESTANZA" aptcache show apt -o Test=File-ww-${LOCALE}
+	echo "Acquire::Languages { \"ww\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
+	testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-ww
+}
+
+testrun
+
+echo "$PACKAGESTANZA
+Description: Advanced front-end for dpkg" > aptarchive/Packages
+
+echo "Package: apt
+Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c
+Description-en: Advanced front-end for dpkg
+ This is Debian's next generation front-end for the dpkg package manager.
+ It provides the apt-get utility and APT dselect method that provides a
+ simpler, safer way to install and upgrade packages." | bzip2 > aptarchive/en.bz2
+
+ENGLISHSTANZA="$PACKAGESTANZA
+Description-en: Advanced front-end for dpkg
+ This is Debian's next generation front-end for the dpkg package manager.
+ It provides the apt-get utility and APT dselect method that provides a
+ simpler, safer way to install and upgrade packages.
+"
+
+testrun

+ 43 - 0
test/integration/test-xorg-break-providers

@@ -0,0 +1,43 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+setupaptarchive
+
+# the new xserver-xorg-core breaks xserver-xorg-video-6
+# which both -intel (installed) and -vesa (not installed)
+# provided in their old version.
+# The test ensures that only -intel will be upgraded
+# (together with -core of course) and -vesa not touched.
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  xserver-xorg-video-intel
+The following packages will be upgraded:
+  xserver-xorg-core xserver-xorg-video-intel
+2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Need to get 0 B/2992 kB of archives.
+After this operation, 24.6 kB of additional disk space will be used.
+E: Trivial Only specified but this is not a trivial operation.' aptget install xserver-xorg-core --trivial-only
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be upgraded:
+  xserver-xorg-core xserver-xorg-video-intel
+2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Need to get 0 B/2992 kB of archives.
+After this operation, 24.6 kB of additional disk space will be used.
+E: Trivial Only specified but this is not a trivial operation.' aptget upgrade --trivial-only
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be upgraded:
+  xserver-xorg-core xserver-xorg-video-intel
+2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Need to get 0 B/2992 kB of archives.
+After this operation, 24.6 kB of additional disk space will be used.
+E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only

+ 24 - 0
test/libapt/getlanguages_test.cc

@@ -85,6 +85,30 @@ int main(int argc,char *argv[])
 	equals(vec.size(), 1);
 	equals(vec[0], "en");
 
+	_config->Set("Acquire::Languages", "none");
+	env[0] = "C";
+	vec = APT::Configuration::getLanguages(false, false, env);
+	equals(vec.size(), 0);
+
+	_config->Set("Acquire::Languages", "environment");
+	env[0] = "C";
+	vec = APT::Configuration::getLanguages(false, false, env);
+	equals(vec.size(), 1);
+	equals(vec[0], "en");
+
+	_config->Set("Acquire::Languages", "de");
+	env[0] = "C";
+	vec = APT::Configuration::getLanguages(false, false, env);
+	equals(vec.size(), 1);
+	equals(vec[0], "de");
+
+	_config->Set("Acquire::Languages", "fr");
+	env[0] = "ast_DE.UTF-8";
+	vec = APT::Configuration::getLanguages(false, false, env);
+	equals(vec.size(), 1);
+	equals(vec[0], "fr");
+	_config->Set("Acquire::Languages", "");
+
 	_config->Set("Acquire::Languages::1", "environment");
 	_config->Set("Acquire::Languages::2", "en");
 	env[0] = "de_DE.UTF-8";

+ 1 - 1
test/libapt/run-tests

@@ -4,7 +4,7 @@ set -e
 local 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)
+(cd $DIR && make)
 echo "Running all testcases …"
 LDPATH="$DIR/../../build/bin"
 EXT="_libapt_test"

+ 8 - 0
test/test-indexes.sh

@@ -135,6 +135,14 @@ echo "deb-src $TEST_SOURCE" >> etc/apt/sources.list
 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 ====="
 check_update
 check_indexes

+ 0 - 1
test/versions.lst

@@ -104,4 +104,3 @@ III-alpha9.8 III-alpha9.8-1.5 -1
 1.4+OOo3.0.0~ 1.4+OOo3.0.0-4 -1 # another tilde check
 2.4.7-1 2.4.7-z -1 # revision comparing
 1.002-1+b2 1.00 1 # whatever...
-2.2.4-47978_Debian_lenny 2.2.4-47978_Debian_lenny 0 # and underscore...