FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
pkgagent.h
Go to the documentation of this file.
1 /**************************************************************
2  Copyright (C) 2010-2011 Hewlett-Packard Development Company, L.P.
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public License
6  version 2 as published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 
17  ***************************************************************/
22 #ifndef _PKGAGENT_H
23 #define _PKGAGENT_H 1
24 
25 #include <stdlib.h>
26 #include <stdio.h>
27 #include <string.h>
28 #include <ctype.h>
29 #include <signal.h>
30 #include <libgen.h>
31 #include <time.h>
32 
33 #include <sys/wait.h>
34 
35 #include "rpmlib.h"
36 #include "rpmts.h"
37 #include "rpmlog.h"
38 #include "rpmmacro.h"
39 
40 #include <libfossology.h>
41 
42 #define MAXCMD 5000
43 #define MAXLENGTH 256
44 
49 struct rpmpkginfo
50 {
51  char pkgName[256];
52  char pkgAlias[256];
53  char pkgArch[64];
54  char version[64];
55  char rpmFilename[256];
56  char license[512];
57  char group[128];
58  char packager[1024];
59  char release[64];
60  char buildDate[128];
61  char vendor[128];
62  char url[256];
63  char sourceRPM[256];
64  char summary[MAXCMD];
65  char description[MAXCMD];
66  long pFileFk;
67  char pFile[MAXCMD];
68  char **requires;
69  int req_size;
70 };
71 
76 struct debpkginfo
77 {
78  char pkgName[MAXCMD];
79  char source[MAXCMD];
80  char version[MAXCMD];
81  char section[MAXCMD];
82  char priority[MAXCMD];
83  char pkgArch[MAXCMD];
85  char maintainer[MAXCMD];
86  char homepage[MAXCMD];
87  char summary[MAXCMD];
88  char description[MAXCMD];
89  long pFileFk;
90  char pFile[MAXCMD];
91  char **depends;
92  int dep_size;
93  char uploaders[MAXCMD];
94  char format[MAXCMD];
95  char standardsVersion[MAXCMD];
96 };
97 
98 extern int Verbose;
99 extern PGconn* db_conn;
100 
101 int ProcessUpload(long upload_pk);
102 
103 int GetMetadata(char *pkg, struct rpmpkginfo *pi);
104 
105 int RecordMetadataRPM(struct rpmpkginfo *pi);
106 
107 int GetMetadataDebBinary(long upload_pk, struct debpkginfo *pi);
108 
109 int RecordMetadataDEB(struct debpkginfo *pi);
110 
111 int GetMetadataDebSource(char *repFile, struct debpkginfo *pi);
112 
113 void Usage(char *Name);
114 
115 char *GetFieldValue(char *Sin, char *Field, int FieldMax,char *Value, int ValueMax, char Separator);
116 #endif /* _PKGAGENT_H */
char ** depends
Package dependency list.
Definition: pkgagent.h:91
int installedSize
Size of package after install.
Definition: pkgagent.h:84
int GetMetadata(char *pkg, struct rpmpkginfo *pi)
Get RPM package info.
Definition: pkgagent.c:517
char pFile[MAXCMD]
Package pfile hash.
Definition: pkgagent.h:67
PGconn * db_conn
the connection to Database
Definition: pkgagent.c:34
Definition: nomos.h:439
long pFileFk
Package pfile in FOSSology.
Definition: pkgagent.h:89
char description[MAXCMD]
Package description.
Definition: pkgagent.h:65
int RecordMetadataDEB(struct debpkginfo *pi)
Store debian package info into database.
Definition: pkgagent.c:830
char packager[1024]
Packager.
Definition: pkgagent.h:58
char buildDate[128]
Package build date.
Definition: pkgagent.h:60
int RecordMetadataRPM(struct rpmpkginfo *pi)
Store rpm package info into database.
Definition: pkgagent.c:575
int dep_size
Package dependency list size.
Definition: pkgagent.h:92
char sourceRPM[256]
Package source.
Definition: pkgagent.h:63
char pkgName[256]
RPM package name.
Definition: pkgagent.h:51
Holds meta info of rpm packages.
Definition: pkgagent.h:49
char version[64]
Package version.
Definition: pkgagent.h:54
Holds meta info of Debian packages.
Definition: pkgagent.h:76
int GetMetadataDebSource(char *repFile, struct debpkginfo *pi)
Get debian source package info from .dsc file.
Definition: pkgagent.c:904
void Usage(char *Name)
Say how to run this program.
Definition: adj2nest.c:573
char ** requires
Package dependency list.
Definition: pkgagent.h:68
int GetMetadataDebBinary(long upload_pk, struct debpkginfo *pi)
Get debian binary package info.
Definition: pkgagent.c:682
char summary[MAXCMD]
Package summary.
Definition: pkgagent.h:64
int Verbose
Verbose level.
Definition: util.c:28
The main FOSSology C library.
char pkgAlias[256]
Package alias.
Definition: pkgagent.h:52
char pkgArch[64]
Package architecture.
Definition: pkgagent.h:53
char rpmFilename[256]
RPM file name.
Definition: pkgagent.h:55
int ProcessUpload(long upload_pk)
Get all pfile need to processed use upload_pk.
Definition: pkgagent.c:174
char vendor[128]
Package vendor.
Definition: pkgagent.h:61
char group[128]
Package group.
Definition: pkgagent.h:57
char release[64]
Package release.
Definition: pkgagent.h:59
char url[256]
Package link.
Definition: pkgagent.h:62
char * GetFieldValue(char *Sin, char *Field, int FieldMax, char *Value, int ValueMax, char Separator)
Given a string that contains field=&#39;value&#39; pairs, save the items.
Definition: pkgagent.c:113
int req_size
Package dependency list size.
Definition: pkgagent.h:69
long pFileFk
Package pfile in FOSSology.
Definition: pkgagent.h:66
const char * upload_pk
Definition: sqlstatements.h:93