[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Freeze exception for yaz and idzebra



  Hi,

  When I introduced yaz and idzebra to Debian, it was because they are
dependencies of a big great free software to manage collections: Koha
http://koha-community.org/
  There is an ITP for Koha itself, but the complexity of its installation
makes that an official Debian package is not yet ready (it is however in
progress and upstream is actively working to reach this goal).
  Nevertheless, it is a good thing that Koha dependencies (mainly idzebra,
yaz and lots of perl packages) are packaged in Debian stable.

  Yaz recently has an SONAME dump (libyaz3 ->  libyaz4) that is already in
testing. However, there are still bugs (in yaz and idzebra because the later
use lots of yaz features: they are developed by the same upstream "Indexdata").
  Version currently in testing (yaz 4.0.10-1 and idzebra 2.0.43-2) have
bugs that prevent them to work with Koha (see #591307).

  So, I request a freeze exception for yaz 4.0.11-1 and idzebra 2.0.44-1.
Note that this is not the latest upstream release (yaz 4.0.12 exists) but
it is enough to fix the segfaults. There are changes that are too big in
yaz 4.0.12 for a freeze time. You can see in #591307 that users verified
that the segfault has gone.
  The diffstat between raw sources packages are very big. However, this
is mainly due to change in documentation and updated copyright statements.

For yaz, between 4.0.10-1 and 4.0.11-1:
diffstat diff-yaz | tail -1
 64 files changed, 3388 insertions(+), 246 deletions(-)
But trimming the documentation change (and the big upstream doc/NEWS file
that has been added in this release) leads to this patch:
vdanjean@eyak:/tmp/yaz$ diffstat diff-yaz-code
 client/client.c         |   23 ++++++++++--
 configure.ac            |    2 -
 debian/changelog        |    9 ++++
 debian/control          |    4 +-
 debian/libyaz4.symbols  |    4 ++
 debian/rules            |   11 +++--
 include/yaz/Makefile.am |    3 +
 include/yaz/oid_std.h   |    1
 include/yaz/z-facet-1.h |   49 +++++++++++++++++++++++++
 src/Makefile.am         |   11 ++++-
 src/cclfind.c           |   25 ++-----------
 src/cclp.h              |    2 +
 src/ccltoken.c          |   91 +++++++++++++++++++++++++++---------------------
 src/facet.asn           |   21 +++++++++++
 src/grs1disp.c          |    2 -
 src/oid.csv             |    1
 src/oid_std.c           |    2 +
 src/z-facet-1.c         |   44 +++++++++++++++++++++++
 src/z.tcl               |    3 +
 src/zoom-c.c            |   27 ++++++++++++--
 test/test_ccl.c         |    8 ----
 win/yaz.nsi             |    2 -
 ztest/gfs-example.c     |   18 ++++++---
 ztest/ztest.c           |   12 ++++--
 24 files changed, 281 insertions(+), 94 deletions(-)

Upstream NEWS file shows us bugs that have been fixed:
> --- 4.0.11 2010/07/09
>
> CCL fixes: bug 2895 and bug 3539.
>
> GR1-display: add comma in display - was removed by mistake in
> version 4.0.0.
>
> Windows installer: bundle MSVCP90.dll - used by icuuc42.dll.
>
> SRU: Merge cookies on HTTP redirects (Giannis Kosmas <kosmas@lib.uoc.gr>).

I attached this diff to this mail.


  About idzebra, here again the numbers seem big if we look at
a raw diffstat between 2.0.43-2 and 2.0.44-1:
vdanjean@eyak:/tmp/idzebra$ diffstat diff-idzebra-before-clean | tail -1
 364 files changed, 4229 insertions(+), 1063 deletions(-)
However, removing documentation fix and copyright update from the
patch leads to this:
vdanjean@eyak:/tmp/idzebra$ diffstat diff-idzebra-code
 Makefile.am                 |    2 +-
 configure.ac                |    2 +-
 data1/d1_expout.c           |   20 ++++++++------------
 data1/d1_grs.c              |   15 +++++----------
 data1/d1_handle.c           |   19 +++++++++++--------
 data1/d1_marc.c             |    2 +-
 debian/changelog            |    9 +++++++++
 debian/control              |    2 +-
 debian/rules                |   18 +++++++++++++-----
 index/recgrs.c              |   18 ++++++++++++------
 index/rpnsearch.c           |    4 ++--
 index/zebrasrv.c            |    9 +++++----
 m4/yaz.m4                   |    3 ---
 rset/rsmultiandor.c         |    9 ++++++---
 test/api/test_result_sets.c |    2 +-
 util/zebramap.c             |   10 ++++++----
 16 files changed, 82 insertions(+), 62 deletions(-)
with this upstream changelog:
> --- 2.0.44 2010/06/29
>
> grs1: avoid term_len < 0 for .abs operator 'range'
>
> ICU: fix use of un-init variable.
>
> More reasonable approx hits for truncated searches.
>
> Updates WRT Odr_int (YAZ 4).

And, here again, the real changes are small enough to look at them and
they seem ok for me (this diff also attached).


  So, do you accept a freeze exception for these too packages?
If you want to look at them, they are available on my private repo
(see my signature)

  Regards,
    Vincent

-- 
Vincent Danjean       GPG key ID 0x9D025E87         vdanjean@debian.org
GPG key fingerprint: FC95 08A6 854D DB48 4B9A  8A94 0BF7 7867 9D02 5E87
Unofficial packages: http://moais.imag.fr/membres/vincent.danjean/deb.html
APT repo:  deb http://people.debian.org/~vdanjean/debian unstable main

diff -Naur yaz-4.0.10/client/client.c yaz-4.0.11/client/client.c
--- yaz-4.0.10/client/client.c	2010-04-28 13:43:49.000000000 +0200
+++ yaz-4.0.11/client/client.c	2010-07-09 16:39:13.000000000 +0200
@@ -1280,6 +1280,8 @@
     const char *username = 0;
     const char *password = 0;
     struct Z_HTTP_Header *h;
+    char *combined_cookies;
+    int combined_cookies_len = 0;
     Z_GDU *gdu = get_HTTP_Request_url(out, uri);
 
     gdu->u.HTTP_Request->method = odr_strdup(out, "GET");
@@ -1288,9 +1290,24 @@
     
     for (h = cookie_hres->headers; h; h = h->next)
     {
-        if (!strcmp(h->name, "Set-Cookie"))
-            z_HTTP_header_add(out, &gdu->u.HTTP_Request->headers,
-                              "Cookie", h->value);
+        if (!strcmp(h->name, "Set-Cookie")) {
+            char *cp;
+
+            if (!(cp = strchr(h->value, ';')))
+                cp = h->value + strlen(h->value);
+            if (cp - h->value >= 1) {
+                combined_cookies = xrealloc(combined_cookies, combined_cookies_len + cp - h->value + 3);
+                memcpy(combined_cookies+combined_cookies_len, h->value, cp - h->value);
+                combined_cookies[combined_cookies_len + cp - h->value] = '\0';
+                strcat(combined_cookies,"; ");
+                combined_cookies_len = strlen(combined_cookies);
+            }
+        }
+    }
+    if (combined_cookies_len)
+    {
+        z_HTTP_header_add(out, &gdu->u.HTTP_Request->headers, "Cookie", combined_cookies);
+        xfree(combined_cookies);
     }
 
     if (auth)
diff -Naur yaz-4.0.10/configure.ac yaz-4.0.11/configure.ac
--- yaz-4.0.10/configure.ac	2010-06-18 10:50:36.000000000 +0200
+++ yaz-4.0.11/configure.ac	2010-07-09 16:44:24.000000000 +0200
@@ -1,7 +1,7 @@
 dnl This file is part of the YAZ toolkit.
 dnl Copyright (C) 1995-2010 Index Data
 AC_PREREQ([2.60])
-AC_INIT([yaz],[4.0.10],[yaz-help@indexdata.dk])
+AC_INIT([yaz],[4.0.11],[yaz-help@indexdata.dk])
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_AUX_DIR([config])
 AM_INIT_AUTOMAKE([1.9])
diff -Naur yaz-4.0.10/debian/changelog yaz-4.0.11/debian/changelog
--- yaz-4.0.10/debian/changelog	2010-06-23 13:13:59.000000000 +0200
+++ yaz-4.0.11/debian/changelog	2010-08-18 11:19:49.000000000 +0200
@@ -1,3 +1,12 @@
+yaz (4.0.11-1) unstable; urgency=low
+
+  * New Upstream Version
+    Fix many bugs
+  * Dump Standard-Version to 3.9.1 (no change needed)
+  * Remplace versionned conflicts with breaks
+
+ -- Vincent Danjean <vdanjean@debian.org>  Sun, 08 Aug 2010 18:49:07 +0200
+
 yaz (4.0.10-1) unstable; urgency=low
 
   * New Upstream Version
diff -Naur yaz-4.0.10/debian/control yaz-4.0.11/debian/control
--- yaz-4.0.10/debian/control	2010-06-23 13:13:59.000000000 +0200
+++ yaz-4.0.11/debian/control	2010-08-18 11:19:49.000000000 +0200
@@ -1,6 +1,6 @@
 Source: yaz
 Section: utils
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
 Maintainer: Vincent Danjean <vdanjean@debian.org>
 Priority: extra
 Build-Depends: debhelper (>= 7.0.50~), pkg-config, libxslt1-dev,
@@ -20,7 +20,7 @@
 Section: libs
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Conflicts: idzebra (<= 1.3.4-2), php4-yaz (<= 4.1.2-5), libyaz
+Breaks: idzebra (<= 1.3.4-2), php4-yaz (<= 4.1.2-5), libyaz
 Replaces: libyaz
 Description: The YAZ Z39.50 toolkit (runtime files)
  YAZ is a toolkit that allows you to develop software using the
diff -Naur yaz-4.0.10/debian/libyaz4.symbols yaz-4.0.11/debian/libyaz4.symbols
--- yaz-4.0.10/debian/libyaz4.symbols	2010-06-23 13:13:59.000000000 +0200
+++ yaz-4.0.11/debian/libyaz4.symbols	2010-08-18 11:19:49.000000000 +0200
@@ -3688,6 +3688,7 @@
  yaz_oid_userinfo_cookie@Base 4.0.1
  yaz_oid_userinfo_cql@Base 4.0.1
  yaz_oid_userinfo_datetime@Base 4.0.1
+ yaz_oid_userinfo_facet_1@Base 4.0.11
  yaz_oid_userinfo_multiplesearchterms_1@Base 4.0.1
  yaz_oid_userinfo_multiplesearchterms_2@Base 4.0.1
  yaz_oid_userinfo_oclc_userinfo@Base 4.0.1
@@ -3925,6 +3926,9 @@
  z_ExtendedServicesRequest@Base 4.0.1
  z_ExtendedServicesResponse@Base 4.0.1
  z_External@Base 4.0.1
+ z_FacetField@Base 4.0.11
+ z_FacetList@Base 4.0.11
+ z_FacetTerm@Base 4.0.11
  z_FormatSpec@Base 4.0.1
  z_FragmentSyntax@Base 4.0.1
  z_GDU@Base 4.0.1
diff -Naur yaz-4.0.10/debian/rules yaz-4.0.11/debian/rules
--- yaz-4.0.10/debian/rules	2010-06-23 13:13:59.000000000 +0200
+++ yaz-4.0.11/debian/rules	2010-08-18 11:19:49.000000000 +0200
@@ -28,15 +28,18 @@
 	dh_auto_clean
 	# remove stamp files
 	$(RM) stamp-*
+
+clean:
+	$(DH) clean
 	# remove generated files
-	$(RM) doc/*.html doc/*.7 doc/*.1 \
+	$(RM) doc/*.html doc/*.7 doc/*.1 doc/*.8 \
 		doc/htmlhelp.hhp doc/toc.hhc doc/manref.xml
 	# remove autoconf generated files
 	find . -name Makefile.in -exec $(RM) {} \;
 	$(RM) aclocal.m4 configure config/* m4/libtool.m4 m4/lt*.m4
-
-clean:
-	$(DH) clean
+	$(RM) yaz.spec doc/local.ent doc/common/print.dsl \
+		yaz-config yaz.pc Doxyfile win/version.nsi \
+		include/yaz/yaz-version.h
 	# if this is a git repository, restore removed files that would have
 	# been ignored by dpkg-source
 	-test -d .git && git checkout -- $$(git status | \
diff -Naur yaz-4.0.10/include/yaz/Makefile.am yaz-4.0.11/include/yaz/Makefile.am
--- yaz-4.0.10/include/yaz/Makefile.am	2010-05-21 11:50:42.000000000 +0200
+++ yaz-4.0.11/include/yaz/Makefile.am	2010-07-09 16:39:13.000000000 +0200
@@ -17,7 +17,8 @@
  ill.h ill-core.h item-req.h oclc-ill-req-ext.h z-accdes1.h z-accform1.h \
  z-acckrb1.h z-core.h z-date.h z-diag1.h z-espec1.h z-estask.h z-exp.h \
  z-grs.h z-mterm2.h z-opac.h z-rrf1.h z-rrf2.h z-sum.h z-sutrs.h z-uifr1.h \
- z-univ.h z-oclcui.h zes-expi.h zes-exps.h zes-order.h zes-pquery.h \
+ z-univ.h z-oclcui.h z-facet-1.h zes-expi.h zes-exps.h zes-order.h \
+ zes-pquery.h \
  zes-psched.h zes-admin.h zes-pset.h zes-update.h zes-update0.h \
  zoom.h z-charneg.h charneg.h soap.h srw.h zgdu.h matchstr.h json.h \
  file_glob.h dirent.h thread_id.h gettimeofday.h shptr.h thread_create.h \
diff -Naur yaz-4.0.10/include/yaz/oid_std.h yaz-4.0.11/include/yaz/oid_std.h
--- yaz-4.0.10/include/yaz/oid_std.h	2009-11-01 22:29:27.000000000 +0100
+++ yaz-4.0.11/include/yaz/oid_std.h	2010-07-09 16:44:18.000000000 +0200
@@ -117,6 +117,7 @@
 OID_EXPORT extern const Odr_oid yaz_oid_userinfo_cookie[];
 OID_EXPORT extern const Odr_oid yaz_oid_userinfo_client_ip[];
 OID_EXPORT extern const Odr_oid yaz_oid_userinfo_scan_set[];
+OID_EXPORT extern const Odr_oid yaz_oid_userinfo_facet_1[];
 OID_EXPORT extern const Odr_oid yaz_oid_elemspec_espec_1[];
 OID_EXPORT extern const Odr_oid yaz_oid_varset_variant_1[];
 OID_EXPORT extern const Odr_oid yaz_oid_schema_wais_schema[];
diff -Naur yaz-4.0.10/include/yaz/z-facet-1.h yaz-4.0.11/include/yaz/z-facet-1.h
--- yaz-4.0.10/include/yaz/z-facet-1.h	1970-01-01 01:00:00.000000000 +0100
+++ yaz-4.0.11/include/yaz/z-facet-1.h	2010-07-09 16:44:19.000000000 +0200
@@ -0,0 +1,49 @@
+/** \file z-facet-1.h
+    \brief ASN.1 Module UserInfoFormat-facet-1
+
+    Generated automatically by YAZ ASN.1 Compiler 0.4
+*/
+
+#ifndef z_facet_1_H
+#define z_facet_1_H
+
+#include <yaz/odr.h>
+#include <yaz/z-core.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct Z_FacetList Z_FacetList;
+YAZ_EXPORT int z_FacetList (ODR o, Z_FacetList **p, int opt, const char *name);
+
+typedef struct Z_FacetField Z_FacetField;
+YAZ_EXPORT int z_FacetField (ODR o, Z_FacetField **p, int opt, const char *name);
+
+typedef struct Z_FacetTerm Z_FacetTerm;
+YAZ_EXPORT int z_FacetTerm (ODR o, Z_FacetTerm **p, int opt, const char *name);
+#ifdef __cplusplus
+}
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+struct Z_FacetList {
+	int num;
+	Z_FacetField **elements;
+};
+
+struct Z_FacetField {
+	Z_AttributeList *attributes;
+	int num_terms;
+	Z_FacetTerm **terms; /* OPT */
+};
+
+struct Z_FacetTerm {
+	Z_Term *term;
+	Odr_int *count;
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff -Naur yaz-4.0.10/src/cclfind.c yaz-4.0.11/src/cclfind.c
--- yaz-4.0.10/src/cclfind.c	2010-04-28 13:43:49.000000000 +0200
+++ yaz-4.0.11/src/cclfind.c	2010-07-09 16:39:13.000000000 +0200
@@ -247,15 +247,14 @@
         struct ccl_rpn_node *p;
         size_t no, i;
         int no_spaces = 0;
-        int left_trunc = 0;
-        int right_trunc = 0;
-        int mid_trunc = 0;
         int relation_value = -1;
         int position_value = -1;
         int structure_value = -1;
         int truncation_value = -1;
         int completeness_value = -1;
         int len = 0;
+        int left_trunc = 0;
+        int right_trunc = 0;
         size_t max = 200;
         if (and_list || or_list || !multi)
             max = 1;
@@ -275,17 +274,9 @@
             for (i = 0; i<lookahead->len; i++)
                 if (lookahead->name[i] == ' ')
                     no_spaces++;
-                else if (strchr(truncation_aliases[0], lookahead->name[i]))
-                {
-                    if (no == 0 && i == 0 && lookahead->len >= 1)
-                        left_trunc = 1;
-                    else if (!is_term_ok(lookahead->next->kind, term_list) &&
-                             i == lookahead->len-1 && i >= 1)
-                        right_trunc = 1;
-                    else
-                        mid_trunc = 1;
-                }
             len += 1+lookahead->len+lookahead->ws_prefix_len;
+            left_trunc = lookahead->left_trunc;
+            right_trunc = lookahead->right_trunc;
             lookahead = lookahead->next;
         }
 
@@ -339,7 +330,6 @@
                             if (truncation_value != -1)
                                 continue;
                             truncation_value = attr->value.numeric;
-                            left_trunc = right_trunc = mid_trunc = 0;
                             break;
                         case CCL_BIB1_COM:
                             if (completeness_value != -1)
@@ -374,13 +364,6 @@
             const char *src_str = cclp->look_token->name;
             size_t src_len = cclp->look_token->len;
             
-            if (i == 0 && left_trunc)
-            {
-                src_len--;
-                src_str++;
-            }
-            if (i == no-1 && right_trunc)
-                src_len--;
             if (p->u.t.term[0] && cclp->look_token->ws_prefix_len)
             {
                 size_t len = strlen(p->u.t.term);
diff -Naur yaz-4.0.10/src/cclp.h yaz-4.0.11/src/cclp.h
--- yaz-4.0.10/src/cclp.h	2010-04-28 13:43:49.000000000 +0200
+++ yaz-4.0.11/src/cclp.h	2010-07-09 16:39:13.000000000 +0200
@@ -55,6 +55,8 @@
     struct ccl_token *prev;
     const char *ws_prefix_buf;  /* leading white space buf */
     size_t ws_prefix_len;       /* leading white space len */
+    int left_trunc;             /* left truncated */
+    int right_trunc;            /* right truncated */
 };
 
 /** CCL parser structure */
diff -Naur yaz-4.0.10/src/ccltoken.c yaz-4.0.11/src/ccltoken.c
--- yaz-4.0.10/src/ccltoken.c	2010-04-28 13:43:49.000000000 +0200
+++ yaz-4.0.11/src/ccltoken.c	2010-07-09 16:39:13.000000000 +0200
@@ -79,6 +79,7 @@
             last->next->prev = last;
             last = last->next;
         }
