]> git.pld-linux.org Git - packages/libxml2.git/commitdiff
up to 2.13.1 master
authorJan Palus <atler@pld-linux.org>
Wed, 19 Jun 2024 15:38:05 +0000 (17:38 +0200)
committerJan Palus <atler@pld-linux.org>
Wed, 19 Jun 2024 15:38:05 +0000 (17:38 +0200)
libxml2-open.gz.patch
libxml2.spec

index 644204bde6ab19ef187d72b8664f8c04a808cb1f..1d01b0cf527b72b20b7a00fc700d1598016b64fa 100644 (file)
@@ -1,38 +1,32 @@
---- libxml2-2.10.0/xmlIO.c.orig        2022-08-18 16:29:32.843322082 +0200
-+++ libxml2-2.10.0/xmlIO.c     2022-08-18 16:32:12.985787850 +0200
-@@ -1115,8 +1115,33 @@ xmlGzfileOpen_real (const char *filename
+--- libxml2-2.13.0/xmlIO.c.orig        2024-06-14 12:32:12.257784372 +0200
++++ libxml2-2.13.0/xmlIO.c     2024-06-14 19:23:06.355299914 +0200
+@@ -547,6 +547,29 @@
+     fd = open(filename, flags, 0777);
+ #endif /* WIN32 */
  
-     if (path == NULL)
-       return(NULL);
--    if (!xmlCheckFilename(path))
--        return(NULL);
-+    if (!xmlCheckFilename(path)) {
-+      /* If we cannot open `foo.xml', we try `foo.xml.gz'. However we i
-+       * append .gz only if filename doesn't alreay end with .gz. */
-+      if (strlen(path) < 3 || strcmp(path + strlen(path) - 3, ".gz") != 0) {
-+          char *gz_filename = xmlMalloc(strlen(path) + 4);
++#ifdef LIBXML_ZLIB_ENABLED
++    if (fd < 0 && errno == ENOENT) {
++        /* If we cannot open `foo.xml', we try `foo.xml.gz'. However we i
++         * append .gz only if filename doesn't alreay end with .gz. */
++        if (strlen(filename) < 3 || strcmp(filename + strlen(filename) - 3, ".gz") != 0) {
++            char *gz_filename = xmlMalloc(strlen(filename) + 4);
++            int gz_fd;
 +
-+          if (gz_filename == NULL) {
-+              xmlGenericError(xmlGenericErrorContext,
-+                              "xmlGzfileOpen:  %s\n",
-+                              "Failure allocating buffer for filename.");
-+              return NULL;
-+          }
++            if (gz_filename != NULL) {
++                strcpy(gz_filename, filename);
++                strcat(gz_filename, ".gz");
++            }
 +
-+          strcpy(gz_filename, path);
-+          strcat(gz_filename, ".gz");
++            gz_fd = open(gz_filename, flags, 0777);
 +
-+          fd = NULL;
++            if (gz_fd >= 0)
++                fd = gz_fd;
 +
-+          if (xmlCheckFilename(gz_filename))
-+              fd = gzopen(gz_filename, "rb");
-+
-+          xmlFree(gz_filename);
-+           
-+          return((void *) fd);
-+      } else
-+          return NULL;
++            xmlFree(gz_filename);
++        }
 +    }
- #if defined(_WIN32)
-     fd = xmlWrapGzOpenUtf8(path, "rb");
++
++#endif /* LIBXML_ZLIB_ENABLED */
+     if (fd < 0) {
+         /*
+          * Windows and possibly other platforms return EINVAL
index 2227c706440da8667e645047bb2e4a4a0798450d..84d198fab56df0e2e4bbfed8dc096f8fb8de1655 100644 (file)
@@ -9,7 +9,6 @@
 %bcond_without python3         # CPython 3.x module
 %bcond_without static_libs     # static library
 %bcond_without zlib            # zlib support
-%bcond_with    mem_debug       # libxml2 memory debuging
 %bcond_without tests           # "make check" call
 
 Summary:       libXML library version 2
@@ -17,14 +16,14 @@ Summary(es.UTF-8):  Biblioteca libXML version 2
 Summary(pl.UTF-8):     Biblioteka libXML wersja 2
 Summary(pt_BR.UTF-8):  Biblioteca libXML versão 2
 Name:          libxml2
-Version:       2.12.6
+Version:       2.13.1
 Release:       1
 Epoch:         1
 License:       MIT
 Group:         Libraries
 #Source0:      ftp://xmlsoft.org/libxml2/%{name}-%{version}.tar.gz
-Source0:       https://download.gnome.org/sources/libxml2/2.12/%{name}-%{version}.tar.xz
-# Source0-md5: 37fab9ace78d8a085af81dc9a19f36d9
+Source0:       https://download.gnome.org/sources/libxml2/2.13/%{name}-%{version}.tar.xz
+# Source0-md5: d76c4742c94adb5d027c718fdeb726c8
 Patch0:                %{name}-open.gz.patch
 Patch1:                %{name}-largefile.patch
 Patch2:                %{name}-libx32.patch
@@ -196,11 +195,12 @@ do biblioteki libxml2.
        --disable-silent-rules \
        %{?with_static_libs:--enable-static} \
        %{?with_ftp:--with-ftp} \
+       --with-http \
        %{?with_legacy:--with-legacy} \
        --with-lzma \
-       --with-mem-debug%{!?with_mem_debug:=no} \
        --without-python \
-       %{!?with_zlib:--without-zlib}
+       --with-tls \
+       %{?with_zlib:--with-zlib}
 
 %{__make}
 
@@ -241,8 +241,10 @@ cd python
 cd ..
 %endif
 
-install -d $RPM_BUILD_ROOT%{_examplesdir}
-%{__mv} $RPM_BUILD_ROOT%{_docdir}/libxml2/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%if %{with apidocs}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cp -p example/*.{c,xml} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%endif
 
 # install catalog file
 install -d $RPM_BUILD_ROOT%{_sysconfdir}/xml
This page took 0.158084 seconds and 4 git commands to generate.