Commit 51cf5cacb68d377f597822b37db302deb6771641

Authored by Silvan Calarco
1 parent 8083cad05b
Exists in master

Switch to rpm 4 and cmake build tool

Showing 21 changed files with 333 additions and 264 deletions Side-by-side Diff

... ... @@ -6,10 +6,9 @@
6 6 config.status
7 7 configure
8 8 aclocal.m4
9   -src/include/config.h*
10 9 src/distromatic
11 10 src/distroquery
12   -src/include/globaldefs.h
13 11 src/include/stamp-h1
14 12 src/.deps
  13 +build/
  1 +project(distromatic)
  2 +
  3 +cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
  4 +
  5 +set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
  6 +
  7 +add_subdirectory(src)
  1 +find_package(ZLIB REQUIRED)
  2 +find_package(PkgConfig)
  3 +set(THREADS_PREFER_PTHREAD_FLAG ON)
  4 +find_package(Threads REQUIRED)
  5 +pkg_check_modules(RPM REQUIRED rpm)
  6 +pkg_check_modules(SQLITE3 REQUIRED sqlite3)
  7 +find_library(LIBIBERTY NAMES iberty)
  8 +
  9 +include_directories(include)
  10 +
  11 +string(REPLACE "." ";" VERSION_LIST ${RPM_VERSION})
  12 +list(GET VERSION_LIST 0 RPM_VERSION_MAJOR)
  13 +list(GET VERSION_LIST 1 RPM_VERSION_MINOR)
  14 +list(GET VERSION_LIST 2 RPM_VERSION_MICRO)
  15 +
  16 +add_compile_definitions(
  17 + PACKAGE="Distromatic"
  18 + PACKAGE_VERSION="1.5.0"
  19 + DEFAULT_CONFIGFILE="/etc/distromatic.conf"
  20 + off64_t=__off64_t
  21 + RPM_VERSION_MAJOR=${RPM_VERSION_MAJOR}
  22 + RPM_VERSION_MINOR=${RPM_VERSION_MINOR}
  23 + RPM_VERSION_MICRO=${RPM_VERSION_MICRO}
  24 + LOCALEDIR="${LOCALEDIR}"
  25 +)
  26 +
  27 +add_executable(distromatic
  28 + buildtools.c
  29 + changelog.c
  30 + distromatic.c
  31 + functions.c
  32 + reports.c
  33 + headerlist.c
  34 + requirelist.c
  35 + rpmfunctions.c
  36 + backend-sqlite3.c
  37 +)
  38 +
  39 +target_link_libraries(distromatic
  40 + Threads::Threads
  41 + ${RPM_LIBRARIES}
  42 + ${ZLIB_LIBRARIES}
  43 + ${SQLITE3_LIBRARIES}
  44 + ${LIBIBERTY}
  45 +)
  46 +target_include_directories(distromatic PUBLIC ${RPM_INCLUDE_DIRS})
  47 +target_compile_options(distromatic PUBLIC ${RPM_CFLAGS_OTHER})
  48 +
  49 +add_executable(distroquery
  50 + distroquery.c
  51 + functions.c
  52 + headerlist.c
  53 + requirelist.c
  54 + rpmfunctions.c
  55 + changelog.c
  56 +)
  57 +
  58 +target_link_libraries(distroquery
  59 + Threads::Threads
  60 + ${RPM_LIBRARIES}
  61 + ${ZLIB_LIBRARIES}
  62 + ${SQLITE3_LIBRARIES}
  63 + ${LIBIBERTY}
  64 +)
  65 +target_include_directories(distroquery PUBLIC ${RPM_INCLUDE_DIRS})
