Michael Vogt лет назад: 15
Родитель
Сommit
ab30a60052

+ 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 - 5
apt-pkg/deb/deblistparser.cc

@@ -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;

+ 47 - 19
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>
@@ -689,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);
@@ -1277,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/");
 

+ 6 - 0
apt-pkg/orderlist.cc

@@ -1073,6 +1073,12 @@ bool pkgOrderList::CheckDep(DepIterator D)
          just needs one */
       if (D.IsNegative() == false)
       {
+	 // ignore provides by older versions of this package
+	 if (((D.Reverse() == false && Pkg == D.ParentPkg()) ||
+	      (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)

+ 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);
    

+ 3 - 0
debian/apt.symbols

@@ -1318,3 +1318,6 @@ 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++)"pkgAcqMethod::PrintStatus(char const*, char const*, char*&) const@Base" 0.8.15~exp1 1
+ (c++)"pkgCache::DepIterator::IsNegative() const@Base" 0.8.15~exp1 1

+ 18 - 3
debian/changelog

@@ -1,4 +1,4 @@
-apt (0.8.15) UNRELEASED; urgency=low
+apt (0.8.15) unstable; urgency=low
 
   [ Julian Andres Klode ]
   * apt-pkg/depcache.cc:
@@ -17,6 +17,8 @@ apt (0.8.15) UNRELEASED; urgency=low
   [ Christian Perrier ]
   * Galician translation update (Miguel Anxo Bouzada). Closes: #626505
   * Italian translation update (Milo Casagrande). Closes: #627834
+  * German documentation translation update (Chris Leick). Closes: #629949
+  * Catalan translation update (Jordi Mallach). Closes: #630657
 
   [ David Kalnischkies ]
   * fix a bunch of cppcheck warnings/errors based on a patch by
@@ -33,6 +35,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:
@@ -73,7 +77,15 @@ 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
@@ -89,8 +101,11 @@ apt (0.8.15) UNRELEASED; urgency=low
   [ 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>
 

+ 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>
 

Разница между файлами не показана из-за своего большого размера
+ 312 - 209
doc/po/apt-doc.pot


Разница между файлами не показана из-за своего большого размера
+ 598 - 402
doc/po/de.po


Разница между файлами не показана из-за своего большого размера
+ 467 - 237
doc/po/es.po


Разница между файлами не показана из-за своего большого размера
+ 492 - 235
doc/po/fr.po


Разница между файлами не показана из-за своего большого размера
+ 324 - 219
doc/po/it.po


Разница между файлами не показана из-за своего большого размера
+ 450 - 240
doc/po/ja.po


Разница между файлами не показана из-за своего большого размера
+ 456 - 234
doc/po/pl.po


Разница между файлами не показана из-за своего большого размера
+ 466 - 236
doc/po/pt.po


Разница между файлами не показана из-за своего большого размера
+ 336 - 221
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;

Разница между файлами не показана из-за своего большого размера
+ 577 - 428
po/ca.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...