summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc15
-rw-r--r--apt-pkg/acquire-item.h5
-rw-r--r--apt-pkg/acquire-worker.cc19
-rw-r--r--apt-pkg/algorithms.h3
-rw-r--r--apt-pkg/cacheiterators.h4
-rw-r--r--apt-pkg/cdrom.cc3
-rw-r--r--apt-pkg/deb/debmetaindex.cc4
-rw-r--r--apt-pkg/deb/debsystem.cc7
8 files changed, 16 insertions, 44 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index dea68f3ee..ef107444f 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -142,21 +142,20 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
{
Decompression = false;
Erase = false;
-
+
DestFile = _config->FindDir("Dir::State::lists") + "partial/";
DestFile += URItoFileName(URI);
if(comprExt.empty())
{
- // autoselect the compression method
- if(FileExists("/usr/bin/bzip2"))
- CompressionExtension = ".bz2";
- else
- CompressionExtension = ".gz";
+ // autoselect
+ if(FileExists("/usr/bin/bzip2"))
+ Desc.URI = URI + ".bz2";
+ else
+ Desc.URI = URI + ".gz";
} else {
- CompressionExtension = comprExt;
+ Desc.URI = URI + comprExt;
}
- Desc.URI = URI + CompressionExtension;
Desc.Description = URIDesc;
Desc.Owner = this;
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index 90f80368b..ea71153d5 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -92,8 +92,7 @@ class pkgAcqIndex : public pkgAcquire::Item
pkgAcquire::ItemDesc Desc;
string RealURI;
string ExpectedMD5;
- string CompressionExtension;
-
+
public:
// Specialized action members
@@ -101,7 +100,7 @@ class pkgAcqIndex : public pkgAcquire::Item
virtual void Done(string Message,unsigned long Size,string Md5Hash,
pkgAcquire::MethodConfig *Cnf);
virtual string Custom600Headers();
- virtual string DescURI() {return RealURI + CompressionExtension;};
+ virtual string DescURI() {return RealURI + ".gz";};
pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc,
string ShortDesct, string ExpectedMD5, string compressExt="");
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc
index d06024178..5cd7d6f1e 100644
--- a/apt-pkg/acquire-worker.cc
+++ b/apt-pkg/acquire-worker.cc
@@ -25,7 +25,6 @@
#include <apti18n.h>
#include <iostream>
-#include <sstream>
#include <fstream>
#include <sys/stat.h>
@@ -368,24 +367,6 @@ bool pkgAcquire::Worker::Capabilities(string Message)
/* */
bool pkgAcquire::Worker::MediaChange(string Message)
{
- int status_fd = _config->FindI("APT::Status-Fd",-1);
- if(status_fd > 0)
- {
- string Media = LookupTag(Message,"Media");
- string Drive = LookupTag(Message,"Drive");
- ostringstream msg,status;
- ioprintf(msg,_("Please insert the disc labeled: "
- "'%s' "
- "in the drive '%s' and press enter."),
- Media.c_str(),Drive.c_str());
- status << "media-change: " // message
- << Media << ":" // media
- << Drive << ":" // drive
- << msg.str() // l10n message
- << endl;
- write(status_fd, status.str().c_str(), status.str().size());
- }
-
if (Log == 0 || Log->MediaChange(LookupTag(Message,"Media"),
LookupTag(Message,"Drive")) == false)
{
diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h
index b95218061..174a7f58d 100644
--- a/apt-pkg/algorithms.h
+++ b/apt-pkg/algorithms.h
@@ -118,8 +118,7 @@ class pkgProblemResolver
// Try to resolve problems only by using keep
bool ResolveByKeep();
-
- // Install all protected packages
+
void InstallProtect();
pkgProblemResolver(pkgDepCache *Cache);
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index c3a0d0a5a..62d2695dd 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -222,7 +222,7 @@ class pkgCache::PrvIterator
void operator ++(int) {if (Prv != Owner->ProvideP) Prv = Owner->ProvideP +
(Type == PrvVer?Prv->NextPkgProv:Prv->NextProvides);};
inline void operator ++() {operator ++(0);};
- inline bool end() const {return Owner == 0 || Prv == Owner->ProvideP?true:false;};
+ inline bool end() const {return Prv == Owner->ProvideP?true:false;};
// Comparison
inline bool operator ==(const PrvIterator &B) const {return Prv == B.Prv;};
@@ -244,8 +244,6 @@ class pkgCache::PrvIterator
inline PkgIterator OwnerPkg() {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[Prv->Version].ParentPkg);};
inline unsigned long Index() const {return Prv - Owner->ProvideP;};
- inline PrvIterator() : Prv(0), Type(PrvVer), Owner(0) {};
-
inline PrvIterator(pkgCache &Owner,Provides *Trg,Version *) :
Prv(Trg), Type(PrvVer), Owner(&Owner)
{
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index c067cf1ee..ca74aa685 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -422,9 +422,6 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
{
F.getline(Buffer,sizeof(Buffer));
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));
_strstrip(Buffer);
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index 526c8c0b2..85e5b16b3 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -165,6 +165,10 @@ bool debReleaseIndex::IsTrusted() const
string VerifiedSigFile = _config->FindDir("Dir::State::lists") +
URItoFileName(MetaIndexURI("Release")) + ".gpg";
+ if(_config->FindB("APT::Authentication::TrustCDROM", false))
+ if(URI.substr(0,strlen("cdrom:")) == "cdrom:")
+ return true;
+
if (FileExists(VerifiedSigFile))
return true;
return false;
diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc
index 2d805ea6f..0b3a4f742 100644
--- a/apt-pkg/deb/debsystem.cc
+++ b/apt-pkg/deb/debsystem.cc
@@ -164,12 +164,7 @@ bool debSystem::Initialize(Configuration &Cnf)
Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct
Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
-
- if (StatusFile) {
- delete StatusFile;
- StatusFile = 0;
- }
-
+
return true;
}
/*}}}*/