Explorar o código

[ David Kalnischkies ]
* doc/makefile:
- create doxygen directory to avoid depending on magic (Closes: #628799)
* cmdline/apt-key:
- explicitly state that net-update is not supported if no url is set
- require to be root for add, rm, update and net-update
- clarify update vs. net-update in different distros (Closes: #632043)
* debian/apt.symbols:
- forgot 'mips' in the list for all architecture dependent symbols
- comment out gcc-4.5 specific symbols as gcc-4.6 is now default
- the symbol for PrintStatus() is architecture dependent
* apt-pkg/policy.cc:
- do not segfault in pinning if a package with this name doesn't exist.
Thanks to Ferdinand Thommes for the report!
- Defaults is a vector of Pin not of PkgPin
- ensure that only the first specific stanza for a package is used
- save all stanzas which had no effect in Unmatched
- allow package:architecure in Package:
- remove invalid pkgcache.bin and rebuild it if possible
- log reinstall commands in history.log
* apt-pkg/init.cc:
- don't set deprecated APT::Acquire::Translation, thanks Jörg Sommer!
* cmdline/apt-config.cc:
- show Acquire::Languages and APT::Architectures settings
in 'dump' (Closes: 626739)
* apt-pkg/orderlist.cc:
- ensure that an old version of a package with a provides can
never satisfy a dependency of a newer version of this package
[ Michael Vogt ]
* methods/mirror.cc:
- ignore lines starting with "#" in the mirror file
- ignore non http urls in the mirrors
- append the dist (e.g. sid, wheezy) as a query string when
asking for a suitable mirror
* apt-pkg/deb/deblistparser.cc:
- include all known languages when building the apt cache
(LP: #794907)
* apt-pkg/deb/debindexfile.cc:
- remove some no longer valid checks for "TranslationsAvailable()"
[ Kenneth Solbø Andersen ]
* apt-pkg/deb/dpkgpm.cc:
- set permissions of term.log to root.adm and 644 (LP: #404724)

[ Chris Leick ]
* various typo and syntax corrections in doc/*.xml

[Chris Baines]
* Began to fix DepAdd for imediate configuration of all packages

Christopher Baines %!s(int64=15) %!d(string=hai) anos
pai
achega
eef7133842
Modificáronse 81 ficheiros con 24071 adicións e 19268 borrados
  1. 1 1
      apt-inst/contrib/extracttar.cc
  2. 1 1
      apt-pkg/aptconfiguration.cc
  3. 5 10
      apt-pkg/deb/debindexfile.cc
  4. 6 6
      apt-pkg/deb/deblistparser.cc
  5. 56 20
      apt-pkg/deb/dpkgpm.cc
  6. 2 0
      apt-pkg/depcache.h
  7. 0 3
      apt-pkg/init.cc
  8. 1 1
      apt-pkg/orderlist.cc
  9. 8 1
      apt-pkg/packagemanager.cc
  10. 44 20
      apt-pkg/policy.cc
  11. 1 0
      apt-pkg/policy.h
  12. 13 0
      cmdline/apt-config.cc
  13. 13 2
      cmdline/apt-key
  14. 1 1
      configure.in
  15. 19 9
      debian/apt.symbols
  16. 54 2
      debian/changelog
  17. 1 1
      doc/apt-cache.8.xml
  18. 3 2
      doc/apt-ftparchive.1.xml
  19. 1 1
      doc/apt-get.8.xml
  20. 12 9
      doc/apt-key.8.xml
  21. 6 0
      doc/apt-verbatim.ent
  22. 3 3
      doc/apt.conf.5.xml
  23. 4 4
      doc/apt_preferences.5.xml
  24. 1 0
      doc/makefile
  25. 319 211
      doc/po/apt-doc.pot
  26. 492 327
      doc/po/de.po
  27. 482 241
      doc/po/es.po
  28. 506 239
      doc/po/fr.po
  29. 331 221
      doc/po/it.po
  30. 465 245
      doc/po/ja.po
  31. 471 238
      doc/po/pl.po
  32. 480 240
      doc/po/pt.po
  33. 343 223
      doc/po/pt_BR.po
  34. 1 1
      methods/http.h
  35. 17 2
      methods/mirror.cc
  36. 1 0
      methods/mirror.h
  37. 510 400
      po/apt-all.pot
  38. 453 382
      po/ar.po
  39. 456 382
      po/ast.po
  40. 457 383
      po/bg.po
  41. 449 381
      po/bs.po
  42. 545 596
      po/ca.po
  43. 456 382
      po/cs.po
  44. 454 383
      po/cy.po
  45. 456 382
      po/da.po
  46. 456 382
      po/de.po
  47. 453 382
      po/dz.po
  48. 453 382
      po/el.po
  49. 457 382
      po/es.po
  50. 453 382
      po/eu.po
  51. 453 382
      po/fi.po
  52. 459 382
      po/fr.po
  53. 521 524
      po/gl.po
  54. 453 382
      po/hu.po
  55. 522 526
      po/it.po
  56. 457 383
      po/ja.po
  57. 453 382
      po/km.po
  58. 456 382
      po/ko.po
  59. 449 381
      po/ku.po
  60. 450 382
      po/lt.po
  61. 453 382
      po/mr.po
  62. 456 382
      po/nb.po
  63. 453 382
      po/ne.po
  64. 453 382
      po/nl.po
  65. 453 382
      po/nn.po
  66. 453 382
      po/pl.po
  67. 456 382
      po/pt.po
  68. 453 382
      po/pt_BR.po
  69. 453 382
      po/ro.po
  70. 456 382
      po/ru.po
  71. 456 382
      po/sk.po
  72. 473 417
      po/sl.po
  73. 456 382
      po/sv.po
  74. 453 382
      po/th.po
  75. 453 382
      po/tl.po
  76. 453 382
      po/uk.po
  77. 456 382
      po/vi.po
  78. 456 385
      po/zh_CN.po
  79. 453 382
      po/zh_TW.po
  80. 6 0
      test/integration/test-bug-611729-mark-as-manual
  81. 72 0
      test/integration/test-pin-non-existent-package

+ 1 - 1
apt-inst/contrib/extracttar.cc

@@ -336,7 +336,7 @@ bool ExtractTar::Go(pkgDirStream &Stream)
       }
       
       // And finish up
-      if (Itm.Size >= 0 && BadRecord == false)
+      if (BadRecord == false)
 	 if (Stream.FinishedFile(Itm,Fd) == false)
 	    return false;
       

+ 1 - 1
apt-pkg/aptconfiguration.cc

@@ -224,7 +224,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
 		environment.push_back("en");
 	}
 
-	// Support settings like Acquire::Translation=none on the command line to
+	// Support settings like Acquire::Languages=none on the command line to
 	// override the configuration settings vector of languages.
 	string const forceLang = _config->Find("Acquire::Languages","");
 	if (forceLang.empty() == false) {

+ 5 - 10
apt-pkg/deb/debindexfile.cc

@@ -423,12 +423,10 @@ string debTranslationsIndex::IndexURI(const char *Type) const
 /* */
 bool debTranslationsIndex::GetIndexes(pkgAcquire *Owner) const
 {
-   if (TranslationsAvailable()) {
-     string const TranslationFile = string("Translation-").append(Language);
-     new pkgAcqIndexTrans(Owner, IndexURI(Language),
-			  Info(TranslationFile.c_str()),
-			  TranslationFile);
-   }
+   string const TranslationFile = string("Translation-").append(Language);
+   new pkgAcqIndexTrans(Owner, IndexURI(Language),
+                        Info(TranslationFile.c_str()),
+                        TranslationFile);
 
    return true;
 }
@@ -468,9 +466,6 @@ string debTranslationsIndex::Info(const char *Type) const
 									/*}}}*/
 bool debTranslationsIndex::HasPackages() const				/*{{{*/
 {
-   if(!TranslationsAvailable())
-      return false;
-   
    return FileExists(IndexFile(Language));
 }
 									/*}}}*/
@@ -510,7 +505,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
 {
    // Check the translation file, if in use
    string TranslationFile = IndexFile(Language);
-   if (TranslationsAvailable() && FileExists(TranslationFile))
+   if (FileExists(TranslationFile))
    {
      FileFd Trans(TranslationFile,FileFd::ReadOnlyGzip);
      debListParser TransParser(&Trans);

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

@@ -201,7 +201,7 @@ string debListParser::DescriptionLanguage()
    if (Section.FindS("Description").empty() == false)
       return "";
 
-   std::vector<string> const lang = APT::Configuration::getLanguages();
+   std::vector<string> const lang = APT::Configuration::getLanguages(true);
    for (std::vector<string>::const_iterator l = lang.begin();
 	l != lang.end(); l++)
       if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false)
@@ -284,18 +284,18 @@ unsigned short debListParser::VersionHash()
       /* Strip out any spaces from the text, this undoes dpkgs reformatting
          of certain fields. dpkg also has the rather interesting notion of
          reformatting depends operators < -> <= */
-      char *I = S;
+      char *J = S;
       for (; Start != End; Start++)
       {
 	 if (isspace(*Start) == 0)
-	    *I++ = tolower_ascii(*Start);
+	    *J++ = tolower_ascii(*Start);
 	 if (*Start == '<' && Start[1] != '<' && Start[1] != '=')
-	    *I++ = '=';
+	    *J++ = '=';
 	 if (*Start == '>' && Start[1] != '>' && Start[1] != '=')
-	    *I++ = '=';
+	    *J++ = '=';
       }
 
-      Result = AddCRC16(Result,S,I - S);
+      Result = AddCRC16(Result,S,J - S);
    }
    
    return Result;

+ 56 - 20
apt-pkg/deb/dpkgpm.cc

@@ -14,8 +14,8 @@
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/strutl.h>
-#include <apti18n.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/cachefile.h>
 
 #include <unistd.h>
 #include <stdlib.h>
@@ -32,6 +32,8 @@
 #include <algorithm>
 #include <sstream>
 #include <map>
+#include <pwd.h>
+#include <grp.h>
 
 #include <termios.h>
 #include <unistd.h>
@@ -667,7 +669,13 @@ bool pkgDPkgPM::OpenLog()
 	 return _error->WarningE("OpenLog", _("Could not open file '%s'"), logfile_name.c_str());
       setvbuf(term_out, NULL, _IONBF, 0);
       SetCloseExec(fileno(term_out), true);
-      chmod(logfile_name.c_str(), 0600);
+      struct passwd *pw;
+      struct group *gr;
+      pw = getpwnam("root");
+      gr = getgrnam("adm");
+      if (pw != NULL && gr != NULL)
+	  chown(logfile_name.c_str(), pw->pw_uid, gr->gr_gid);
+      chmod(logfile_name.c_str(), 0644);
       fprintf(term_out, "\nLog started: %s\n", timestr);
    }
 
@@ -681,31 +689,42 @@ bool pkgDPkgPM::OpenLog()
 	 return _error->WarningE("OpenLog", _("Could not open file '%s'"), history_name.c_str());
       chmod(history_name.c_str(), 0644);
       fprintf(history_out, "\nStart-Date: %s\n", timestr);
-      string remove, purge, install, upgrade, downgrade;
+      string remove, purge, install, reinstall, upgrade, downgrade;
       for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
       {
-	 if (Cache[I].NewInstall())
-	 {
-	    install += I.FullName(false) + string(" (") + Cache[I].CandVersion;
-	    if (Cache[I].Flags & pkgCache::Flag::Auto)
-	       install+= ", automatic";
-	    install += string("), ");
-	 }
-	 else if (Cache[I].Upgrade())
-	    upgrade += I.FullName(false) + string(" (") + Cache[I].CurVersion + string(", ") + Cache[I].CandVersion + string("), ");
-	 else if (Cache[I].Downgrade())
-	    downgrade += I.FullName(false) + string(" (") + Cache[I].CurVersion + string(", ") + Cache[I].CandVersion + string("), ");
-	 else if (Cache[I].Delete())
-	 {
-	    if ((Cache[I].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge)
-	       purge += I.FullName(false) + string(" (") + Cache[I].CurVersion + string("), ");	    
-	    else
-	       remove += I.FullName(false) + string(" (") + Cache[I].CurVersion + string("), ");	    
+	 enum { CANDIDATE, CANDIDATE_AUTO, CURRENT_CANDIDATE, CURRENT } infostring;
+	 string *line = NULL;
+	 #define HISTORYINFO(X, Y) { line = &X; infostring = Y; }
+	 if (Cache[I].NewInstall() == true)
+	    HISTORYINFO(install, CANDIDATE_AUTO)
+	 else if (Cache[I].ReInstall() == true)
+	    HISTORYINFO(reinstall, CANDIDATE)
+	 else if (Cache[I].Upgrade() == true)
+	    HISTORYINFO(upgrade, CURRENT_CANDIDATE)
+	 else if (Cache[I].Downgrade() == true)
+	    HISTORYINFO(downgrade, CURRENT_CANDIDATE)
+	 else if (Cache[I].Delete() == true)
+	    HISTORYINFO((Cache[I].Purge() ? purge : remove), CURRENT)
+	 else
+	    continue;
+	 #undef HISTORYINFO
+	 line->append(I.FullName(false)).append(" (");
+	 switch (infostring) {
+	 case CANDIDATE: line->append(Cache[I].CandVersion); break;
+	 case CANDIDATE_AUTO:
+	    line->append(Cache[I].CandVersion);
+	    if ((Cache[I].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto)
+	       line->append(", automatic");
+	    break;
+	 case CURRENT_CANDIDATE: line->append(Cache[I].CurVersion).append(", ").append(Cache[I].CandVersion); break;
+	 case CURRENT: line->append(Cache[I].CurVersion); break;
 	 }
+	 line->append("), ");
       }
       if (_config->Exists("Commandline::AsString") == true)
 	 WriteHistoryTag("Commandline", _config->Find("Commandline::AsString"));
       WriteHistoryTag("Install", install);
+      WriteHistoryTag("Reinstall", reinstall);
       WriteHistoryTag("Upgrade", upgrade);
       WriteHistoryTag("Downgrade",downgrade);
       WriteHistoryTag("Remove",remove);
@@ -1269,6 +1288,23 @@ bool pkgDPkgPM::Go(int OutStatusFd)
    if (RunScripts("DPkg::Post-Invoke") == false)
       return false;
 
+   if (_config->FindB("Debug::pkgDPkgPM",false) == false)
+   {
+      std::string const oldpkgcache = _config->FindFile("Dir::cache::pkgcache");
+      if (oldpkgcache.empty() == false && RealFileExists(oldpkgcache) == true &&
+	  unlink(oldpkgcache.c_str()) == 0)
+      {
+	 std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache");
+	 if (srcpkgcache.empty() == false && RealFileExists(srcpkgcache) == true)
+	 {
+	    _error->PushToStack();
+	    pkgCacheFile CacheFile;
+	    CacheFile.BuildCaches(NULL, true);
+	    _error->RevertToStack();
+	 }
+      }
+   }
+
    Cache.writeStateFile(NULL);
    return true;
 }

+ 2 - 0
apt-pkg/depcache.h

@@ -231,6 +231,7 @@ class pkgDepCache : protected pkgCache::Namespace
       // Various test members for the current status of the package
       inline bool NewInstall() const {return Status == 2 && Mode == ModeInstall;};
       inline bool Delete() const {return Mode == ModeDelete;};
+      inline bool Purge() const {return Delete() == true && (iFlags & pkgDepCache::Purge) == pkgDepCache::Purge; };
       inline bool Keep() const {return Mode == ModeKeep;};
       inline bool Upgrade() const {return Status > 0 && Mode == ModeInstall;};
       inline bool Upgradable() const {return Status >= 1;};
@@ -241,6 +242,7 @@ class pkgDepCache : protected pkgCache::Namespace
       inline bool InstBroken() const {return (DepState & DepInstMin) != DepInstMin;};
       inline bool InstPolicyBroken() const {return (DepState & DepInstPolicy) != DepInstPolicy;};
       inline bool Install() const {return Mode == ModeInstall;};
+      inline bool ReInstall() const {return Delete() == false && (iFlags & pkgDepCache::ReInstall) == pkgDepCache::ReInstall;};
       inline VerIterator InstVerIter(pkgCache &Cache)
                 {return VerIterator(Cache,InstallVer);};
       inline VerIterator CandidateVerIter(pkgCache &Cache)

+ 0 - 3
apt-pkg/init.cc

@@ -85,9 +85,6 @@ bool pkgInitConfig(Configuration &Cnf)
    Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$");
    Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$");
 
-   // Translation
-   Cnf.Set("APT::Acquire::Translation", "environment");
-
    // Default cdrom mount point
    Cnf.Set("Acquire::cdrom::mount", "/media/cdrom/");
 

+ 1 - 1
apt-pkg/orderlist.cc

@@ -1078,7 +1078,7 @@ bool pkgOrderList::CheckDep(DepIterator D)
 	      (D.Reverse() == true && Pkg == D.TargetPkg())) &&
 	     Cache[Pkg].InstallVer != *I)
 	    continue;
-      
+
 	 /* Try to find something that does not have the after flag set
 	    if at all possible */
 	 if (IsFlag(Pkg,After) == true)

+ 8 - 1
apt-pkg/packagemanager.cc

@@ -476,6 +476,13 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
 	       continue;
 	    }
 	    
+	    // Check if this package is being re-installed 
+	    if ((Cache[Pkg].iFlags & pkgDepCache::ReInstall) == pkgDepCache::ReInstall && Cache[Pkg].InstallVer != *I && 
+	        List->IsNow(Pkg) == true && Pkg.State() == PkgIterator::NeedsNothing) {
+	       Bad = false;
+	       continue;
+	    }
+	    
 	    // Not the install version 
 	    if (Cache[Pkg].InstallVer != *I || 
 		(Cache[Pkg].Keep() == true && Pkg.State() == PkgIterator::NeedsNothing))
@@ -844,4 +851,4 @@ pkgPackageManager::OrderResult pkgPackageManager::DoInstall(int statusFd)
    
    return DoInstallPostFork(statusFd);
 }
-									/*}}}*/
+									/*}}}*/	      

+ 44 - 20
apt-pkg/policy.cc

@@ -210,13 +210,20 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name,
 {
    if (Name.empty() == true)
    {
-      Pin *P = &*Defaults.insert(Defaults.end(),PkgPin());
+      Pin *P = &*Defaults.insert(Defaults.end(),Pin());
       P->Type = Type;
       P->Priority = Priority;
       P->Data = Data;
       return;
    }
-   
+
+   size_t found = Name.rfind(':');
+   string Arch;
+   if (found != string::npos) {
+      Arch = Name.substr(found+1);
+      Name.erase(found);
+   }
+
    // Allow pinning by wildcards
    // TODO: Maybe we should always prefer specific pins over non-
    // specific ones.
@@ -225,32 +232,49 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name,
       pkgVersionMatch match(Data, Type);
       for (pkgCache::GrpIterator G = Cache->GrpBegin(); G.end() != true; ++G)
 	 if (match.ExpressionMatches(Name, G.Name()))
-	    CreatePin(Type, G.Name(), Data, Priority);
+	 {
+	    if (Arch.empty() == false)
+	       CreatePin(Type, string(G.Name()).append(":").append(Arch), Data, Priority);
+	    else
+	       CreatePin(Type, G.Name(), Data, Priority);
+	 }
       return;
    }
 
-   // Get a spot to put the pin
-   pkgCache::GrpIterator Grp = Cache->FindGrp(Name);
-   for (pkgCache::PkgIterator Pkg = Grp.PackageList();
-	Pkg.end() != true; Pkg = Grp.NextPkg(Pkg))
+   // find the package (group) this pin applies to
+   pkgCache::GrpIterator Grp;
+   pkgCache::PkgIterator Pkg;
+   if (Arch.empty() == false)
+      Pkg = Cache->FindPkg(Name, Arch);
+   else {
+      Grp = Cache->FindGrp(Name);
+      if (Grp.end() == false)
+	 Pkg = Grp.PackageList();
+   }
+
+   if (Pkg.end() == true)
    {
-      Pin *P = 0;
-      if (Pkg.end() == false)
-	 P = Pins + Pkg->ID;
-      else
-      {
-	 // Check the unmatched table
-	 for (vector<PkgPin>::iterator I = Unmatched.begin();
-	      I != Unmatched.end() && P == 0; I++)
-	    if (I->Pkg == Name)
-	       P = &*I;
+      PkgPin *P = &*Unmatched.insert(Unmatched.end(),PkgPin(Name));
+      if (Arch.empty() == false)
+	 P->Pkg.append(":").append(Arch);
+      P->Type = Type;
+      P->Priority = Priority;
+      P->Data = Data;
+      return;
+   }
 
-	 if (P == 0)
-	    P = &*Unmatched.insert(Unmatched.end(),PkgPin());
-      }
+   for (; Pkg.end() != true; Pkg = Grp.NextPkg(Pkg))
+   {
+      Pin *P = Pins + Pkg->ID;
+      // the first specific stanza for a package is the ruler,
+      // all others need to be ignored
+      if (P->Type != pkgVersionMatch::None)
+	 P = &*Unmatched.insert(Unmatched.end(),PkgPin(Pkg.FullName()));
       P->Type = Type;
       P->Priority = Priority;
       P->Data = Data;
+      if (Grp.end() == true)
+	 break;
    }
 }
 									/*}}}*/

