29 $sql =
"select * from mimetype where
30 mimetype_name='application/x-rpm'
31 or mimetype_name='application/x-debian-package'
32 or mimetype_name='application/x-debian-source'";
35 while ($row = pg_fetch_assoc($result)) {
36 if ($row[
'mimetype_name'] ==
'application/x-rpm') {
37 $pkArray[0] = $row[
'mimetype_pk'];
38 }
else if ($row[
'mimetype_name'] ==
'application/x-debian-package') {
39 $pkArray[1] = $row[
'mimetype_pk'];
40 }
else if ($row[
'mimetype_name'] ==
'application/x-debian-source') {
41 $pkArray[2] = $row[
'mimetype_pk'];
44 pg_free_result($result);
61 &$NumSrcPkgs, &$NumBinPkgs, &$NumBinNoSrcPkgs)
65 list($rpm_mtpk, $deb_mtsrcpk, $deb_mtbinpk) = $MimetypeArray;
68 if ($uploadtree_row[
'pfile_mimetypefk'] == $deb_mtsrcpk) {
74 if ($uploadtree_row[
'pfile_mimetypefk'] == $deb_mtbinpk) {
76 $srcpkgmt = $deb_mtsrcpk;
80 $sql =
"select source from pkg_deb where pfile_fk=$uploadtree_row[pfile_fk] limit 1";
83 $row = pg_fetch_assoc($result);
84 $source = $row[
'source'];
85 pg_free_result($result);
94 if ($uploadtree_row[
'pfile_mimetypefk'] == $rpm_mtpk) {
95 $srcpkgmt = $rpm_mtpk;
97 $sql =
"select source_rpm from pkg_rpm where pfile_fk=$uploadtree_row[pfile_fk] limit 1";
100 $row = pg_fetch_assoc($result);
101 $source = $row[
'source_rpm'];
102 pg_free_result($result);
103 if ((substr($source, 0, 6) ==
"(none)") || empty($source)) {
112 if (empty($source)) {
118 $source =
trim($source);
119 $sql =
"select uploadtree_pk from uploadtree, pfile where
120 upload_fk=$uploadtree_row[upload_fk] and ufile_name='$source'
121 and pfile_fk=pfile_pk and pfile_mimetypefk=$srcpkgmt limit 1";
124 if (pg_num_rows($result) == 0) {
127 pg_free_result($result);
DBCheckResult($result, $sql, $filenm, $lineno)
Check the postgres result for unexpected errors. If found, treat them as fatal.
GetPkgMimetypes()
Get package mimetype.
IncrSrcBinCounts($uploadtree_row, $MimetypeArray, &$NumSrcPkgs, &$NumBinPkgs, &$NumBinNoSrcPkgs)
Increment counts of source package, binary package, and binary with no source.
char * trim(char *ptext)
Trimming whitespace.
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN
list_t type structure used to keep various lists. (e.g. there are multiple lists).