apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

configuration.cc File Reference
#include <config.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/macros.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/string_view.h>
#include <ctype.h>
#include <regex.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <fstream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#include <apti18n.h>
Include dependency graph for configuration.cc:

Go to the source code of this file.

Functions

static std::string getConfigTypeString (ConfigType const type)
 
static ConfigType getConfigType (std::string const &type)
 
static void checkFindConfigOptionTypeInternal (std::string name, ConfigType const type)
 
static void checkFindConfigOptionType (char const *const name, ConfigType const type)
 
static bool LoadConfigurationIndex (std::string const &filename)
 
static void leaveCurrentScope (std::stack< std::string > &Stack, std::string &ParentTag)
 
bool ReadConfigFile (Configuration &Conf, const string &FName, bool const &AsSectional, unsigned const &Depth)
 
bool ReadConfigDir (Configuration &Conf, const string &Dir, bool const &AsSectional, unsigned const &Depth)
 

Variables

Configuration_config = new Configuration
 
enum APT_HIDDEN ConfigType
 
 UNDEFINED
 
 INT
 
 BOOL
 
 STRING
 
 STRING_OR_BOOL
 
 STRING_OR_LIST
 
 FILE
 
 DIR
 
 LIST
 
APT_HIDDEN std::unordered_map< std::string, ConfigTypeapt_known_config {}
 

Function Documentation

◆ checkFindConfigOptionType()

static void checkFindConfigOptionType ( char const *const  name,
ConfigType const  type 
)
static

◆ checkFindConfigOptionTypeInternal()

static void checkFindConfigOptionTypeInternal ( std::string  name,
ConfigType const  type 
)
static

◆ getConfigType()

static ConfigType getConfigType ( std::string const &  type)
static

Definition at line 74 of file configuration.cc.

References BOOL, DIR, FILE, INT, LIST, STRING, STRING_OR_BOOL, STRING_OR_LIST, and UNDEFINED.

Referenced by LoadConfigurationIndex().

◆ getConfigTypeString()

static std::string getConfigTypeString ( ConfigType const  type)
static

Definition at line 57 of file configuration.cc.

References BOOL, DIR, FILE, INT, LIST, STRING, STRING_OR_BOOL, STRING_OR_LIST, and UNDEFINED.

Referenced by checkFindConfigOptionTypeInternal().

◆ leaveCurrentScope()

static void leaveCurrentScope ( std::stack< std::string > &  Stack,
std::string &  ParentTag 
)
static

Definition at line 831 of file configuration.cc.

Referenced by ReadConfigFile().

◆ LoadConfigurationIndex()

static bool LoadConfigurationIndex ( std::string const &  filename)
static

◆ ReadConfigDir()

bool ReadConfigDir ( Configuration Conf,
const string &  Dir,
bool const &  AsSectional,
unsigned const &  Depth 
)

Definition at line 1127 of file configuration.cc.

References GetListOfFilesInDir().

Referenced by pkgInitConfig(), and ReadConfigFile().

◆ ReadConfigFile()

Variable Documentation

◆ _config

Configuration* _config = new Configuration

Definition at line 49 of file configuration.cc.