src/backend-sqlite3.c
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2013-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2013-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 *
6 6 * This program is free software; you can redistribute it and/or modify it under
7 7 * the terms of version 2 of the GNU General Public License as published by the
... ... @@ -18,7 +18,6 @@
18 18 */
19 19  
20 20 #include <sqlite3.h>
21   -#include "config.h"
22 21 #include "headerlist.h"
23 22 #include "changelog.h"
24 23 #include "backend-sqlite3.h"
... ... @@ -56,7 +55,7 @@
56 55  
57 56 int SQLite_commit_transaction(sqlite3 *db) {
58 57 if (sqlite3_exec(db, "COMMIT;", 0, 0, 0)) {
59   - fprintf(stderr, "ERROR: SQLite: (COMMIT) %s\n", sqlite3_errmsg(db));
  58 + fprintf(stderr, "ERROR: SQLite: (COMMIT) %s\n", sqlite3_errmsg(db));
60 59 return 1;
61 60 }
62 61 sqlite3_transaction_size = 0;
... ... @@ -64,8 +63,8 @@
64 63 }
65 64  
66 65 int SQLite_print_contents_subtree(sqlite3 *db,
67   - struct fileTree* ft,
68   - struct configTag* ct,
  66 + struct fileTree* ft,
  67 + struct configTag* ct,
69 68 int arch) {
70 69  
71 70 int thisrep, i;
... ... @@ -268,7 +267,7 @@
268 267 packager->packages_count);
269 268  
270 269 if (sqlite3_prepare_v2(db, sqlite3_query, -1, &stmt, NULL)) {
271   - fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
  270 + fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
272 271 }
273 272 sqlite3_bind_text(stmt, 1, packager->name, -1, SQLITE_STATIC);
274 273 if (sqlite3_step(stmt) != SQLITE_DONE) {
... ... @@ -295,7 +294,7 @@
295 294 changelog->pkg->id);
296 295  
297 296 if (sqlite3_prepare_v2(db, sqlite3_query, -1, &stmt, NULL)) {
298   - fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
  297 + fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
299 298 }
300 299 sqlite3_bind_text(stmt, 1, changelog->release, -1, SQLITE_STATIC);
301 300 sqlite3_bind_text(stmt, 2, changelog->text, -1, SQLITE_STATIC);
... ... @@ -468,7 +467,7 @@
468 467 currsource->size,
469 468 (currsource->changelog?nextchangelogid:0));
470 469 if (sqlite3_prepare_v2(db, sqlite3_query, -1, &stmt, NULL)) {
471   - fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
  470 + fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
472 471 }
473 472  
474 473 sqlite3_bind_text(stmt, 1, currsource->name, -1, SQLITE_STATIC);
... ... @@ -518,7 +517,7 @@
518 517 currsource->id);
519 518  
520 519 if (sqlite3_prepare_v2(db, sqlite3_query, -1, &stmt, NULL)) {
521   - fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
  520 + fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
522 521 }
523 522 sqlite3_bind_text(stmt, 1, currsource->patch[i], -1, SQLITE_STATIC);
524 523 if (sqlite3_step(stmt) != SQLITE_DONE) {
... ... @@ -555,7 +554,7 @@
555 554 currsource->required[i]->id);
556 555  
557 556 if (sqlite3_prepare_v2(db, sqlite3_query, -1, &stmt, NULL)) {
558   - fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
  557 + fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
559 558 }
560 559 if (sqlite3_step(stmt) != SQLITE_DONE) {
561 560 fprintf(stderr, "ERROR: SQLite: (%s) %s\n", sqlite3_query, sqlite3_errmsg(db));
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2006 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 *
7 7 * This program is free software; you can redistribute it and/or modify it under
... ... @@ -17,10 +17,6 @@
17 17 * this program; if not, write to the Free Software Foundation, Inc.,
18 18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19 19 */
20   -
21   -#ifdef HAVE_CONFIG_H
22   -# include "config.h"
23   -#endif
24 20  
25 21 #if HAVE_STRING_H
26 22 # if !STDC_HEADERS && HAVE_MEMORY_H
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2007 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 *
7 7 * This program is free software; you can redistribute it and/or modify it under
... ... @@ -18,10 +18,6 @@
18 18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19 19 */
20 20  
21   -#ifdef HAVE_CONFIG_H
22   -# include "config.h"
23   -#endif
24   -
25 21 #if TIME_WITH_SYS_TIME
26 22 # include <sys/time.h>
27 23 # include <time.h>
... ... @@ -44,6 +40,7 @@
44 40 #endif
45 41  
46 42 #include "distromatic.h"
  43 +#include "config.h"
47 44 #include "changelog.h"
48 45 #include "functions.h"
49 46  
... ... @@ -85,7 +82,7 @@
85 82 i++;
86 83 }
87 84 }
88   -
  85 +
