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)  

aptMethod Class Reference

#include <aptmethod.h>

Inheritance diagram for aptMethod:
[legend]
Collaboration diagram for aptMethod:
[legend]

Public Member Functions

virtual bool Configuration (std::string Message) APT_OVERRIDE
 
bool RunningInQemu (void)
 
bool LoadSeccomp ()
 
bool CalculateHashes (FetchItem const *const Itm, FetchResult &Res) const APT_NONNULL(2)
 
void Warning (std::string &&msg)
 
void setPostfixForMethodNames (char const *const postfix) APT_NONNULL(2)
 
bool DebugEnabled () const
 
std::string ConfigFind (char const *const postfix, std::string const &defValue) const APT_NONNULL(2)
 
std::string ConfigFind (std::string const &postfix, std::string const &defValue) const
 
bool ConfigFindB (char const *const postfix, bool const defValue) const APT_NONNULL(2)
 
int ConfigFindI (char const *const postfix, int const defValue) const APT_NONNULL(2)
 
bool TransferModificationTimes (char const *const From, char const *const To, time_t &LastModified) APT_NONNULL(2
 
 if (lstat(To, &Buf2) !=0||S_ISLNK(Buf2.st_mode)) return true
 
 if (stat(From, &Buf) !=0) return _error -> Errno("stat", _("Failed to stat"))
 
 if (utimes(To, times) !=0) return _error -> Errno("utimes", _("Failed to set modification time"))
 
void Dequeue ()
 
 aptMethod (std::string &&Binary, char const *const Ver, unsigned long const Flags) APT_NONNULL(3)
 
- Public Member Functions inherited from pkgAcqMethod
void Log (const char *Format,...)
 
void Status (const char *Format,...)
 
void Redirect (const std::string &NewURI)
 
int Run (bool Single=false)
 
void SetFailReason (std::string Msg)
 
void SetIP (std::string aIP)
 
 pkgAcqMethod (const char *Ver, unsigned long Flags=0)
 
virtual ~pkgAcqMethod ()
 
void DropPrivsOrDie ()
 

Static Public Member Functions

static std::string URIEncode (std::string const &part)
 
static std::string DecodeSendURI (std::string const &part)
 

Public Attributes

std::vector< std::string > methodNames
 
bool struct stat Buf2
 
struct stat Buf
 
struct timeval times [2]
 
times[0] tv_sec = Buf.st_atime
 
 LastModified = times[1].tv_sec = Buf.st_mtime
 
times[0] tv_usec = times[1].tv_usec = 0
 
return true
 

Protected Types

enum  Seccomp { BASE = (1 << 1) , NETWORK = (1 << 2) , DIRECTORY = (1 << 3) }
 

Protected Attributes

std::string const Binary
 
unsigned long SeccompFlags
 
- Protected Attributes inherited from pkgAcqMethod
std::vector< std::string > Messages
 
FetchItemQueue
 
FetchItemQueueBack
 
std::string FailReason
 
std::string UsedMirror
 
std::string IP
 
const char * Format
 
const char va_list &args const
 

Additional Inherited Members

- Public Types inherited from pkgAcqMethod
enum  CnfFlags {
  SingleInstance = (1 << 0) , Pipeline = (1 << 1) , SendConfig = (1 << 2) , LocalOnly = (1 << 3) ,
  NeedsCleanup = (1 << 4) , Removable = (1 << 5) , AuxRequests = (1 << 6) , SendURIEncoded = (1 << 7)
}
 
- Protected Member Functions inherited from pkgAcqMethod
virtual bool Fetch (FetchItem *)
 
virtual bool URIAcquire (std::string const &, FetchItem *Itm)
 
void Fail (bool Transient=false)
 
void Fail (const char *Why, bool Transient=false)
 
virtual void Fail (std::string Why, bool Transient=false)
 
virtual void URIStart (FetchResult &Res)
 
virtual void URIDone (FetchResult &Res, FetchResult *Alt=0)
 
void SendMessage (std::string const &header, std::unordered_map< std::string, std::string > &&fields)
 
bool MediaFail (std::string Required, std::string Drive)
 
virtual void Exit ()
 
 APT_DEPRECATED_MSG ("Use SendMessage instead") void PrintStatus(char const *const header
 

Detailed Description

Definition at line 46 of file aptmethod.h.

Member Enumeration Documentation

◆ Seccomp

enum Seccomp
protected
Enumerator
BASE 
NETWORK 
DIRECTORY 

Definition at line 51 of file aptmethod.h.

Constructor & Destructor Documentation

◆ aptMethod()

aptMethod ( std::string &&  Binary,
char const *const  Ver,
unsigned long const  Flags 
)
inline

Definition at line 500 of file aptmethod.h.

References Binary.

Member Function Documentation

◆ CalculateHashes()

bool CalculateHashes ( FetchItem const *const  Itm,
FetchResult Res 
) const
inline

Definition at line 377 of file aptmethod.h.

References Hashes::AddFD(), FileFd::Open(), and FileFd::ReadOnly.

Referenced by CopyMethod::Fetch(), and FileMethod::Fetch().

◆ ConfigFind() [1/2]

std::string ConfigFind ( char const *const  postfix,
std::string const defValue 
) const
inline

◆ ConfigFind() [2/2]

std::string ConfigFind ( std::string const postfix,
std::string const defValue 
) const
inline

Definition at line 437 of file aptmethod.h.

References ConfigFind().

◆ ConfigFindB()

bool ConfigFindB ( char const *const  postfix,
bool const  defValue 
) const
inline

◆ ConfigFindI()

int ConfigFindI ( char const *const  postfix,
int const  defValue 
) const
inline

◆ Configuration()

virtual bool Configuration ( std::string  Message)
inlinevirtual

◆ DebugEnabled()

◆ DecodeSendURI()

static std::string DecodeSendURI ( std::string const part)
inlinestatic

◆ Dequeue()

void Dequeue ( )
inline

◆ if() [1/3]

if ( lstat(To, &Buf2) !  = 0||S_ISLNK(Buf2.st_mode))

◆ if() [2/3]

if ( stat(From, &Buf) !  = 0) -> Errno("stat", _("Failed to stat"))

◆ if() [3/3]

if ( utimes(To, times) !  = 0) -> Errno("utimes", _("Failed to set modification time"))

◆ LoadSeccomp()

◆ RunningInQemu()

bool RunningInQemu ( void  )
inline

Definition at line 74 of file aptmethod.h.

Referenced by LoadSeccomp().

◆ setPostfixForMethodNames()

void setPostfixForMethodNames ( char const *const  postfix)
inline

Definition at line 401 of file aptmethod.h.

References hasDoubleColon(), and methodNames.

Referenced by BaseHttpMethod::Loop().

◆ TransferModificationTimes()

bool TransferModificationTimes ( char const *const  From,
char const *const  To,
time_t &  LastModified 
)

◆ URIEncode()

static std::string URIEncode ( std::string const part)
inlinestatic

Definition at line 487 of file aptmethod.h.

References _config, Configuration::Find(), and QuoteString().

Referenced by fixURIEncoding(), and HttpMethod::SendReq().

◆ Warning()

Member Data Documentation

◆ Binary

◆ Buf

struct stat Buf

◆ Buf2

bool struct stat Buf2
Initial value:
{
if (strcmp(To, "/dev/null") == 0)
return true

Definition at line 455 of file aptmethod.h.

◆ LastModified

LastModified = times[1].tv_sec = Buf.st_mtime

Definition at line 471 of file aptmethod.h.

◆ methodNames

std::vector<std::string> methodNames

◆ SeccompFlags

◆ times

◆ true

return true

Definition at line 475 of file aptmethod.h.

◆ tv_sec

times [0] tv_sec = Buf.st_atime

Definition at line 470 of file aptmethod.h.

◆ tv_usec

times [0] tv_usec = times[1].tv_usec = 0

Definition at line 472 of file aptmethod.h.


The documentation for this class was generated from the following file: