Przeglądaj źródła

Merge apt--mvo--0
Patches applied:

* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-2
* merge with matts tree, added documentation for the gpgv stuff

* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-3
* added gpgv::Options to configure-index

* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-4
* PulseIntervall can be configured now to make frontends like synaptic hayppy. it's done in a way that does not break binary compatibility

* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-5
* fix for apt-get update removing the cdroms Release.gpg files

* michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-6
* path scoring changed, the non-symlink path is scored highest

Matt Zimmerman 21 lat temu
rodzic
commit
f827a9e553

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

@@ -350,18 +350,8 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
 /* The only header we use is the last-modified header. */
 /* The only header we use is the last-modified header. */
 string pkgAcqMetaSig::Custom600Headers()
 string pkgAcqMetaSig::Custom600Headers()
 {
 {
-   // mvo: we don't really need the last-modified header here
-   //      1) it points to "Final" and that was renamed to "DestFile" 
-   //         so it's never send anyway
-   //      2) because DestFIle is in partial/ we will send a partial request
-   //         with if-range in the http method (or the equivalent for ftp). 
-   //         that should give the same result
-
-   string Final = _config->FindDir("Dir::State::lists");
-   Final += URItoFileName(RealURI);
-   
    struct stat Buf;
    struct stat Buf;
-   if (stat(Final.c_str(),&Buf) != 0)
+   if (stat(DestFile.c_str(),&Buf) != 0)
       return "\nIndex-File: true";
       return "\nIndex-File: true";
 
 
    return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
    return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);

+ 3 - 3
apt-pkg/acquire.cc

@@ -312,7 +312,7 @@ void pkgAcquire::RunFds(fd_set *RSet,fd_set *WSet)
 /* This runs the queues. It manages a select loop for all of the
 /* This runs the queues. It manages a select loop for all of the
    Worker tasks. The workers interact with the queues and items to
    Worker tasks. The workers interact with the queues and items to
    manage the actual fetch. */
    manage the actual fetch. */
-pkgAcquire::RunResult pkgAcquire::Run()
+pkgAcquire::RunResult pkgAcquire::Run(int PulseIntervall)
 {
 {
    Running = true;
    Running = true;
    
    
@@ -327,7 +327,7 @@ pkgAcquire::RunResult pkgAcquire::Run()
    // Run till all things have been acquired
    // Run till all things have been acquired
    struct timeval tv;
    struct timeval tv;
    tv.tv_sec = 0;
    tv.tv_sec = 0;
-   tv.tv_usec = 500000; 
+   tv.tv_usec = PulseIntervall; 
    while (ToFetch > 0)
    while (ToFetch > 0)
    {
    {
       fd_set RFds;
       fd_set RFds;
@@ -357,7 +357,7 @@ pkgAcquire::RunResult pkgAcquire::Run()
       // Timeout, notify the log class
       // Timeout, notify the log class
       if (Res == 0 || (Log != 0 && Log->Update == true))
       if (Res == 0 || (Log != 0 && Log->Update == true))
       {
       {
-	 tv.tv_usec = 500000;
+	 tv.tv_usec = PulseIntervall;
 	 for (Worker *I = Workers; I != 0; I = I->NextAcquire)
 	 for (Worker *I = Workers; I != 0; I = I->NextAcquire)
 	    I->Pulse();
 	    I->Pulse();
 	 if (Log != 0 && Log->Pulse(this) == false)
 	 if (Log != 0 && Log->Pulse(this) == false)

+ 2 - 1
apt-pkg/acquire.h

@@ -100,7 +100,8 @@ class pkgAcquire
 
 
    enum RunResult {Continue,Failed,Cancelled};
    enum RunResult {Continue,Failed,Cancelled};
 
 
-   RunResult Run();
+   RunResult Run() { return Run(500000); }; // Binary compatibility
+   RunResult Run(int PulseIntervall);
    void Shutdown();
    void Shutdown();
    
    
    // Simple iteration mechanism
    // Simple iteration mechanism

+ 17 - 0
apt-pkg/cdrom.cc

@@ -169,6 +169,23 @@ int pkgCdrom::Score(string Path)
       Res += 10;
       Res += 10;
    if (Path.find("/debian/") != string::npos)
    if (Path.find("/debian/") != string::npos)
       Res -= 10;
       Res -= 10;
+
+   // check for symlinks in the patch leading to the actual file
+   // a symlink gets a big penalty
+   struct stat Buf;
+   string statPath = flNotFile(Path);
+   string cdromPath = _config->FindDir("Acquire::cdrom::mount","/cdrom/");
+   while(statPath != cdromPath && statPath != "./") {
+      statPath.resize(statPath.size()-1);  // remove the trailing '/'
+      if (lstat(statPath.c_str(),&Buf) == 0) {
+        if(S_ISLNK(Buf.st_mode)) {
+           Res -= 60;
+           break;
+        }
+      }
+      statPath = flNotFile(statPath); // descent
+   }
+
    return Res;
    return Res;
 }
 }
 
 

+ 13 - 0
debian/changelog

@@ -1,3 +1,16 @@
+apt (0.6.33) hoary; urgency=low
+
+  * Merge michael.vogt@ubuntu.com--2005/apt--mvo--0 (through patch-6)
+    - patch-1: cosmetic changes (whitespace, "Apt::GPGV->APT::GPGV")
+    - patch-2: (doc) documentation for gpgv
+    - patch-3: (doc) new config variables added configure-index
+    - patch-4: pkgAcquire::Run() pulse intervall can be configured
+    - patch-5: fix for apt-get update removing Release.gpg files (#6865)
+    - patch-6: change the path scoring in apt-cdrom, prefer pathes without
+      symlinks
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sat, 26 Feb 2005 15:21:17 -0800
+
 apt (0.6.32) hoary; urgency=low
 apt (0.6.32) hoary; urgency=low
 
 
   * Merge michael.vogt@ubuntu.com--2005/apt--mvo--0 (patch-1)
   * Merge michael.vogt@ubuntu.com--2005/apt--mvo--0 (patch-1)

+ 10 - 1
doc/apt.conf.5.xml

@@ -251,6 +251,13 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
      the cdrom block. It is important to have the trailing slash. Unmount 
      the cdrom block. It is important to have the trailing slash. Unmount 
      commands can be specified using UMount.</para></listitem>
      commands can be specified using UMount.</para></listitem>
      </varlistentry>
      </varlistentry>
+
+     <varlistentry><term>gpgv</term>
+     <listitem><para>GPGV URIs; the only option for GPGV URIs is the option to pass additional parameters to gpgv.
+     <literal>gpgv::Options</literal> Additional options passed to gpgv.
+     </para></listitem>
+     </varlistentry>
+
    </variablelist>
    </variablelist>
   </para>
   </para>
  </refsect1>
  </refsect1>
@@ -373,7 +380,9 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
    <literal>Debug::NoLocking</literal> disables file locking so APT can do some 
    <literal>Debug::NoLocking</literal> disables file locking so APT can do some 
    operations as non-root and <literal>Debug::pkgDPkgPM</literal> will print out the 
    operations as non-root and <literal>Debug::pkgDPkgPM</literal> will print out the 
    command line for each dpkg invokation. <literal>Debug::IdentCdrom</literal> will 
    command line for each dpkg invokation. <literal>Debug::IdentCdrom</literal> will 
-   disable the inclusion of statfs data in CDROM IDs.</para>
+   disable the inclusion of statfs data in CDROM IDs.
+   <literal>Debug::Acquire::gpgv</literal> Debugging of the gpgv method.
+   </para>
  </refsect1>
  </refsect1>
  
  
  <refsect1><title>Examples</title>
  <refsect1><title>Examples</title>

+ 13 - 0
doc/examples/configure-index

@@ -72,6 +72,11 @@ APT
      NoAct "false";
      NoAct "false";
   };
   };
 
 
+  GPGV
+  {
+     TrustedKeyring "/etc/apt/trusted.gpg";
+  };
+
   // Some general options
   // Some general options
   Ignore-Hold "false";
   Ignore-Hold "false";
   Clean-Installed "true";
   Clean-Installed "true";
@@ -137,6 +142,11 @@ Acquire
        UMount "sleep 500";
        UMount "sleep 500";
     }
     }
   };
   };
