SOURCES: rpm-no-neon.patch (NEW) - kill neon dependency, also kill...
baggins
baggins at pld-linux.org
Sun Jun 19 20:59:24 CEST 2005
Author: baggins Date: Sun Jun 19 18:59:24 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- kill neon dependency, also kills WebDAV/HTTP support
---- Files affected:
SOURCES:
rpm-no-neon.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/rpm-no-neon.patch
diff -u /dev/null SOURCES/rpm-no-neon.patch:1.1
--- /dev/null Sun Jun 19 20:59:24 2005
+++ SOURCES/rpm-no-neon.patch Sun Jun 19 20:59:19 2005
@@ -0,0 +1,2296 @@
+diff -ur rpm-4.4.1/configure.ac rpm-4.4.1-no-neon/configure.ac
+--- rpm-4.4.1/configure.ac 2005-06-19 20:37:35.675035608 +0200
++++ rpm-4.4.1-no-neon/configure.ac 2005-06-19 20:34:07.022755576 +0200
+@@ -448,26 +448,6 @@
+ WITH_NEON_SUBDIR=
+ WITH_NEON_INCLUDE=
+ WITH_NEON_LIB=
+-AC_CHECK_HEADER([neon/ne_session.h], [
+- AC_CHECK_LIB(neon, ne_session_create, [
+- AC_DEFINE(HAVE_LIBNEON, 1, [Define to 1 if you have the `neon' library (-lneon).])
+- AC_CHECK_LIB(neon, ne_get_response_header, [
+- AC_DEFINE(HAVE_NEON_NE_GET_RESPONSE_HEADER, 1, [Define to 1 if you have ne_get_response_header() in libneon.])
+- ])
+- AC_CHECK_LIB(neon, ne_send_request_chunk, [
+- AC_DEFINE(HAVE_NEON_NE_SEND_REQUEST_CHUNK, 1, [Define to 1 if you have ne_send_request_chunk() in libneon.])
+- ])
+- WITH_NEON_INCLUDE="-I${includedir}/neon"
+- WITH_NEON_LIB="-lneon"
+- ])
+- ], [
+- if test -d neon ; then
+- AC_DEFINE(HAVE_LIBNEON, 1, [Define to 1 if you have the `neon' library (-lneon).])
+- WITH_NEON_SUBDIR=neon
+- WITH_NEON_INCLUDE="-I\${top_srcdir}/${WITH_NEON_SUBDIR}/src"
+- WITH_NEON_LIB="\${top_builddir}/${WITH_NEON_SUBDIR}/src/libneon.la"
+- fi
+-])
+ AC_SUBST(WITH_NEON_SUBDIR)
+ AC_SUBST(WITH_NEON_INCLUDE)
+ AC_SUBST(WITH_NEON_LIB)
+diff -ur rpm-4.4.1/rpmio/Makefile.am rpm-4.4.1-no-neon/rpmio/Makefile.am
+--- rpm-4.4.1/rpmio/Makefile.am 2005-06-19 20:37:35.322089264 +0200
++++ rpm-4.4.1-no-neon/rpmio/Makefile.am 2005-06-19 20:34:06.996759528 +0200
+@@ -37,7 +37,7 @@
+ @WITH_LUA_LIB@ \
+ $(top_builddir)/file/src/libmagic.la \
+ @WITH_ZLIB_LIB@ \
+- -lneon -lpthread -lhome_etc
++ -lpthread -lhome_etc
+ librpmio_la_LIBADD = # $(BEECRYPTLOBJS)
+ librpmio_la_DEPENDENCIES = # .created
+
+diff -ur rpm-4.4.1/rpmio/rpmdav.c rpm-4.4.1-no-neon/rpmio/rpmdav.c
+--- rpm-4.4.1/rpmio/rpmdav.c 2005-01-17 19:46:27.000000000 +0100
++++ rpm-4.4.1-no-neon/rpmio/rpmdav.c 2005-06-19 20:35:12.340825720 +0200
+@@ -9,17 +9,6 @@
+ #include <pthread.h>
+ #endif
+
+-#include <neon/ne_alloc.h>
+-#include <neon/ne_auth.h>
+-#include <neon/ne_basic.h>
+-#include <neon/ne_dates.h>
+-#include <neon/ne_locks.h>
+-#include <neon/ne_props.h>
+-#include <neon/ne_request.h>
+-#include <neon/ne_socket.h>
+-#include <neon/ne_string.h>
+-#include <neon/ne_utils.h>
+-
+ #include <rpmio_internal.h>
+
+ #define _RPMDAV_INTERNAL
+@@ -55,1304 +44,6 @@
+ }
+
+ /* =============================================================== */
+-static int davFree(urlinfo u)
+- /*@globals internalState @*/
+- /*@modifies u, internalState @*/
+-{
+- if (u != NULL && u->sess != NULL) {
+- u->capabilities = _free(u->capabilities);
+- if (u->lockstore != NULL)
+- ne_lockstore_destroy(u->lockstore);
+- u->lockstore = NULL;
+- ne_session_destroy(u->sess);
+- u->sess = NULL;
+- }
+- return 0;
+-}
+-
+-static void davProgress(void * userdata, off_t current, off_t total)
+- /*@*/
+-{
+- urlinfo u = userdata;
+- ne_session * sess;
+-
+-assert(u != NULL);
+- sess = u->sess;
+-assert(sess != NULL);
+-assert(u == ne_get_session_private(sess, "urlinfo"));
+-
+- u->current = current;
+- u->total = total;
+-
+-if (_dav_debug < 0)
+-fprintf(stderr, "*** davProgress(%p,0x%x:0x%x) sess %p u %p\n", userdata, (unsigned int)current, (unsigned int)total, sess, u);
+-}
+-
+-static void davNotify(void * userdata,
+- ne_conn_status connstatus, const char * info)
+- /*@*/
+-{
+- urlinfo u = userdata;
+- ne_session * sess;
+- /*@observer@*/
+- static const char * connstates[] = {
+- "namelookup",
+- "connecting",
+- "connected",
+- "secure",
+- "unknown"
+- };
+-
+-assert(u != NULL);
+- sess = u->sess;
+-assert(sess != NULL);
+-assert(u == ne_get_session_private(sess, "urlinfo"));
+-
+-#ifdef REFERENCE
+-typedef enum {
+- ne_conn_namelookup, /* lookup up hostname (info = hostname) */
+- ne_conn_connecting, /* connecting to host (info = hostname) */
+- ne_conn_connected, /* connected to host (info = hostname) */
+- ne_conn_secure /* connection now secure (info = crypto level) */
+-} ne_conn_status;
+-#endif
+-
+- u->connstatus = connstatus;
+-
+-/*@-boundsread@*/
+-if (_dav_debug < 0)
+-fprintf(stderr, "*** davNotify(%p,%d,%p) sess %p u %p %s\n", userdata, connstatus, info, sess, u, connstates[ (connstatus < 4 ? connstatus : 4)]);
+-/*@=boundsread@*/
+-
+-}
+-
+-static void davCreateRequest(ne_request * req, void * userdata,
+- const char * method, const char * uri)
+- /*@*/
+-{
+- urlinfo u = userdata;
+- ne_session * sess;
+- void * private = NULL;
+- const char * id = "urlinfo";
+-
+-assert(u != NULL);
+-assert(u->sess != NULL);
+-assert(req != NULL);
+- sess = ne_get_session(req);
+-assert(sess == u->sess);
+-assert(u == ne_get_session_private(sess, "urlinfo"));
+-
+-assert(sess != NULL);
+- private = ne_get_session_private(sess, id);
+-assert(u == private);
+-
+-if (_dav_debug < 0)
+-fprintf(stderr, "*** davCreateRequest(%p,%p,%s,%s) %s:%p\n", req, userdata, method, uri, id, private);
+-}
+-
+-static void davPreSend(ne_request * req, void * userdata, ne_buffer * buf)
+-{
+- urlinfo u = userdata;
+- ne_session * sess;
+- const char * id = "fd";
+- FD_t fd = NULL;
+-
+-assert(u != NULL);
+-assert(u->sess != NULL);
+-assert(req != NULL);
+- sess = ne_get_session(req);
+-assert(sess == u->sess);
+-assert(u == ne_get_session_private(sess, "urlinfo"));
+-
+- fd = ne_get_request_private(req, id);
+-
+-if (_dav_debug < 0)
+-fprintf(stderr, "*** davPreSend(%p,%p,%p) sess %p %s %p\n", req, userdata, buf, sess, id, fd);
+-if (_dav_debug)
+-fprintf(stderr, "-> %s\n", buf->data);
+-
+-}
+-
+-static int davPostSend(ne_request * req, void * userdata, const ne_status * status)
+- /*@*/
+-{
+- urlinfo u = userdata;
+- ne_session * sess;
+- const char * id = "fd";
+- FD_t fd = NULL;
+-
+-assert(u != NULL);
+-assert(u->sess != NULL);
+-assert(req != NULL);
+- sess = ne_get_session(req);
+-assert(sess == u->sess);
+-assert(u == ne_get_session_private(sess, "urlinfo"));
+-
+- fd = ne_get_request_private(req, id);
+-
+-/*@-evalorder@*/
+-if (_dav_debug < 0)
+-fprintf(stderr, "*** davPostSend(%p,%p,%p) sess %p %s %p %s\n", req, userdata, status, sess, id, fd, ne_get_error(sess));
+-/*@=evalorder@*/
+- return NE_OK;
+-}
+-
+-static void davDestroyRequest(ne_request * req, void * userdata)
+- /*@*/
+-{
+- urlinfo u = userdata;
+- ne_session * sess;
+- const char * id = "fd";
+- FD_t fd = NULL;
+-
+-assert(u != NULL);
+-assert(u->sess != NULL);
+-assert(req != NULL);
+- sess = ne_get_session(req);
+-assert(sess == u->sess);
+-assert(u == ne_get_session_private(sess, "urlinfo"));
+-
+- fd = ne_get_request_private(req, id);
+-
+-if (_dav_debug < 0)
+-fprintf(stderr, "*** davDestroyRequest(%p,%p) sess %p %s %p\n", req, userdata, sess, id, fd);
+-}
+-
+-static void davDestroySession(void * userdata)
+- /*@*/
+-{
+- urlinfo u = userdata;
+- ne_session * sess;
+- void * private = NULL;
+- const char * id = "urlinfo";
+-
+-assert(u != NULL);
+-assert(u->sess != NULL);
+- sess = u->sess;
+-assert(u == ne_get_session_private(sess, "urlinfo"));
+-
+-assert(sess != NULL);
+- private = ne_get_session_private(sess, id);
+-assert(u == private);
+-
+-if (_dav_debug < 0)
+-fprintf(stderr, "*** davDestroySession(%p) sess %p %s %p\n", userdata, sess, id, private);
+-}
+-
+-static int
+-davVerifyCert(void *userdata, int failures, const ne_ssl_certificate *cert)
+- /*@*/
+-{
+- const char *hostname = userdata;
+-
+-if (_dav_debug < 0)
+-fprintf(stderr, "*** davVerifyCert(%p,%d,%p) %s\n", userdata, failures, cert, hostname);
+-
+- return 0; /* HACK: trust all server certificates. */
+-}
+-
+-static int davConnect(urlinfo u)
+- /*@globals internalState @*/
+- /*@modifies u, internalState @*/
+-{
+- const char * path = NULL;
+- int rc;
+-
+- /* HACK: hkp:// has no steenkin' options */
+- if (!(u->urltype == URL_IS_HTTP || u->urltype == URL_IS_HTTPS))
+- return 0;
+-
+- /* HACK: where should server capabilities be read? */
+- (void) urlPath(u->url, &path);
+- /* HACK: perhaps capture Allow: tag, look for PUT permitted. */
+- rc = ne_options(u->sess, path, u->capabilities);
+- switch (rc) {
+- case NE_OK:
+- break;
+- case NE_ERROR:
+- /* HACK: "301 Moved Permanently" on empty subdir. */
+- if (!strncmp("301 ", ne_get_error(u->sess), sizeof("301 ")-1))
+- break;
+- /*@fallthrough@*/
+- case NE_CONNECT:
+- case NE_LOOKUP:
+- default:
+-if (_dav_debug)
+-fprintf(stderr, "*** Connect to %s:%d failed(%d):\n\t%s\n",
+- u->host, u->port, rc, ne_get_error(u->sess));
+- break;
+- }
+-
+- /* HACK: sensitive to error returns? */
+- u->httpVersion = (ne_version_pre_http11(u->sess) ? 0 : 1);
+-
+- return rc;
+-}
+-
+-static int davInit(const char * url, urlinfo * uret)
+- /*@globals internalState @*/
+- /*@modifies *uret, internalState @*/
+-{
+- urlinfo u = NULL;
+- int rc = 0;
+-
+-/*@-globs@*/ /* FIX: h_errno annoyance. */
+- if (urlSplit(url, &u))
+- return -1; /* XXX error returns needed. */
+-/*@=globs@*/
+-
+- if (u->url != NULL && u->sess == NULL)
+- switch (u->urltype) {
+- default:
+- assert(u->urltype != u->urltype);
+- /*@notreached@*/ break;
+- case URL_IS_HTTPS:
+- case URL_IS_HTTP:
+- case URL_IS_HKP:
+- { ne_server_capabilities * capabilities;
+-
+- /* HACK: oneshots should be done Somewhere Else Instead. */
+-/*@-noeffect@*/
+- rc = ((_dav_debug < 0) ? NE_DBG_HTTP : 0);
+- ne_debug_init(stderr, rc); /* XXX oneshot? */
+-/*@=noeffect@*/
+- rc = ne_sock_init(); /* XXX oneshot? */
+-
+- u->lockstore = ne_lockstore_create(); /* XXX oneshot? */
+-
+- u->capabilities = capabilities = xcalloc(1, sizeof(*capabilities));
+- u->sess = ne_session_create(u->scheme, u->host, u->port);
+-
+- ne_lockstore_register(u->lockstore, u->sess);
+-
+- if (u->proxyh != NULL)
+- ne_session_proxy(u->sess, u->proxyh, u->proxyp);
+-
+-#if 0
+- { const ne_inet_addr ** addrs;
+- unsigned int n;
+- ne_set_addrlist(u->sess, addrs, n);
+- }
+-#endif
+-
+- ne_set_progress(u->sess, davProgress, u);
+- ne_set_status(u->sess, davNotify, u);
+-
+- ne_set_persist(u->sess, 1);
+- ne_set_read_timeout(u->sess, httpTimeoutSecs);
+- ne_set_useragent(u->sess, PACKAGE "/" PACKAGE_VERSION);
+-
+- /* XXX check that neon is ssl enabled. */
+- if (!strcasecmp(u->scheme, "https"))
+- ne_ssl_set_verify(u->sess, davVerifyCert, (char *)u->host);
+-
+- ne_set_session_private(u->sess, "urlinfo", u);
+-
+- ne_hook_destroy_session(u->sess, davDestroySession, u);
+-
+- ne_hook_create_request(u->sess, davCreateRequest, u);
+- ne_hook_pre_send(u->sess, davPreSend, u);
+- ne_hook_post_send(u->sess, davPostSend, u);
+- ne_hook_destroy_request(u->sess, davDestroyRequest, u);
+-
+- /* HACK: where should server capabilities be read? */
+- rc = davConnect(u);
+- if (rc)
+- goto exit;
+- } break;
+- }
+-
+-exit:
+-/*@-boundswrite@*/
+- if (rc == 0 && uret != NULL)
+- *uret = urlLink(u, __FUNCTION__);
+-/*@=boundswrite@*/
+- u = urlFree(u, "urlSplit (davInit)");
+-
+- return rc;
+-}
+-
+-/* =============================================================== */
+-enum fetch_rtype_e {
+- resr_normal = 0,
+- resr_collection,
+- resr_reference,
+- resr_error
+-};
+-
+-struct fetch_resource_s {
+- struct fetch_resource_s *next;
+- char *uri;
+-/*@unused@*/
+- char *displayname;
+- enum fetch_rtype_e type;
+- size_t size;
+- time_t modtime;
+- int is_executable;
+- int is_vcr; /* Is version resource. 0: no vcr, 1 checkin 2 checkout */
+- char *error_reason; /* error string returned for this resource */
+- int error_status; /* error status returned for this resource */
+-};
+-
+-/*@null@*/
+-static void *fetch_destroy_item(/*@only@*/ struct fetch_resource_s *res)
+- /*@modifies res @*/
+-{
+- NE_FREE(res->uri);
+- NE_FREE(res->error_reason);
+- res = _free(res);
+- return NULL;
+-}
+-
+-#ifdef UNUSED
+-/*@null@*/
+-static void *fetch_destroy_list(/*@only@*/ struct fetch_resource_s *res)
+- /*@modifies res @*/
+-{
+- struct fetch_resource_s *next;
+-/*@-branchstate@*/
+- for (; res != NULL; res = next) {
+- next = res->next;
+- res = fetch_destroy_item(res);
+- }
+-/*@=branchstate@*/
+- return NULL;
+-}
+-#endif
+-
+-static void *fetch_create_item(/*@unused@*/ void *userdata, /*@unused@*/ const char *uri)
+- /*@*/
+-{
+- struct fetch_resource_s * res = ne_calloc(sizeof(*res));
+- return res;
+-}
+-
+-/* =============================================================== */
+-struct fetch_context_s {
+-/*@relnull@*/
+- struct fetch_resource_s **resrock;
+- const char *uri;
+- unsigned int include_target; /* Include resource at href */
+-/*@refcounted@*/
+- urlinfo u;
+- int ac;
+- int nalloced;
+- ARGV_t av;
+- mode_t * modes;
+- size_t * sizes;
+- time_t * mtimes;
+-};
+-
+-/*@null@*/
+-static void *fetch_destroy_context(/*@only@*/ /*@null@*/ struct fetch_context_s *ctx)
+- /*@globals internalState @*/
+- /*@modifies ctx, internalState @*/
+-{
+- if (ctx == NULL)
+- return NULL;
+- if (ctx->av != NULL)
+- ctx->av = argvFree(ctx->av);
+- ctx->modes = _free(ctx->modes);
+- ctx->sizes = _free(ctx->sizes);
+- ctx->mtimes = _free(ctx->mtimes);
+- ctx->u = urlFree(ctx->u, __FUNCTION__);
+- ctx->uri = _free(ctx->uri);
+-/*@-boundswrite@*/
+- memset(ctx, 0, sizeof(*ctx));
+-/*@=boundswrite@*/
+- ctx = _free(ctx);
+- return NULL;
+-}
+-
+-/*@null@*/
+-static void *fetch_create_context(const char *uri)
+- /*@globals internalState @*/
+- /*@modifies internalState @*/
+-{
+- struct fetch_context_s * ctx;
+- urlinfo u;
+-
+-/*@-globs@*/ /* FIX: h_errno annoyance. */
+- if (urlSplit(uri, &u))
+- return NULL;
+-/*@=globs@*/
+-
+- ctx = ne_calloc(sizeof(*ctx));
+- ctx->uri = xstrdup(uri);
+- ctx->u = urlLink(u, __FUNCTION__);
+- return ctx;
+-}
+-
+-/*@unchecked@*/ /*@observer@*/
+-static const ne_propname fetch_props[] = {
+- { "DAV:", "getcontentlength" },
+- { "DAV:", "getlastmodified" },
+- { "http://apache.org/dav/props/", "executable" },
+- { "DAV:", "resourcetype" },
+- { "DAV:", "checked-in" },
+- { "DAV:", "checked-out" },
+- { NULL, NULL }
+-};
+-
+-#define ELM_resourcetype (NE_PROPS_STATE_TOP + 1)
+-#define ELM_collection (NE_PROPS_STATE_TOP + 2)
+-
+-/*@unchecked@*/ /*@observer@*/
+-static const struct ne_xml_idmap fetch_idmap[] = {
+- { "DAV:", "resourcetype", ELM_resourcetype },
+- { "DAV:", "collection", ELM_collection }
+-};
+-
+-static int fetch_startelm(void *userdata, int parent,
+- const char *nspace, const char *name,
+- /*@unused@*/ const char **atts)
+- /*@*/
+-{
+- ne_propfind_handler *pfh = userdata;
+- struct fetch_resource_s *r = ne_propfind_current_private(pfh);
+- int state = ne_xml_mapid(fetch_idmap, NE_XML_MAPLEN(fetch_idmap),
+- nspace, name);
+-
+- if (r == NULL ||
+- !((parent == NE_207_STATE_PROP && state == ELM_resourcetype) ||
+- (parent == ELM_resourcetype && state == ELM_collection)))
+- return NE_XML_DECLINE;
+-
+- if (state == ELM_collection) {
+- r->type = resr_collection;
+- }
+-
+- return state;
+-}
+-
+-static int fetch_compare(const struct fetch_resource_s *r1,
+- const struct fetch_resource_s *r2)
+- /*@*/
+-{
+- /* Sort errors first, then collections, then alphabetically */
+- if (r1->type == resr_error) {
+- return -1;
+- } else if (r2->type == resr_error) {
+- return 1;
+- } else if (r1->type == resr_collection) {
+- if (r2->type != resr_collection) {
+- return -1;
+- } else {
+- return strcmp(r1->uri, r2->uri);
+- }
+- } else {
+- if (r2->type != resr_collection) {
+- return strcmp(r1->uri, r2->uri);
+- } else {
+- return 1;
+- }
+- }
+-}
+-
+-static void fetch_results(void *userdata, const char *uri,
+- const ne_prop_result_set *set)
+- /*@*/
+-{
+- struct fetch_context_s *ctx = userdata;
+- struct fetch_resource_s *current, *previous, *newres;
+- const char *clength, *modtime, *isexec;
+- const char *checkin, *checkout;
+- const ne_status *status = NULL;
+- const char * path = NULL;
+-
+- (void) urlPath(uri, &path);
+- if (path == NULL)
+- return;
+-
+- newres = ne_propset_private(set);
+-
+-if (_dav_debug < 0)
+-fprintf(stderr, "==> %s in uri %s\n", path, ctx->uri);
+-
+- if (ne_path_compare(ctx->uri, path) == 0 && !ctx->include_target) {
+- /* This is the target URI */
+-if (_dav_debug < 0)
+-fprintf(stderr, "==> %s skipping target resource.\n", path);
+- /* Free the private structure. */
+- free(newres);
+- return;
+- }
+-
+- newres->uri = ne_strdup(path);
<<Diff was trimmed, longer than 597 lines>>
More information about the pld-cvs-commit
mailing list