+        last->left_trunc = last->right_trunc = 0;
         last->ws_prefix_buf = (const char *) cp0;
         last->ws_prefix_len = cp - cp0;
         last->next = NULL;
@@ -121,53 +122,66 @@
             else
                 last->kind = CCL_TOK_REL;
             break;
-        case '\"':
-            last->kind = CCL_TOK_TERM;
-            last->name = (const char *) cp;
-            last->len = 0;
-            while (*cp && *cp != '\"')
+        default:
+            --cp;
+            --last->len;
+            if (*cp == '?')
             {
+                last->left_trunc = 1;
                 cp++;
-                ++ last->len;
             }
-            if (*cp == '\"')
-                cp++;
-            break;
-        default:
-            if (!strchr("(),%!><= \t\n\r", cp[-1]))
+            if (*cp == '"')
             {
-                while (*cp && !strchr("(),%!><= \t\n\r", *cp))
+                cp++;
+                last->kind = CCL_TOK_TERM;
+                last->name = (const char *) cp;
+                while (*cp && *cp != '"')
                 {
                     cp++;
                     ++ last->len;
                 }
+                if (*cp)
+                    cp++;
+            }
+            else
+            {
+                last->kind = CCL_TOK_TERM;
+                last->name = (const char *) cp;
+                while (*cp && !strchr("(),%!><=? \t\n\r", *cp))
+                {
+                    ++ last->len;
+                    cp++;
+                }
+                aliases = ccl_qual_search_special(cclp->bibset, "and");
+                if (!aliases)
+                    aliases = cclp->ccl_token_and;
+                if (token_cmp(cclp, aliases, last))
+                    last->kind = CCL_TOK_AND;
+                
+                aliases = ccl_qual_search_special(cclp->bibset, "or");
+                if (!aliases)
+                    aliases = cclp->ccl_token_or;
+                if (token_cmp(cclp, aliases, last))
+                    last->kind = CCL_TOK_OR;
+                
+                aliases = ccl_qual_search_special(cclp->bibset, "not");
+                if (!aliases)
+                    aliases = cclp->ccl_token_not;
+                if (token_cmp(cclp, aliases, last))
+                    last->kind = CCL_TOK_NOT;
+                
+                aliases = ccl_qual_search_special(cclp->bibset, "set");
+                if (!aliases)
+                    aliases = cclp->ccl_token_set;
+                
+                if (token_cmp(cclp, aliases, last))
+                    last->kind = CCL_TOK_SET;
+            }
+            if (*cp == '?')
+            {
+                last->right_trunc = 1;
+                cp++;
             }
