Browse Source

* merged with apt--fixes--0

Patches applied:

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-7
   * fixed incorrect man-page example

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-8
   * changelog udpate

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-9
   * we only need to check once for xmlto

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-10
   * fix a bug in a man-page, fix a problem with overly long lines in apt-cdrom

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-11
   * merged with apt--main--0

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-12
   * fix a incorrect error message (it always added .gz regardless what was downloaded)

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-13
   * merged with main

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-14
   * added Hashsum support for file and cdrom 

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-15
   * added README.arch

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-16
   * merged with main

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-17
   * move the changelog to the right place

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-18
   * Change pkgPolicy::Pin from private to protected 

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-19
   * added a default constructor for PrvIterator 

 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-20
   * applied otavios patch to reread the statusFile on debSystem::Initialize

 * otavio@debian.org--2005/apt--fixes--0--patch-28
   Reread status configuration, needed for clients using independent apt ...
Michael Vogt 21 years ago
parent
commit
13e8426f80

+ 8 - 0
README.arch

@@ -0,0 +1,8 @@
+
+You can build apt from arch, but this needs the following additional
+packages (in addtion to the usual build-depends):
+xmlto perlsgml sgml2x sgmlspl docbook
+
+then run:
+debian/rules arch-build
+

+ 10 - 8
apt-pkg/acquire-item.cc

@@ -142,20 +142,21 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
 {
 {
    Decompression = false;
    Decompression = false;
    Erase = false;
    Erase = false;
-   
+
    DestFile = _config->FindDir("Dir::State::lists") + "partial/";
    DestFile = _config->FindDir("Dir::State::lists") + "partial/";
    DestFile += URItoFileName(URI);
    DestFile += URItoFileName(URI);
 
 
    if(comprExt.empty()) 
    if(comprExt.empty()) 
    {
    {
-      // autoselect 
-      if(FileExists("/usr/bin/bzip2"))
-	 Desc.URI = URI + ".bz2"; 
-      else
-	 Desc.URI = URI + ".gz"; 
+      // autoselect the compression method
+      if(FileExists("/usr/bin/bzip2")) 
+	 CompressionExtension = ".bz2";
+      else 
+	 CompressionExtension = ".gz";
    } else {
    } else {
-      Desc.URI = URI + comprExt; 
+      CompressionExtension = comprExt;
    }
    }
+   Desc.URI = URI + CompressionExtension; 
 
 
    Desc.Description = URIDesc;
    Desc.Description = URIDesc;
    Desc.Owner = this;
    Desc.Owner = this;
@@ -905,7 +906,8 @@ void pkgAcqArchive::Done(string Message,unsigned long Size,string Md5Hash,
       {
       {
 	 Status = StatError;
 	 Status = StatError;
 	 ErrorText = _("MD5Sum mismatch");
 	 ErrorText = _("MD5Sum mismatch");
-	 Rename(DestFile,DestFile + ".FAILED");
+	 if(FileExists(DestFile))
+	    Rename(DestFile,DestFile + ".FAILED");
 	 return;
 	 return;
       }
       }
    }
    }

+ 3 - 2
apt-pkg/acquire-item.h

@@ -92,7 +92,8 @@ class pkgAcqIndex : public pkgAcquire::Item
    pkgAcquire::ItemDesc Desc;
    pkgAcquire::ItemDesc Desc;
    string RealURI;
    string RealURI;
    string ExpectedMD5;
    string ExpectedMD5;
-   
+   string CompressionExtension;
+
    public:
    public:
    
    
    // Specialized action members
    // Specialized action members
@@ -100,7 +101,7 @@ class pkgAcqIndex : public pkgAcquire::Item
    virtual void Done(string Message,unsigned long Size,string Md5Hash,
    virtual void Done(string Message,unsigned long Size,string Md5Hash,
 		     pkgAcquire::MethodConfig *Cnf);
 		     pkgAcquire::MethodConfig *Cnf);
    virtual string Custom600Headers();
    virtual string Custom600Headers();
-   virtual string DescURI() {return RealURI + ".gz";};
+   virtual string DescURI() {return RealURI + CompressionExtension;};
 
 
    pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc,
    pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc,
 	       string ShortDesct, string ExpectedMD5, string compressExt="");
 	       string ShortDesct, string ExpectedMD5, string compressExt="");

+ 3 - 1
apt-pkg/cacheiterators.h

@@ -222,7 +222,7 @@ class pkgCache::PrvIterator
    void operator ++(int) {if (Prv != Owner->ProvideP) Prv = Owner->ProvideP +
    void operator ++(int) {if (Prv != Owner->ProvideP) Prv = Owner->ProvideP +
 	(Type == PrvVer?Prv->NextPkgProv:Prv->NextProvides);};
 	(Type == PrvVer?Prv->NextPkgProv:Prv->NextProvides);};
    inline void operator ++() {operator ++(0);};
    inline void operator ++() {operator ++(0);};