+ 1 - 0
apt-pkg/policy.h

@@ -55,6 +55,7 @@ class pkgPolicy : public pkgDepCache::Policy
    struct PkgPin : Pin
    {
       string Pkg;
+      PkgPin(string const &Pkg) : Pin(), Pkg(Pkg) {};
    };
    
    Pin *Pins;

+ 13 - 0
cmdline/apt-config.cc

@@ -20,6 +20,8 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/init.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/aptconfiguration.h>
 
 #include <config.h>
 #include <apti18n.h>
@@ -27,6 +29,7 @@
 #include <locale.h>
 #include <iostream>
 #include <string>
+#include <vector>
 									/*}}}*/
 using namespace std;
 
@@ -119,6 +122,16 @@ int main(int argc,const char *argv[])					/*{{{*/
        CmdL.FileSize() == 0)
       return ShowHelp();
 
+   std::vector<std::string> const langs = APT::Configuration::getLanguages(true);
+   _config->Clear("Acquire::Languages");
+   for (std::vector<std::string>::const_iterator l = langs.begin(); l != langs.end(); ++l)
+      _config->Set("Acquire::Languages::", *l);
+
+   std::vector<std::string> const archs = APT::Configuration::getArchitectures();
+   _config->Clear("APT::Architectures");
+   for (std::vector<std::string>::const_iterator a = archs.begin(); a != archs.end(); ++a)
+      _config->Set("APT::Architectures::", *a);
+
    // Match the operation
    CmdL.DispatchArg(Cmds);
    

