diff -Nur rpm2html-1.8.1/acconfig.h rpm2html-1.8.1.new/acconfig.h --- rpm2html-1.8.1/acconfig.h 2001-07-28 20:03:07 +0400 +++ rpm2html-1.8.1.new/acconfig.h 2003-09-17 08:54:34 +0400 @@ -1,2 +0,0 @@ -#undef USE_RPM310 -#undef USE_RPMIO diff -Nur rpm2html-1.8.1/configure.in rpm2html-1.8.1.new/configure.in --- rpm2html-1.8.1/configure.in 2002-11-16 14:34:15 +0300 +++ rpm2html-1.8.1.new/configure.in 2003-09-18 11:24:39 +0400 @@ -1,6 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.2) -AC_INIT(rpm2html.c) +AC_INIT([rpm2html], [1.8.1]) +AC_CONFIG_SRCDIR([rpm2html.c]) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST @@ -53,8 +54,8 @@ AC_CHECK_LIB(intl, gettext) AC_CHECK_FUNC(dbopen, [], [ - AC_CHECK_LIB(db-3.1, db_create, [LIBS="-ldb-3.1 $LIBS"], - AC_CHECK_LIB(db-3.0, db_create, [LIBS="-ldb-3.0 $LIBS"], + AC_CHECK_LIB(db-4.0, db_create, [LIBS="-ldb-4.0 $LIBS"], + AC_CHECK_LIB(db3, db_create, [LIBS="-ldb3 $LIBS"], AC_CHECK_LIB(db1, dbopen, [LIBS="-ldb1 $LIBS"], AC_CHECK_LIB(db, dbopen, [LIBS="-ldb $LIBS"], [LIBS="-lbz2 -lpthread -lrt $LIBS"])))) @@ -64,47 +65,11 @@ [LIBS="-lpopt $LIBS"], AC_MSG_ERROR(*** libpopt not found)) -AC_CHECK_LIB(rpmio, Fopen, - [LIBS="-lrpmio $LIBS"; - AC_DEFINE_UNQUOTED(USE_RPMIO, 1) - AC_SUBST(USE_RPMIO) - ]) - -AC_CHECK_LIB(rpmdb, rpmdbOpen, [LIBS="-lrpm -lrpmdb $LIBS"], - AC_CHECK_LIB(rpm, rpmReadConfigFiles, [LIBS="-lrpm $LIBS"], - AC_MSG_ERROR(*** librpm not found) - ), -lrpm -) - -dnl -dnl Is there a specific path for RPM stuff ? -dnl - -RPM_CFLAGS="-I/usr/include/rpm" -RPM_LIBS="-L/usr/lib" -AC_ARG_WITH(rpm-prefix, [ --with-rpm-prefix Prefix for RPM (/usr)]) -if test "$with_rpm_prefix" != "" ; then - RPM_CFLAGS="-I$with_rpm_prefix/include/rpm" - RPM_LIBS="-L$with_rpm_prefix/libs" -fi - -AC_ARG_WITH(rpm-includes, [ --with-rpm-includes Includes for RPM (/usr/include/rpm)]) -if test "$with_rpm_includes" != "" ; then - RPM_CFLAGS="-I$with_rpm_includes" -fi - -AC_ARG_WITH(rpm-flags, [ --with-rpm-flags Libs for RPM (/usr/lib)]) -if test "$with_rpm_flags" != "" ; then - RPM_LIBS="-L$with_rpm_flags" -fi - -AC_SUBST(RPM_CFLAGS) -AC_SUBST(RPM_LIBS) - -dnl hack: we're gonna use rpm-3.1 -AC_DEFINE_UNQUOTED(USE_RPM310, 1) -AC_SUBST(USE_RPM310) -AC_CHECK_LIB(rpm, rpmReadConfigFiles,,AC_MSG_ERROR(*** rpm lib not found)) +LIBS="${LIBS} -lrpmdb -lrpmio -lrpm" +AC_CHECK_LIB(rpm, rpmdbOpen, + [AC_DEFINE_UNQUOTED(USE_RPMIO, 1, [Define to 1 if you have the header file.]) + AC_SUBST(USE_RPMIO)], + AC_MSG_ERROR([Can't find the RPM library -- please install rpm-devel])) dnl dnl Checking for libxml @@ -135,9 +100,16 @@ AC_HEADER_STDC AC_CHECK_HEADERS(db_185.h db1/db.h) AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h) -AC_CHECK_HEADERS(rpm/rpmio.h) AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h) -AC_CHECK_HEADERS(zlib.h rpm/rpmlib.h) +AC_CHECK_HEADERS(zlib.h) + +AC_CHECK_HEADERS(rpm/rpmio.h, + [RPM_CFLAGS="-I/usr/include/rpm"; + RPM_LIBS="-L/usr/lib"; + AC_SUBST(RPM_CFLAGS) + AC_SUBST(RPM_LIBS) + ] + ,AC_MSG_ERROR([Can't find the RPM header files -- please install librpm-devel])) dnl Checks for library functions. AC_FUNC_STRFTIME @@ -157,40 +129,56 @@ [LIBS="$LIBS -lmysqlclient"], AC_MSG_ERROR(*** libmysqlclient not found)) - echo Enabling SQL support + AC_MSG_RESULT([Enabling SQL support.]) SQL_FLAGS="-DWITH_SQL" SQL_OBJ=sql.o SQL_PROGS=sqltools +else + ac_cv_lib_mysqlclient_mysql_init=no fi AM_CONDITIONAL(WITH_MYSQL, test "${with_sql}" = "yes") AC_SUBST(SQL_FLAGS) AC_SUBST(SQL_PROGS) AC_SUBST(SQL_OBJ) -dnl -dnl Do we plug in the gpg? -dnl +#dnl +#dnl Do we plug in the gpg? +#dnl GPG_FLAGS= GPG_PROG= -AC_ARG_WITH(gpg, [ --with-gpg Add the GPG support (off)]) -if test "x$with_gpg" != "x" ; then - if test "$with_gpg" = "yes" ; then - AC_PATH_PROG(GPG_PROG, gpg, /usr/bin/gpg) +dnl for now, signature resolving code is implemented only with librpmio +dnl so without librpmio it wont work +#if test "$ac_cv_lib_rpmio_Fopen" = "yes" ; then +if test "$ac_cv_header_rpm_rpmio_h" = "yes" ; then + AC_ARG_WITH(gpg, [ --with-gpg=PROG Add the GPG support (off)], + [if test "$withval" != no; then + if test "$withval" != yes; then + AC_CHECK_FILE($withval, GPG_PROG=$withval) + else + AC_PATH_PROG([GPG_PROG], [gpg]) + fi + fi] + ) + + if test -n "$GPG_PROG"; then + GPG_FLAGS="-DWITH_GPG -DGPG_PROG=\\\"$GPG_PROG\\\"" + ac_cv_gpg_support=$withval else - AC_PATH_PROG(GPG_PROG, gpg, "$with_gpg") - fi - - dnl for now, signature resolving code is implemented only with librpmio - dnl so without librpmio it wont work - if "x$USE_RPMIO" != "x1" ; then - AC_MSG_ERROR(*** librpmio not found, use --without-gpg) + ac_cv_gpg_support=no fi - - echo Enabling GPG support - GPG_FLAGS="-DWITH_GPG -DGPG_PROG=\\\"$GPG_PROG\\\"" +else + ac_cv_gpg_support=no fi AC_SUBST(GPG_FLAGS) AC_SUBST(GPG_PROG) +dnl report configuration +AC_MSG_RESULT([ +** Configuration summary for $PACKAGE $VERSION: + + Support for MySQL : $ac_cv_lib_mysqlclient_mysql_init + Support for GPG : $ac_cv_gpg_support +]) + AC_OUTPUT(rpm2html.spec Makefile) diff -Nur rpm2html-1.8.1/html.h rpm2html-1.8.1.new/html.h --- rpm2html-1.8.1/html.h 2000-12-10 21:19:52 +0300 +++ rpm2html-1.8.1.new/html.h 2003-09-15 11:49:29 +0400 @@ -21,6 +21,7 @@ extern rpmDataPtr dumpDirIndex(rpmDirPtr dir, rpmSubdirPtr tree, rpmDataPtr list); extern void dumpIndex(time_t start_time, int installed); +extern void dumpTopIndex(rpmDirPtr *sqlDirList); extern void rpmDumpHtmlRealRoot(rpmDirPtr dir); extern const char *rpmName(rpmDataPtr cur); extern const char *resourceName(const char *resource); diff -Nur rpm2html-1.8.1/Makefile.am rpm2html-1.8.1.new/Makefile.am --- rpm2html-1.8.1/Makefile.am 2002-11-16 14:34:15 +0300 +++ rpm2html-1.8.1.new/Makefile.am 2003-09-17 14:56:36 +0400 @@ -17,15 +17,14 @@ msg.fr msg.es msg.de msg.pl msg.cz dir.gif new.gif \ $(MAKE_FILES) $(CONFIG) $(RDF_FILES) $(FIND_FILES) $(USELESS) -INCLUDES = -I$(top_srcdir) -I$(top_builddir) $(CFLAGS) $(XML_CFLAGS) \ - $(RPM_CFLAGS) $(SQL_FLAGS) +INCLUDES = $(XML_CFLAGS) $(RPM_CFLAGS) $(SQL_FLAGS) $(GPG_FLAGS) noinst_PROGRAMS = compressor compressor_SOURCES = compressor.c compressor_LDFLAGS = -compressor_LDADD = $(LIBS) +compressor_LDADD = -LDADDS = $(XML_LIBS) $(LIBS) +LDADDS = $(XML_LIBS) if WITH_MYSQL bin_PROGRAMS = rpm2html sqltools diff -Nur rpm2html-1.8.1/memory.h rpm2html-1.8.1.new/memory.h --- rpm2html-1.8.1/memory.h 2000-12-18 17:45:51 +0300 +++ rpm2html-1.8.1.new/memory.h 2003-09-15 11:22:45 +0400 @@ -8,7 +8,7 @@ #ifndef _RPM2HTML_DEBUG_MEMORY_ALLOC_ #define _RPM2HTML_DEBUG_MEMORY_ALLOC_ -/* #define NO_DEBUG_MEMORY */ +#define NO_DEBUG_MEMORY #include #include diff -Nur rpm2html-1.8.1/rpm2html.c rpm2html-1.8.1.new/rpm2html.c --- rpm2html-1.8.1/rpm2html.c 2002-11-16 14:34:15 +0300 +++ rpm2html-1.8.1.new/rpm2html.c 2003-09-15 10:42:19 +0400 @@ -80,7 +80,8 @@ } else if (!strcmp(ptr, "dumplang")) { i++; if (i >= argc) break; - writeLanguageFile(ptr); + //writeLanguageFile(ptr); + writeLanguageFile(argv[i]); return(0); } else if (!strcmp(ptr, "nosql")) { rpm2html_no_sql++; diff -Nur rpm2html-1.8.1/rpm2html.h rpm2html-1.8.1.new/rpm2html.h --- rpm2html-1.8.1/rpm2html.h 2001-07-28 20:03:07 +0400 +++ rpm2html-1.8.1.new/rpm2html.h 2003-09-15 10:43:11 +0400 @@ -16,7 +16,7 @@ * General setup default values overriden by config file. */ #define RPM2HTML_NAME "rpm2html" -#define RPM2HTML_VER "1.7" +#define RPM2HTML_VER "1.8.1" #define RPM2HTML_URL "http://rpmfind.net/linux/rpm2html/" #define RPM2HTML_MAINT "Daniel Veillard" #define RPM2HTML_MAIL "daniel@veillard.com" diff -Nur rpm2html-1.8.1/rpmopen.c rpm2html-1.8.1.new/rpmopen.c --- rpm2html-1.8.1/rpmopen.c 2002-12-27 10:44:26 +0300 +++ rpm2html-1.8.1.new/rpmopen.c 2003-09-25 14:13:29 +0400 @@ -25,7 +25,7 @@ #include #include #include -#include +//#include int readLead(FD_t fd, /*@out@*/struct rpmlead *lead); int rpmReadSignature(FD_t fd, /*@out@*/ Header *header, short sig_type); @@ -224,7 +224,7 @@ res++; else return (0); - if ((res - base) > 20) + if ((res - base) > 64) return (0); } return (1); @@ -318,7 +318,8 @@ /* Write out the signature */ sigfile = xmlMalloc(30); strcpy(sigfile, "/tmp/rpm2html.sig.XXXXXX"); - sigfile = mktemp(sigfile); +// sigfile = mktemp(sigfile); + mkstemp(sigfile); sfd = Fopen(sigfile, "w.fdio"); (void) Fwrite(rpm->extra->sigs[sign]->sig, sizeof(char), rpm->extra->sigs[sign]->size, sfd); @@ -994,7 +995,8 @@ #endif /* open the file for reading */ - if (tree->htmlpath[0] != '\0') +// if (tree->htmlpath[0] != '\0') + if ((tree->rpmpath != NULL) && (tree->rpmpath[0] != '\0')) snprintf(buffer, sizeof(buffer), "%s/%s/%s", dir->rpmdir, tree->rpmpath, nameRpm); else @@ -1096,7 +1098,8 @@ /* open temp file for writing */ sigtarget = xmlMalloc(30); strcpy(sigtarget, "/tmp/rpm2html.date.XXXXXX"); - sigtarget = mktemp(sigtarget); +// sigtarget = mktemp(sigtarget); + mkstemp(sigtarget); ofd = Fopen(sigtarget, "w.ufdio"); if (ofd == NULL || Ferror(ofd)) { fprintf(stderr, "Fopen of %s failed: %s\n", sigtarget, diff -Nur rpm2html-1.8.1/search.php rpm2html-1.8.1.new/search.php --- rpm2html-1.8.1/search.php 2002-12-27 10:44:26 +0300 +++ rpm2html-1.8.1.new/search.php 2003-09-25 09:20:31 +0400 @@ -21,20 +21,21 @@ echo "Search the RPM repository on $host"; } ?> - + - +
- - - - - - + + + + + + - + +
Indexindex by Groupindex by Distributionindex by Vendorindex by creation dateindex by NameIndexindex by Groupindex by Distributionindex by Vendorindex by creation dateindex by Name MirrorsHelpHelpSearch
0) { printf("

Found %d RPM for ", $j); - echo "$origquery\n

"; + echo "$origquery\n"; - printf("\n"); - printf("\n"); + echo("
PackageSummaryDistributionDownload
\n"); + echo("\t\n"); $prevname=""; for ($i = $j - 1; $i >= 0; $i--) { @@ -321,11 +375,12 @@ if ($prevname != $name) { if ($prevname != "") - echo "
PackageSummaryDistributionDownload

"; +// echo "

"; + echo "\n"; $prevname = $name; } - echo ""; + echo "\n"; if (($subdir) && ($directory) && (!$html)) { $rpmsubdir = substr($path, strlen($directory)); $pos = strpos($rpmsubdir, "$name-$version-$release"); @@ -333,19 +388,19 @@ $pos = strpos($rpmsubdir, "$name"); } if ($pos == false) { - echo ""; + echo "\t\n"; } else { $rpmsubdir = substr($rpmsubdir, 0, $pos); - $url = "/linux/RPM/$subdir/$rpmsubdir/$name-$version-$release.$arch.html"; + $url = "$subdir/$rpmsubdir/$name-$version-$release.$arch.html"; $url = str_replace('///', '/', $url); $url = str_replace('//', '/', $url); - echo ""; + echo "\t\n"; } } else { - echo ""; + echo "\t\n"; } - echo ""; - echo ""; + echo "\t\n"; + echo "\t\n"; $url = strstr($path, '/linux'); if (!$url) $url = strstr($path, '/pub'); @@ -354,15 +409,15 @@ $url = str_replace('///', '/', $url); $url = str_replace('//', '/', $url); if ($host == "rpmfind.net") { - echo ""; + echo "\t\n"; } else if ($host == "www.rpmfind.net") { - echo ""; + echo "\t\n"; } else { - echo ""; + echo "\t\n"; } } else - echo ""; - echo ""; + echo "\t\n"; + echo "\n"; } printf("
 
 $name-$version-$release.$arch.html$name-$version-$release.$arch.html $summary$dist$summary$dist$name-$version-$release.$arch.rpm$name-$version-$release.$arch.rpm$name-$version-$release.$arch.rpm$name-$version-$release.$arch.rpm$name-$version-$release.$arch.rpm$name-$version-$release.$arch.rpm$name-$version-$release.$arch.rpm
$name-$version-$release.$arch.rpm
\n"); @@ -392,7 +447,7 @@ } ?>
-

Generated by rpm2html 1.6 +

Generated by rpm2html 1.8.1

Daniel Veillard diff -Nur rpm2html-1.8.1/sql.c rpm2html-1.8.1.new/sql.c --- rpm2html-1.8.1/sql.c 2002-02-17 02:34:35 +0300 +++ rpm2html-1.8.1.new/sql.c 2003-09-17 08:49:25 +0400 @@ -80,6 +80,8 @@ base = "rpmfind"; if (passwd == NULL) passwd = getenv("MySQL_PASS"); + if (passwd == NULL) + passwd = ""; if (user == NULL) user = getenv("MySQL_USER"); if (user == NULL) @@ -833,8 +835,8 @@ URLSrc varchar(255), \n\ Html varchar(8), \n\ Color varchar(10), \n\ - Key1 text, \n\ - Key2 text, \n\ + FollowSymLinks text, \n\ + RpmSymLinks text, \n\ Description text, \n\ PRIMARY KEY (ID), \n\ KEY Name (Name(10)) \n\ @@ -1232,7 +1234,7 @@ char query[MAX_QUERY]; int left = MAX_QUERY - 1; int len; - char *end; +// char *end; static int queries = 0; if (filename == NULL) @@ -1290,13 +1292,13 @@ } int sql_get_top_queries(int count) { - int id; +// int id; MYSQL_RES *result; MYSQL_ROW row; char query[MAX_QUERY]; int left = MAX_QUERY - 1; int len; - char *end; +// char *end; static int queries = 0; if (count <= 0) @@ -2750,7 +2752,7 @@ for (i = 0;i < index;i++) { snprintf(query, SMALL_QUERY - 1, - "SELECT Directory,Name,Vendor,Path,URL,URLSrc,Description,Html,Color \ + "SELECT Directory,Name,Vendor,Path,URL,URLSrc,Description,Html,Color,FollowSymLinks,RpmSymLinks \ FROM Distribs WHERE ID=%d", ids[i]); query[SMALL_QUERY - 1] = 0; if (mysql_query(sql,query)) { @@ -2778,6 +2780,10 @@ printf("html=%s\n", row[7]); if (row[8] != NULL) printf("color=%s\n", row[8]); + if (row[9] != NULL) + printf("followsymlinks=%s\n", row[9]); + if (row[10] != NULL) + printf("rpmsymlinks=%s\n", row[10]); } } mysql_free_result(result); @@ -3320,7 +3326,7 @@ if (!strcasecmp(name, "mirror")) { sql_add_metadata_base(value); } else { - printf("Config file : %s entry for [metadata] ignored\n", name); + printf("Config SQL : %s entry for [metadata] ignored\n", name); } return; } @@ -3373,6 +3379,20 @@ else fprintf(stderr, "database has no distrib: %s", rpmdir); + } else if (!strcasecmp(name, "followsymlinks")) { + distrib = sql_read_info_key("Distribs", "Directory", rpmdir); + if (distrib > 0) + sql_update_id("Distribs", distrib, "FollowSymLinks", value); + else + fprintf(stderr, "database has no distrib: %s", + rpmdir); + } else if (!strcasecmp(name, "rpmsymlinks")) { + distrib = sql_read_info_key("Distribs", "Directory", rpmdir); + if (distrib > 0) + sql_update_id("Distribs", distrib, "RpmSymLinks", value); + else + fprintf(stderr, "database has no distrib: %s", + rpmdir); } else if (!strcasecmp(name, "mirror")) { distrib = sql_read_info_key("Distribs", "Directory", rpmdir); if (distrib > 0) @@ -3381,7 +3401,7 @@ fprintf(stderr, "database has no distrib: %s", rpmdir); } else { - printf("Config file : %s entry for [%s] ignored\n", name, rpmdir); + printf("Config SQL : %s entry for [%s] ignored\n", name, rpmdir); } }