#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/indexfile.h>
-#include <apt-pkg/indexrecords.h>
#include <apt-pkg/init.h>
#include <apt-pkg/md5.h>
#include <apt-pkg/metaindex.h>
return true;
}
- // Disable drop-privs if "_apt" can not write to the target dir
- CheckDropPrivsMustBeDisabled(Fetcher);
-
if (_error->PendingError() == true || CheckAuth(Fetcher, false) == false)
return false;
AcqTextStatus Stat(std::cout, ScreenWidth,_config->FindI("quiet",0));
pkgAcquire Fetcher(&Stat);
- SPtrArray<DscFile> Dsc = new DscFile[CmdL.FileSize()];
+ std::unique_ptr<DscFile[]> Dsc(new DscFile[CmdL.FileSize()]);
// insert all downloaded uris into this set to avoid downloading them
// twice
return true;
}
- // Disable drop-privs if "_apt" can not write to the target dir
- CheckDropPrivsMustBeDisabled(Fetcher);
-
// check authentication status of the source as well
if (UntrustedList.empty() == false && AuthPrompt(UntrustedList, false) == false)
return false;
CacheFile Cache;
_config->Set("APT::Install-Recommends", false);
+
+ bool WantLock = _config->FindB("APT::Get::Print-URIs", false) == false;
- if (Cache.Open(true) == false)
+ if (Cache.Open(WantLock) == false)
return false;
if (CmdL.FileSize() <= 1)
{
string Src;
pkgSrcRecords::Parser *Last = 0;
- SPtr<pkgSrcRecords::Parser> LastOwner;
+ std::unique_ptr<pkgSrcRecords::Parser> LastOwner;
// an unpacked debian source tree
using APT::String::Startswith;
std::string TypeName = "Debian control file";
pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str());
if(Type != NULL)
- LastOwner = Last = Type->CreateSrcPkgParser(*I);
+ LastOwner.reset(Last = Type->CreateSrcPkgParser(*I));
}
// if its a local file (e.g. .dsc) use this
else if (FileExists(*I))
string TypeName = "Debian " + flExtension(*I) + " file";
pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str());
if(Type != NULL)
- LastOwner = Last = Type->CreateSrcPkgParser(*I);
+ LastOwner.reset(Last = Type->CreateSrcPkgParser(*I));
} else {
// normal case, search the cache for the source file
Last = FindSrc(*I,SrcRecs,Src,Cache);
if (printOnly == false)
{
- // Disable drop-privs if "_apt" can not write to the target dir
- CheckDropPrivsMustBeDisabled(Fetcher);
- if (_error->PendingError() == true)
- return false;
-
bool Failed = false;
if (AcquireRun(Fetcher, 0, &Failed, NULL) == false || Failed == true)
return false;
<< "Description: " << T->Description << "\n"
<< "URI: " << T->URI << "\n"
<< "Filename: " << filename << "\n"
- << "Optional: " << (T->IsOptional ? "yes" : "no") << "\n";
+ << "Optional: " << (T->IsOptional ? "yes" : "no") << "\n"
+ << "KeepCompressed: " << (T->KeepCompressed ? "yes" : "no") << "\n";
for (std::map<std::string,std::string>::const_iterator O = AddOptions.begin(); O != AddOptions.end(); ++O)
stanza << format_key(O->first) << ": " << O->second << "\n";
for (std::map<std::string,std::string>::const_iterator O = T->Options.begin(); O != T->Options.end(); ++O)
- stanza << format_key(O->first) << ": " << O->second << "\n";
+ {
+ if (O->first == "PDIFFS")
+ stanza << "PDiffs: " << O->second << "\n";
+ else if (O->first == "COMPRESSIONTYPES")
+ stanza << "CompressionTypes: " << O->second << "\n";
+ else if (O->first == "DEFAULTENABLED")
+ stanza << "DefaultEnabled: " << O->second << "\n";
+ else
+ stanza << format_key(O->first) << ": " << O->second << "\n";
+ }
stanza << "\n";
if (Filtered)
{"remove",&DoInstall},
{"purge",&DoInstall},
{"autoremove",&DoInstall},
+ {"auto-remove",&DoInstall},
{"markauto",&DoMarkAuto},
{"unmarkauto",&DoMarkAuto},
{"dist-upgrade",&DoDistUpgrade},
+ {"full-upgrade",&DoDistUpgrade},
{"dselect-upgrade",&DoDSelectUpgrade},
{"build-dep",&DoBuildDep},
{"clean",&DoClean},
{"autoclean",&DoAutoClean},
+ {"auto-clean",&DoAutoClean},
{"check",&DoCheck},
{"source",&DoSource},
{"download",&DoDownload},