89 86 if (!match) {
90 87 lastpackager = currpackager;
91 88 currpackager = currpackager->next;
... ... @@ -127,7 +124,7 @@
127 124 struct Packager *currpackager = NULL;
128 125 char **changelogtext, **changelogrelease;
129 126 char *endp;
130   - int_32 *changelogtime;
  127 + uint_32 *changelogtime;
131 128 char changelogname[255];
132 129  
133 130 changelogtime = headerGetUIntArrayEntry(h, RPMTAG_CHANGELOGTIME, &count);
... ... @@ -254,7 +251,7 @@
254 251 changeLogTimeStr(strdate, changelogfull->changelog));
255 252 lasttime=changelogfull->changelog->time;
256 253 }
257   - fprintf(fout,"<p><a href=\"%stag=%s&amp;pkg=%s.source\">%s</a> %s - ",
  254 + fprintf(fout,"<p><a href=\"%stag=%s&amp;pkg=%s.source\">%s</a> %s - ",
258 255 ct->configdefaults->url_prefix,
259 256 ct->tag,
260 257 changelogfull->source->name,
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 *
7 7 * This program is free software; you can redistribute it and/or modify it under
... ... @@ -18,8 +18,6 @@
18 18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19 19 */
20 20  
21   -#include "config.h"
22   -
23 21 /* Tell glibc's <time.h> to provide a prototype for strptime() */
24 22 #ifndef __USE_XOPEN
25 23 # define __USE_XOPEN
... ... @@ -114,8 +112,8 @@
114 112 int handleObsoletedPackages(struct configTag *ct, int arch);
115 113  
116 114 static const char *copyright[] = {
117   -PROGRAMNAME " version " PROGRAMVERSION,
118   -"Copyright (C) 2004-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>",
  115 +PACKAGE " version " PACKAGE_VERSION,
  116 +"Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>",
119 117 "Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>",
120 118 (char *)0
121 119 };
122 120  
... ... @@ -228,10 +226,10 @@
228 226 if (!require1 && !require2) return 0;
229 227 if (!require1 || !require1->name) return 1;
230 228 if (!require2 || !require2->name) return -1;
231   -/* if (require1->resolved->numproviders != require2->resolved->numproviders)
  229 +/* if (require1->resolved->numproviders != require2->resolved->numproviders)
232 230 return require2->resolved->numproviders - require1->resolved->numproviders;
233   -
234   - if (require1->resolved->numproviders == 1)
  231 +
  232 + if (require1->resolved->numproviders == 1)
235 233 return strcmp(require1->resolved->provider[0]->name,require2->resolved->provider[0]->name);
236 234 else*/
237 235 return strcmp(require1->name,require2->name);
... ... @@ -371,7 +369,7 @@
371 369 prov->provider[i]->arch,
372 370 ct->repository[prov->provider[i]->altrepository]->tag);
373 371 } else {
374   - snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s provided by %s(%s,%s)",
  372 + snprintf(buf, PATH_MAX, "%s(%s,%s) obsoletes %s provided by %s(%s,%s)",
375 373 currheader->name,
376 374 currheader->arch,
377 375 ct->repository[currheader->altrepository]->tag,
... ... @@ -590,7 +588,7 @@
590 588 }
591 589  
592 590 if (provided->numproviders > 0) {
593   - if (strcmp(currheader->require[i]->version,"") &&
  591 + if (strcmp(currheader->require[i]->version,"") &&
594 592 (currheader->require[i]->flags & (RPMSENSE_LESS|RPMSENSE_GREATER|RPMSENSE_EQUAL))) {
595 593  
596 594 found = 0;
... ... @@ -663,7 +661,7 @@
663 661 ct->repository[currheader->altrepository]->tag);
664 662 logmsg(LOG_WARNING,"%s", warning);
665 663 for (k = 0; k < provided->numproviders; k++) {
666   - if (provided->provider[k]->sourceheader &&
  664 + if (provided->provider[k]->sourceheader &&
667 665 (provided->provider[k]->altrepository == ct->repository_level)) {
668 666 addWarning(provided->provider[k]->sourceheader, warning);
669 667 }
... ... @@ -674,7 +672,7 @@
674 672 }
675 673 }
676 674 }
677   -
  675 +
678 676 }
679 677 }
680 678 currheader->require[i]->resolved=provided;
... ... @@ -721,7 +719,7 @@
721 719 provided=findOrCreateProvidedListEntry((struct providedList**) &ct->providedlist_idx[archidx],
722 720 currsourceheader->require[i]->name,1,archidx);
723 721 if (provided->numbuildproviders == 0) {
724   - // check if require[i]->name requirement is met
  722 + // check if require[i]->name requirement is met
725 723  
726 724 if ((currsourceheader->require[i]->name)[0] == '/') {
727 725 /* requirement is a file, find who provides it */
... ... @@ -768,7 +766,7 @@
768 766 }
769 767  
770 768 if (provided->numbuildproviders > 0) {
771   - if (strcmp(currsourceheader->require[i]->version,"") &&
  769 + if (strcmp(currsourceheader->require[i]->version,"") &&
772 770 (currsourceheader->require[i]->flags & (RPMSENSE_LESS+RPMSENSE_GREATER+RPMSENSE_EQUAL))) {
773 771 found = 0;
774 772 for (j = 0; j < provided->numproviders; j++) {
... ... @@ -790,7 +788,7 @@
790 788 if (currsourceheader->require[i]->flags & RPMSENSE_EQUAL) fprintf(stderr,"=");
791 789 fprintf(stderr," %s (failing build provider(s):", currsourceheader->require[i]->version);
792 790 for (j = 0; j < provided->numbuildproviders; j++) {
793   - fprintf(stderr," %s#%s",
  791 + fprintf(stderr," %s#%s",
794 792 provided->provider[j]->name, provided->buildprovider[j]->version);
795 793 /* printrpmversion(buffer,PATH_MAX,
796 794 provided->provider[j]->epoch,
... ... @@ -800,7 +798,7 @@
800 798 fprintf(stderr,")\n");
801 799 }
802 800 }
803   -
  801 +
804 802 }
805 803 }
806 804 currsourceheader->require[i]->resolved=provided;
... ... @@ -1174,7 +1172,7 @@
1174 1172 for (i = 0; i < ARCHS_MAX && configtag->arch[i]; i++) {
1175 1173 pthread_join(pth[i], NULL);
1176 1174 }
1177   -
  1175 +
1178 1176 if (!passed_arch) { // can't do missing builds and ports check in single arch mode
1179 1177 if (!quietmode)
1180 1178 fprintf(stdout, "Checking for SRPMS with no builds and missing ports...\n");
1 1 /*
2 2 * distroquery - tool for querying data generated by distromatic
3 3 *
4   - * Copyright (C) 2013-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2013-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 *
6 6 * This program is free software; you can redistribute it and/or modify it under
7 7 * the terms of version 2 of the GNU General Public License as published by the
... ... @@ -17,8 +17,6 @@
17 17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18 18 */
19 19  
20   -#include "config.h"
21   -
22 20 #include <getopt.h>
23 21 #include <errno.h>
24 22 #include <stdio.h>
... ... @@ -36,6 +34,9 @@
36 34  
37 35 #include <dirent.h>
38 36 #include <sys/stat.h>
  37 +#include <ctype.h>
  38 +#include <malloc.h>
  39 +#include <string.h>
39 40  
40 41 #if HAVE_STRING_H
41 42 # if !STDC_HEADERS && HAVE_MEMORY_H
... ... @@ -73,6 +74,8 @@
73 74  
74 75 #include <sqlite3.h>
75 76 #include "distromatic.h"
  77 +#include "config.h"
  78 +#include "rpmfunctions.h"
76 79 #include "functions.h"
77 80  
78 81 // must be as big as ARCHS_MAX (5)
79 82  
80 83  
... ... @@ -115,11 +118,11 @@
115 118 char *url_encode(char *str) {
116 119 char *pstr = str, *buf = malloc(strlen(str) * 3 + 1), *pbuf = buf;
117 120 while (*pstr) {
118   - if (isalnum(*pstr) || *pstr == '-' || *pstr == '_' || *pstr == '.' || *pstr == '~')
  121 + if (isalnum(*pstr) || *pstr == '-' || *pstr == '_' || *pstr == '.' || *pstr == '~')
119 122 *pbuf++ = *pstr;
120   - else if (*pstr == ' ')
  123 + else if (*pstr == ' ')
121 124 *pbuf++ = '+';
122   - else
  125 + else
123 126 *pbuf++ = '%', *pbuf++ = to_hex(*pstr >> 4), *pbuf++ = to_hex(*pstr & 15);
124 127 pstr++;
125 128 }
... ... @@ -138,7 +141,7 @@
138 141 *pbuf++ = from_hex(pstr[1]) << 4 | from_hex(pstr[2]);
139 142 pstr += 2;
140 143 }
141   - } else if (*pstr == '+') {
  144 + } else if (*pstr == '+') {
142 145 *pbuf++ = ' ';
143 146 } else {
144 147 *pbuf++ = *pstr;
... ... @@ -157,7 +160,7 @@
157 160 if (!strcmp(colname, name)) {
158 161 if (table) {
159 162 if (!strcmp(sqlite3_column_table_name(stmt, id), table)) return id;
160   - } else {
  163 + } else {
161 164 return id;
162 165 }
163 166 }
... ... @@ -313,7 +316,7 @@
313 316  
314 317 void printInputForm() {
315 318 struct configTag *ct = firstconfigtag;
316   -
  319 +
317 320 const char ajax_call[] = "distroquery_request("
318 321 // "'repository='+getElementById('repository').value"
319 322 "'query='+getElementById('query').value+"
... ... @@ -467,7 +470,7 @@
467 470 sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "name")));
468 471 } else {
469 472 printf("<tr><td style=\"font-family:courier\">%s</td><td style=\"font-family:courier\">%s</td>"
470   - "<td style=\"font-family:courier\">%s</td><td width=50%% style=\"font-family:courier\">%s</td>",
  473 + "<td style=\"font-family:courier\">%s</td><td width=50%% style=\"font-family:courier\">%s</td>",
471 474 sqlite3_column_text(stmt2,sqlite3_find_column_id(stmt2, "fileusers", "name")),
472 475 sqlite3_column_text(stmt2,sqlite3_find_column_id(stmt2, "filegroups", "name")),
473 476 expandFileFlags(flags, sql),
... ... @@ -855,7 +858,7 @@
855 858 printf("%s '%s' :: %s", _("Search results for"), query, firstconfigtag->configdefaults->distribution_name);
856 859 printf("]]></title>");
857 860 }
858   -
  861 +
859 862 for (i = 0; query_repositories[i] != NULL; i++) {
860 863 for (a = 0; a <= ARCHS_MAX && query_repositories[i]->arch[a]; a++) {
861 864 if (query_repositories[i]->db[a]) {
... ... @@ -1321,7 +1324,7 @@
1321 1324 " packages_files_rel.id_group=filegroups.id", query_package);
1322 1325 if (sqlite3_prepare_v2(dbf, sql, strlen(sql), &stmt1, NULL) == SQLITE_OK) {
1323 1326 while (sqlite3_step(stmt1) == SQLITE_ROW) {
1324   - printf("<tr><td style=\"font-family:courier\">%s</td><td style=\"font-family:courier\">%s</td><td style=\"font-family:courier\">%s</td><td>%s</td></tr>",
  1327 + printf("<tr><td style=\"font-family:courier\">%s</td><td style=\"font-family:courier\">%s</td><td style=\"font-family:courier\">%s</td><td>%s</td></tr>",
1325 1328 sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, "fileusers", "name")),
1326 1329 sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, "filegroups", "name")),
1327 1330 expandFileFlags(sqlite3_column_int(stmt1,sqlite3_find_column_id(stmt1, NULL, "flags")), sql),
... ... @@ -1659,7 +1662,7 @@
1659 1662 } else if (query_path) {
1660 1663 printFileBrowser();
1661 1664 }
1662   -
  1665 +
1663 1666 if (!responsed || (responsed && searchbox)) printInputForm();
1664 1667  
1665 1668 if (!reply_plain) printf("</distroquery>\n");
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2007 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 *
7 7 * This program is free software; you can redistribute it and/or modify it under
... ... @@ -18,10 +18,6 @@
18 18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19 19 */
20 20  
21   -#ifdef HAVE_CONFIG_H
22   -# include "config.h"
23   -#endif
24   -
25 21 #if STDC_HEADERS
26 22 # include <stdlib.h>
27 23 # include <stddef.h>
... ... @@ -50,10 +46,6 @@
50 46 # include <libiberty.h>
51 47 #endif
52 48  
53   -#ifndef FUNCTIONS_H
54   -# include "functions.h"
55   -#endif
56   -
57 49 /* Tell glibc's <time.h> to provide a prototype for strptime() */
58 50 #ifndef __USE_XOPEN
59 51 # define __USE_XOPEN
60 52  
... ... @@ -70,8 +62,9 @@
70 62 # endif
71 63 #endif
72 64  
73   -#include "functions.h"
74 65 #include "distromatic.h"
  66 +#include "config.h"
  67 +#include "functions.h"
75 68 #include "changelog.h"
76 69  
77 70 #include <execinfo.h>
78 71  
79 72  
80 73  
81 74  
... ... @@ -496,22 +489,22 @@
496 489  
497 490 if (sbytes < 1024) {
498 491 snprintf((char *)s, SSSIZE, "%lld B", sbytes);
499   - return (char *)s;
  492 + return (char *)s;
500 493 }
501 494 if ((sbytes / 1024) < 1024) {
502 495 snprintf((char *)s, SSSIZE, "%.2f KB", sbytes / 1024.0);
503   - return (char*)s;
  496 + return (char*)s;
504 497 }
505 498 if ((sbytes / 1024 / 1024 ) < 1024) {
506 499 snprintf((char *)s, SSSIZE, "%.2f MB", sbytes / 1024.0 / 1024.0);
507   - return (char*)s;
  500 + return (char*)s;
508 501 }
509 502 if ((sbytes / 1024 / 1024 / 1024 ) < 1024) {
510 503 snprintf((char *)s, SSSIZE, "%.2f GB", sbytes / 1024.0 / 1024.0 / 1024.0);
511   - return (char*)s;
  504 + return (char*)s;
512 505 }
513 506 snprintf((char *)s, SSSIZE, "%.2f TB", sbytes / 1024.0 / 1024.0 / 1024.0 / 1024.0);
514   - return (char*)s;
  507 + return (char*)s;
515 508 }
516 509  
517 510  
... ... @@ -519,7 +512,7 @@
519 512 {
520 513 unsigned int i=0,j=0;
521 514 char subst[10];
522   -
  515 +
523 516 while (source[i] && i<max) {
524 517 switch (source[i]) {
525 518 case '<': strcpy(subst,"&lt;"); break;
... ... @@ -535,7 +528,7 @@
535 528 } else {
536 529 fprintf(stderr,"Warning: can't tidy HTML string due to limited buffer.\n");
537 530 return source;
538   - }
  531 + }
539 532 i++;
540 533 }
541 534 return dest;
... ... @@ -545,7 +538,7 @@
545 538 {
546 539 unsigned int i=0,j=0;
547 540 char subst[10];
548   -
  541 +
549 542 while (source[i] && i<max) {
550 543 switch (source[i]) {
551 544 case '<': strcpy(subst,"&lt;"); break;
... ... @@ -560,7 +553,7 @@
560 553 } else {
561 554 fprintf(stderr,"Warning: can't tidy HTML string due to limited buffer.\n");
562 555 return source;
563   - }
  556 + }
564 557 i++;
565 558 }
566 559 return dest;
... ... @@ -569,7 +562,7 @@
569 562 /*
570 563 scansdir is like scandir with the difference that it uses stat()
571 564 to get entry file types
572   -
  565 +
573 566 */
574 567 int scansdir(const char *dir, struct dirent ***namelist,
575 568 int (*sel)(const struct dirent *),
... ... @@ -618,7 +611,7 @@
618 611 if (closedir(d)) return(-1);
619 612 // if (i == 0) return(-1);
620 613 if (compar != NULL)
621   - qsort((void *)(*namelist), (size_t)i, sizeof(struct dirent *),
  614 + qsort((void *)(*namelist), (size_t)i, sizeof(struct dirent *),
622 615 (__compar_fn_t) compar);
623 616  
624 617 return(i);
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 *
7 7 * This program is free software; you can redistribute it and/or modify it under
... ... @@ -18,7 +18,6 @@
18 18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19 19 */
20 20  
21   -#include "config.h"
22 21 #include <assert.h>
23 22 #include <dirent.h>
24 23  
... ... @@ -52,6 +51,7 @@
52 51 #endif
53 52  
54 53 #include "distromatic.h"
  54 +#include "config.h"
55 55 #include "changelog.h"
56 56 #include "functions.h"
57 57 #include "headerlist.h"
58 58  
... ... @@ -165,13 +165,13 @@
165 165 while (currheaderlist) {
166 166 if (!strcmp(name, currheaderlist->name)) {
167 167 if (((!release) || !strcmp(release, currheaderlist->release)) &&
168   - ((!version) || !strcmp(version, currheaderlist->version)) &&
  168 + ((!version) || !strcmp(version, currheaderlist->version)) &&
169 169 ((altrepository < 0) || (altrepository == currheaderlist->altrepository)))
170 170 return currheaderlist;
171 171 oldheaderlist = currheaderlist->old;
172 172 while (oldheaderlist) {
173 173 if (((!release) || !strcmp(release, oldheaderlist->release)) &&
174   - ((!version) || !strcmp(version, oldheaderlist->version)) &&
  174 + ((!version) || !strcmp(version, oldheaderlist->version)) &&
175 175 ((altrepository < 0) || (altrepository == oldheaderlist->altrepository)))
176 176 return oldheaderlist;
177 177 oldheaderlist = oldheaderlist->old;
... ... @@ -338,7 +338,7 @@
338 338 if (currheadersourcelist->altrepository == altrepository) {
339 339 stats->headersourcelistvec[c] = currheadersourcelist;
340 340 c++;
341   - if (currheadersourcelist->packager &&
  341 + if (currheadersourcelist->packager &&
342 342 (currheadersourcelist->packager->role & PACKAGER_ROLE_MAINTAINER)) {
343 343 currheadersourcelist->packager->packages_count++;
344 344 }
... ... @@ -394,7 +394,7 @@
394 394 ptr = strstr(entry->d_name, ".src.rpm");
395 395  
396 396 if (entry->d_type != DT_REG) return 0; /* skip if not a file */
397   -
  397 +
398 398 if (ptr == NULL) {
399 399 logmsg(LOG_WARNING,"file %s has not src.rpm extension; skipping.",entry->d_name);
400 400 return 0;
... ... @@ -541,7 +541,7 @@
541 541 pstart = findname+1; /* skip trailing slash */
542 542 pend = findname+1;
543 543 l = strlen(findname);
544   -
  544 +
545 545 while (pend-findname < l) {
546 546 pend=strchr(pstart,'/');
547 547 if (pend == 0) pend=findname+l; /* not final slash, it should be a file */
... ... @@ -555,7 +555,7 @@
555 555 }
556 556 else
557 557 currdir = findOrCreateFileTreeBrother(first,f,arch);
558   -
  558 +
559 559 if (!*first)
560 560 *first = currdir;
561 561 prevdir = currdir;
... ... @@ -629,7 +629,7 @@
629 629 char **requireversion, **requirename;
630 630 uint_32 *requireflags;
631 631 char warning[PATH_MAX];
632   -#if RPM_VERSION >= 0x040100
  632 +#if RPM_VERSION >= 0x050000
633 633 rpmts ts = rpmtsCreate();
634 634 #else
635 635 rpmts ts = NULL;
... ... @@ -720,7 +720,7 @@
720 720 newheadersourcelist->require[j]->resolved = NULL;
721 721 }
722 722 newheadersourcelist->requirecount = requirecount;
723   -
  723 +
724 724 if (mode & GENHEADER_CHANGELOG) {
725 725 changelog = getPackageChangelog(h, newheadersourcelist);
726 726 while (changelog) {
727 727  
... ... @@ -813,7 +813,9 @@
813 813 } // for
814 814  
815 815 free(namelist);
  816 +#if RPM_VERSION >= 0x050000
816 817 rpmtsFree(ts);
  818 +#endif
817 819 return 0;
818 820 }
819 821  
820 822  
821 823  
... ... @@ -868,18 +870,18 @@
868 870 char filepath[bufsize + 1], currname[bufsize + 1];
869 871 char *filename=NULL;
870 872 long i ,j , k, n, altn[ALT_REPS_MAX];
871   - int altrepository=0, obsoletecount, providecount, requirecount,
  873 + int altrepository=0, obsoletecount, providecount, requirecount,
872 874 filenamecount, dirnamecount,
873 875 *dirindex;
874 876 int_16 *fileflags;
875   - char **obsoletename, **obsoleteversion,
876   - **providename, **provideversion,
  877 + char **obsoletename, **obsoleteversion,
  878 + **providename, **provideversion,
877 879 **requirename, **requireversion,
878 880 **basename, **dirname, **newversion,
879 881 **fileusername, **filegroupname;
880 882 const char* errstr;
881 883 uint_32 *requireflags, *obsoleteflags, *provideflags;
882   -#if RPM_VERSION >= 0x040100
  884 +#if RPM_VERSION >= 0x050000
883 885 rpmts ts = rpmtsCreate();
884 886 #else
885 887 rpmts ts = NULL;
... ... @@ -959,7 +961,7 @@
959 961 altrepository=i+1;
960 962 altcnt[i]++;
961 963 /* check for duplicates in alternate repository */
962   - if ((altcnt[i] < altn[i] - 1) &&
  964 + if ((altcnt[i] < altn[i] - 1) &&
963 965 (!rpmnamecmp(altnamelist[i][altcnt[i]]->d_name,altnamelist[i][altcnt[i]+1]->d_name,0))) {
964 966 if (i == ct->repository_level-1) {
965 967 logmsg(LOG_WARNING, "%s: duplicated RPM package (skipped)",
966 968  
... ... @@ -973,9 +975,10 @@
973 975  
974 976 /* break while loop when no more packages are found */
975 977 if (currname[0] == '\0') { break; }
976   - /* process package */
  978 + /* process package */
977 979 logmsg(LOG_DEBUG, "getting header for %s", filepath);
978 980  
  981 + sem_t rpm_mutex;
979 982 sem_wait(&rpm_mutex);
980 983 if (getHeader(&ts, filepath, &h)) {
981 984 sem_post(&rpm_mutex);
... ... @@ -1011,7 +1014,7 @@
1011 1014 (void) headerFree(h);
1012 1015 free(newheaderlist);
1013 1016 continue;
1014   - } else {
  1017 + } else {
1015 1018 if (getPackageNameFromFile(newheaderlist->sourcename)) {
1016 1019 logmsg(LOG_WARNING,
1017 1020 "file %s doesn't have a standard format; skipping package.");
1018 1021  
... ... @@ -1046,14 +1049,14 @@
1046 1049 currheaderlist->next = newheaderlist;
1047 1050 }
1048 1051 currheaderlist = newheaderlist;
1049   -
  1052 +
1050 1053 if (!ct->headerlist[arch]) {
1051 1054 /* set first pointer of the list */
1052 1055 ct->headerlist[arch] = newheaderlist;
1053 1056 }
1054 1057  
1055 1058 } else if (newheaderlist->sourcename) /* missing source header */ {
1056   -
  1059 +
1057 1060 if ((!newheaderlist->sourceheader) ||
1058 1061 (newheaderlist->sourceheader->altrepository) <= altrepository)
1059 1062 {
1060 1063  
... ... @@ -1173,7 +1176,9 @@
1173 1176 free(altnamelist[altrepository-1][altcnt[altrepository-1]-1]); }
1174 1177 else free(namelist[cnt-1]);
1175 1178 } // main while
  1179 +#if RPM_VERSION >= 0x050000
1176 1180 rpmtsFree(ts);
  1181 +#endif
1177 1182 free(namelist);
1178 1183 createProvidedListIndex((struct providedList **)&(ct->providedlist_idx[arch]), arch);
1179 1184 return 0;
src/include/buildtools.h
... ... @@ -8,9 +8,7 @@
8 8 #ifndef BUILDTOOLS_H
9 9 #define BUILDTOOLS_H
10 10  
11   -#ifndef DISTROMATIC_H
12   -# include "distromatic.h"
13   -#endif
  11 +#include "config.h"
14 12  
15 13 int generateBuildInfo(struct configTag *configtag, int arch);
16 14  
src/include/changelog.h
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2007 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 */
7 7  
8 8 #ifndef CHANGELOG_H
9 9 #define CHANGELOG_H
10 10  
11   -#ifndef RPMFUNCTIONS_H
12   -# include "rpmfunctions.h"
13   -#endif
14   -
15 11 #if TIME_WITH_SYS_TIME
16 12 # include <sys/time.h>
17 13 # include <time.h>
... ... @@ -23,8 +19,9 @@
23 19 # endif
24 20 #endif
25 21  
26   -#define PACKAGER_MAXALIASES 5
27   -#define PACKAGER_ROLE_MAINTAINER 1
  22 +#include "distromatic.h"
  23 +#include "config.h"
  24 +#include "rpmfunctions.h"
28 25  
29 26 struct changeLog {
30 27 long time;
src/include/config.h
  1 +/*
  2 + * distromatic - tool for RPM based repositories
  3 + *
  4 + * Copyright (C) 2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
  5 + */
  6 +
  7 +#ifndef CONFIG_H
  8 +#define CONFIG_H
  9 +
  10 +#include "distromatic.h"
  11 +#include "headerlist.h"
  12 +
  13 +struct configDefaults {
  14 + char *html_basedir;
  15 + char *distribution_name;
  16 + char *url_address;
  17 + char *url_prefix;
  18 + char *url_search_prefix;
  19 + char *url_dir;
  20 + char *favicon_search_prefix;
  21 + char *arch[ARCHS_MAX];
  22 +};
  23 +
  24 +struct configTag {
  25 + struct configDefaults *configdefaults;
  26 + char *tag;
  27 + char *description;
  28 + char *repository_dir;
  29 + char *repository_source_dir;
  30 + struct configTag *repository[ALT_REPS_MAX+1];
  31 + int repository_level;
  32 + char *html_dir;
  33 + char *download_prefix;
  34 + char *download_dir;
  35 + char *showfile_prefix;
  36 + char *arch[ARCHS_MAX];
  37 + struct headerList *headerlist[ARCHS_MAX];
  38 + struct headerSourceList *headersourcelist;
  39 + struct providedList *providedlist_idx[ARCHS_MAX][PROVIDEDLIST_IDX_SIZE];
  40 + struct fileTree *filetree[ARCHS_MAX];
  41 + struct fileUserList *fileuserlist[ARCHS_MAX];
  42 + struct fileGroupList *filegrouplist[ARCHS_MAX];
  43 + struct headerStats stats;
  44 + struct configTag *next;
  45 + void *db[ARCHS_MAX + 1];
  46 +};
  47 +
  48 +#endif
src/include/distromatic.h
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2007 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 */
7 7  
8 8 #ifndef DISTROMATIC_H
9 9 #define DISTROMATIC_H
10 10  
11   -#include "globaldefs.h"
12   -#include "headerlist.h"
  11 +#define PACKAGE_BUGREPORT "silvan.calarco@mambasoft.it"
13 12  
  13 +#define ARCHS_MAX 5
14 14 #define OBSOLETE_MAX 16384
15   -
16   -struct configDefaults {
17   - char *html_basedir;
18   - char *distribution_name;
19   - char *url_address;
20   - char *url_prefix;
21   - char *url_search_prefix;
22   - char *url_dir;
23   - char *favicon_search_prefix;
24   - char *arch[ARCHS_MAX];
25   -};
26   -
27   -struct configTag {
28   - struct configDefaults *configdefaults;
29   - char *tag;
30   - char *description;
31   - char *repository_dir;
32   - char *repository_source_dir;
33   - struct configTag *repository[ALT_REPS_MAX+1];
34   - int repository_level;
35   - char *html_dir;
36   - char *download_prefix;
37   - char *download_dir;
38   - char *showfile_prefix;
39   - char *arch[ARCHS_MAX];
40   - struct headerList *headerlist[ARCHS_MAX];
41   - struct headerSourceList *headersourcelist;
42   - struct providedList *providedlist_idx[ARCHS_MAX][PROVIDEDLIST_IDX_SIZE];
43   - struct fileTree *filetree[ARCHS_MAX];
44   - struct fileUserList *fileuserlist[ARCHS_MAX];
45   - struct fileGroupList *filegrouplist[ARCHS_MAX];
46   - struct headerStats stats;
47   - struct configTag *next;
48   - void *db[ARCHS_MAX + 1];
49   -};
  15 +#define DEFAULT_ARCH "i586"
  16 +#define CONF_DEFAULTS_SECTION 1
  17 +#define CONF_REP_SECTION 0
  18 +#define CONF_MAINTAINERS_SECTION 2
  19 +#define GENHEADER_CHANGELOG 1
  20 +#define GENHEADER_BASE 2
  21 +#define GENHEADER_REQUIREMENTS 4
  22 +#define GENHEADER_STATS 8
  23 +#define ALT_REPS_MAX 10
  24 +#define PACKAGER_MAXALIASES 5
  25 +#define PACKAGER_ROLE_MAINTAINER 1
50 26  
51 27 #endif
src/include/functions.h
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2007 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 */
7 7  
8 8 #ifndef FUNCTIONS_H
9 9 #define FUNCTIONS_H
  10 +
  11 +#include <dirent.h>
10 12  
11 13 #define HDSIZE 16
12 14 #define SSSIZE 16
src/include/globaldefs.h.in
1   -/*
2   - * globaldefs.h - global definitions for distromatic
3   - *
4   - * Copyright (C) 2010 by Silvan Calarco <silvan.calarco@mambasoft.it>
5   - */
6   -
7   -#ifndef GLOBALDEFS_H
8   -#define GLOBALDEFS_H
9   -
10   -#define PROGRAMNAME "@PACKAGE_NAME@"
11   -#define PROGRAMVERSION "@PACKAGE_VERSION@"
12   -#define DEFAULT_CONFIGFILE "@sysconfdir@/@PACKAGE_NAME@.conf"
13   -#define DEFAULT_ARCH "@DEFAULT_ARCH@"
14   -#define ARCHS_MAX 5
15   -
16   -#define CONF_REP_SECTION 0
17   -#define CONF_DEFAULTS_SECTION 1
18   -#define CONF_MAINTAINERS_SECTION 2
19   -
20   -#endif
src/include/headerlist.h
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2007 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 */
7 7  
8 8  
9 9  
... ... @@ -10,17 +10,11 @@
10 10  
11 11 #define PROVIDEDLIST_IDX_SIZE 20
12 12  
13   -#include "globaldefs.h"
14   -
15 13 #ifndef RPMFUNCTIONS_H
16   -# include "rpmfunctions.h"
  14 +#include "rpmfunctions.h"
17 15 #endif
18 16  
19   -#define GENHEADER_CHANGELOG 1
20   -#define GENHEADER_BASE 2
21   -#define GENHEADER_REQUIREMENTS 4
22   -#define GENHEADER_STATS 8
23   -#define ALT_REPS_MAX 10
  17 +#include "distromatic.h"
24 18  
25 19 struct providedList {
26 20 char *name;
src/include/rpmfunctions.h
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2007 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 */
7 7  
8 8 #ifndef RPMFUNCTIONS_H
9 9 #define RPMFUNCTIONS_H
10 10  
  11 +/* Define to the RPM version */
  12 +#define RPM_VERSION ((RPM_VERSION_MAJOR<<16)|(RPM_VERSION_MINOR<<8)|RPM_VERSION_MICRO)
  13 +
  14 +#if RPM_VERSION_MAJOR == 4
  15 +#define uint_32 uint32_t
  16 +#define int_16 rpmFlags
  17 +#define HE_t rpmTagVal
  18 +#endif
  19 +
11 20 #ifndef H_RPMLIB
12 21 # include <rpm/rpmlib.h>
13 22 #endif
14 23  
  24 +#if RPM_VERSION >= 0x040100
  25 +#include <rpm/rpmts.h>
  26 +#else
  27 +#define rpmReadPackageFile(a,b,c,d) rpmReadPackageHeader(b,d,0,NULL,NULL)
  28 +#endif
  29 +
  30 +#if RPM_VERSION >= 0x050000
  31 +#ifndef H_RPMEVR
  32 +#include <rpm/rpmevr.h>
  33 +#endif
  34 +#endif
  35 +
15 36 #include <semaphore.h>
16   -#include "headerlist.h"
  37 +#include <dirent.h>
17 38  
18 39 #define HEADERS_BUFFER_SIZE 2000000
19 40  
... ... @@ -21,8 +42,6 @@
21 42  
22 43 void rpminit(void);
23 44  
24   -//int myHeaderGetEntry(Header h, int_32 tag, int *type, void** p, int *c);
25   -
26 45 char *headerGetStringEntry(Header h, const int tag);
27 46  
28 47 char **headerGetStringArrayEntry(Header h, const int tag, int* count);
... ... @@ -57,8 +76,6 @@
57 76 int scanrpmnamecmp(const struct dirent **f1, const struct dirent **f2);
58 77  
59 78 char* printrpmversion(char *s, int bufsize, long epoch, char *version, char *release);
60   -
61   -sem_t rpm_mutex;
62 79  
63 80 #endif // RPMFUNCTIONS_H
1 1 /*
2 2 * distromatic - tool for RPM based repositories
3 3 *
4   - * Copyright (C) 2004-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
  4 + * Copyright (C) 2004-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
5 5 * Copyright (C) 2006 by Davide Madrisan <davide.madrisan@gmail.com>
6 6 *
7 7 * This program is free software; you can redistribute it and/or modify it under
... ... @@ -18,10 +18,6 @@
18 18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19 19 */
20 20  
21   -#ifdef HAVE_CONFIG_H
22   -# include "config.h"
23   -#endif
24   -
25 21 #if HAVE_STRING_H
26 22 # if !STDC_HEADERS && HAVE_MEMORY_H
27 23 # include <memory.h>
... ... @@ -32,6 +28,7 @@
32 28 # include <strings.h>
33 29 #endif
34 30  
  31 +#include "distromatic.h"
35 32 #include "changelog.h"
36 33 #include "reports.h"
37 34 #include "rpmfunctions.h"
... ... @@ -71,7 +68,7 @@
71 68 else {
72 69 ret=strcasecmp((*(struct headerSourceList **)ptr1)->packager->name,
73 70 (*(struct headerSourceList **)ptr2)->packager->name);
74   -
  71 +
75 72 if (!ret) {
76