-            last->kind = CCL_TOK_TERM;
-
-            aliases = ccl_qual_search_special(cclp->bibset, "and");
-            if (!aliases)
-                aliases = cclp->ccl_token_and;
-            if (token_cmp(cclp, aliases, last))
-                last->kind = CCL_TOK_AND;
-
-            aliases = ccl_qual_search_special(cclp->bibset, "or");
-            if (!aliases)
-                aliases = cclp->ccl_token_or;
-            if (token_cmp(cclp, aliases, last))
-                last->kind = CCL_TOK_OR;
-
-            aliases = ccl_qual_search_special(cclp->bibset, "not");
-            if (!aliases)
-                aliases = cclp->ccl_token_not;
-            if (token_cmp(cclp, aliases, last))
-                last->kind = CCL_TOK_NOT;
-
-            aliases = ccl_qual_search_special(cclp->bibset, "set");
-            if (!aliases)
-                aliases = cclp->ccl_token_set;
-
-            if (token_cmp(cclp, aliases, last))
-                last->kind = CCL_TOK_SET;
         }
     }
     return first;
@@ -184,6 +198,7 @@
         n->next->prev = n;
 
     n->kind = CCL_TOK_TERM;
+    n->left_trunc = n->right_trunc = 0;
     n->name = 0;
     n->len = 0;
     n->ws_prefix_buf = 0;
