FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
process.c File Reference

Functions to process a single file and process an upload. More...

#include "maintagent.h"
Include dependency graph for process.c:

Go to the source code of this file.

Functions

PGresult * PQexecCheck (int exitNumber, char *SQL, char *file, const int line)
 simple wrapper which includes PQexec and fo_checkPQcommand More...
 
FUNCTION void PQexecCheckClear (int exitNumber, char *SQL, char *file, const int line)
 Execute SQL query and create the result and clear the result. More...
 
FUNCTION void vacAnalyze ()
 Do database vacuum and analyze. More...
 
FUNCTION void validateFolders ()
 Validate folder and foldercontents tables. More...
 
FUNCTION void verifyFilePerms (int fix)
 Verify and optionally fix file permissions. More...
 
FUNCTION void removeUploads ()
 Remove Uploads with no pfiles. More...
 
FUNCTION void removeTemps ()
 Remove orphaned temp tables from deprecated pkgmettagetta and old delagent. More...
 
FUNCTION void processExpired ()
 Process expired uploads (slow) More...
 
FUNCTION void removeOrphanedFiles ()
 Remove orphaned files from the repository (slow) Loop through each file in the repository and make sure there is a pfile table entry. Then make sure the pfile_pk is used by uploadtree. More...
 
FUNCTION void deleteOrphanGold ()
 Delete orphaned gold files from the repository Loop through each gold file in the repository and make sure there is a pfile entry in the upload table. More...
 
FUNCTION void normalizeUploadPriorities ()
 Normalize priority of Uploads. More...
 
FUNCTION void reIndexAllTables ()
 reindex of all indexes in fossology database More...
 
FUNCTION void removeOrphanedRows ()
 remove orphaned rows from fossology database More...
 
FUNCTION void removeOrphanedLogFiles ()
 

Variables

PGconn * pgConn = NULL
 the connection to Database More...
 
fo_dbManagerdbManager
 fo_dbManager object
 

Detailed Description

Functions to process a single file and process an upload.

Definition in file process.c.

Function Documentation

FUNCTION void deleteOrphanGold ( )

Delete orphaned gold files from the repository Loop through each gold file in the repository and make sure there is a pfile entry in the upload table.

Returns
void but writes status to stdout
Todo:
Remove orphaned gold files from the repository is not implemented yet

Definition at line 282 of file process.c.

FUNCTION void normalizeUploadPriorities ( )

Normalize priority of Uploads.

Returns
void but writes status to stdout

Definition at line 304 of file process.c.

PGresult* PQexecCheck ( int  exitNumber,
char *  SQL,
char *  file,
const int  line 
)

simple wrapper which includes PQexec and fo_checkPQcommand

Parameters
exitNumberexit number
SQLSQL command executed
filesource file name
linesource line number
Returns
PQexec query result

Definition at line 38 of file process.c.

FUNCTION void PQexecCheckClear ( int  exitNumber,
char *  SQL,
char *  file,
const int  line 
)

Execute SQL query and create the result and clear the result.

See also
PQexecCheck()

Definition at line 54 of file process.c.

FUNCTION void processExpired ( )

Process expired uploads (slow)

Returns
void but writes status to stdout
Todo:
Process expired uploads is not implemented yet

Definition at line 233 of file process.c.

FUNCTION void reIndexAllTables ( )

reindex of all indexes in fossology database

Returns
void but writes status to stdout

Definition at line 329 of file process.c.

FUNCTION void removeOrphanedFiles ( )

Remove orphaned files from the repository (slow) Loop through each file in the repository and make sure there is a pfile table entry. Then make sure the pfile_pk is used by uploadtree.

Returns
void but writes status to stdout
Todo:
Remove orphaned files from the repository is not implemented yet

Definition at line 258 of file process.c.

FUNCTION void removeOrphanedLogFiles ( )

Remove orphan log files created to store the logs from agents on disk.

Returns
void but writes status to stdout

Definition at line 460 of file process.c.

FUNCTION void removeOrphanedRows ( )

remove orphaned rows from fossology database

Returns
void but writes status to stdout

Definition at line 357 of file process.c.

FUNCTION void removeTemps ( )

Remove orphaned temp tables from deprecated pkgmettagetta and old delagent.

Returns
void but writes status to stdout

Definition at line 195 of file process.c.

FUNCTION void removeUploads ( )

Remove Uploads with no pfiles.

Returns
void but writes status to stdout
Todo:
Optimize query

Definition at line 167 of file process.c.

FUNCTION void vacAnalyze ( )

Do database vacuum and analyze.

Returns
void but writes status to stdout

Definition at line 65 of file process.c.

FUNCTION void validateFolders ( )

Validate folder and foldercontents tables.

Returns
void but writes status to stdout

Definition at line 87 of file process.c.

FUNCTION void verifyFilePerms ( int  fix)

Verify and optionally fix file permissions.

1 /usr/share/fossology drwxr-sr-x 15 fossy fossy
2 /srv/repostitory
3 path /srv/fossology/repository drwxrws--- 3 fossy fossy
4 /etc/fossology drwxr-sr-x 4 fossy fossy
5 /usr/local/lib/fossology/ drwxr-sr-x 2 fossy fossy
Parameters
fix0 to report bad permissions, 1 to report and fix them
Returns
void but writes status to stdout
Todo:
Verify file permissions is not implemented yet

Definition at line 140 of file process.c.

Variable Documentation

PGconn* pgConn = NULL

the connection to Database

DB connection.

Database connection.

Definition at line 27 of file process.c.