+
+  gpgv
+  {
+   Options {"--ignore-time-conflict";}	// not very usefull on a normal system
+  };
 };
 };
 
 
 // Directory layout
 // Directory layout
@@ -171,6 +181,7 @@ Dir "/"
   Bin {
   Bin {
      methods "/usr/lib/apt/methods/";
      methods "/usr/lib/apt/methods/";
      gzip "/bin/gzip";
      gzip "/bin/gzip";
+     gpg  "/usr/bin/gpgv";
      dpkg "/usr/bin/dpkg";
      dpkg "/usr/bin/dpkg";
      dpkg-source "/usr/bin/dpkg-source";
      dpkg-source "/usr/bin/dpkg-source";
      dpkg-buildpackage "/usr/bin/dpkg-buildpackage"
      dpkg-buildpackage "/usr/bin/dpkg-buildpackage"
@@ -229,8 +240,10 @@ Debug
   NoLocking "false";
   NoLocking "false";
   Acquire::Ftp "false";    // Show ftp command traffic
   Acquire::Ftp "false";    // Show ftp command traffic
   Acquire::Http "false";   // Show http command traffic
   Acquire::Http "false";   // Show http command traffic
+  Acquire::gpgv "false";   // Show the gpgv traffic
   aptcdrom "false";        // Show found package files
   aptcdrom "false";        // Show found package files
   IdentCdrom "false";
   IdentCdrom "false";
+  
 }
 }
 
 
 /* Whatever you do, do not use this configuration file!! Take out ONLY
 /* Whatever you do, do not use this configuration file!! Take out ONLY

+ 1 - 1
methods/cdrom.cc

@@ -97,7 +97,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
    {
    {
       Res.LastModified = Itm->LastModified;
       Res.LastModified = Itm->LastModified;
       Res.IMSHit = true;
       Res.IMSHit = true;
-      Res.Filename = File;
+      Res.Filename = Itm->DestFile;
       URIDone(Res);
       URIDone(Res);
       return true;
       return true;
    }
    }

+ 1 - 1
methods/gpgv.cc

@@ -46,7 +46,7 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
    int status;
    int status;
    struct stat buff;
    struct stat buff;
    string gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv");
    string gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv");
-   string pubringpath = _config->Find("Apt::GPGV::TrustedKeyring", "/etc/apt/trusted.gpg");
+   string pubringpath = _config->Find("APT::GPGV::TrustedKeyring", "/etc/apt/trusted.gpg");
    if (_config->FindB("Debug::Acquire::gpgv", false))
    if (_config->FindB("Debug::Acquire::gpgv", false))
    {
    {
       std::cerr << "gpgv path: " << gpgvpath << std::endl;
       std::cerr << "gpgv path: " << gpgvpath << std::endl;

+ 21 - 21
po/apt-all.pot

@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-02-08 16:58+0100\n"
+"POT-Creation-Date: 2005-02-25 14:16+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2259,31 +2259,31 @@ msgstr ""
 msgid "rename failed, %s (%s -> %s)."
 msgid "rename failed, %s (%s -> %s)."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:235 apt-pkg/acquire-item.cc:904
+#: apt-pkg/acquire-item.cc:235 apt-pkg/acquire-item.cc:894
 msgid "MD5Sum mismatch"
 msgid "MD5Sum mismatch"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:718
+#: apt-pkg/acquire-item.cc:708
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "I wasn't able to locate a file for the %s package. This might mean you need "
 "I wasn't able to locate a file for the %s package. This might mean you need "
 "to manually fix this package. (due to missing arch)"
 "to manually fix this package. (due to missing arch)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:771
+#: apt-pkg/acquire-item.cc:761
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "I wasn't able to locate file for the %s package. This might mean you need to "
 "I wasn't able to locate file for the %s package. This might mean you need to "
 "manually fix this package."
 "manually fix this package."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:807
+#: apt-pkg/acquire-item.cc:797
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "The package index files are corrupted. No Filename: field for package %s."
 "The package index files are corrupted. No Filename: field for package %s."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:894
+#: apt-pkg/acquire-item.cc:884
 msgid "Size mismatch"
 msgid "Size mismatch"
 msgstr ""
 msgstr ""
 
 
@@ -2292,73 +2292,73 @@ msgstr ""
 msgid "Vendor block %s contains no fingerprint"
 msgid "Vendor block %s contains no fingerprint"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:487
+#: apt-pkg/cdrom.cc:503
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "Using CD-ROM mount point %s\n"
 "Using CD-ROM mount point %s\n"
 "Mounting CD-ROM\n"
 "Mounting CD-ROM\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:496 apt-pkg/cdrom.cc:578
+#: apt-pkg/cdrom.cc:512 apt-pkg/cdrom.cc:594
 msgid "Identifying.. "
 msgid "Identifying.. "
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:521
+#: apt-pkg/cdrom.cc:537
 #, c-format
 #, c-format
 msgid "Stored Label: %s \n"
 msgid "Stored Label: %s \n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:541
+#: apt-pkg/cdrom.cc:557
 #, c-format
 #, c-format
 msgid "Using CD-ROM mount point %s\n"
 msgid "Using CD-ROM mount point %s\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:559
+#: apt-pkg/cdrom.cc:575
 msgid "Unmounting CD-ROM\n"
 msgid "Unmounting CD-ROM\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:563
+#: apt-pkg/cdrom.cc:579
 msgid "Waiting for disc...\n"
 msgid "Waiting for disc...\n"
 msgstr ""
 msgstr ""
 
 
 #. Mount the new CDROM
 #. Mount the new CDROM
-#: apt-pkg/cdrom.cc:571
+#: apt-pkg/cdrom.cc:587
 msgid "Mounting CD-ROM...\n"
 msgid "Mounting CD-ROM...\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:589
+#: apt-pkg/cdrom.cc:605
 msgid "Scanning Disc for index files..\n"
 msgid "Scanning Disc for index files..\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:627
+#: apt-pkg/cdrom.cc:643
 #, c-format
 #, c-format
 msgid "Found %i package indexes, %i source indexes and %i signatures\n"
 msgid "Found %i package indexes, %i source indexes and %i signatures\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:684
+#: apt-pkg/cdrom.cc:700
 msgid "That is not a valid name, try again.\n"
 msgid "That is not a valid name, try again.\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:700
+#: apt-pkg/cdrom.cc:716
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "This Disc is called: \n"
 "This Disc is called: \n"
 "'%s'\n"
 "'%s'\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:704
+#: apt-pkg/cdrom.cc:720
 msgid "Copying package lists..."
 msgid "Copying package lists..."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:728
+#: apt-pkg/cdrom.cc:744
 msgid "Writing new source list\n"
 msgid "Writing new source list\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:737
+#: apt-pkg/cdrom.cc:753
 msgid "Source List entries for this Disc are:\n"
 msgid "Source List entries for this Disc are:\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/cdrom.cc:771
+#: apt-pkg/cdrom.cc:787
 msgid "Unmounting CD-ROM..."
 msgid "Unmounting CD-ROM..."
 msgstr ""
 msgstr ""