diff -Naur yaz-4.0.10/src/facet.asn yaz-4.0.11/src/facet.asn
--- yaz-4.0.10/src/facet.asn	1970-01-01 01:00:00.000000000 +0100
+++ yaz-4.0.11/src/facet.asn	2010-07-09 16:39:13.000000000 +0200
@@ -0,0 +1,21 @@
+UserInfoFormat-facet-1
+{Z39-50-userInfoFormat facet-1 (1)} DEFINITIONS ::=
+BEGIN
+IMPORTS AttributeList, Term FROM Z39-50-APDU-1995;
+FacetList ::= SEQUENCE OF FacetField;
+
+FacetField ::= SEQUENCE {
+  -- attributes will specify:
+  --   1=use (field name)
+  --   3=sortorder 0=most frequent, 1=least frequent, ..
+  --   3=limit (integer)
+  attributes [1] IMPLICIT AttributeList,
+  terms [2] IMPLICIT SEQUENCE OF FacetTerm OPTIONAL
+}
+
+FacetTerm ::= SEQUENCE {
+  term [1] IMPLICIT Term,
+  count [2] IMPLICIT INTEGER
+}
+
+END
diff -Naur yaz-4.0.10/src/grs1disp.c yaz-4.0.11/src/grs1disp.c
--- yaz-4.0.10/src/grs1disp.c	2010-04-28 13:43:49.000000000 +0200
+++ yaz-4.0.11/src/grs1disp.c	2010-07-09 16:39:13.000000000 +0200
@@ -49,7 +49,7 @@
         t = r->elements[i];
         wrbuf_printf(w, "(");
         if (t->tagType)
-            wrbuf_printf(w, ODR_INT_PRINTF, *t->tagType);
+            wrbuf_printf(w, ODR_INT_PRINTF ",", *t->tagType);
         else
             wrbuf_printf(w, "?,");
         if (t->tagValue->which == Z_StringOrNumeric_numeric)
diff -Naur yaz-4.0.10/src/Makefile.am yaz-4.0.11/src/Makefile.am
--- yaz-4.0.10/src/Makefile.am	2010-05-21 11:50:42.000000000 +0200
+++ yaz-4.0.11/src/Makefile.am	2010-07-09 16:39:13.000000000 +0200
@@ -10,7 +10,7 @@
 
 tabdatadir = $(pkgdatadir)/z39.50
 tabdata_DATA=datetime.asn esupdate.asn univres.asn z3950v3.asn z.tcl \
- esadmin.asn charneg-3.asn mterm2.asn oclcui.asn
+ esadmin.asn charneg-3.asn mterm2.asn oclcui.asn facet.asn
 
 illdatadir=$(pkgdatadir)/ill
 illdata_DATA=ill9702.asn item-req.asn ill.tcl oclc-ill-req-ext.asn
@@ -63,7 +63,7 @@
 GEN_FILES = oid_std.c \
   marc8.c marc8r.c iso5426.c \
   diagbib1.c diagsrw.c diagsru_update.c \
-  z-accdes1.c z-accform1.c z-acckrb1.c z-core.c \
+  z-accdes1.c z-accform1.c z-acckrb1.c z-core.c z-facet-1.c \
   z-diag1.c z-espec1.c z-estask.c z-exp.c z-grs.c z-mterm2.c z-opac.c \
   z-uifr1.c z-rrf1.c z-rrf2.c z-sum.c z-sutrs.c z-oclcui.c\
   zes-expi.c zes-exps.c zes-order.c zes-pquery.c zes-psched.c \
@@ -185,6 +185,12 @@
 $(srcdir)/z.tcl $(srcdir)/oclcui.asn $(YAZCOMP)
 	$(TCLSH) $(YAZCOMP_Z) $(srcdir)/oclcui.asn
 
+# UserInfoFormat-facet-1
+z-facet-1.c \
+$(top_srcdir)/include/yaz/z-facet-1.h: $(srcdir)/facet.asn $(YAZCOMP)
+	$(TCLSH) $(YAZCOMP_Z) $(srcdir)/facet.asn
+
+
 # ILL protocol
 ill-core.c \
 $(top_srcdir)/include/yaz/ill-core.h: \
@@ -203,3 +209,4 @@
 $(srcdir)/ill.tcl $(srcdir)/item-req.asn $(YAZCOMP)
 	$(TCLSH) $(YAZCOMP_I) $(srcdir)/item-req.asn
 
+
diff -Naur yaz-4.0.10/src/oid.csv yaz-4.0.11/src/oid.csv
--- yaz-4.0.10/src/oid.csv	2009-11-01 22:25:54.000000000 +0100
+++ yaz-4.0.11/src/oid.csv	2010-07-09 16:39:13.000000000 +0200
@@ -107,6 +107,7 @@
 USERINFO, Z3950_PREFIX.10.1000.81.2, "Cookie"
 USERINFO, Z3950_PREFIX.10.1000.81.3, "Client-IP"
 USERINFO, Z3950_PREFIX.10.1000.81.4, "Scan-Set"
+USERINFO, Z3950_PREFIX.10.1000.81.5, "Facet-1"
 ELEMSPEC, Z3950_PREFIX.11.1, "Espec-1"
 VARSET, Z3950_PREFIX.12.1, "Variant-1"
 SCHEMA, Z3950_PREFIX.13.1, "WAIS-schema"
diff -Naur yaz-4.0.10/src/oid_std.c yaz-4.0.11/src/oid_std.c
--- yaz-4.0.10/src/oid_std.c	2009-11-01 22:29:27.000000000 +0100
+++ yaz-4.0.11/src/oid_std.c	2010-07-09 16:44:18.000000000 +0200
@@ -111,6 +111,7 @@
 YAZ_EXPORT const Odr_oid yaz_oid_userinfo_cookie[] = {Z3950_PREFIX,10,1000,81,2,-1};
 YAZ_EXPORT const Odr_oid yaz_oid_userinfo_client_ip[] = {Z3950_PREFIX,10,1000,81,3,-1};
 YAZ_EXPORT const Odr_oid yaz_oid_userinfo_scan_set[] = {Z3950_PREFIX,10,1000,81,4,-1};
+YAZ_EXPORT const Odr_oid yaz_oid_userinfo_facet_1[] = {Z3950_PREFIX,10,1000,81,5,-1};
 YAZ_EXPORT const Odr_oid yaz_oid_elemspec_espec_1[] = {Z3950_PREFIX,11,1,-1};
 YAZ_EXPORT const Odr_oid yaz_oid_varset_variant_1[] = {Z3950_PREFIX,12,1,-1};
 YAZ_EXPORT const Odr_oid yaz_oid_schema_wais_schema[] = {Z3950_PREFIX,13,1,-1};
