![]() |
FOSSology
3.2.0rc1
Open Source License Compliance by Open Source Software
|
#include "buckets.h"
Go to the source code of this file.
Functions | |
| FUNCTION int | walkTree (PGconn *pgConn, pbucketdef_t bucketDefArray, int agent_pk, int uploadtree_pk, int skipProcessedCheck, int hasPrules) |
| This function does a recursive depth first walk through a file tree (uploadtree). More... | |
| FUNCTION int | processFile (PGconn *pgConn, pbucketdef_t bucketDefArray, puploadtree_t puploadtree, int agent_pk, int hasPrules) |
| Process a file. More... | |
Variables | |
| int | debug |
Processing a given file
Definition in file walk.c.
| FUNCTION int processFile | ( | PGconn * | pgConn, |
| pbucketdef_t | bucketDefArray, | ||
| puploadtree_t | puploadtree, | ||
| int | agent_pk, | ||
| int | hasPrules | ||
| ) |
Process a file.
The file might be a single file, a container, an artifact, a package, ..., in other words, an uploadtree record.
Need to process container artifacts as a regular directory so that buckets cascade up without interruption.
There is one small caveat. If the container is a package AND the bucketDefArray has rules that apply to packages (applies_to='p') THEN process the package as both a leaf since the bucket pool has its own rules for packages, and as a container (the pkg is in each of its childrens buckets).
| pgConn | The database connection object. |
| bucketDefArray | Bucket Definitions |
| puoloadtree | Uploadtree record |
| agent_pk | The agent_pk |
| hasPrules | 1=bucketDefArray contains at least one rule that only apply to packages. 0=No package rules. |
| FUNCTION int walkTree | ( | PGconn * | pgConn, |
| pbucketdef_t | bucketDefArray, | ||
| int | agent_pk, | ||
| int | uploadtree_pk, | ||
| int | skipProcessedCheck, | ||
| int | hasPrules | ||
| ) |
This function does a recursive depth first walk through a file tree (uploadtree).
| pgConn | The database connection object. |
| bucketDefArray | Bucket Definitions |
| agent_pk | The agent_pk |
| uploadtree_pk | |
| skipProcessedCheck | true if it is ok to skip the initial processed() call. The call is unnecessary during recursion and it's an DB query, so best to avoid doing an unnecessary call. |
| hasPrules | 1=bucketDefArray contains at least one rule that only apply to packages. 0=No package rules. |