-   inline bool end() const {return Prv == Owner->ProvideP?true:false;};
+   inline bool end() const {return Owner == 0 || Prv == Owner->ProvideP?true:false;};
    
    
    // Comparison
    // Comparison
    inline bool operator ==(const PrvIterator &B) const {return Prv == B.Prv;};
    inline bool operator ==(const PrvIterator &B) const {return Prv == B.Prv;};
@@ -244,6 +244,8 @@ class pkgCache::PrvIterator
    inline PkgIterator OwnerPkg() {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[Prv->Version].ParentPkg);};
    inline PkgIterator OwnerPkg() {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[Prv->Version].ParentPkg);};
    inline unsigned long Index() const {return Prv - Owner->ProvideP;};
    inline unsigned long Index() const {return Prv - Owner->ProvideP;};
 
 
+   inline PrvIterator() : Owner(0), Prv(0), Type(PrvVer) {};
+
    inline PrvIterator(pkgCache &Owner,Provides *Trg,Version *) :
    inline PrvIterator(pkgCache &Owner,Provides *Trg,Version *) :
           Prv(Trg), Type(PrvVer), Owner(&Owner) 
           Prv(Trg), Type(PrvVer), Owner(&Owner) 
    {
    {

+ 3 - 0
apt-pkg/cdrom.cc

@@ -422,6 +422,9 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
    {      
    {      
       F.getline(Buffer,sizeof(Buffer));
       F.getline(Buffer,sizeof(Buffer));
       CurLine++;
       CurLine++;
+      if (F.fail() && !F.eof())
+	 return _error->Error(_("Line %u too long in source list %s."),
+			      CurLine,File.c_str());
       _strtabexpand(Buffer,sizeof(Buffer));
       _strtabexpand(Buffer,sizeof(Buffer));
       _strstrip(Buffer);
       _strstrip(Buffer);
             
             

+ 6 - 1
apt-pkg/deb/debsystem.cc

@@ -164,7 +164,12 @@ bool debSystem::Initialize(Configuration &Cnf)
    Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct
    Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct
    Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
    Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
    Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
    Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
-   
+
+   if (StatusFile) {
+     delete StatusFile;
+     StatusFile = 0;
+   }
+
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/

+ 2 - 2
apt-pkg/policy.h

@@ -45,6 +45,8 @@ using std::vector;
 
 
 class pkgPolicy : public pkgDepCache::Policy
 class pkgPolicy : public pkgDepCache::Policy
 {
 {
+   protected:
+
    struct Pin
    struct Pin
    {
    {
       pkgVersionMatch::MatchType Type;
       pkgVersionMatch::MatchType Type;
@@ -58,8 +60,6 @@ class pkgPolicy : public pkgDepCache::Policy
       string Pkg;
       string Pkg;
    };
    };
    
    
-   protected:
-   
    Pin *Pins;
    Pin *Pins;
    signed short *PFPriority;
    signed short *PFPriority;
    vector<Pin> Defaults;
    vector<Pin> Defaults;

+ 1 - 1
cmdline/apt-get.cc

@@ -1659,7 +1659,7 @@ bool DoInstall(CommandLine &CmdL)
    // See if we need to prompt
    // See if we need to prompt
    if (Cache->InstCount() == ExpectedInst && Cache->DelCount() == 0)
    if (Cache->InstCount() == ExpectedInst && Cache->DelCount() == 0)
       return InstallPackages(Cache,false,false);
       return InstallPackages(Cache,false,false);
-   
+
    return InstallPackages(Cache,false);   
    return InstallPackages(Cache,false);   
 }
 }
 									/*}}}*/
 									/*}}}*/

+ 1 - 4
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)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 
 dnl -- SET THIS TO THE RELEASE VERSION --
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.6.40.2")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.41")
 PACKAGE="apt"
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)
 AC_SUBST(PACKAGE)
@@ -181,9 +181,6 @@ AC_PATH_PROG(DOCBOOK2MAN,docbook2man)
 dnl Check for the XML tools needed to build man pages
 dnl Check for the XML tools needed to build man pages
 AC_PATH_PROG(XMLTO,xmlto)
 AC_PATH_PROG(XMLTO,xmlto)
 
 
-dnl Check for the XML tools needed to build man pages
-AC_PATH_PROG(XMLTO,xmlto)
-
 dnl Check for YODL
 dnl Check for YODL
 dnl AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
 dnl AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
 
 

+ 12 - 8
debian/changelog

@@ -1,11 +1,11 @@
-apt (0.6.40.2) unstable; urgency=low
+apt (0.6.41) unstable; urgency=low
 
 
   * improved the support for "error" and "conffile" reporting from
   * improved the support for "error" and "conffile" reporting from
     dpkg, added the format to README.progress-reporting
     dpkg, added the format to README.progress-reporting
   * added README.progress-reporting to the apt-doc package
   * added README.progress-reporting to the apt-doc package
   * improved the network timeout handling, if a index file from a 
   * improved the network timeout handling, if a index file from a 
-    sources.list times out, don't try to get the other files from
-    that entry
+    sources.list times out or EAI_AGAIN is returned from getaddrinfo, 
+    don't try to get the other files from that entry
   * Support architecture-specific extra overrides
   * Support architecture-specific extra overrides
     (closes: #225947). Thanks to  Anthony Towns for idea and
     (closes: #225947). Thanks to  Anthony Towns for idea and
     the patch, thanks to Colin Watson for testing it.
     the patch, thanks to Colin Watson for testing it.
@@ -17,11 +17,15 @@ apt (0.6.40.2) unstable; urgency=low
   * Andreas Pakulat:
   * Andreas Pakulat:
     - added example apt-ftparchive.conf file to doc/examples 
     - added example apt-ftparchive.conf file to doc/examples 
       (closes: #322483)
       (closes: #322483)
-  * methods/connect.cc:
-    - send failure reason for EAI_AGAIN (TmpResolveFailure) to acuire-item
-  * apt-pkg/acquire-item.cc:
-    - fail early if a FailReason is TmpResolveFailure (avoids hangs during
-      the install when no network is available)
+  * Fix a incorrect example in the man-page (closes: #282918)
+  * Fix a bug for very long lines in the apt-cdrom code (closes: #280356)
+  * Fix a manual page bug (closes: #316314)
+  * Do md5sum checking for file and cdrom method (closes: #319142)
+  * Change pkgPolicy::Pin from private to protected to let subclasses
+    access it too (closes: #321799)
+  * add default constructor for PrvIterator (closes: #322267)
+  * Reread status configuration on debSystem::Initialize() 
+    (needed for apt-proxy, thanks to Otavio for this patch)
   
   
  -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 23 Aug 2005 00:15:00 +0200
  -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 23 Aug 2005 00:15:00 +0200
 
 

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

@@ -284,7 +284,7 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";};
    <literal>sourcelist</literal> gives the location of the sourcelist and 
    <literal>sourcelist</literal> gives the location of the sourcelist and 
    <literal>main</literal> is the default configuration file (setting has no effect,
    <literal>main</literal> is the default configuration file (setting has no effect,
    unless it is done from the config file specified by 
    unless it is done from the config file specified by 
-   <envar>APT_CONFIG</envar>.</para>
+   <envar>APT_CONFIG</envar>).</para>
 
 
    <para>The <literal>Dir::Parts</literal> setting reads in all the config fragments in 
    <para>The <literal>Dir::Parts</literal> setting reads in all the config fragments in 
    lexical order from the directory specified. After this is done then the
    lexical order from the directory specified. After this is done then the

+ 1 - 1
doc/apt_preferences.5.xml

@@ -183,7 +183,7 @@ belonging to any distribution whose Archive name is "<literal>unstable</literal>
 <programlisting>
 <programlisting>
 Package: *
 Package: *
 Pin: release a=unstable
 Pin: release a=unstable
-Pin-Priority: 50
+Pin-Priority: 500
 </programlisting>
 </programlisting>
 
 
 <simpara>The following record assigns a high priority to all package versions
 <simpara>The following record assigns a high priority to all package versions

+ 7 - 0
methods/cdrom.cc

@@ -13,6 +13,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>
@@ -180,6 +181,12 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
       CurrentID = NewID;
       CurrentID = NewID;
    Res.LastModified = Buf.st_mtime;
    Res.LastModified = Buf.st_mtime;
    Res.Size = Buf.st_size;
    Res.Size = Buf.st_size;
+
+   Hashes Hash;
+   FileFd Fd(Res.Filename, FileFd::ReadOnly);
+   Hash.AddFD(Fd.Fd(), Fd.Size());
+   Res.TakeHashes(Hash);
+
    URIDone(Res);
    URIDone(Res);
    return true;
    return true;
 }
 }

+ 7 - 1
methods/file.cc

@@ -15,6 +15,8 @@
 // Include Files							/*{{{*/
 // Include Files							/*{{{*/
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/hashes.h>
+#include <apt-pkg/fileutl.h>
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>
@@ -75,7 +77,11 @@ bool FileMethod::Fetch(FetchItem *Itm)
    
    
    if (Res.Filename.empty() == true)
    if (Res.Filename.empty() == true)
       return _error->Error(_("File not found"));
       return _error->Error(_("File not found"));
-   
+
+   Hashes Hash;
+   FileFd Fd(Res.Filename, FileFd::ReadOnly);
+   Hash.AddFD(Fd.Fd(), Fd.Size());
+   Res.TakeHashes(Hash);
    URIDone(Res);
    URIDone(Res);
    return true;
    return true;
 }
 }

File diff suppressed because it is too large
+ 294 - 177
po/apt-all.pot