@@ -253,6 +254,7 @@
 	{CLASS_USERINFO, yaz_oid_userinfo_cookie, "Cookie"},
 	{CLASS_USERINFO, yaz_oid_userinfo_client_ip, "Client-IP"},
 	{CLASS_USERINFO, yaz_oid_userinfo_scan_set, "Scan-Set"},
+	{CLASS_USERINFO, yaz_oid_userinfo_facet_1, "Facet-1"},
 	{CLASS_ELEMSPEC, yaz_oid_elemspec_espec_1, "Espec-1"},
 	{CLASS_VARSET, yaz_oid_varset_variant_1, "Variant-1"},
 	{CLASS_SCHEMA, yaz_oid_schema_wais_schema, "WAIS-schema"},
diff -Naur yaz-4.0.10/src/z-facet-1.c yaz-4.0.11/src/z-facet-1.c
--- yaz-4.0.10/src/z-facet-1.c	1970-01-01 01:00:00.000000000 +0100
+++ yaz-4.0.11/src/z-facet-1.c	2010-07-09 16:44:19.000000000 +0200
@@ -0,0 +1,44 @@
+/** \file z-facet-1.c
+    \brief ASN.1 Module UserInfoFormat-facet-1
+
+    Generated automatically by YAZ ASN.1 Compiler 0.4
+*/
+
+#include <yaz/z-facet-1.h>
+
+int z_FacetList (ODR o, Z_FacetList **p, int opt, const char *name)
+{
+	if (!odr_initmember (o, p, sizeof(**p)))
+		return odr_missing(o, opt, name);
+	if (odr_sequence_of (o, (Odr_fun) z_FacetField, &(*p)->elements,
+		&(*p)->num, name))
+		return 1;
+	if (o->direction == ODR_DECODE)
+		*p = 0;
+	return odr_missing(o, opt, name);
+}
+
+int z_FacetField (ODR o, Z_FacetField **p, int opt, const char *name)
+{
+	if (!odr_sequence_begin (o, p, sizeof(**p), name))
+		return odr_missing(o, opt, name) && odr_ok (o);
+	return
+		odr_implicit_tag (o, z_AttributeList,
+			&(*p)->attributes, ODR_CONTEXT, 1, 0, "attributes") &&
+		odr_implicit_settag (o, ODR_CONTEXT, 2) &&
+		(odr_sequence_of(o, (Odr_fun) z_FacetTerm, &(*p)->terms,
+		  &(*p)->num_terms, "terms") || odr_ok(o)) &&
+		odr_sequence_end (o);
+}
+
+int z_FacetTerm (ODR o, Z_FacetTerm **p, int opt, const char *name)
+{
+	if (!odr_sequence_begin (o, p, sizeof(**p), name))
+		return odr_missing(o, opt, name) && odr_ok (o);
+	return
+		odr_implicit_tag (o, z_Term,
+			&(*p)->term, ODR_CONTEXT, 1, 0, "term") &&
+		odr_implicit_tag (o, odr_integer,
+			&(*p)->count, ODR_CONTEXT, 2, 0, "count") &&
+		odr_sequence_end (o);
+}
diff -Naur yaz-4.0.10/src/zoom-c.c yaz-4.0.11/src/zoom-c.c
--- yaz-4.0.10/src/zoom-c.c	2010-06-18 10:50:17.000000000 +0200
+++ yaz-4.0.11/src/zoom-c.c	2010-07-09 16:39:13.000000000 +0200
@@ -4241,17 +4241,38 @@
 {
     struct Z_HTTP_Header *h;
     Z_GDU *gdu = get_HTTP_Request_url(c->odr_out, uri);
+    char *combined_cookies;
+    int combined_cookies_len = 0;
 
     gdu->u.HTTP_Request->method = odr_strdup(c->odr_out, "GET");
     z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers, "Accept",
                       "text/xml");
-    
+
     for (h = cookie_hres->headers; h; h = h->next)
     {
         if (!strcmp(h->name, "Set-Cookie"))
-            z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers,
-                              "Cookie", h->value);
+        {
+            char *cp;
+
+            if (!(cp = strchr(h->value, ';')))
+                cp = h->value + strlen(h->value);
+            if (cp - h->value >= 1) {
+                combined_cookies = xrealloc(combined_cookies, combined_cookies_len + cp - h->value + 3);
+                memcpy(combined_cookies+combined_cookies_len, h->value, cp - h->value);
+                combined_cookies[combined_cookies_len + cp - h->value] = '\0';
+                strcat(combined_cookies,"; ");
+                combined_cookies_len = strlen(combined_cookies);
+            }
+        }
+    }
+
+    if (combined_cookies_len)
+    {
+        z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers,
+                          "Cookie", combined_cookies);
+        xfree(combined_cookies);
     }
+
     if (c->user && c->password)
     {
         z_HTTP_header_add_basic_auth(c->odr_out, &gdu->u.HTTP_Request->headers,
diff -Naur yaz-4.0.10/src/z.tcl yaz-4.0.11/src/z.tcl
--- yaz-4.0.10/src/z.tcl	2009-11-01 22:25:54.000000000 +0100
+++ yaz-4.0.11/src/z.tcl	2010-07-09 16:39:13.000000000 +0200
@@ -342,6 +342,9 @@
 set filename($m) z-charneg
 set membermap($m,OriginProposal_0,private) {OriginProposal_0_private zprivate}
 set membermap($m,TargetResponse,private) {TargetResponse_private zprivate}
+# ----
+set m UserInfoFormat-facet-1
+set filename($m) z-facet-1
 # ----------------------------------------------------------
 # "Constructed" types defined by means of C-types are declared here.
 # Each function returns the C-handler and the C-type.
diff -Naur yaz-4.0.10/test/test_ccl.c yaz-4.0.11/test/test_ccl.c
--- yaz-4.0.10/test/test_ccl.c	2010-04-28 13:43:49.000000000 +0200
+++ yaz-4.0.11/test/test_ccl.c	2010-07-09 16:39:13.000000000 +0200
@@ -241,18 +241,10 @@
                             "@or @attr 4=2 @attr 1=1016 a "
                             "@attr 1=/my/title a "));
 
-    /* Bug #2895 */
-#if 1
-    YAZ_CHECK(tst_ccl_query(bibset, "a? b?", 
-                            /* incorrect. */
-                            "@and @attr 4=2 @attr 1=1016 a? "
-                            "@attr 5=1 @attr 4=2 @attr 1=1016 b "));
-#else
     YAZ_CHECK(tst_ccl_query(bibset, "a? b?", 
                             /* correct */
                             "@and @attr 5=1 @attr 4=2 @attr 1=1016 a "
                             "@attr 5=1 @attr 4=2 @attr 1=1016 b "));
-#endif
     ccl_qual_rm(&bibset);
 }
 
diff -Naur yaz-4.0.10/win/yaz.nsi yaz-4.0.11/win/yaz.nsi
--- yaz-4.0.10/win/yaz.nsi	2010-06-18 10:52:59.000000000 +0200
+++ yaz-4.0.11/win/yaz.nsi	2010-07-09 16:45:39.000000000 +0200
@@ -18,7 +18,7 @@
 ;!define VS_RUNTIME_MANIFEST "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\Microsoft.VC80.CRT.manifest"
 
 ; 4: VS 2008
-!define VS_RUNTIME_DLL      "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\msvcr90.dll"
+!define VS_RUNTIME_DLL      "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\msvc*90.dll"
 !define VS_RUNTIME_MANIFEST "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest"
 
 
diff -Naur yaz-4.0.10/ztest/gfs-example.c yaz-4.0.11/ztest/gfs-example.c
--- yaz-4.0.10/ztest/gfs-example.c	2010-06-18 10:50:17.000000000 +0200
+++ yaz-4.0.11/ztest/gfs-example.c	2010-07-09 16:39:13.000000000 +0200
@@ -17,14 +17,21 @@
 #include <yaz/matchstr.h>
 #include <yaz/snprintf.h>
 