Referenced by pkgAcqMetaBase::AbortTransaction(), AcqTextStatus::AcqTextStatus(), AcquireUpdate(), pkgCdrom::Add(), AddOrIdent(), debSystem::AddStatusFiles(), edspSystem::AddStatusFiles(), eippSystem::AddStatusFiles(), AnalPrompt(), debSystem::ArchitecturesSupported(), AuthPrompt(), CDROMMethod::AutoDetectAndMount(), AutoDetectProxy(), BinaryCommandSpecificConfiguration(), BinarySpecificConfiguration(), CacheFile::BuildCaches(), pkgCacheFile::BuildCaches(), canNotFindPkgName_impl(), pkgAcqMetaBase::CheckAuthDone(), OpProgress::CheckChange(), CacheFile::CheckDeps(), pkgAcqMetaBase::CheckDownloadDone(), CheckDropPrivsMustBeDisabled(), CheckForBadItemAndFailIt(), CheckFreeSpaceBeforeDownload(), CheckIfCalledByScript(), CheckIfSimulateMode(), CheckNothingBroken(), debSystem::CheckUpdates(), CheckValidity(), CacheDB::Clean(), pkgAcqMetaBase::CommitTransaction(), Compressor::Compressor(), aptMethod::ConfigFind(), pkgAcqMethod::Configuration(), aptMethod::Configuration(), aptAuthConfMethod::Configuration(), BaseHttpMethod::Configuration(), CDROMMethod::Configuration(), FtpMethod::Configuration(), RSHMethod::Configuration(), pkgDPkgPM::Configure(), pkgPackageManager::ConfigureAll(), ConfigValueInSubTree(), Connect(), ConnectionAllowed(), ConnectToHostname(), SigVerify::CopyAndVerify(), SigVerify::CopyMetaIndex(), IndexCopy::CopyPackages(), TranslationsCopy::CopyTranslations(), CreateDumpFile(), CreateDynamicMMap(), debSLTypeDebian::CreateItemInternal(), pkgAcqMetaBase::Custom600Headers(), BaseHttpMethod::DealWithHeaders(), debListParser::debListParser(), aptMethod::DebugEnabled(), aptMethod::DecodeSendURI(), DispatchCommandLine(), DisplayFileInPager(), DoAuto(), DoAutoClean(), DoAutoDetectProxy(), DoAutomaticRemove(), DoBuildDep(), DoCacheManipulationFromCommandLine(), DoCatFile(), DoChangelog(), DoClean(), DoDownload(), DoDSelectUpgrade(), DoDump(), DoIndexTargets(), DoIt(), DoList(), DoMarkAuto(), DoMinimize(), DoMoo1(), DoMoo2(), DoMoo3(), DoMooApril(), pkgAcqFile::Done(), ReleaseWriter::DoPackage(), DoSearch(), DoSelection(), DoShell(), DoSource(), Dotty(), DoUpdate(), DoUpgrade(), debSystem::DpkgChrootDirectory(), DpkgChrootDirectory(), PackageManagerFancy::DrawStatusLine(), DropPrivileges(), pkgPackageManager::EarlyRemove(), EditFileInSensibleEditor(), EditSources(), edspListParser::edspListParser(), LogCleaner::Erase(), ExcludePhased(), debSystem::ExecDpkg(), ExecGPGV(), ExecuteExternal(), AcqTextStatus::Fail(), pkgAcqMethod::Fail(), CDROMMethod::Fetch(), StoreMethod::Fetch(), HashStringList::find(), pkgDebianIndexFile::FindInCache(), debReleaseIndex::FindInCache(), FindMountPointForDevice(), pkgCdrom::FindPackages(), FindSrc(), ReleaseWriter::Finish(), pkgAcqMetaClearSig::Finished(), pkgAcqAuxFile::Finished(), pkgSourceList::Type::FixupURI(), formatUTCDateTime(), FTPConn::FTPConn(), FTWScanner::FTWScanner(), FullTextSearch(), GenCaches(), PackageMap::GenContents(), Generate(), PackageMap::GenPackages(), PackageMap::GenSources(), pkgPackageManager::GetArchives(), GetAuxFileNameFromURI(), GetAuxFileNameFromURIInLists(), GetBuildDeps(), pkgAcquire::GetConfig(), debSLTypeDebian::GetDebReleaseIndexBy(), debSystem::GetDpkgBaseCommand(), debSystem::GetDpkgExecutable(), pkgAcqArchive::GetFinalFilename(), GetFinalFileNameFromURI(), GetIndexTargetsFor(), pkgSourceList::GetLastModifiedTime(), GetListOfFilesInDir(), GetLocalitySortedVersionSet(), pkgAcquire::GetLock(), GetLockMaybeWait(), getMooLine(), GetPartialFileName(), APT::KernelAutoRemoveHelper::GetProtectedKernelsRegex(), GetSrvRecords(), Digest::getState(), PackageManagerFancy::GetTerminalSize(), pkgDPkgPM::Go(), Go(), pkgArchiveCleaner::Go(), HashString::HashString(), pkgCache< Str, Itr >::Header::Header(), IdentCdrom(), pkgAcqChangelog::Init(), pkgPolicy::InitDefaults(), pkgAcquire::Initialize(), InitOutput(), pkgDPkgPM::Install(), InstallPackages(), IsConfigured(), IsModeChangeOk(), debReleaseIndex::IsTrusted(), ItemIsEssential(), ItemIsProtected(), ListSingleVersion(), ListUpdate(), debReleaseIndex::Load(), aptMethod::LoadSeccomp(), LoadTree(), debSystem::Lock(), debSystem::LockInner(), FTPConn::Login(), BaseHttpMethod::Loop(), main(), pkgProblemResolver::MakeScores(), pkgCacheGenerator::MakeStatusCache(), pkgDepCache::MarkFollowsRecommends(), pkgDepCache::MarkFollowsSuggests(), pkgDepCache::MarkInstall(), pkgDepCache::MarkInstall_StateChange(), pkgDepCache::MarkPackage(), pkgDepCache::MarkRequired(), Configuration::MatchAgainstConfig::MatchAgainstConfig(), MaybeAddAuth(), AcqTextStatus::MediaChange(), MergeKeepFdsFromConfiguration(), debReleaseIndex::MetaIndexFile(), pkgCdrom::MountAndIdentCDROM(), MountCdrom(), FTPConn::Open(), CacheFile::Open(), CacheFile::OpenForInstall(), pkgDPkgPM::OpenLog(), TryToInstall::operator()(), HashStringList::operator==(), IndexTarget::Option(), pkgPackageManager::OrderInstall(), CacheSetHelper::PackageFromFnmatch(), CacheSetHelper::PackageFromPackageName(), CacheSetHelper::PackageFromRegEx(), APT::Progress::PackageManagerProgressFactory(), PackageNameMatcher::PackageNameMatcher(), PackagesWriter::PackagesWriter(), debListParser::ParseDepends(), pkgAcqDiffIndex::ParseDiffIndex(), pkgSourceList::Type::ParseLine(), debSLTypeDebian::parsePlusMinusTargetOptions(), pkgSourceList::Type::ParseStanza(), debStatusListParser::ParseStatus(), pkgAcqArchive::pkgAcqArchive(), pkgAcqDiffIndex::pkgAcqDiffIndex(), pkgAcqIndex::pkgAcqIndex(), pkgAcqIndexDiffs::pkgAcqIndexDiffs(), pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(), pkgAcqMetaIndex::pkgAcqMetaIndex(), pkgAcqMetaSig::pkgAcqMetaSig(), pkgAllUpgradeNoNewPackages(), pkgAllUpgradeWithNewPackages(), pkgDepCache::pkgDepCache(), pkgDistUpgrade(), pkgInitArchTupleMap(), pkgOrderList::pkgOrderList(), pkgPackageManager::pkgPackageManager(), pkgPolicy::pkgPolicy(), pkgProblemResolver::pkgProblemResolver(), pkgDepCache::Policy::Policy(), PopFromSrvRecs(), pkgDPkgPM::ProcessDpkgStatusLine(), pkgAcquireStatus::Pulse(), AcqTextStatus::Pulse(), pkgAcqMetaClearSig::QueueIndexes(), pkgAcquire::QueueName(), pkgAcqTransactionItem::QueueURI(), pkgSourceList::ReadMainList(), ReadPinDir(), ReadPinFile(), EDSP::ReadRequest(), pkgDepCache::readStateFile(), CacheDB::ReadyDB(), IndexCopy::ReconstructPrefix(), AcqTextStatus::ReleaseInfoChanges(), ReleaseWriter::ReleaseWriter(), pkgCache< Str, Itr >::ReMap(), pkgCacheGenerator::ReMap(), pkgCacheFile::RemoveCaches(), ReportMirrorFailureToCentral(), pkgProblemResolver::Resolve(), pkgProblemResolver::ResolveByKeep(), pkgProblemResolver::ResolveByKeepInternal(), pkgProblemResolver::ResolveInternal(), RunJsonHook(), RunScripts(), pkgDPkgPM::RunScriptsWithPkgs(), StateChanges::Save(), CommandLine::SaveInConfig(), pkgUdevCdromDevices::Scan(), pkgOrderList::Score(), pkgCdrom::Score(), Search(), pkgDPkgPM::SendPkgsInfo(), HttpMethod::SendReq(), SetCacheStartBeforeRemovingCache(), APT::setDefaultConfigurationForCompressors(), SetupAPTPartialDirectory(), PackageManagerFancy::SetupTerminalScrollArea(), ShowCommonHelp(), ShowDepends(), ShowHelp(), ShowList(), ShowPackage(), ShowPkgNames(), ShowSrcPackage(), SimpleGenContents(), SimpleGenPackages(), SimpleGenSources(), SingleConfigToDoHashes(), pkgPackageManager::SmartConfigure(), pkgPackageManager::SmartUnPack(), SourcesWriter::SourcesWriter(), pkgCacheGenerator::Start(), pkgDPkgPM::StartPtyMagic(), PackageManager::StatusChanged(), PackageManagerProgressFd::StatusChanged(), AcqTextStatus::Stop(), pkgDepCache::Sweep(), TargetIsAllowedToBe(), pkgAcqTransactionItem::TransactionState(), CleanupItem::TransactionState(), UnMet(), pkgCdrom::UnmountCDROM(), UnmountCdrom(), UnwrapTLS(), OpTextProgress::Update(), pkgAcqChangelog::URI(), pkgAcquire::URIEncode(), aptMethod::URIEncode(), HashStringList::usable(), debListParser::UsePackage(), SigVerify::Verify(), HashString::VerifyFile(), pkgAcqMetaBase::VerifyVendor(), pkgDPkgPM::WriteApportReport(), WriteBuildDependencyPackage(), pkgCdrom::WriteDatabase(), EIPP::WriteRequest(), EDSP::WriteRequest(), EDSP::WriteSolutionStanza(), pkgCdrom::WriteSourceList(), pkgDepCache::writeStateFile(), XVcg(), YnPrompt(), and pkgCacheGenerator::~pkgCacheGenerator().

◆ apt_known_config

APT_HIDDEN std::unordered_map<std::string, ConfigType> apt_known_config {}

◆ BOOL

BOOL

◆ ConfigType

enum APT_HIDDEN ConfigType
strong

Definition at line 55 of file configuration.cc.

◆ DIR

◆ FILE

◆ INT

INT

Definition at line 55 of file configuration.cc.

Referenced by getConfigType(), and getConfigTypeString().

◆ LIST

LIST

◆ STRING

STRING

◆ STRING_OR_BOOL

STRING_OR_BOOL

◆ STRING_OR_LIST

STRING_OR_LIST

◆ UNDEFINED

UNDEFINED