+ 13 - 2
cmdline/apt-key

@@ -21,6 +21,13 @@ ARCHIVE_KEYRING_URI=""
 ARCHIVE_KEYRING=/usr/share/keyrings/debian-archive-keyring.gpg
 REMOVED_KEYS=/usr/share/keyrings/debian-archive-removed-keys.gpg
 
+requires_root() {
+	if [ "$(id -u)" -ne 0 ]; then
+		echo >&1 "ERROR: This command can only be used by root."
+		exit 1
+	fi
+}
+
 add_keys_with_verify_against_master_keyring() {
     ADD_KEYRING=$1
     MASTER=$2
@@ -59,13 +66,14 @@ add_keys_with_verify_against_master_keyring() {
 # (otherwise it does not make sense from a security POV)
 net_update() {
     if [ -z "$ARCHIVE_KEYRING_URI" ]; then
-	echo "ERROR: no location for the archive-keyring given"
+	echo >&2 "ERROR: Your distribution is not supported in net-update as no uri for the archive-keyring is set"
 	exit 1
     fi
+    requires_root
     # in theory we would need to depend on wget for this, but this feature
     # isn't useable in debian anyway as we have no keyring uri nor a master key
     if ! which wget >/dev/null 2>&1; then
-	echo "ERROR: an installed wget is required for a network-based update"
+	echo >&2 "ERROR: an installed wget is required for a network-based update"
 	exit 1
     fi
     if [ ! -d /var/lib/apt/keyrings ]; then
@@ -93,6 +101,7 @@ update() {
 	echo >&2 "Is the debian-archive-keyring package installed?"
 	exit 1
     fi
+    requires_root
 
     # add new keys from the package;
 
@@ -184,10 +193,12 @@ fi
 
 case "$command" in
     add)
+        requires_root
         $GPG --quiet --batch --import "$1"
         echo "OK"
         ;;
     del|rm|remove)
+        requires_root
         $GPG --quiet --batch --delete-key --yes "$1"
         echo "OK"
         ;;

+ 1 - 1
configure.in

@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.8.15")
+AC_DEFINE_UNQUOTED(VERSION,"0.8.15.1")
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)

+ 19 - 9
debian/apt.symbols

@@ -1230,37 +1230,45 @@ libapt-pkg.so.4.10 libapt-pkg4.10
 # (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0
 # (c++|regex|optional=std)"^pkgCache::(Dep|Pkg|Ver|Grp|Prv|Desc|PkgFile)Iterator\*\* std::_.+@Base$" 0.8.0
 ### gcc-4.5 specific
- (c++|regex|optional=std)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0
- (c++|optional=inline)"FileFd::FileFd(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, FileFd::OpenMode, unsigned long)@Base" 0.8.0
- (c++|regex|optional=template)"^SPtrArray<[^ ]+>::~SPtrArray\(\)@Base$" 0.8.0
- (c++|optional=template)"SPtrArray<unsigned char>::~SPtrArray()@Base" 0.8.0
+# (c++|regex|optional=std)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0
+# (c++|optional=inline)"FileFd::FileFd(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, FileFd::OpenMode, unsigned long)@Base" 0.8.0
+# (c++|regex|optional=template)"^SPtrArray<[^ ]+>::~SPtrArray\(\)@Base$" 0.8.0
+# (c++|optional=template)"SPtrArray<unsigned char>::~SPtrArray()@Base" 0.8.0
 ### gcc-4.6 specific
  (c++|optional=template)"SPtrArray<pkgCache::Version*>::~SPtrArray()@Base" 0.8.0
  (c++|regex|optional=std)"^std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<char( const|)\*>\(.+\)@Base$" 0.8.0
  (c++|regex|optional=std)"^std::vector<DiffInfo, .+@Base$" 0.8.0
  (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0
- (c++|optional=strange)"pkgCache::VerIterator::VerIterator(pkgCache&, pkgCache::Version*)@Base" 0.8.0
+# (c++|optional=strange)"pkgCache::VerIterator::VerIterator(pkgCache&, pkgCache::Version*)@Base" 0.8.0
+### architecture specific: va_list
+ (arch=armel armhf|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, std::__va_list&) const@Base" 0.8.15~exp1 1
+ (arch=i386 hurd-i386 kfreebsd-i386|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, char*&) const@Base" 0.8.15~exp1 1
+ (arch=hppa ia64 mips mipsel sparc sparc64|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, void*&) const@Base" 0.8.15~exp1 1
+ (arch=amd64 kfreebsd-amd64 powerpc powerpcspe s390|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __va_list_tag (&) [1]) const@Base" 0.8.15~exp1 1
+ (arch=sh4|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __builtin_va_list&) const@Base" 0.8.15~exp1 1
+ (arch=alpha|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __va_list_tag&) const@Base" 0.8.15~exp1 1
 ### architecture specific: va_list & size_t
  (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, char*&, unsigned int&)@Base" 0.8.11.4 1
  (arch=armel armhf|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, std::__va_list&, unsigned int&)@Base" 0.8.11.4 1
  (arch=alpha|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag&, unsigned long&)@Base" 0.8.11.4 1
  (arch=powerpc powerpcspe|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned int&)@Base" 0.8.11.4 1
  (arch=amd64 kfreebsd-amd64 s390|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned long&)@Base" 0.8.11.4 1
- (arch=hppa mipsel sparc|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@Base" 0.8.11.4 1
+ (arch=hppa mips mipsel sparc|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@Base" 0.8.11.4 1
  (arch=ia64 sparc64|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned long&)@Base" 0.8.11.4 1
  (arch=sh4|c++|optional=private)"GlobalError::Insert(GlobalError::MsgType, char const*, __builtin_va_list&, unsigned int&)@Base" 0.8.11.4 1
+
  (arch=i386 hurd-i386 kfreebsd-i386|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned int&)@Base" 0.8.11.4 1
  (arch=armel armhf|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, std::__va_list&, int, unsigned int&)@Base" 0.8.11.4 1
  (arch=alpha|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag&, int, unsigned long&)@Base" 0.8.11.4 1
  (arch=powerpc powerpcspe|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned int&)@Base" 0.8.11.4 1
  (arch=amd64 kfreebsd-amd64 s390|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned long&)@Base" 0.8.11.4 1
- (arch=hppa mipsel sparc|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned int&)@Base" 0.8.11.4 1
+ (arch=hppa mips mipsel sparc|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned int&)@Base" 0.8.11.4 1
  (arch=ia64 sparc64|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned long&)@Base" 0.8.11.4 1
  (arch=sh4|c++|optional=private)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __builtin_va_list&, int, unsigned int&)@Base" 0.8.11.4 1
 ### architecture specific: size_t
- (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mipsel powerpc powerpcspe sh4 sparc|c++)"_strtabexpand(char*, unsigned int)@Base" 0.8.0
+ (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mips mipsel powerpc powerpcspe sh4 sparc|c++)"_strtabexpand(char*, unsigned int)@Base" 0.8.0
  (arch=alpha amd64 ia64 kfreebsd-amd64 s390 sparc64|c++)"_strtabexpand(char*, unsigned long)@Base" 0.8.0
- (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mipsel powerpc powerpcspe sh4 sparc|c++)"indexRecords::parseSumData(char const*&, char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&)@Base" 0.8.0
+ (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mips mipsel powerpc powerpcspe sh4 sparc|c++)"indexRecords::parseSumData(char const*&, char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&)@Base" 0.8.0
  (arch=alpha amd64 ia64 kfreebsd-amd64 s390 sparc64|c++)"indexRecords::parseSumData(char const*&, char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long&)@Base" 0.8.0
 ### try to ignore std:: template instances
  (c++|regex|optional=std)"^(void |)std::[^ ]+<.+ >::(_|~).+\(.*\)@Base$" 0.8.0
@@ -1318,3 +1326,5 @@ libapt-pkg.so.4.10 libapt-pkg4.10
  (c++|optional=private)"debListParser::NewProvidesAllArch(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&)@Base" 0.8.13.2 1
  (c++|optional=private)"PrintMode(char)@Base" 0.8.13.2 1
  (c++)"pkgDepCache::IsModeChangeOk(pkgDepCache::ModeList, pkgCache::PkgIterator const&, unsigned long, bool)@Base" 0.8.13.2 1
+ (c++)"pkgPackageManager::SmartUnPack(pkgCache::PkgIterator, bool)@Base" 0.8.15~exp1 1
+ (c++)"pkgCache::DepIterator::IsNegative() const@Base" 0.8.15~exp1 1

+ 54 - 2
debian/changelog

@@ -1,4 +1,27 @@
-apt (0.8.15) UNRELEASED; urgency=low
+apt (0.8.15.1) unstable; urgency=low
+
+  [ David Kalnischkies ]
+  * doc/makefile:
+    - create doxygen directory to avoid depending on magic (Closes: #628799)
+  * cmdline/apt-key:
+    - explicitly state that net-update is not supported if no url is set
+    - require to be root for add, rm, update and net-update
+    - clarify update vs. net-update in different distros (Closes: #632043)
+  * debian/apt.symbols:
+    - forgot 'mips' in the list for all architecture dependent symbols
+    - comment out gcc-4.5 specific symbols as gcc-4.6 is now default
+    - the symbol for PrintStatus() is architecture dependent
+  * apt-pkg/policy.cc:
+    - do not segfault in pinning if a package with this name doesn't exist.
+      Thanks to Ferdinand Thommes for the report!
+    - Defaults is a vector of Pin not of PkgPin
+    - ensure that only the first specific stanza for a package is used
+    - save all stanzas which had no effect in Unmatched
+    - allow package:architecure in Package:
+
+ -- Michael Vogt <mvo@debian.org>  Thu, 30 Jun 2011 10:05:36 +0200
+
+apt (0.8.15) unstable; urgency=low
 
   [ Julian Andres Klode ]
   * apt-pkg/depcache.cc:
@@ -35,6 +58,8 @@ apt (0.8.15) UNRELEASED; urgency=low
     - let VisitRProvides report if the calls were successful
   * apt-pkg/deb/dpkgpm.cc:
     - replace obsolete usleep with nanosleep
+    - remove invalid pkgcache.bin and rebuild it if possible
+    - log reinstall commands in history.log
   * debian/apt{,-utils}.symbols:
     - update both experimental symbol-files to reflect 0.8.14 state
   * debian/rules:
@@ -75,8 +100,35 @@ apt (0.8.15) UNRELEASED; urgency=low
   * apt-pkg/packagemanager.cc:
     - ensure for Multi-Arch:same packages that they are unpacked in
       lock step even in immediate configuration (Closes: #618288)
+  * apt-pkg/init.cc:
+    - don't set deprecated APT::Acquire::Translation, thanks Jörg Sommer!
+  * cmdline/apt-config.cc:
+    - show Acquire::Languages and APT::Architectures settings
+      in 'dump' (Closes: 626739)
+  * apt-pkg/orderlist.cc:
+    - ensure that an old version of a package with a provides can
+      never satisfy a dependency of a newer version of this package
+
+  [ Michael Vogt ]
+  * methods/mirror.cc:
+    - ignore lines starting with "#" in the mirror file
+    - ignore non http urls in the mirrors
+    - append the dist (e.g. sid, wheezy) as a query string when
+      asking for a suitable mirror 
+  * apt-pkg/deb/deblistparser.cc:
+    - include all known languages when building the apt cache
+      (LP: #794907)
+  * apt-pkg/deb/debindexfile.cc:
+    - remove some no longer valid checks for "TranslationsAvailable()"
+
+  [ Kenneth Solbø Andersen ]
+  * apt-pkg/deb/dpkgpm.cc:
+    - set permissions of term.log to root.adm and 644 (LP: #404724)
+  
+  [ Chris Leick ]
+  * various typo and syntax corrections in doc/*.xml
 
- -- Michael Vogt <mvo@debian.org>  Mon, 16 May 2011 14:57:52 +0200
+ -- Michael Vogt <mvo@debian.org>  Tue, 28 Jun 2011 18:00:48 +0200
 
 apt (0.8.14.1) unstable; urgency=low
 

+ 1 - 1
doc/apt-cache.8.xml

@@ -315,7 +315,7 @@ Reverse Provides:
 		   <term><option>--no-replaces</option></term>
 		   <term><option>--no-enhances</option></term>
 		   <listitem><para>Per default the <literal>depends</literal> and
-     <literal>rdepends</literal> print all dependencies. This can be twicked with
+     <literal>rdepends</literal> print all dependencies. This can be tweaked with
      these flags which will omit the specified dependency type.
      Configuration Item: <literal>APT::Cache::Show<replaceable>DependencyType</replaceable></literal>
      e.g. <literal>APT::Cache::ShowRecommends</literal>.</para></listitem>

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

@@ -532,8 +532,9 @@ for i in Sections do
      index files will not have the checksum fields where possible.
      Configuration Items: <literal>APT::FTPArchive::<replaceable>Checksum</replaceable></literal> and
      <literal>APT::FTPArchive::<replaceable>Index</replaceable>::<replaceable>Checksum</replaceable></literal> where
-     <literal>Index</literal> can be <literal>Packages</literal>, <literal>Sources</literal> or <literal>Release</literal> and
-     <literal>Checksum</literal> can be <literal>MD5</literal>, <literal>SHA1</literal> or <literal>SHA256</literal>.</para></listitem>
+     <literal><replaceable>Index</replaceable></literal> can be <literal>Packages</literal>, <literal>Sources</literal> or
+     <literal>Release</literal> and <literal><replaceable>Checksum</replaceable></literal> can be <literal>MD5</literal>,
+     <literal>SHA1</literal> or <literal>SHA256</literal>.</para></listitem>
      </varlistentry>
 
      <varlistentry><term><option>-d</option></term><term><option>--db</option></term>

+ 1 - 1
doc/apt-get.8.xml

@@ -280,7 +280,7 @@
 
      <varlistentry><term>download</term>
        <listitem><para><literal>download</literal> will download the given
-           binary package into the current directoy.
+           binary package into the current directory.
        </para></listitem>
      </varlistentry>
 

+ 12 - 9
doc/apt-key.8.xml

@@ -128,9 +128,10 @@
      <listitem>
      <para>
 
-       Update the local keyring with the keyring of Debian archive
-       keys and removes from the keyring the archive keys which are no
-       longer valid.
+       Update the local keyring with the archive keyring and remove from
+       the local keyring the archive keys which are no longer valid.
+       The archive keyring is shipped in the <literal>archive-keyring</literal> package of your
+       distribution, e.g. the <literal>debian-archive-keyring</literal> package in Debian.
 
      </para>
 
@@ -141,12 +142,14 @@
      <listitem>
      <para>
 
-       Update the local keyring with the keys of a key server
-       and removes from the keyring the archive keys which are no
-       longer valid. This requires an installed wget and an APT
-       build configured to have a server to fetch from. APT in
-       Debian does not support this command, but Ubuntu's APT
-       does.
+       Work similar to the <command>update</command> command above, but get the
+       archive keyring from an URI instead and validate it against a master key.
+
+       This requires an installed &wget; and an APT build configured to have
+       a server to fetch from and a master keyring to validate.
+
+       APT in Debian does not support this command and relies on
+       <command>update</command> instead, but Ubuntu's APT does.
 
      </para>
 

+ 6 - 0
doc/apt-verbatim.ent

@@ -148,6 +148,12 @@
   </citerefentry>"
 >
 
+<!ENTITY wget "<citerefentry>
+    <refentrytitle><command>wget</command></refentrytitle>
+    <manvolnum>1</manvolnum>
+  </citerefentry>"
+>
+
 <!-- Boiler plate docinfo section -->
 <!ENTITY apt-email "
    <address>

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

@@ -50,7 +50,7 @@
       <listitem><para>the file specified by the <envar>APT_CONFIG</envar>
 	 environment variable (if any)</para></listitem>
       <listitem><para>all files in <literal>Dir::Etc::Parts</literal> in
-	 alphanumeric ascending order which have no or "<literal>conf</literal>"
+	 alphanumeric ascending order which have either no or "<literal>conf</literal>"
 	 as filename extension and which only contain alphanumeric,
 	 hyphen (-), underscore (_) and period (.) characters.
 	 Otherwise APT will print a notice that it has ignored a file if the file
@@ -441,13 +441,13 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
      It is not needed to add <literal>bz2</literal> explicit to the list as it will be added automatic.</para>
      <para>Note that at run time the <literal>Dir::Bin::<replaceable>Methodname</replaceable></literal> will
      be checked: If this setting exists the method will only be used if this file exists, e.g. for
-     the bzip2 method (the inbuilt) setting is <literallayout>Dir::Bin::bzip2 "/bin/bzip2";</literallayout>
+     the bzip2 method (the inbuilt) setting is: <literallayout>Dir::Bin::bzip2 "/bin/bzip2";</literallayout>
      Note also that list entries specified on the command line will be added at the end of the list
      specified in the configuration files, but before the default entries. To prefer a type in this case
      over the ones specified in the configuration files you can set the option direct - not in list style.
      This will not override the defined list, it will only prefix the list with this type.</para>
      <para>The special type <literal>uncompressed</literal> can be used to give uncompressed files a
-     preference, but note that most archives doesn't provide uncompressed files so this is mostly only
+     preference, but note that most archives don't provide uncompressed files so this is mostly only
      useable for local mirrors.</para></listitem>
      </varlistentry>
 

+ 4 - 4
doc/apt_preferences.5.xml

@@ -69,8 +69,8 @@ You have been warned.</para>
 
 <para>Note that the files in the <filename>/etc/apt/preferences.d</filename>
 directory are parsed in alphanumeric ascending order and need to obey the
-following naming convention: The files have no or "<literal>pref</literal>"
-as filename extension and which only contain alphanumeric,  hyphen (-),
+following naming convention: The files have either no or "<literal>pref</literal>"
+as filename extension and only contain alphanumeric, hyphen (-),
 underscore (_) and period (.) characters.
 Otherwise APT will print a notice that it has ignored a file if the file
 doesn't match a pattern in the <literal>Dir::Ignore-Files-Silently</literal>
@@ -265,7 +265,7 @@ APT also supports pinning by glob() expressions and regular
 expressions surrounded by /. For example, the following
 example assigns the priority 500 to all packages from
 experimental where the name starts with gnome (as a glob()-like
-expression or contains the word kde (as a POSIX extended regular
+expression) or contains the word kde (as a POSIX extended regular
 expression surrounded by slashes).
 </para>
 
@@ -277,7 +277,7 @@ Pin-Priority: 500
 
 <para>
 The rule for those expressions is that they can occur anywhere
-where a string can occur. Those, the following pin assigns the
+where a string can occur. Thus, the following pin assigns the
 priority 990 to all packages from a release starting with karmic.
 </para>
 

+ 1 - 0
doc/makefile

@@ -101,6 +101,7 @@ $(BUILD)/doc/Doxyfile: Doxyfile.in
 
 $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
 	rm -fr $(BUILD)/doc/doxygen
+	mkdir $(BUILD)/doc/doxygen  # some versions seem to not create this directory #628799
 	$(DOXYGEN) $(BUILD)/doc/Doxyfile
 	touch $(BUILD)/doc/doxygen-stamp
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 319 - 211
doc/po/apt-doc.pot


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 492 - 327
doc/po/de.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 482 - 241
doc/po/es.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 506 - 239
doc/po/fr.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 331 - 221
doc/po/it.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 465 - 245
doc/po/ja.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 471 - 238
doc/po/pl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 480 - 240
doc/po/pt.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 343 - 223
doc/po/pt_BR.po


+ 1 - 1
methods/http.h

@@ -182,7 +182,7 @@ class HttpMethod : public pkgAcqMethod
    string AutoDetectProxyCmd;
 
    public:
-   friend class ServerState;
+   friend struct ServerState;
 
    FileFd *File;
    ServerState *Server;

+ 17 - 2
methods/mirror.cc

@@ -134,6 +134,10 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str)
    string fetch = BaseUri;
    fetch.replace(0,strlen("mirror://"),"http://");
 
+   // append the dist as a query string
+   if (Dist != "")
+      fetch += "?dist=" + Dist;
+
    if(Debug)
       clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'"
            << " to " << MirrorFile << endl;
@@ -274,8 +278,18 @@ bool MirrorMethod::InitMirrors()
    while (!in.eof()) 
    {
       getline(in, s);
-      if (s.size() > 0)
-	 AllMirrors.push_back(s);
+
+      // ignore lines that start with #
+      if (s.find("#") == 0)
+         continue;
+      // ignore empty lines
+      if (s.size() == 0)
+         continue;
+      // ignore non http lines
+      if (s.find("http://") != 0)
+         continue;
+
+      AllMirrors.push_back(s);
    }
    Mirror = AllMirrors[0];
    UsedMirror = Mirror;
@@ -329,6 +343,7 @@ string MirrorMethod::GetMirrorFileName(string mirror_uri_str)
 	 if(Debug)
 	    std::cerr << "found BaseURI: " << uristr << std::endl;
 	 BaseUri = uristr.substr(0,uristr.size()-1);
+         Dist = (*I)->GetDist();
       }
    }
    // get new file

+ 1 - 0
methods/mirror.h

@@ -29,6 +29,7 @@ class MirrorMethod : public HttpMethod
    vector<string> AllMirrors; // all available mirrors
    string MirrorFile; // the file that contains the list of mirrors
    bool DownloadedMirrorFile; // already downloaded this session
+   string Dist;       // the target distrubtion (e.g. sid, oneiric)
 
    bool Debug;
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 510 - 400
po/apt-all.pot


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/ar.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/ast.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 457 - 383
po/bg.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 449 - 381
po/bs.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 545 - 596
po/ca.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/cs.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 454 - 383
po/cy.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/da.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/de.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/dz.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/el.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 457 - 382
po/es.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/eu.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/fi.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 459 - 382
po/fr.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 521 - 524
po/gl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/hu.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 522 - 526
po/it.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 457 - 383
po/ja.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/km.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/ko.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 449 - 381
po/ku.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 450 - 382
po/lt.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/mr.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/nb.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/ne.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/nl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/nn.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/pl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/pt.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/pt_BR.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/ro.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/ru.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/sk.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 473 - 417
po/sl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/sv.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/th.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/tl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/uk.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 382
po/vi.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 456 - 385
po/zh_CN.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 453 - 382
po/zh_TW.po


+ 6 - 0
test/integration/test-bug-611729-mark-as-manual

@@ -48,11 +48,17 @@ b is already the newest version.
 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -d
 testmarkedauto 'b'
 
+rm rootdir/var/log/apt/history.log
+
 aptget install b --reinstall -y -qq 2>&1 > /dev/null
 testdpkgnotinstalled a
 testdpkginstalled b c
 testmarkedauto 'b'
 
+sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
+testfileequal 'rootdir/var/log/apt/history.log' '
+Reinstall: b:i386 (1.0)'
+
 testequal 'Reading package lists...
 Building dependency tree...
 Reading state information...

+ 72 - 0
test/integration/test-pin-non-existent-package

@@ -0,0 +1,72 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'apt' 'i386' '0.8.15'
+insertpackage 'unstable' 'arch' 'i386' '1.0'
+
+setupaptarchive
+
+testcandidate() {
+	msgtest "Test that the Candidate for $1 is" $2
+	if [ "$(aptcache policy $1 | grep '^  Candidate:')" = "  Candidate: $2" ]; then
+		msgpass
+	else
+		echo
+		aptcache policy $1
+		msgfail
+	fi
+}
+
+testcandidate apt '0.8.15'
+testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
+testequal 'Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
+
+echo 'Package: apt
+Pin: release a=unstable
+Pin-Priority: -1' > rootdir/etc/apt/preferences
+
+testcandidate apt '(none)'
+testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
+testequal 'Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
+
+echo '
+Package: doesntexist
+Pin: release a=unstable
+Pin-Priority: 1000' >> rootdir/etc/apt/preferences
+
+testcandidate apt '(none)'
+
+echo '
+Package: apt
+Pin: release a=unstable
+Pin-Priority: 1000' >> rootdir/etc/apt/preferences
+
+testcandidate apt '(none)'
+testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
+
+testequal 'Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade
+
+echo 'Package: arch:amd64
+Pin: release a=unstable
+Pin-Priority: -1' > rootdir/etc/apt/preferences
+
+testcandidate arch '1.0'
+
+echo '
+Package: arch:i386
+Pin: release a=unstable
+Pin-Priority: -1' >> rootdir/etc/apt/preferences
+
+testcandidate arch '(none)'
+