Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package librepo for openSUSE:Factory checked in at 2022-10-17 14:57:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/librepo (Old) and /work/SRC/openSUSE:Factory/.librepo.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "librepo" Mon Oct 17 14:57:17 2022 rev:17 rq:1011160 version:1.14.5 Changes: -------- --- /work/SRC/openSUSE:Factory/librepo/librepo.changes 2021-08-31 19:54:52.717876723 +0200 +++ /work/SRC/openSUSE:Factory/.librepo.new.2275/librepo.changes 2022-10-17 14:57:19.242049025 +0200 @@ -1,0 +2,8 @@ +Sat Oct 15 19:32:29 UTC 2022 - Andreas Stieger <andreas.stie...@gmx.de> + +- update to 1.14.5: + * Detailed error message when using non-existing TMPDIR + * Make error messages about repodata and rpm mismatch more user + friendly + +------------------------------------------------------------------- Old: ---- librepo-1.14.2.tar.gz New: ---- librepo-1.14.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ librepo.spec ++++++ --- /var/tmp/diff_new_pack.zDdUub/_old 2022-10-17 14:57:20.042050562 +0200 +++ /var/tmp/diff_new_pack.zDdUub/_new 2022-10-17 14:57:20.046050569 +0200 @@ -1,7 +1,7 @@ # # spec file for package librepo # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # Copyright (c) 2020-2021 Neal Gompa <ngomp...@gmail.com>. # # All modifications and additions to the file contributed by third parties @@ -37,7 +37,7 @@ %define devname %{name}-devel Name: librepo -Version: 1.14.2 +Version: 1.14.5 Release: 0 Summary: Repodata downloading library License: LGPL-2.0-or-later @@ -50,7 +50,7 @@ BuildRequires: doxygen BuildRequires: gpgme-devel BuildRequires: pkgconfig(check) -BuildRequires: pkgconfig(glib-2.0) >= 2.26.0 +BuildRequires: pkgconfig(glib-2.0) >= 2.28.0 BuildRequires: pkgconfig(libcrypto) BuildRequires: pkgconfig(libcurl) >= 7.52.0 BuildRequires: pkgconfig(libxml-2.0) ++++++ librepo-1.14.2.tar.gz -> librepo-1.14.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/CMakeLists.txt new/librepo-1.14.5/CMakeLists.txt --- old/librepo-1.14.2/CMakeLists.txt 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/CMakeLists.txt 2022-09-09 12:32:23.000000000 +0200 @@ -28,7 +28,7 @@ # Find necessare libraries FIND_PACKAGE(PkgConfig) -PKG_CHECK_MODULES(GLIB2 glib-2.0 REQUIRED) +PKG_CHECK_MODULES(GLIB2 glib-2.0>=2.28 REQUIRED) PKG_SEARCH_MODULE(LIBCRYPTO REQUIRED libcrypto openssl) PKG_CHECK_MODULES(LIBXML2 libxml-2.0 REQUIRED) FIND_PACKAGE(CURL 7.52.0 REQUIRED) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/README.md new/librepo-1.14.5/README.md --- old/librepo-1.14.2/README.md 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/README.md 2022-09-09 12:32:23.000000000 +0200 @@ -14,7 +14,7 @@ * gcc (http://gcc.gnu.org/) - gcc/gcc * glib2 (http://developer.gnome.org/glib/) - glib2-devel/libglib2.0-dev * gpgme (http://www.gnupg.org/) - gpgme-devel/libgpgme11-dev -* libattr (http://www.bestbits.at/acl/) - libattr-devel/libattr1-dev +* libattr (https://savannah.nongnu.org/projects/attr) - libattr-devel/libattr1-dev * libcurl (http://curl.haxx.se/libcurl/) - libcurl-devel/libcurl4-openssl-dev * openssl (http://www.openssl.org/) - openssl-devel/libssl-dev * python (http://python.org/) - python3-devel/libpython3-dev diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/VERSION.cmake new/librepo-1.14.5/VERSION.cmake --- old/librepo-1.14.2/VERSION.cmake 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/VERSION.cmake 2022-09-09 12:32:23.000000000 +0200 @@ -1,3 +1,3 @@ SET(LIBREPO_MAJOR "1") SET(LIBREPO_MINOR "14") -SET(LIBREPO_PATCH "2") +SET(LIBREPO_PATCH "5") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/checksum.c new/librepo-1.14.5/librepo/checksum.c --- old/librepo-1.14.2/librepo/checksum.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/checksum.c 2022-09-09 12:32:23.000000000 +0200 @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#define _POSIX_C_SOURCE 200809L #include <glib.h> #include <glib/gprintf.h> #include <assert.h> @@ -204,8 +205,6 @@ gchar **calculated, GError **err) { - _cleanup_free_ gchar *checksum = NULL; - assert(fd >= 0); assert(!err || *err == NULL); @@ -217,16 +216,18 @@ return FALSE; } - time_t timestamp = -1; + long long timestamp = -1; if (caching) { struct stat st; if (fstat(fd, &st) == 0) { timestamp = st.st_mtime; + timestamp *= 1000000000; //convert sec timestamp to nanosec timestamp + timestamp += st.st_mtim.tv_nsec; } } - _cleanup_free_ gchar *timestamp_str = g_strdup_printf("%lli", (long long)timestamp); + _cleanup_free_ gchar *timestamp_str = g_strdup_printf("%lli", timestamp); const char *type_str = lr_checksum_type_to_str(type); _cleanup_free_ gchar *timestamp_key = g_strconcat(XATTR_CHKSUM_PREFIX, "mtime", NULL); _cleanup_free_ gchar *checksum_key = g_strconcat(XATTR_CHKSUM_PREFIX, type_str, NULL); @@ -259,7 +260,7 @@ } } - checksum = lr_checksum_fd(type, fd, err); + char *checksum = lr_checksum_fd(type, fd, err); if (!checksum) return FALSE; @@ -271,6 +272,7 @@ } else { g_set_error(err, LR_CHECKSUM_ERROR, LRE_FILE, "fsync failed: %s", strerror(errno)); + lr_free(checksum); return FALSE; } } @@ -284,6 +286,7 @@ if (calculated) *calculated = g_strdup(checksum); + lr_free(checksum); return TRUE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/downloader.c new/librepo-1.14.5/librepo/downloader.c --- old/librepo-1.14.2/librepo/downloader.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/downloader.c 2022-09-09 12:32:23.000000000 +0200 @@ -534,8 +534,9 @@ __func__, content_length, expected); lrtarget->headercb_state = LR_HCS_INTERRUPTED; lrtarget->headercb_interrupt_reason = g_strdup_printf( - "FTP server reports size: %"G_GINT64_FORMAT" " - "via 213 code, but expected size is: %"G_GINT64_FORMAT, + "Inconsistent FTP server data, file Content-Length: %"G_GINT64_FORMAT " reported" + " via 213 code, repository metadata states file length: %"G_GINT64_FORMAT + " (please report to repository maintainer)", content_length, expected); ret++; // Return error value } else { @@ -565,8 +566,9 @@ __func__, content_length, expected); lrtarget->headercb_state = LR_HCS_INTERRUPTED; lrtarget->headercb_interrupt_reason = g_strdup_printf( - "Server reports Content-Length: %"G_GINT64_FORMAT" but " - "expected size is: %"G_GINT64_FORMAT, + "Inconsistent server data, reported file Content-Length: %"G_GINT64_FORMAT + ", repository metadata states file length: %"G_GINT64_FORMAT + " (please report to repository maintainer)", content_length, expected); ret++; // Return error value } else { @@ -1974,7 +1976,7 @@ tmp = g_strconcat(expected, chksum->value, "(", chtype_str ? chtype_str : "UNKNOWN", ") ", NULL); - free(expected); + g_free(expected); expected = tmp; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/lrmirrorlist.c new/librepo-1.14.5/librepo/lrmirrorlist.c --- old/librepo-1.14.2/librepo/lrmirrorlist.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/lrmirrorlist.c 2022-09-09 12:32:23.000000000 +0200 @@ -156,7 +156,7 @@ LrInternalMirror *mirror = lr_lrmirror_new(url_copy, urlvars); mirror->preference = metalinkurl->preference; mirror->protocol = lr_detect_protocol(mirror->url); - lr_free(url_copy); + g_free(url_copy); list = g_slist_append(list, mirror); //g_debug("%s: Appending URL: %s", __func__, mirror->url); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/metadata_downloader.c new/librepo-1.14.5/librepo/metadata_downloader.c --- old/librepo-1.14.2/librepo/metadata_downloader.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/metadata_downloader.c 2022-09-09 12:32:23.000000000 +0200 @@ -24,8 +24,8 @@ #include <assert.h> #include <string.h> #include <errno.h> +#include <unistd.h> #include <sys/stat.h> -#include <zconf.h> #include "librepo/librepo.h" @@ -89,8 +89,7 @@ if (!target) return; g_string_chunk_free(target->chunk); - if (target->err != NULL) - g_list_free(target->err); + g_list_free_full(target->err, g_free); g_free(target); } @@ -98,26 +97,11 @@ lr_metadatatarget_append_error(LrMetadataTarget *target, char *format, ...) { va_list valist; - size_t length = strlen(format); - char *error_message = NULL; - - va_start(valist, format); - while (1) { - char *arg = va_arg(valist, char*); - if (arg == NULL) - break; - - length += strlen(arg); - } - length += RESERVE; - va_end(valist); - va_start(valist, format); - error_message = malloc(length * sizeof(char)); - vsnprintf(error_message, length, format, valist); + gchar *error_message = g_strdup_vprintf(format, valist); va_end(valist); - target->err = g_list_append(target->err, (gpointer) error_message); + target->err = g_list_append(target->err, error_message); } static gboolean @@ -192,7 +176,7 @@ GSList **paths, GError *err) { - lr_metadatatarget_append_error(target, err->message, NULL); + lr_metadatatarget_append_error(target, err->message); fillInvalidationValues(fd_list, paths); g_error_free(err); } @@ -221,13 +205,13 @@ handle = target->handle; if (!handle->urls && !handle->mirrorlisturl && !handle->metalinkurl) { - lr_metadatatarget_append_error(target, "No LRO_URLS, LRO_MIRRORLISTURL nor LRO_METALINKURL specified", NULL); + lr_metadatatarget_append_error(target, "No LRO_URLS, LRO_MIRRORLISTURL nor LRO_METALINKURL specified"); fillInvalidationValues(fd_list, paths); continue; } if (handle->repotype != LR_YUMREPO) { - lr_metadatatarget_append_error(target, "Bad LRO_REPOTYPE specified", NULL); + lr_metadatatarget_append_error(target, "Bad LRO_REPOTYPE specified"); fillInvalidationValues(fd_list, paths); continue; } @@ -242,14 +226,14 @@ if (!lr_handle_prepare_internal_mirrorlist(handle, handle->fastestmirror, &err)) { - lr_metadatatarget_append_error(target, "Cannot prepare internal mirrorlist: %s", err->message, NULL); + lr_metadatatarget_append_error(target, "Cannot prepare internal mirrorlist: %s", err->message); fillInvalidationValues(fd_list, paths); g_error_free(err); continue; } if (mkdir(handle->destdir, S_IRWXU) == -1 && errno != EEXIST) { - lr_metadatatarget_append_error(target, "Cannot create tmpdir: %s %s", handle->destdir, g_strerror(errno), NULL); + lr_metadatatarget_append_error(target, "Cannot create tmpdir: %s %s", handle->destdir, g_strerror(errno)); fillInvalidationValues(fd_list, paths); g_error_free(err); continue; @@ -335,12 +319,12 @@ handle->gnupghomedir = g_strdup(target->gnupghomedir); if (target->download_target->rcode != LRE_OK) { - lr_metadatatarget_append_error(target, (char *) lr_strerror(target->download_target->rcode), NULL); + lr_metadatatarget_append_error(target, (char *) lr_strerror(target->download_target->rcode)); goto fail; } if (!lr_check_repomd_xml_asc_availability(handle, target->repo, fd_value, path->data, &error)) { - lr_metadatatarget_append_error(target, error->message, NULL); + lr_metadatatarget_append_error(target, error->message); g_error_free(error); goto fail; } @@ -349,7 +333,7 @@ ret = lr_yum_repomd_parse_file(target->repomd, fd_value, lr_xml_parser_warning_logger, "Repomd xml parser", &error); if (!ret) { - lr_metadatatarget_append_error(target, "Parsing unsuccessful: %s", error->message, NULL); + lr_metadatatarget_append_error(target, "Parsing unsuccessful: %s", error->message); g_error_free(error); goto fail; } @@ -377,7 +361,7 @@ LrDownloadTarget *download_target = elem->data; LrMetadataTarget *target = download_target->userdata; if (download_target->err) - lr_metadatatarget_append_error(target, download_target->err, NULL); + lr_metadatatarget_append_error(target, download_target->err); if (target->err != NULL) { ret = FALSE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/metalink.c new/librepo-1.14.5/librepo/metalink.c --- old/librepo-1.14.2/librepo/metalink.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/metalink.c 2022-09-09 12:32:23.000000000 +0200 @@ -504,7 +504,7 @@ // Parsing - ret = lr_xml_parser_generic(parser, pd, fd, &tmp_err); + ret = lr_xml_parser_generic(&parser, pd, fd, &tmp_err); if (tmp_err) { g_propagate_error(err, tmp_err); goto err; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/package_downloader.c new/librepo-1.14.5/librepo/package_downloader.c --- old/librepo-1.14.2/librepo/package_downloader.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/package_downloader.c 2022-09-09 12:32:23.000000000 +0200 @@ -173,7 +173,7 @@ if (!target) return; g_string_chunk_free(target->chunk); - g_free(target); + lr_free(target); } gboolean diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/repoconf.c new/librepo-1.14.5/librepo/repoconf.c --- old/librepo-1.14.2/librepo/repoconf.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/repoconf.c 2022-09-09 12:32:23.000000000 +0200 @@ -146,7 +146,7 @@ return; g_slist_free_full(repos->repos, (GDestroyNotify) lr_yum_repoconf_free); g_slist_free_full(repos->files, (GDestroyNotify) lr_yum_repofile_free); - g_free(repos); + lr_free(repos); } GSList * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/repomd.c new/librepo-1.14.5/librepo/repomd.c --- old/librepo-1.14.2/librepo/repomd.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/repomd.c 2022-09-09 12:32:23.000000000 +0200 @@ -570,7 +570,7 @@ // Parsing - ret = lr_xml_parser_generic(parser, pd, fd, &tmp_err); + ret = lr_xml_parser_generic(&parser, pd, fd, &tmp_err); if (tmp_err) g_propagate_error(err, tmp_err); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/repoutil_yum.c new/librepo-1.14.5/librepo/repoutil_yum.c --- old/librepo-1.14.2/librepo/repoutil_yum.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/repoutil_yum.c 2022-09-09 12:32:23.000000000 +0200 @@ -105,11 +105,11 @@ if (fd < 0) { g_set_error(err, LR_REPOUTIL_YUM_ERROR, LRE_IO, "open(%s, O_RDONLY) error: %s", path, g_strerror(errno)); - lr_free(path); + g_free(path); return FALSE; } - lr_free(path); + g_free(path); ret = lr_yum_repomd_parse_file(repomd, fd, NULL, NULL, err); close(fd); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/util.c new/librepo-1.14.5/librepo/util.c --- old/librepo-1.14.2/librepo/util.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/util.c 2022-09-09 12:32:23.000000000 +0200 @@ -158,7 +158,7 @@ template = g_build_filename(g_get_tmp_dir(), "librepo-tmp-XXXXXX", NULL); fd = mkstemp(template); if (fd < 0) { - perror("Cannot create temporary file - mkstemp"); + fprintf(stderr, "Cannot create temporary file - mkstemp '%s': %s\n", template, strerror(errno)); exit(1); } unlink(template); @@ -170,7 +170,7 @@ { char *template = g_build_filename(g_get_tmp_dir(), "librepo-tmpdir-XXXXXX", NULL); if (!mkdtemp(template)) { - lr_free(template); + g_free(template); return NULL; } return template; @@ -206,7 +206,7 @@ qmark_section = strchr(first, '?'); - res = lr_malloc(total_len + separator_len + 1); + res = g_malloc(total_len + separator_len + 1); next = first; va_start(args, first); @@ -273,7 +273,7 @@ assert(offset <= total_len); if (offset == 0) { - lr_free(res); + g_free(res); return g_strdup(first); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/xmlparser.c new/librepo-1.14.5/librepo/xmlparser.c --- old/librepo-1.14.2/librepo/xmlparser.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/xmlparser.c 2022-09-09 12:32:23.000000000 +0200 @@ -143,7 +143,7 @@ } gboolean -lr_xml_parser_generic(XmlParser parser, +lr_xml_parser_generic(XmlParser *parser, LrParserData *pd, int fd, GError **err) @@ -151,7 +151,7 @@ /* Note: This function uses .err members of LrParserData! */ gboolean ret = TRUE; - xmlParserCtxtPtr ctxt = xmlCreatePushParserCtxt(&parser, pd, NULL, 0, NULL); + xmlParserCtxtPtr ctxt = xmlCreatePushParserCtxt(parser, pd, NULL, 0, NULL); ctxt->linenumbers = 1; assert(ctxt); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/xmlparser_internal.h new/librepo-1.14.5/librepo/xmlparser_internal.h --- old/librepo-1.14.2/librepo/xmlparser_internal.h 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/xmlparser_internal.h 2022-09-09 12:32:23.000000000 +0200 @@ -159,7 +159,7 @@ /** Generic parser. */ gboolean -lr_xml_parser_generic(XmlParser parser, +lr_xml_parser_generic(XmlParser *parser, LrParserData *pd, int fd, GError **err); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo/yum.c new/librepo-1.14.5/librepo/yum.c --- old/librepo-1.14.2/librepo/yum.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo/yum.c 2022-09-09 12:32:23.000000000 +0200 @@ -335,7 +335,7 @@ return FALSE; } } - lr_free(path_to_repodata); + g_free(path_to_repodata); return TRUE; } @@ -356,7 +356,7 @@ g_debug("%s: Cannot create: %s", __func__, ml_file_path); g_set_error(err, LR_YUM_ERROR, LRE_IO, "Cannot create %s: %s", ml_file_path, g_strerror(errno)); - lr_free(ml_file_path); + g_free(ml_file_path); return FALSE; } rc = lr_copy_content(handle->mirrorlist_fd, fd); @@ -366,7 +366,7 @@ g_set_error(err, LR_YUM_ERROR, LRE_IO, "Cannot copy content of mirrorlist file %s: %s", ml_file_path, g_strerror(errno)); - lr_free(ml_file_path); + g_free(ml_file_path); return FALSE; } repo->mirrorlist = ml_file_path; @@ -391,7 +391,7 @@ g_debug("%s: Cannot create: %s", __func__, ml_file_path); g_set_error(err, LR_YUM_ERROR, LRE_IO, "Cannot create %s: %s", ml_file_path, g_strerror(errno)); - lr_free(ml_file_path); + g_free(ml_file_path); return FALSE; } rc = lr_copy_content(handle->metalink_fd, fd); @@ -401,7 +401,7 @@ g_set_error(err, LR_YUM_ERROR, LRE_IO, "Cannot copy content of metalink file %s: %s", ml_file_path, g_strerror(errno)); - lr_free(ml_file_path); + g_free(ml_file_path); return FALSE; } repo->metalink = ml_file_path; @@ -422,7 +422,7 @@ if (fd == -1) { g_set_error(err, LR_YUM_ERROR, LRE_IO, "Cannot open %s: %s", *path, g_strerror(errno)); - lr_free(*path); + g_free(*path); return -1; } @@ -458,13 +458,13 @@ g_debug("%s: Cannot open: %s", __func__, signature); g_set_error(err, LR_YUM_ERROR, LRE_IO, "Cannot open %s: %s", signature, g_strerror(errno)); - lr_free(signature); + g_free(signature); return FALSE; } url = lr_pathconcat(handle->used_mirror, "repodata/repomd.xml.asc", NULL); ret = lr_download_url(handle, url, fd_sig, &tmp_err); - lr_free(url); + g_free(url); close(fd_sig); if (!ret) { // Error downloading signature @@ -474,7 +474,7 @@ "repository does not support GPG verification: %s", tmp_err->message); g_clear_error(&tmp_err); unlink(signature); - lr_free(signature); + g_free(signature); return FALSE; } else { // Signature downloaded @@ -483,7 +483,7 @@ path, handle->gnupghomedir, &tmp_err); - lr_free(signature); + g_free(signature); if (!ret) { g_debug("%s: GPG signature verification failed: %s", __func__, tmp_err->message); @@ -680,7 +680,7 @@ __func__, *path, g_strerror(errno)); g_set_error(err, LR_YUM_ERROR, LRE_IO, "Cannot create/open %s: %s", *path, g_strerror(errno)); - lr_free(*path); + g_free(*path); g_slist_free_full(*targets, (GDestroyNotify) lr_downloadtarget_free); return FALSE; } @@ -713,7 +713,7 @@ __func__, *path, g_strerror(errno)); g_set_error(err, LR_YUM_ERROR, LRE_IO, "Cannot create/open %s: %s", *path, g_strerror(errno)); - lr_free(*path); + g_free(*path); g_slist_free_full(*targets, (GDestroyNotify) lr_downloadtarget_free); return FALSE; } @@ -778,7 +778,7 @@ char *dest_dir = realpath(handle->destdir, NULL); path = lr_pathconcat(handle->destdir, record->location_href, NULL); char *requested_dir = realpath(dirname(path), NULL); - lr_free(path); + g_free(path); if (!g_str_has_prefix(requested_dir, dest_dir)) { g_debug("%s: Invalid path: %s", __func__, location_href); g_set_error(err, LR_YUM_ERROR, LRE_IO, "Invalid path: %s", location_href); @@ -850,7 +850,7 @@ /* Because path may already exists in repo (while update) */ lr_yum_repo_update(repo, record->type, path); - lr_free(path); + g_free(path); } return TRUE; @@ -1130,7 +1130,7 @@ repo->mirrorlist = mrl_fn; } else { repo->mirrorlist = NULL; - lr_free(mrl_fn); + g_free(mrl_fn); } } @@ -1142,7 +1142,7 @@ repo->metalink = mtl_fn; } else { repo->metalink = NULL; - lr_free(mtl_fn); + g_free(mtl_fn); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/librepo.spec new/librepo-1.14.5/librepo.spec --- old/librepo-1.14.2/librepo.spec 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/librepo.spec 2022-09-09 12:32:23.000000000 +0200 @@ -11,7 +11,7 @@ %global dnf_conflict 2.8.8 Name: librepo -Version: 1.14.2 +Version: 1.14.5 Release: 1%{?dist} Summary: Repodata downloading library @@ -23,7 +23,7 @@ BuildRequires: gcc BuildRequires: check-devel BuildRequires: doxygen -BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(glib-2.0) >= 2.28 BuildRequires: gpgme-devel BuildRequires: libattr-devel BuildRequires: libcurl-devel >= %{libcurl_version} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/tests/test_checksum.c new/librepo-1.14.5/tests/test_checksum.c --- old/librepo-1.14.2/tests/test_checksum.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/tests/test_checksum.c 2022-09-09 12:32:23.000000000 +0200 @@ -1,3 +1,4 @@ +#define _POSIX_C_SOURCE 200809L #define _GNU_SOURCE #include <errno.h> #include <stdlib.h> @@ -86,7 +87,7 @@ test_checksum(file, LR_CHECKSUM_SHA512, CHKS_VAL_01_SHA512); ck_assert_msg(remove(file) == 0, "Cannot delete temporary test file"); - lr_free(file); + g_free(file); } END_TEST @@ -150,7 +151,10 @@ // stored timestamp matches the file mtime ret = stat(filename, &st); ck_assert_int_eq(ret, 0); - mtime_str = g_strdup_printf("%lli", (long long) st.st_mtime); + long long timestamp = st.st_mtime; + timestamp *= 1000000000; //convert sec timestamp to nanosec timestamp + timestamp += st.st_mtim.tv_nsec; + mtime_str = g_strdup_printf("%lli", timestamp); attr_ret = GETXATTR(filename, timestamp_key, &buf, sizeof(buf)-1); ck_assert(attr_ret != -1); buf[attr_ret] = 0; @@ -231,9 +235,9 @@ ck_assert(attr_ret == -1); // Cached checksum should not exists lr_free(calculated); - lr_free(filename); - lr_free(timestamp_key); - lr_free(checksum_key); + g_free(filename); + g_free(timestamp_key); + g_free(checksum_key); lr_free(mtime_str); } END_TEST @@ -290,9 +294,9 @@ ck_assert(attr_ret != -1); cleanup: close(fd); - lr_free(filename); - lr_free(timestamp_key); - lr_free(checksum_key); + g_free(filename); + g_free(timestamp_key); + g_free(checksum_key); } END_TEST diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/tests/test_downloader.c new/librepo-1.14.5/tests/test_downloader.c --- old/librepo-1.14.2/tests/test_downloader.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/tests/test_downloader.c 2022-09-09 12:32:23.000000000 +0200 @@ -52,7 +52,7 @@ tmpfn1 = lr_pathconcat(test_globals.tmpdir, "single_file_XXXXXX", NULL); fd1 = mkstemp(tmpfn1); - lr_free(tmpfn1); + g_free(tmpfn1); ck_assert_int_ge(fd1, 0); t1 = lr_downloadtarget_new(handle, "index.html", NULL, fd1, NULL, NULL, @@ -97,7 +97,7 @@ tmpfn1 = lr_pathconcat(test_globals.tmpdir, "single_file_2_XXXXXX", NULL); fd1 = mkstemp(tmpfn1); - lr_free(tmpfn1); + g_free(tmpfn1); ck_assert_int_ge(fd1, 0); t1 = lr_downloadtarget_new(NULL, "http://seznam.cz/index.html", NULL, @@ -154,8 +154,8 @@ fd1 = mkstemp(tmpfn1); fd2 = mkstemp(tmpfn2); - lr_free(tmpfn1); - lr_free(tmpfn2); + g_free(tmpfn1); + g_free(tmpfn2); ck_assert_int_ge(fd1, 0); ck_assert_int_ge(fd2, 0); @@ -223,9 +223,9 @@ fd1 = mkstemp(tmpfn1); fd2 = mkstemp(tmpfn2); fd3 = mkstemp(tmpfn3); - lr_free(tmpfn1); - lr_free(tmpfn2); - lr_free(tmpfn3); + g_free(tmpfn1); + g_free(tmpfn2); + g_free(tmpfn3); ck_assert_int_ge(fd1, 0); ck_assert_int_ge(fd2, 0); ck_assert_int_ge(fd3, 0); @@ -329,7 +329,7 @@ tmpfn1 = lr_pathconcat(test_globals.tmpdir, "single_file_XXXXXX", NULL); fd1 = mkstemp(tmpfn1); - lr_free(tmpfn1); + g_free(tmpfn1); ck_assert_int_ge(fd1, 0); checksum = lr_downloadtargetchecksum_new(LR_CHECKSUM_SHA512, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/tests/test_gpg.c new/librepo-1.14.5/tests/test_gpg.c --- old/librepo-1.14.2/tests/test_gpg.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/tests/test_gpg.c 2022-09-09 12:32:23.000000000 +0200 @@ -110,7 +110,7 @@ lr_free(_data_path); lr_free(signature_path); lr_free(_signature_path); - lr_free(tmp_home_path); + g_free(tmp_home_path); } END_TEST diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/tests/test_main.c new/librepo-1.14.5/tests/test_main.c --- old/librepo-1.14.2/tests/test_main.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/tests/test_main.c 2022-09-09 12:32:23.000000000 +0200 @@ -39,7 +39,7 @@ static void free_test_globals(struct TestGlobals_s *tg) { - lr_free(tg->tmpdir); + g_free(tg->tmpdir); lr_free(tg->testdata_dir); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/tests/test_metalink.c new/librepo-1.14.5/tests/test_metalink.c --- old/librepo-1.14.2/tests/test_metalink.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/tests/test_metalink.c 2022-09-09 12:32:23.000000000 +0200 @@ -48,7 +48,7 @@ path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR, "metalink_good_01", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_metalink_init(); ck_assert_ptr_nonnull(ml); @@ -160,7 +160,7 @@ path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR, "metalink_good_02", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_metalink_init(); ck_assert_ptr_nonnull(ml); @@ -206,7 +206,7 @@ path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR, "metalink_good_03", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_metalink_init(); ck_assert_ptr_nonnull(ml); @@ -250,7 +250,7 @@ path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR, "metalink_bad_01", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_metalink_init(); ck_assert_ptr_nonnull(ml); @@ -371,7 +371,7 @@ path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR, "metalink_bad_02", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_metalink_init(); ck_assert_ptr_nonnull(ml); @@ -395,7 +395,7 @@ path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR, "metalink_really_bad_01", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_metalink_init(); ck_assert_ptr_nonnull(ml); @@ -419,7 +419,7 @@ path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR, "metalink_really_bad_02", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_metalink_init(); ck_assert_ptr_nonnull(ml); @@ -443,7 +443,7 @@ path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR, "metalink_really_bad_03", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_metalink_init(); ck_assert_ptr_nonnull(ml); @@ -470,7 +470,7 @@ path = lr_pathconcat(test_globals.testdata_dir, METALINK_DIR, "metalink_with_alternates", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_metalink_init(); ck_assert_ptr_nonnull(ml); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/tests/test_mirrorlist.c new/librepo-1.14.5/tests/test_mirrorlist.c --- old/librepo-1.14.2/tests/test_mirrorlist.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/tests/test_mirrorlist.c 2022-09-09 12:32:23.000000000 +0200 @@ -35,7 +35,7 @@ path = lr_pathconcat(test_globals.testdata_dir, MIRRORLIST_DIR, "mirrorlist_01", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_mirrorlist_init(); ck_assert_ptr_nonnull(ml); @@ -68,7 +68,7 @@ path = lr_pathconcat(test_globals.testdata_dir, MIRRORLIST_DIR, "mirrorlist_02", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_mirrorlist_init(); ck_assert_ptr_nonnull(ml); @@ -92,7 +92,7 @@ path = lr_pathconcat(test_globals.testdata_dir, MIRRORLIST_DIR, "mirrorlist_03", NULL); fd = open(path, O_RDONLY); - lr_free(path); + g_free(path); ck_assert_int_ge(fd, 0); ml = lr_mirrorlist_init(); ck_assert_ptr_nonnull(ml); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librepo-1.14.2/tests/test_util.c new/librepo-1.14.5/tests/test_util.c --- old/librepo-1.14.2/tests/test_util.c 2021-08-25 18:45:07.000000000 +0200 +++ new/librepo-1.14.5/tests/test_util.c 2022-09-09 12:32:23.000000000 +0200 @@ -54,7 +54,7 @@ char *tmp_dir = lr_gettmpdir(); ck_assert_ptr_nonnull(tmp_dir); ck_assert_int_eq(rmdir(tmp_dir), 0); - lr_free(tmp_dir); + g_free(tmp_dir); } END_TEST @@ -68,43 +68,43 @@ path = lr_pathconcat("", NULL); ck_assert_ptr_nonnull(path); ck_assert_str_eq(path, ""); - lr_free(path); + g_free(path); path = NULL; path = lr_pathconcat("/tmp", "foo///", "bar", NULL); ck_assert_ptr_nonnull(path); ck_assert_str_eq(path, "/tmp/foo/bar"); - lr_free(path); + g_free(path); path = NULL; path = lr_pathconcat("foo", "bar/", NULL); ck_assert_ptr_nonnull(path); ck_assert_str_eq(path, "foo/bar"); - lr_free(path); + g_free(path); path = NULL; path = lr_pathconcat("foo", "/bar/", NULL); ck_assert_ptr_nonnull(path); ck_assert_str_eq(path, "foo/bar"); - lr_free(path); + g_free(path); path = NULL; path = lr_pathconcat("foo", "bar", "", NULL); ck_assert_ptr_nonnull(path); ck_assert_str_eq(path, "foo/bar/"); - lr_free(path); + g_free(path); path = NULL; path = lr_pathconcat("http://host.net", "path/to/somewhere", NULL); ck_assert_ptr_nonnull(path); ck_assert_str_eq(path, "http://host.net/path/to/somewhere"); - lr_free(path); + g_free(path); path = NULL; path = lr_pathconcat("http://host.net?hello=1", "path/to/", "somewhere", NULL); ck_assert_ptr_nonnull(path); ck_assert_str_eq(path, "http://host.net/path/to/somewhere?hello=1"); - lr_free(path); + g_free(path); path = NULL; } END_TEST @@ -126,8 +126,8 @@ ck_assert_int_eq(rc, 0); ck_assert_int_ne(unlink(tmp_file), 0); ck_assert_int_ne(rmdir(tmp_dir), 0); - lr_free(tmp_dir); - lr_free(tmp_file); + g_free(tmp_dir); + g_free(tmp_file); } END_TEST @@ -141,61 +141,61 @@ new_url = lr_url_without_path(""); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, ""); - lr_free(new_url); + g_free(new_url); new_url = NULL; new_url = lr_url_without_path("hostname"); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, "hostname"); - lr_free(new_url); + g_free(new_url); new_url = NULL; new_url = lr_url_without_path("hostname/foo/bar/"); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, "hostname"); - lr_free(new_url); + g_free(new_url); new_url = NULL; new_url = lr_url_without_path("hostname:80"); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, "hostname:80"); - lr_free(new_url); + g_free(new_url); new_url = NULL; new_url = lr_url_without_path("hostname:80/foo/bar"); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, "hostname:80"); - lr_free(new_url); + g_free(new_url); new_url = NULL; new_url = lr_url_without_path("http://hostname:80/"); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, "http://hostname:80"); - lr_free(new_url); + g_free(new_url); new_url = NULL; new_url = lr_url_without_path("http://hostname:80/foo/bar"); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, "http://hostname:80"); - lr_free(new_url); + g_free(new_url); new_url = NULL; new_url = lr_url_without_path("ftp://foo.hostname:80/foo/bar"); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, "ftp://foo.hostname:80"); - lr_free(new_url); + g_free(new_url); new_url = NULL; new_url = lr_url_without_path("file:///home/foobar"); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, "file://"); - lr_free(new_url); + g_free(new_url); new_url = NULL; new_url = lr_url_without_path("file:/home/foobar"); ck_assert_ptr_nonnull(new_url); ck_assert_str_eq(new_url, "file://"); - lr_free(new_url); + g_free(new_url); new_url = NULL; } END_TEST