FOSSology  4.4.0
Open Source License Compliance by Open Source Software
pkgagent.h File Reference

pkgagent header More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#include <libgen.h>
#include <time.h>
#include <sys/wait.h>
#include "rpm/rpmlib.h"
#include "rpm/rpmts.h"
#include "rpm/rpmlog.h"
#include "rpm/rpmmacro.h"
#include <libfossology.h>
Include dependency graph for pkgagent.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rpmpkginfo
 Holds meta info of rpm packages. More...
 
struct  debpkginfo
 Holds meta info of Debian packages. More...
 

Macros

#define MAXCMD   5000
 
#define MAXLENGTH   256
 

Functions

int ProcessUpload (long upload_pk)
 Get all pfile need to processed use upload_pk. More...
 
int GetMetadata (char *pkg, struct rpmpkginfo *pi)
 Get RPM package info. More...
 
int RecordMetadataRPM (struct rpmpkginfo *pi)
 Store rpm package info into database. More...
 
int GetMetadataDebBinary (long upload_pk, struct debpkginfo *pi)
 Get debian binary package info. More...
 
int RecordMetadataDEB (struct debpkginfo *pi)
 Store debian package info into database. More...
 
int GetMetadataDebSource (char *repFile, struct debpkginfo *pi)
 Get debian source package info from .dsc file. More...
 
void Usage (char *Name)
 Say how to run this program. More...
 
char * GetFieldValue (char *Sin, char *Field, int FieldMax, char *Value, int ValueMax, char Separator)
 Given a string that contains field='value' pairs, save the items. More...
 

Variables

int Verbose
 Verbose level. More...
 
PGconn * db_conn
 the connection to Database More...
 

Detailed Description

pkgagent header

Definition in file pkgagent.h.

Function Documentation

◆ GetFieldValue()

char* GetFieldValue ( char *  Sin,
char *  Field,
int  FieldMax,
char *  Value,
int  ValueMax,
char  Separator 
)

Given a string that contains field='value' pairs, save the items.

Parameters
[in]SinString to parse
[out]FieldField string
[in]FieldMaxField capacity
[out]ValueValue string
[in]ValueMaxValue capacity
[in]SeparatorSeparator to use
Returns
pointer to start of next field, or NULL at \0.

Definition at line 101 of file pkgagent.c.

◆ GetMetadata()

int GetMetadata ( char *  pkg,
struct rpmpkginfo pi 
)

Get RPM package info.

Parameters
pkgPath of repo pfile
[out]pirpmpkginfo global pointer
Returns
0 on OK, -1 on failure.

Definition at line 505 of file pkgagent.c.

◆ GetMetadataDebBinary()

int GetMetadataDebBinary ( long  upload_pk,
struct debpkginfo pi 
)

Get debian binary package info.

Parameters
upload_pkthe upload_pk
pithe global pointor of debpkginfo
Returns
0 on OK, -1 on failure.

Definition at line 670 of file pkgagent.c.

◆ GetMetadataDebSource()

int GetMetadataDebSource ( char *  repFile,
struct debpkginfo pi 
)

Get debian source package info from .dsc file.

Parameters
repFilethe pfile path name
[out]pithe global pointor of debpkginfo
Returns
0 on OK, -1 on failure.
Todo:
Check if file is really Debian source

Definition at line 892 of file pkgagent.c.

◆ ProcessUpload()

int ProcessUpload ( long  upload_pk)

Get all pfile need to processed use upload_pk.

Parameters
upload_pkThe upload_pk send from scheduler
Returns
0 on OK, -1 on failure.

Definition at line 162 of file pkgagent.c.

◆ RecordMetadataDEB()

int RecordMetadataDEB ( struct debpkginfo pi)

Store debian package info into database.

Parameters
pithe global pointor of debpkginfo
Returns
0 on OK, -1 on failure.

Definition at line 818 of file pkgagent.c.

◆ RecordMetadataRPM()

int RecordMetadataRPM ( struct rpmpkginfo pi)

Store rpm package info into database.

Parameters
pi
Returns
0 on OK, -1 on failure.

Definition at line 563 of file pkgagent.c.

◆ Usage()

void Usage ( char *  Name)

Say how to run this program.

Print usage of bucket agent

Parameters
NameAbsolute path of agent

Many agents permit running from the command-line for testing. At minimum, you need "-i" to initialize the DB and exit.

Say how to run this program.

Parameters
Name- the name of the executable, usually it is mimetype

Say how to run this program.

Parameters
NamePath to nomos binary

Print usage of bucket agent

Parameters
NameAbsolute path of agent

Many agents permit running from the command-line for testing. At minimum, you need "-i" to initialize the DB and exit.

Say how to run this program.

Parameters
Name- the name of the executable, usually it is mimetype

Say how to run this program.

Parameters
NamePath to nomos binary

Usage():

Print usage of bucket agent

Parameters
NameAbsolute path of agent

Many agents permit running from the command-line for testing. At minimum, you need "-i" to initialize the DB and exit.

Say how to run this program.

Parameters
Name- the name of the executable, usually it is mimetype

Say how to run this program.

Parameters
NamePath to nomos binary

Usage():

Say how to run this program.

Usage():

Say how to run this program.

Usage():

Parameters
NamePath of the binary

Print usage of bucket agent

Parameters
NameAbsolute path of agent

Many agents permit running from the command-line for testing. At minimum, you need "-i" to initialize the DB and exit.

Say how to run this program.

Parameters
Name- the name of the executable, usually it is mimetype

Say how to run this program.

Parameters
NamePath to nomos binary

Usage():

Say how to run this program.

Usage():

Say how to run this program.

Usage():

Parameters
NamePath of the binary

Say how to run this program.

Parameters
Filename(executable argv[0] name)

Say how to run this program.

Parameters
NameThe name of the executable, usually it is wget_agent

Definition at line 561 of file adj2nest.c.

Variable Documentation

◆ db_conn

PGconn* db_conn
extern

the connection to Database

the connection to Database

Definition at line 22 of file pkgagent.c.

◆ Verbose

int Verbose
extern

Verbose level.

Contains all the functions supported by delagent

Verbosity level

Contains all the functions supported by delagent

Verbosity level

Verbose level.

Contains all the functions supported by delagent

Verbosity level

Definition at line 19 of file util.c.