+/* session handle . Put anything you like in here! */
+struct my_handle {
+    int counter;
+};
+
 static int my_search(void *handle, bend_search_rr *rr)
 {
+    struct my_handle *my_p = (struct my_handle *) handle;
+
     if (rr->num_bases != 1)
     {
         rr->errcode = YAZ_BIB1_COMBI_OF_SPECIFIED_DATABASES_UNSUPP;
         return 0;
     }
-    /* Throw Database unavailable if other than Default or Slow */
+    /* Throw Database unavailable if other than Default */
     if (!yaz_matchstr (rr->basenames[0], "Default"))
         ;  /* Default is OK in our test */
     else
@@ -35,6 +42,7 @@
     }
 
     rr->hits = 123; /* dummy hit count */
+    my_p->counter++;
     return 0;
 }
 
@@ -70,14 +78,14 @@
 {
     bend_initresult *r = (bend_initresult *)
         odr_malloc (q->stream, sizeof(*r));
-    int *counter = (int *) xmalloc (sizeof(int));
+    struct my_handle *my_p = (struct my_handle *) xmalloc (sizeof(*my_p));
 
-    *counter = 0;
+    my_p->counter = 0;
     r->errcode = 0;
     r->errstring = 0;
-    r->handle = counter;         /* user handle, in this case a simple int */
+    r->handle = my_p;            /* user handle */
     q->bend_search = my_search;  /* register search handler */
-    q->bend_fetch = my_fetch;     /* register fetch handle */
+    q->bend_fetch = my_fetch;    /* register fetch handle */
     q->query_charset = "UTF-8";
     q->records_in_same_charset = 1;
 
diff -Naur yaz-4.0.10/ztest/ztest.c yaz-4.0.11/ztest/ztest.c
--- yaz-4.0.10/ztest/ztest.c	2010-04-28 13:43:49.000000000 +0200
+++ yaz-4.0.11/ztest/ztest.c	2010-07-09 16:39:13.000000000 +0200
@@ -133,12 +133,16 @@
 */
 static Odr_int get_hit_count(Z_Query *q)
 {
-    Odr_int h = -1;
     if (q->which == Z_Query_type_1 || q->which == Z_Query_type_101)
+    {
+        Odr_int h = -1;
         h = get_term_hit(q->u.type_1->RPNStructure);
-    if (h == -1)
-        h = rand() % 24;
-    return h;
+        if (h == -1)
+            h = rand() % 24;
+        return h;
+    }
+    else
+        return 24;
 }
 
 /** \brief checks if it's a dummy Slow database
diff -Naur idzebra-2.0.43/configure.ac idzebra-2.0.44/configure.ac
--- idzebra-2.0.43/configure.ac	2010-08-23 08:56:59.000000000 +0200
+++ idzebra-2.0.44/configure.ac	2010-08-23 08:57:08.000000000 +0200
@@ -2,7 +2,7 @@
 dnl   Copyright (C) 1994-2009 Index Data
 dnl
 AC_PREREQ(2.60)
-AC_INIT([idzebra],[2.0.43],[zebra-help@indexdata.dk])
+AC_INIT([idzebra],[2.0.44],[zebra-help@indexdata.dk])
 AC_CONFIG_SRCDIR(configure.ac)
 AC_CONFIG_AUX_DIR(config)
 AM_INIT_AUTOMAKE([1.9])
diff -Naur idzebra-2.0.43/data1/d1_expout.c idzebra-2.0.44/data1/d1_expout.c
--- idzebra-2.0.43/data1/d1_expout.c	2009-06-19 14:57:28.000000000 +0200
+++ idzebra-2.0.44/data1/d1_expout.c	2010-06-29 10:57:13.000000000 +0200
@@ -68,18 +68,15 @@
     return 1;
 }
 
-static int *f_integer(ExpHandle *eh, data1_node *c)
+static Odr_int *f_integer(ExpHandle *eh, data1_node *c)
 {
-    int *r;
     char intbuf[64];
 
     c = c->child;
-    if (!is_data_tag (eh, c) || c->u.data.len > 63)
+    if (!is_data_tag (eh, c) || c->u.data.len >= sizeof(intbuf))
 	return 0;
-    r = (int *)odr_malloc(eh->o, sizeof(*r));
     sprintf(intbuf, "%.*s", c->u.data.len, c->u.data.data);
-    *r = atoi(intbuf);
-    return r;
+    return odr_intdup(eh->o, atoi(intbuf));
 }
 
 static char *f_string(ExpHandle *eh, data1_node *c)
@@ -251,7 +248,7 @@
 		(res->num_operators)++;
 	    }
 	    if (res->num_operators)
-		res->operators = (int **)
+		res->operators = (Odr_int **)
 		    odr_malloc (eh->o, res->num_operators
 				* sizeof(*res->operators));
 	    for (n = c->child; n; n = n->next)
@@ -388,9 +385,8 @@
     return res;
 }
 
-static int *f_recordCount(ExpHandle *eh, data1_node *c, int *which)
+static Odr_int *f_recordCount(ExpHandle *eh, data1_node *c, int *which)
 {
-    int *r= (int *)odr_malloc(eh->o, sizeof(*r));
     int *wp = which;
     char intbuf[64];
 
@@ -403,11 +399,11 @@
 	*wp = Z_DatabaseInfo_approxNumber;
     else
 	return 0;
-    if (!c->child || c->child->which != DATA1N_data)
+    if (!c->child || c->child->which != DATA1N_data || 
+        c->child->u.data.len >= sizeof(intbuf))
 	return 0;
     sprintf(intbuf, "%.*s", c->child->u.data.len, c->child->u.data.data);
-    *r = atoi(intbuf);
-    return r;
+    return odr_intdup(eh->o, atoi(intbuf));
 }
 
 static Z_ContactInfo *f_contactInfo(ExpHandle *eh, data1_node *n)
diff -Naur idzebra-2.0.43/data1/d1_grs.c idzebra-2.0.44/data1/d1_grs.c
--- idzebra-2.0.43/data1/d1_grs.c	2009-06-19 14:57:28.000000000 +0200
+++ idzebra-2.0.44/data1/d1_grs.c	2010-06-29 10:57:13.000000000 +0200
@@ -78,10 +78,8 @@
 	assert(p->which == DATA1N_variant);
 	t = v->triples[num] = (Z_Triple *)odr_malloc(o, sizeof(*t));
 	t->variantSetId = 0;
-	t->zclass = (int *)odr_malloc(o, sizeof(int));
-	*t->zclass = p->u.variant.type->zclass->zclass;
-	t->type = (int *)odr_malloc(o, sizeof(int));
-	*t->type = p->u.variant.type->type;
+        t->zclass = odr_intdup(o, p->u.variant.type->zclass->zclass);
+	t->type = odr_intdup(o, p->u.variant.type->type);
 
 	switch (p->u.variant.type->datatype)
 	{
@@ -192,8 +190,7 @@
 	{
         case DATA1I_num:
             res->which = Z_ElementData_numeric;
-            res->u.numeric = (int *)odr_malloc(o, sizeof(int));
-            *res->u.numeric = atoi_n (cp, toget);
+            res->u.numeric = odr_intdup(o, atoi_n(cp, toget));
             *len += 4;
             break;
         case DATA1I_text:
@@ -295,14 +292,12 @@
 	return 0;
     }
 
-    res->tagType = (int *)odr_malloc(o, sizeof(int));
-    *res->tagType = (tag && tag->tagset) ? tag->tagset->type : 3;
+    res->tagType = odr_intdup(o, (tag && tag->tagset) ? tag->tagset->type : 3);
     res->tagValue = (Z_StringOrNumeric *)odr_malloc(o, sizeof(Z_StringOrNumeric));
     if (tag && tag->which == DATA1T_numeric)
     {
 	res->tagValue->which = Z_StringOrNumeric_numeric;
-	res->tagValue->u.numeric = (int *)odr_malloc(o, sizeof(int));
-	*res->tagValue->u.numeric = tag->value.numeric;
+	res->tagValue->u.numeric = odr_intdup(o, tag->value.numeric);
     }
     else
     {
diff -Naur idzebra-2.0.43/data1/d1_handle.c idzebra-2.0.44/data1/d1_handle.c
--- idzebra-2.0.43/data1/d1_handle.c	2009-06-19 14:57:28.000000000 +0200
+++ idzebra-2.0.44/data1/d1_handle.c	2010-06-29 10:57:13.000000000 +0200
@@ -150,18 +150,21 @@
     FILE *f;
     const char *path = data1_get_tabpath(dh);
     const char *root = data1_get_tabroot(dh);
-    if (!path || !*path)
-    {
-        yaz_log(YLOG_DEBUG, "data1_fath_fopen file=%s mode=%s no open",
-                file, mode);
-	return 0;
-    }
-    yaz_log(YLOG_DEBUG, "data1_fath_fopen path=%s root=%s "
+
+    yaz_log(YLOG_DEBUG, "data1_path_fopen path=%s root=%s "
             "file=%s mode=%s", path ? path : "NULL",
             root ? root : "NULL", file, mode);
-    f = yaz_fopen(path, file, "r", root);
+    if (!path || !*path)
+	return 0;
+    f = yaz_fopen(path, file, mode, root);
     if (!f)
+    {
 	yaz_log(YLOG_WARN|YLOG_ERRNO, "Couldn't open %s", file);
+        if (root)
+            yaz_log(YLOG_LOG, "for root=%s", root);
+        if (path)
+            yaz_log(YLOG_LOG, "for profilePath=%s", path);
+    }
     return f;
 }
 
diff -Naur idzebra-2.0.43/data1/d1_marc.c idzebra-2.0.44/data1/d1_marc.c
--- idzebra-2.0.43/data1/d1_marc.c	2009-06-19 14:57:28.000000000 +0200
+++ idzebra-2.0.44/data1/d1_marc.c	2010-06-29 11:16:19.000000000 +0200
@@ -189,7 +189,7 @@
             }
             *len += n->u.data.len;
         }
-        if (n->which == DATA1N_tag)
+        if (n->which == DATA1N_tag && *len == 0)
             n = n->child;
 	else if (n->which == DATA1N_data)
             n = n->next;
diff -Naur idzebra-2.0.43/debian/changelog idzebra-2.0.44/debian/changelog
--- idzebra-2.0.43/debian/changelog	2010-06-24 09:20:57.000000000 +0200
+++ idzebra-2.0.44/debian/changelog	2010-08-18 12:50:47.000000000 +0200
@@ -1,3 +1,12 @@
+idzebra (2.0.44-1) unstable; urgency=low
+
+  * New Upstream Version
+    Many bug fix
+  * debian/control: bump standard-version (no change needed)
+  * debian/rules: really remove generated files before build
+
+ -- Vincent Danjean <vdanjean@debian.org>  Wed, 18 Aug 2010 11:32:49 +0200
+
 idzebra (2.0.43-2) unstable; urgency=low
 
   * debian/control: build-depends on libyaz3-dev or libyaz4-dev
diff -Naur idzebra-2.0.43/debian/control idzebra-2.0.44/debian/control
--- idzebra-2.0.43/debian/control	2010-06-24 09:20:57.000000000 +0200
+++ idzebra-2.0.44/debian/control	2010-08-18 12:50:47.000000000 +0200
@@ -2,7 +2,7 @@
 Priority: optional
 Section: text
 Maintainer: Vincent Danjean <vdanjean@debian.org>
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
 Build-Depends: debhelper (>= 7.0.50~), quilt (>= 0.46-7~),
  libyaz4-dev | libyaz3-dev (>= 3.0.17), libexpat1-dev, tcl8.4-dev, libbz2-dev, libxslt1-dev,
  libbz2-dev, libreadline-dev, libncurses5-dev,
diff -Naur idzebra-2.0.43/debian/rules idzebra-2.0.44/debian/rules
--- idzebra-2.0.43/debian/rules	2010-06-24 09:20:57.000000000 +0200
+++ idzebra-2.0.44/debian/rules	2010-08-18 12:50:47.000000000 +0200
@@ -11,7 +11,7 @@
 export PATH:=$(DEB_CCACHE_DIR):${PATH}
 endif
 
-build clean install binary-arch binary-indep binary: %:
+build install binary-arch binary-indep binary: %:
 	$(DH) $@
 
 #export CFLAGS+= -Wall
@@ -27,15 +27,23 @@
 	dh_auto_clean
 	# remove stamp files
 	$(RM) stamp-*
+	# remove a socket used for tests
+	$(RM) test/gils/socket
+
+clean:
+	$(DH) clean
 	# remove generated files
 	$(RM) doc/*.html doc/manref.xml doc/htmlhelp.hhp doc/toc.hhc \
 		doc/*.1 doc/*.8 doc/gils.txt doc/gils.ps \
-		test/gils/out test/zsh/test*.zsh.out
-	# remove a socket used for tests
-	$(RM) test/gils/socket
+		test/gils/out test/zsh/test*.zsh.out \
+		doc/manref.xml
 	# remove autoconf generated files
 	find . -name Makefile.in -exec $(RM) {} \;
-	$(RM) aclocal.m4 configure config/* m4/libtool.m4
+	$(RM) aclocal.m4 configure config/* m4/libtool.m4 \
+		config.guess config.sub m4/lt*.m4
+	$(RM) doc/local.ent doc/common/print.dsl idzebra.spec \
+		idzebra-config-2.0 Doxyfile win/version.nsi \
+		include/idzebra/version.h
 	# if this is a git repository, restore removed files that would have
 	# been ignored by dpkg-source
 	-test -d .git && git checkout -- $$(git status | \
diff -Naur idzebra-2.0.43/index/recgrs.c idzebra-2.0.44/index/recgrs.c
--- idzebra-2.0.43/index/recgrs.c	2009-09-16 13:59:49.000000000 +0200
+++ idzebra-2.0.44/index/recgrs.c	2010-06-29 10:57:13.000000000 +0200
@@ -104,12 +104,18 @@
 	return 0;	
     sp_lex(sp);
     
-    if (wrd->term_buf && wrd->term_len)
+    if (wrd->term_buf)
     {
-	wrd->term_buf += start;
-	wrd->term_len -= start;
-	if (wrd->term_len > len)
-	    wrd->term_len = len;
+        if (start >= wrd->term_len)
+            wrd->term_len = 0;
+        else
+        {
+            wrd->term_len -= start;
+            wrd->term_buf += start;
+
+            if (wrd->term_len > len)
+                wrd->term_len = len;
+        }
     }
     return 1;
 }
@@ -563,7 +569,7 @@
 		memcpy(&wrd_tl, wrd, sizeof(*wrd));
 		if (tl->source)
 		    sp_parse(sp, n, &wrd_tl, tl->source);
-                
+
                 /* this is just the old fashioned attribute based index */
                 wrd_tl.index_name = tl->index_name;
                 if (p->flagShowRecords)
diff -Naur idzebra-2.0.43/index/rpnsearch.c idzebra-2.0.44/index/rpnsearch.c
--- idzebra-2.0.43/index/rpnsearch.c	2009-11-05 09:33:21.000000000 +0100
+++ idzebra-2.0.44/index/rpnsearch.c	2010-06-29 10:57:13.000000000 +0200
@@ -1977,7 +1977,7 @@
     sk->u.sortAttributes->id = odr_oiddup_nmem(stream, attributeSet);
     sk->u.sortAttributes->list = zapt->attributes;
 
-    sks->sortRelation = (int *)
+    sks->sortRelation = (Odr_int *)
         nmem_malloc(stream, sizeof(*sks->sortRelation));
     if (sort_relation_value == 1)
         *sks->sortRelation = Z_SortKeySpec_ascending;
@@ -1986,7 +1986,7 @@
     else 
         *sks->sortRelation = Z_SortKeySpec_ascending;
 
-    sks->caseSensitivity = (int *)
+    sks->caseSensitivity = (Odr_int *)
         nmem_malloc(stream, sizeof(*sks->caseSensitivity));
     *sks->caseSensitivity = 0;
 
diff -Naur idzebra-2.0.43/index/zebrasrv.c idzebra-2.0.44/index/zebrasrv.c
--- idzebra-2.0.43/index/zebrasrv.c	2009-07-28 16:10:56.000000000 +0200
+++ idzebra-2.0.44/index/zebrasrv.c	2010-06-29 10:57:13.000000000 +0200
@@ -224,7 +224,7 @@
         se->subqueryId = term_ref_id ? 
 	    odr_strdup(r->stream, term_ref_id) : 0;
 	    
-        se->fullQuery = odr_intdup(r->stream, 0);
+        se->fullQuery = odr_booldup(r->stream, 0);
         se->subqueryExpression = 
             odr_malloc(r->stream, sizeof(Z_QueryExpression));
         se->subqueryExpression->which = 
@@ -516,10 +516,10 @@
 {
     ZebraHandle zh = (ZebraHandle) handle;
     
-    yaz_log(YLOG_LOG, "function: %d", *rr->esr->function);
+    yaz_log(YLOG_LOG, "function: " ODR_INT_PRINTF, *rr->esr->function);
     if (rr->esr->packageName)
     	yaz_log(YLOG_LOG, "packagename: %s", rr->esr->packageName);
-    yaz_log(YLOG_LOG, "Waitaction: %d", *rr->esr->waitAction);
+    yaz_log(YLOG_LOG, "Waitaction: " ODR_INT_PRINTF, *rr->esr->waitAction);
 
     if (!rr->esr->taskSpecificParameters)
     {
@@ -566,7 +566,8 @@
 		    yaz_log(YLOG_LOG, "start");
 		    break;
 		default:
-		    yaz_log(YLOG_LOG, " unknown (%d)", *toKeep->action);
+		    yaz_log(YLOG_LOG, " unknown (" ODR_INT_PRINTF ")",
+                            *toKeep->action);
 		}
 	    }
 	    if (toKeep->databaseName)
diff -Naur idzebra-2.0.43/m4/yaz.m4 idzebra-2.0.44/m4/yaz.m4
--- idzebra-2.0.43/m4/yaz.m4	2008-09-05 15:32:50.000000000 +0200
+++ idzebra-2.0.44/m4/yaz.m4	2010-01-22 12:39:57.000000000 +0100
@@ -147,9 +147,6 @@
 			if test "$have_yaz_version" -lt "$req_yaz_version"; then
 				AC_MSG_ERROR([$YAZVERSION. Requires YAZ $2 or later])
 			fi
-			if test "$req_yaz_version" -gt "2000028"; then
-				YAZINC="$YAZINC -DYAZ_USE_NEW_LOG=1"
-			fi
 		fi
 	fi
 ]) 
diff -Naur idzebra-2.0.43/Makefile.am idzebra-2.0.44/Makefile.am
--- idzebra-2.0.43/Makefile.am	2009-06-19 14:57:28.000000000 +0200
+++ idzebra-2.0.44/Makefile.am	2010-06-29 10:57:13.000000000 +0200
@@ -11,7 +11,7 @@
 
 SPEC_FILE=idzebra.spec
 
-EXTRA_DIST= README NEWS $(SPEC_FILE) $(SPEC_FILE).in \
+EXTRA_DIST= README NEWS IDMETA $(SPEC_FILE) $(SPEC_FILE).in \
  idzebra-config-2.0.in m4/idzebra-2.0.m4 m4/yaz.m4 buildconf.sh Doxyfile.in
 
 dist-hook:
diff -Naur idzebra-2.0.43/rset/rsmultiandor.c idzebra-2.0.44/rset/rsmultiandor.c
--- idzebra-2.0.43/rset/rsmultiandor.c	2009-06-19 14:57:28.000000000 +0200
+++ idzebra-2.0.44/rset/rsmultiandor.c	2010-06-29 10:57:13.000000000 +0200
@@ -613,11 +613,12 @@
 	(struct rfd_private *)(rfd->priv);
     double ratio = and_op ? 0.0 : 1.0;
     int i;
+    double sum_cur = 0.0;
+    double sum_tot = 0.0;
     for (i = 0; i<ct->no_children; i++){
         double nratio, cur, tot;
         rset_pos(mrfd->items[i].fd, &cur, &tot);
         yaz_log(log_level, "r_pos: %d %0.1f %0.1f", i, cur,tot);
-        
         nratio = cur / tot;
         if (and_op)
         {
@@ -626,10 +627,12 @@
         }
         else
         {
-            if (nratio < ratio)
-                ratio = nratio;
+            sum_cur += cur;
+            sum_tot += tot;
         }
     }
+    if (!and_op)
+        ratio = sum_cur / sum_tot;
     if (ratio == 0.0 || ratio == 1.0) { /* nothing there */
         *current = 0;
         *total = 0;
diff -Naur idzebra-2.0.43/test/api/test_result_sets.c idzebra-2.0.44/test/api/test_result_sets.c
--- idzebra-2.0.43/test/api/test_result_sets.c	2009-06-19 14:57:28.000000000 +0200
+++ idzebra-2.0.44/test/api/test_result_sets.c	2010-06-29 10:57:13.000000000 +0200
@@ -71,7 +71,7 @@
 	    exit(1);
 	}
         yaz_pqf_destroy(parser);
-        zebra_deleteResultSet(zh, Z_DeleteRequest_list,
+        zebra_deleteResultSet(zh, Z_DeleteResultSetRequest_list,
                               1, &setnamep, &status);
         odr_destroy(odr_input);
         odr_destroy(odr_output);
diff -Naur idzebra-2.0.43/util/zebramap.c idzebra-2.0.44/util/zebramap.c
--- idzebra-2.0.43/util/zebramap.c	2009-06-19 14:57:28.000000000 +0200
+++ idzebra-2.0.44/util/zebramap.c	2010-06-29 10:57:13.000000000 +0200
@@ -698,6 +698,9 @@
 int zebra_map_tokenize_start(zebra_map_t zm,
                              const char *buf, size_t len)
 {
+#if YAZ_HAVE_ICU
+    int ret;
+#endif
     assert(zm->use_chain);
 
     wrbuf_rewind(zm->input_str);
@@ -716,10 +719,9 @@
             yaz_log(YLOG_LOG, "input %s", 
                     wrbuf_cstr(zm->print_str)); 
         }
-        icu_chain_assign_cstr(zm->icu_chain,
-                              wrbuf_cstr(zm->input_str),
-                              &status);
-        if (!U_SUCCESS(status))
+        ret = icu_chain_assign_cstr(zm->icu_chain,
+                                    wrbuf_cstr(zm->input_str), &status);
+        if (!ret && !U_SUCCESS(status))
         {
             if (zm->debug)
             {

Reply to: