Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libzip for openSUSE:Factory checked in at 2024-11-12 19:19:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzip (Old) and /work/SRC/openSUSE:Factory/.libzip.new.2017 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libzip" Tue Nov 12 19:19:54 2024 rev:48 rq:1223409 version:1.11.2 Changes: -------- --- /work/SRC/openSUSE:Factory/libzip/libzip.changes 2024-11-01 21:00:51.505622809 +0100 +++ /work/SRC/openSUSE:Factory/.libzip.new.2017/libzip.changes 2024-11-12 19:20:06.904183854 +0100 @@ -1,0 +2,6 @@ +Thu Nov 7 18:06:35 UTC 2024 - Yann BOYER <yann.boyer...@gmail.com> + +- version update to 1.11.2 + * Fix performance regression in `zip_stat` introduced in 1.11. + +------------------------------------------------------------------- Old: ---- libzip-1.11.1.tar.xz New: ---- libzip-1.11.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzip.spec ++++++ --- /var/tmp/diff_new_pack.vEJOS7/_old 2024-11-12 19:20:07.444206479 +0100 +++ /var/tmp/diff_new_pack.vEJOS7/_new 2024-11-12 19:20:07.444206479 +0100 @@ -19,7 +19,7 @@ %{!?make_build: %global make_build make %{?_smp_mflags}} %define sover 5 Name: libzip -Version: 1.11.1 +Version: 1.11.2 Release: 0 Summary: C library for reading, creating, and modifying zip archives License: BSD-3-Clause ++++++ libzip-1.11.1.tar.xz -> libzip-1.11.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/.github/ISSUE_TEMPLATE/other.md new/libzip-1.11.2/.github/ISSUE_TEMPLATE/other.md --- old/libzip-1.11.1/.github/ISSUE_TEMPLATE/other.md 1970-01-01 01:00:00.000000000 +0100 +++ new/libzip-1.11.2/.github/ISSUE_TEMPLATE/other.md 2024-10-31 23:27:33.000000000 +0100 @@ -0,0 +1,10 @@ +--- +name: Other +about: If you have a question about libzip , consider using Discussions instead. +title: '' +labels: '' +assignees: '' + +--- + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/CMakeLists.txt new/libzip-1.11.2/CMakeLists.txt --- old/libzip-1.11.1/CMakeLists.txt 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/CMakeLists.txt 2024-10-31 23:27:33.000000000 +0100 @@ -6,7 +6,7 @@ endif() project(libzip - VERSION 1.11.1 + VERSION 1.11.2 LANGUAGES C) if(NOT libzip_VERSION_PATCH) @@ -101,7 +101,10 @@ check_function_exists(_dup HAVE__DUP) check_function_exists(_fdopen HAVE__FDOPEN) check_function_exists(_fileno HAVE__FILENO) +check_function_exists(_fseeki64 HAVE__FSEEKI64) +check_function_exists(_fstat64 HAVE__FSTAT64) check_function_exists(_setmode HAVE__SETMODE) +check_function_exists(_stat64 HAVE__STAT64) check_symbol_exists(_snprintf stdio.h HAVE__SNPRINTF) check_symbol_exists(_snprintf_s stdio.h HAVE__SNPRINTF_S) check_symbol_exists(_snwprintf_s stdio.h HAVE__SNWPRINTF_S) @@ -244,7 +247,7 @@ endif(ENABLE_LZMA) if(ENABLE_ZSTD) - find_package(zstd 1.3.6) + find_package(zstd 1.4.0) if(zstd_FOUND) set(HAVE_LIBZSTD 1) if(TARGET zstd::libzstd_shared AND BUILD_SHARED_LIBS) @@ -463,8 +466,8 @@ endif() # write out config file -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake-config.h.in ${PROJECT_BINARY_DIR}/config.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake-zipconf.h.in ${PROJECT_BINARY_DIR}/zipconf.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zipconf.h.in ${PROJECT_BINARY_DIR}/zipconf.h) # for tests @@ -477,19 +480,19 @@ write_basic_package_version_file("${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" COMPATIBILITY AnyNewerVersion) -configure_package_config_file("${PROJECT_NAME}-config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libzip) +if(LIBZIP_DO_INSTALL) + configure_package_config_file("${PROJECT_NAME}-config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libzip) -# Install Find* modules, they are required by libzip-config.cmake to resolve dependencies -install(FILES + # Install Find* modules, they are required by libzip-config.cmake to resolve dependencies + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindNettle.cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findzstd.cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindMbedTLS.cmake - DESTINATION + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libzip/modules - ) + ) -if(LIBZIP_DO_INSTALL) # Add targets to the build-tree export set export(TARGETS zip FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/NEWS.md new/libzip-1.11.2/NEWS.md --- old/libzip-1.11.1/NEWS.md 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/NEWS.md 2024-10-31 23:27:33.000000000 +0100 @@ -1,3 +1,7 @@ +# 1.11.2 [2024-10-31] + +* Fix performance regression in `zip_stat` introduced in 1.11. + # 1.11.1 [2024-09-19] * Fix zipconf.h for version number with missing third component. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/cmake-config.h.in new/libzip-1.11.2/cmake-config.h.in --- old/libzip-1.11.1/cmake-config.h.in 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/cmake-config.h.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,72 +0,0 @@ -#ifndef HAD_CONFIG_H -#define HAD_CONFIG_H -#ifndef _HAD_ZIPCONF_H -#include "zipconf.h" -#endif -/* BEGIN DEFINES */ -#cmakedefine ENABLE_FDOPEN -#cmakedefine HAVE___PROGNAME -#cmakedefine HAVE__CLOSE -#cmakedefine HAVE__DUP -#cmakedefine HAVE__FDOPEN -#cmakedefine HAVE__FILENO -#cmakedefine HAVE__SETMODE -#cmakedefine HAVE__SNPRINTF -#cmakedefine HAVE__SNPRINTF_S -#cmakedefine HAVE__SNWPRINTF_S -#cmakedefine HAVE__STRDUP -#cmakedefine HAVE__STRICMP -#cmakedefine HAVE__STRTOI64 -#cmakedefine HAVE__STRTOUI64 -#cmakedefine HAVE__UNLINK -#cmakedefine HAVE_ARC4RANDOM -#cmakedefine HAVE_CLONEFILE -#cmakedefine HAVE_COMMONCRYPTO -#cmakedefine HAVE_CRYPTO -#cmakedefine HAVE_FICLONERANGE -#cmakedefine HAVE_FILENO -#cmakedefine HAVE_FCHMOD -#cmakedefine HAVE_FSEEKO -#cmakedefine HAVE_FTELLO -#cmakedefine HAVE_GETPROGNAME -#cmakedefine HAVE_GNUTLS -#cmakedefine HAVE_LIBBZ2 -#cmakedefine HAVE_LIBLZMA -#cmakedefine HAVE_LIBZSTD -#cmakedefine HAVE_LOCALTIME_R -#cmakedefine HAVE_LOCALTIME_S -#cmakedefine HAVE_MEMCPY_S -#cmakedefine HAVE_MBEDTLS -#cmakedefine HAVE_MKSTEMP -#cmakedefine HAVE_NULLABLE -#cmakedefine HAVE_OPENSSL -#cmakedefine HAVE_SETMODE -#cmakedefine HAVE_SNPRINTF -#cmakedefine HAVE_SNPRINTF_S -#cmakedefine HAVE_STRCASECMP -#cmakedefine HAVE_STRDUP -#cmakedefine HAVE_STRERROR_S -#cmakedefine HAVE_STRERRORLEN_S -#cmakedefine HAVE_STRICMP -#cmakedefine HAVE_STRNCPY_S -#cmakedefine HAVE_STRTOLL -#cmakedefine HAVE_STRTOULL -#cmakedefine HAVE_STRUCT_TM_TM_ZONE -#cmakedefine HAVE_STDBOOL_H -#cmakedefine HAVE_STRINGS_H -#cmakedefine HAVE_UNISTD_H -#cmakedefine HAVE_WINDOWS_CRYPTO -#cmakedefine SIZEOF_OFF_T ${SIZEOF_OFF_T} -#cmakedefine SIZEOF_SIZE_T ${SIZEOF_SIZE_T} -#cmakedefine HAVE_DIRENT_H -#cmakedefine HAVE_FTS_H -#cmakedefine HAVE_NDIR_H -#cmakedefine HAVE_SYS_DIR_H -#cmakedefine HAVE_SYS_NDIR_H -#cmakedefine WORDS_BIGENDIAN -#cmakedefine HAVE_SHARED -/* END DEFINES */ -#define PACKAGE "@CMAKE_PROJECT_NAME@" -#define VERSION "@CMAKE_PROJECT_VERSION@" - -#endif /* HAD_CONFIG_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/cmake-zipconf.h.in new/libzip-1.11.2/cmake-zipconf.h.in --- old/libzip-1.11.1/cmake-zipconf.h.in 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/cmake-zipconf.h.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,47 +0,0 @@ -#ifndef _HAD_ZIPCONF_H -#define _HAD_ZIPCONF_H - -/* - zipconf.h -- platform specific include file - - This file was generated automatically by CMake - based on ../cmake-zipconf.h.in. - */ - -#define LIBZIP_VERSION "${libzip_VERSION}" -#define LIBZIP_VERSION_MAJOR ${libzip_VERSION_MAJOR} -#define LIBZIP_VERSION_MINOR ${libzip_VERSION_MINOR} -#define LIBZIP_VERSION_MICRO ${libzip_VERSION_PATCH} - -#cmakedefine ZIP_STATIC - -${ZIP_NULLABLE_DEFINES} - -${LIBZIP_TYPES_INCLUDE} - -typedef ${ZIP_INT8_T} zip_int8_t; -typedef ${ZIP_UINT8_T} zip_uint8_t; -typedef ${ZIP_INT16_T} zip_int16_t; -typedef ${ZIP_UINT16_T} zip_uint16_t; -typedef ${ZIP_INT32_T} zip_int32_t; -typedef ${ZIP_UINT32_T} zip_uint32_t; -typedef ${ZIP_INT64_T} zip_int64_t; -typedef ${ZIP_UINT64_T} zip_uint64_t; - -#define ZIP_INT8_MIN (-ZIP_INT8_MAX-1) -#define ZIP_INT8_MAX 0x7f -#define ZIP_UINT8_MAX 0xff - -#define ZIP_INT16_MIN (-ZIP_INT16_MAX-1) -#define ZIP_INT16_MAX 0x7fff -#define ZIP_UINT16_MAX 0xffff - -#define ZIP_INT32_MIN (-ZIP_INT32_MAX-1L) -#define ZIP_INT32_MAX 0x7fffffffL -#define ZIP_UINT32_MAX 0xffffffffLU - -#define ZIP_INT64_MIN (-ZIP_INT64_MAX-1LL) -#define ZIP_INT64_MAX 0x7fffffffffffffffLL -#define ZIP_UINT64_MAX 0xffffffffffffffffULL - -#endif /* zipconf.h */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/config.h.in new/libzip-1.11.2/config.h.in --- old/libzip-1.11.1/config.h.in 1970-01-01 01:00:00.000000000 +0100 +++ new/libzip-1.11.2/config.h.in 2024-10-31 23:27:33.000000000 +0100 @@ -0,0 +1,75 @@ +#ifndef HAD_CONFIG_H +#define HAD_CONFIG_H +#ifndef _HAD_ZIPCONF_H +#include "zipconf.h" +#endif +/* BEGIN DEFINES */ +#cmakedefine ENABLE_FDOPEN +#cmakedefine HAVE___PROGNAME +#cmakedefine HAVE__CLOSE +#cmakedefine HAVE__DUP +#cmakedefine HAVE__FDOPEN +#cmakedefine HAVE__FILENO +#cmakedefine HAVE__FSEEKI64 +#cmakedefine HAVE__FSTAT64 +#cmakedefine HAVE__SETMODE +#cmakedefine HAVE__SNPRINTF +#cmakedefine HAVE__SNPRINTF_S +#cmakedefine HAVE__SNWPRINTF_S +#cmakedefine HAVE__STAT64 +#cmakedefine HAVE__STRDUP +#cmakedefine HAVE__STRICMP +#cmakedefine HAVE__STRTOI64 +#cmakedefine HAVE__STRTOUI64 +#cmakedefine HAVE__UNLINK +#cmakedefine HAVE_ARC4RANDOM +#cmakedefine HAVE_CLONEFILE +#cmakedefine HAVE_COMMONCRYPTO +#cmakedefine HAVE_CRYPTO +#cmakedefine HAVE_FICLONERANGE +#cmakedefine HAVE_FILENO +#cmakedefine HAVE_FCHMOD +#cmakedefine HAVE_FSEEKO +#cmakedefine HAVE_FTELLO +#cmakedefine HAVE_GETPROGNAME +#cmakedefine HAVE_GNUTLS +#cmakedefine HAVE_LIBBZ2 +#cmakedefine HAVE_LIBLZMA +#cmakedefine HAVE_LIBZSTD +#cmakedefine HAVE_LOCALTIME_R +#cmakedefine HAVE_LOCALTIME_S +#cmakedefine HAVE_MEMCPY_S +#cmakedefine HAVE_MBEDTLS +#cmakedefine HAVE_MKSTEMP +#cmakedefine HAVE_NULLABLE +#cmakedefine HAVE_OPENSSL +#cmakedefine HAVE_SETMODE +#cmakedefine HAVE_SNPRINTF +#cmakedefine HAVE_SNPRINTF_S +#cmakedefine HAVE_STRCASECMP +#cmakedefine HAVE_STRDUP +#cmakedefine HAVE_STRERROR_S +#cmakedefine HAVE_STRERRORLEN_S +#cmakedefine HAVE_STRICMP +#cmakedefine HAVE_STRNCPY_S +#cmakedefine HAVE_STRTOLL +#cmakedefine HAVE_STRTOULL +#cmakedefine HAVE_STRUCT_TM_TM_ZONE +#cmakedefine HAVE_STDBOOL_H +#cmakedefine HAVE_STRINGS_H +#cmakedefine HAVE_UNISTD_H +#cmakedefine HAVE_WINDOWS_CRYPTO +#cmakedefine SIZEOF_OFF_T ${SIZEOF_OFF_T} +#cmakedefine SIZEOF_SIZE_T ${SIZEOF_SIZE_T} +#cmakedefine HAVE_DIRENT_H +#cmakedefine HAVE_FTS_H +#cmakedefine HAVE_NDIR_H +#cmakedefine HAVE_SYS_DIR_H +#cmakedefine HAVE_SYS_NDIR_H +#cmakedefine WORDS_BIGENDIAN +#cmakedefine HAVE_SHARED +/* END DEFINES */ +#define PACKAGE "@CMAKE_PROJECT_NAME@" +#define VERSION "@CMAKE_PROJECT_VERSION@" + +#endif /* HAD_CONFIG_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/lib/compat.h new/libzip-1.11.2/lib/compat.h --- old/libzip-1.11.1/lib/compat.h 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/lib/compat.h 2024-10-31 23:27:33.000000000 +0100 @@ -123,14 +123,64 @@ #endif #endif -#ifndef HAVE_FSEEKO -#define fseeko(s, o, w) (fseek((s), (long int)(o), (w))) + +#if defined(HAVE__FSEEKI64) && defined(HAVE__FSTAT64) && defined(HAVE__SEEK64) +/* Windows API using int64 */ +typedef zip_int64_t zip_off_t; +typedef struct _stat64 zip_os_stat_t; +#define zip_os_stat _stat64 +#define zip_os_fstat _fstat64 +#define zip_os_seek _fseeki64 +#define ZIP_FSEEK_MAX ZIP_INT64_MAX +#define ZIP_FSEEK_MIN ZIP_INT64_MIN +#else + +/* Normal API */ +#include <sys/stat.h> +typedef struct stat zip_os_stat_t; +#define zip_os_fstat fstat +#define zip_os_stat stat + +#if defined(HAVE_FTELLO) && defined(HAVE_FSEEKO) +/* Using off_t */ +typedef off_t zip_off_t; +#if SIZEOF_OFF_T == 8 +#define ZIP_OFF_MAX ZIP_INT64_MAX +#define ZIP_OFF_MIN ZIP_INT64_MIN +#elif SIZEOF_OFF_T == 4 +#define ZIP_OFF_MAX ZIP_INT32_MAX +#define ZIP_OFF_MIN ZIP_INT32_MIN +#elif SIZEOF_OFF_T == 2 +#define ZIP_OFF_MAX ZIP_INT16_MAX +#define ZIP_OFF_MIN ZIP_INT16_MIN +#else +#error unsupported size of off_t +#endif + +#define ZIP_FSEEK_MAX ZIP_OFF_MAX +#define ZIP_FSEEK_MIN ZIP_OFF_MIN + +#define zip_os_fseek fseeko +#define zip_os_ftell ftello +#else + +/* Using long */ +typedef long zip_off_t; +#include <limits.h> +#define ZIP_FSEEK_MAX LONG_MAX +#define ZIP_FSEEK_MIN LONG_MIN + +#define zip_os_fseek fseek +#define zip_os_ftell ftell +#endif + #endif #ifndef HAVE_FTELLO #define ftello(s) ((long)ftell((s))) #endif + #ifdef HAVE_LOCALTIME_S #ifdef _WIN32 /* Windows is incompatible to the C11 standard, hurray! */ @@ -179,27 +229,6 @@ #endif #endif -#if SIZEOF_OFF_T == 8 -#define ZIP_OFF_MAX ZIP_INT64_MAX -#define ZIP_OFF_MIN ZIP_INT64_MIN -#elif SIZEOF_OFF_T == 4 -#define ZIP_OFF_MAX ZIP_INT32_MAX -#define ZIP_OFF_MIN ZIP_INT32_MIN -#elif SIZEOF_OFF_T == 2 -#define ZIP_OFF_MAX ZIP_INT16_MAX -#define ZIP_OFF_MIN ZIP_INT16_MIN -#else -#error unsupported size of off_t -#endif - -#if defined(HAVE_FTELLO) && defined(HAVE_FSEEKO) -#define ZIP_FSEEK_MAX ZIP_OFF_MAX -#define ZIP_FSEEK_MIN ZIP_OFF_MIN -#else -#include <limits.h> -#define ZIP_FSEEK_MAX LONG_MAX -#define ZIP_FSEEK_MIN LONG_MIN -#endif #ifndef SIZE_MAX #if SIZEOF_SIZE_T == 8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/lib/zip_dirent.c new/libzip-1.11.2/lib/zip_dirent.c --- old/libzip-1.11.1/lib/zip_dirent.c 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/lib/zip_dirent.c 2024-10-31 23:27:33.000000000 +0100 @@ -39,7 +39,6 @@ #include <time.h> #include <zlib.h> -#include "zip.h" #include "zipint.h" static zip_string_t *_zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str, bool check_consistency); @@ -283,6 +282,7 @@ de->cloned = 0; de->crc_valid = true; + de->last_mod_mtime_valid = false; de->version_madeby = 63 | (ZIP_OPSYS_DEFAULT << 8); de->version_needed = 10; /* 1.0 */ de->bitflags = 0; @@ -1264,3 +1264,12 @@ } return 0; } + +time_t zip_dirent_get_last_mod_mtime(zip_dirent_t *de) { + if (!de->last_mod_mtime_valid) { + de->last_mod_mtime = _zip_d2u_time(&de->last_mod); + de->last_mod_mtime_valid = true; + } + + return de->last_mod_mtime; +} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/lib/zip_file_set_mtime.c new/libzip-1.11.2/lib/zip_file_set_mtime.c --- old/libzip-1.11.1/lib/zip_file_set_mtime.c 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/lib/zip_file_set_mtime.c 2024-10-31 23:27:33.000000000 +0100 @@ -33,8 +33,7 @@ #include "zipint.h" -ZIP_EXTERN int -zip_file_set_dostime(zip_t *za, zip_uint64_t idx, zip_uint16_t dtime, zip_uint16_t ddate, zip_flags_t flags) { +static int zip_file_set_time(zip_t *za, zip_uint64_t idx, zip_uint16_t dtime, zip_uint16_t ddate, zip_flags_t flags, time_t *mtime) { zip_entry_t *e; if (_zip_get_dirent(za, idx, 0, NULL) == NULL) { @@ -66,18 +65,29 @@ e->changes->last_mod.time = dtime; e->changes->last_mod.date = ddate; + if (mtime != NULL) { + e->changes->last_mod_mtime = *mtime; + e->changes->last_mod_mtime_valid = true; + } + else { + e->changes->last_mod_mtime_valid = false; + } e->changes->changed |= ZIP_DIRENT_LAST_MOD; return 0; } -ZIP_EXTERN int -zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags) { +ZIP_EXTERN int zip_file_set_dostime(zip_t *za, zip_uint64_t idx, zip_uint16_t dtime, zip_uint16_t ddate, zip_flags_t flags) { + return zip_file_set_time(za, idx, dtime, ddate, flags, NULL); +} + + +ZIP_EXTERN int zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags) { zip_dostime_t dostime; if (_zip_u2d_time(mtime, &dostime, &za->error) < 0) { return -1; } - return zip_file_set_dostime(za, idx, dostime.time, dostime.date, flags); + return zip_file_set_time(za, idx, dostime.time, dostime.date, flags, &mtime); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/lib/zip_new.c new/libzip-1.11.2/lib/zip_new.c --- old/libzip-1.11.1/lib/zip_new.c 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/lib/zip_new.c 2024-10-31 23:27:33.000000000 +0100 @@ -68,6 +68,7 @@ za->nopen_source = za->nopen_source_alloc = 0; za->open_source = NULL; za->progress = NULL; + za->torrent_mtime = 0; return za; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/lib/zip_source_file_stdio.c new/libzip-1.11.2/lib/zip_source_file_stdio.c --- old/libzip-1.11.1/lib/zip_source_file_stdio.c 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/lib/zip_source_file_stdio.c 2024-10-31 23:27:33.000000000 +0100 @@ -39,7 +39,6 @@ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> -#include <sys/stat.h> #ifdef _WIN32 #ifndef S_IWUSR @@ -120,7 +119,7 @@ } #endif - if (fseeko((FILE *)f, (off_t)offset, whence) < 0) { + if (zip_os_fseek((FILE *)f, (zip_off_t)offset, whence) < 0) { zip_error_set(&ctx->error, ZIP_ER_SEEK, errno); return false; } @@ -130,15 +129,15 @@ bool _zip_stdio_op_stat(zip_source_file_context_t *ctx, zip_source_file_stat_t *st) { - struct stat sb; + zip_os_stat_t sb; int ret; if (ctx->fname) { - ret = stat(ctx->fname, &sb); + ret = zip_os_stat(ctx->fname, &sb); } else { - ret = fstat(fileno((FILE *)ctx->f), &sb); + ret = zip_os_fstat(fileno((FILE *)ctx->f), &sb); } if (ret < 0) { @@ -168,7 +167,7 @@ zip_int64_t _zip_stdio_op_tell(zip_source_file_context_t *ctx, void *f) { - off_t offset = ftello((FILE *)f); + zip_off_t offset = zip_os_ftell((FILE *)f); if (offset < 0) { zip_error_set(&ctx->error, ZIP_ER_SEEK, errno); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/lib/zip_source_file_stdio_named.c new/libzip-1.11.2/lib/zip_source_file_stdio_named.c --- old/libzip-1.11.1/lib/zip_source_file_stdio_named.c 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/lib/zip_source_file_stdio_named.c 2024-10-31 23:27:33.000000000 +0100 @@ -178,9 +178,9 @@ { int fd; struct file_clone_range range; - struct stat st; + zip_os_stat_t st; - if (fstat(fileno(ctx->f), &st) < 0) { + if (zip_os_fstat(fileno(ctx->f), &st) < 0) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); return -1; } @@ -223,7 +223,7 @@ ctx->tmpname = NULL; return -1; } - if (fseeko(tfp, (off_t)offset, SEEK_SET) < 0) { + if (zip_os_fseek(tfp, (zip_off_t)offset, SEEK_SET) < 0) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); (void)fclose(tfp); (void)remove(ctx->tmpname); @@ -290,11 +290,11 @@ static int create_temp_file(zip_source_file_context_t *ctx, bool create_file) { char *temp; int mode; - struct stat st; + zip_os_stat_t st; int fd = 0; char *start, *end; - if (stat(ctx->fname, &st) == 0) { + if (zip_os_stat(ctx->fname, &st) == 0) { mode = st.st_mode; } else { @@ -344,7 +344,7 @@ } } else { - if (stat(temp, &st) < 0) { + if (zip_os_stat(temp, &st) < 0) { if (errno == ENOENT) { break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/lib/zip_stat_index.c new/libzip-1.11.2/lib/zip_stat_index.c --- old/libzip-1.11.1/lib/zip_stat_index.c 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/lib/zip_stat_index.c 2024-10-31 23:27:33.000000000 +0100 @@ -77,7 +77,7 @@ } if (entry->changes != NULL && entry->changes->changed & ZIP_DIRENT_LAST_MOD) { - st->mtime = _zip_d2u_time(&de->last_mod); + st->mtime = zip_dirent_get_last_mod_mtime(de); st->valid |= ZIP_STAT_MTIME; } } @@ -86,7 +86,7 @@ st->crc = de->crc; st->size = de->uncomp_size; - st->mtime = _zip_d2u_time(&de->last_mod); + st->mtime = zip_dirent_get_last_mod_mtime(de); st->comp_size = de->comp_size; st->comp_method = (zip_uint16_t)de->comp_method; st->encryption_method = de->encryption_method; @@ -97,9 +97,12 @@ } if ((za->ch_flags & ZIP_AFL_WANT_TORRENTZIP) && (flags & ZIP_FL_UNCHANGED) == 0) { - zip_dostime_t dostime = {0xbc00, 0x2198}; + if (za->torrent_mtime == 0) { + zip_dostime_t dostime = {0xbc00, 0x2198}; + za->torrent_mtime = _zip_d2u_time(&dostime); + } st->comp_method = ZIP_CM_DEFLATE; - st->mtime = _zip_d2u_time(&dostime); + st->mtime = za->torrent_mtime; st->valid |= ZIP_STAT_MTIME | ZIP_STAT_COMP_METHOD; st->valid &= ~ZIP_STAT_COMP_SIZE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/lib/zipint.h new/libzip-1.11.2/lib/zipint.h --- old/libzip-1.11.1/lib/zipint.h 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/lib/zipint.h 2024-10-31 23:27:33.000000000 +0100 @@ -314,6 +314,7 @@ zip_progress_t *progress; /* progress callback for zip_close() */ zip_uint32_t* write_crc; /* have _zip_write() compute CRC */ + time_t torrent_mtime; }; /* file in zip archive, part of API */ @@ -346,6 +347,7 @@ bool cloned; /* whether this instance is cloned, and thus shares non-changed strings */ bool crc_valid; /* if CRC is valid (sometimes not for encrypted archives) */ + bool last_mod_mtime_valid; zip_uint16_t version_madeby; /* (c) version of creator */ zip_uint16_t version_needed; /* (cl) version needed to extract */ @@ -366,6 +368,8 @@ zip_uint32_t compression_level; /* level of compression to use (never valid in orig) */ zip_uint16_t encryption_method; /* encryption method, computed from other fields */ char *password; /* file specific encryption password */ + + time_t last_mod_mtime; /* cached last_mod in Unix time format */ }; /* zip archive central directory */ @@ -553,6 +557,7 @@ zip_dirent_t *_zip_dirent_clone(const zip_dirent_t *); void _zip_dirent_free(zip_dirent_t *); void _zip_dirent_finalize(zip_dirent_t *); +time_t zip_dirent_get_last_mod_mtime(zip_dirent_t *de); void _zip_dirent_init(zip_dirent_t *); bool _zip_dirent_needs_zip64(const zip_dirent_t *, zip_flags_t); zip_dirent_t *_zip_dirent_new(void); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_get_num_entries.html new/libzip-1.11.2/man/zip_get_num_entries.html --- old/libzip-1.11.1/man/zip_get_num_entries.html 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_get_num_entries.html 2024-10-31 23:27:33.000000000 +0100 @@ -70,8 +70,8 @@ entries in <var class="Ar">archive</var>. Entries are all files that are present in the original archive or that were added while the archive is open. This includes deleted files, since indices are not renumbered until the - archive is closed. (This allows to refer to deleted files, e. g. to undelete - them.) + archive is closed. (This allows one to refer to deleted files, e. g. to + undelete them.) <p class="Pp">If <var class="Ar">flags</var> is set to <code class="Dv">ZIP_FL_UNCHANGED</code>, the original number of files is returned.</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_get_num_entries.man new/libzip-1.11.2/man/zip_get_num_entries.man --- old/libzip-1.11.1/man/zip_get_num_entries.man 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_get_num_entries.man 2024-10-31 23:27:33.000000000 +0100 @@ -56,7 +56,7 @@ were added while the archive is open. This includes deleted files, since indices are not renumbered until the archive is closed. -(This allows to refer to deleted files, e. g. to undelete them.) +(This allows one to refer to deleted files, e. g. to undelete them.) .PP If \fIflags\fR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_get_num_entries.mdoc new/libzip-1.11.2/man/zip_get_num_entries.mdoc --- old/libzip-1.11.1/man/zip_get_num_entries.mdoc 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_get_num_entries.mdoc 2024-10-31 23:27:33.000000000 +0100 @@ -50,7 +50,7 @@ were added while the archive is open. This includes deleted files, since indices are not renumbered until the archive is closed. -(This allows to refer to deleted files, e. g. to undelete them.) +(This allows one to refer to deleted files, e. g. to undelete them.) .Pp If .Ar flags diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_source_layered.mdoc new/libzip-1.11.2/man/zip_source_layered.mdoc --- old/libzip-1.11.1/man/zip_source_layered.mdoc 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_source_layered.mdoc 2024-10-31 23:27:33.000000000 +0100 @@ -93,7 +93,6 @@ The caller should not free it. .Pp The interaction with the lower layer depends on the command: -.El .Ss Dv ZIP_SOURCE_ACCEPT_EMPTY If the layered source supports this command, the lower layer is not called automatically. Otherwise, the return value of the lower source is used. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_source_window_create.html new/libzip-1.11.2/man/zip_source_window_create.html --- old/libzip-1.11.1/man/zip_source_window_create.html 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_source_window_create.html 2024-10-31 23:27:33.000000000 +0100 @@ -103,7 +103,6 @@ ALSO</a></h1> <a class="Xr" href="libzip.html">libzip(3)</a>, <a class="Xr" href="zip_source.html">zip_source(3)</a> - <a class="Xr" href="zip_source.html">zip_source(3)</a> </section> <section class="Sh"> <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_source_window_create.man new/libzip-1.11.2/man/zip_source_window_create.man --- old/libzip-1.11.1/man/zip_source_window_create.man 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_source_window_create.man 2024-10-31 23:27:33.000000000 +0100 @@ -94,7 +94,6 @@ .SH "SEE ALSO" libzip(3), zip_source(3) -zip_source(3) .SH "HISTORY" \fBzip_source_window_create\fR() was added in libzip 1.8.0. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_source_window_create.mdoc new/libzip-1.11.2/man/zip_source_window_create.mdoc --- old/libzip-1.11.1/man/zip_source_window_create.mdoc 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_source_window_create.mdoc 2024-10-31 23:27:33.000000000 +0100 @@ -88,7 +88,6 @@ .Sh SEE ALSO .Xr libzip 3 , .Xr zip_source 3 -.Xr zip_source 3 .Sh HISTORY .Fn zip_source_window_create was added in libzip 1.8.0. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_source_zip.html new/libzip-1.11.2/man/zip_source_zip.html --- old/libzip-1.11.1/man/zip_source_zip.html 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_source_zip.html 2024-10-31 23:27:33.000000000 +0100 @@ -97,10 +97,12 @@ <var class="Ar">start</var>, is used. If <var class="Ar">start</var> is zero and <var class="Ar">len</var> is -1, the whole file will be copied without decompressing it.</p> -<p class="Pp">Supported flags are: - <br/> - Try to get the original data without any changes that may have been made to - <var class="Ar">srcarchive</var> after opening it.</p> +<p class="Pp">Supported flags are:</p> +<dl class="Bl-tag"> + <dt><a class="permalink" href="#ZIP_FL_UNCHANGED"><code class="Dv" id="ZIP_FL_UNCHANGED">ZIP_FL_UNCHANGED</code></a></dt> + <dd>Try to get the original data without any changes that may have been made + to <var class="Ar">srcarchive</var> after opening it.</dd> +</dl> </section> <section class="Sh"> <h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN @@ -141,7 +143,8 @@ <code class="Fn">zip_source_zip</code>() was added in libzip 1.0. <code class="Fn">zip_source_zip_create</code>() was added in libzip 1.8.0. Both were deprecated in libzip 1.10.0. Use - <code class="Fn">zip_source_zip_file</code>() or instead. + <code class="Fn">zip_source_zip_file</code>() or + <code class="Fn">zip_source_zip_file_create</code>() instead. </section> <section class="Sh"> <h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_source_zip.man new/libzip-1.11.2/man/zip_source_zip.man --- old/libzip-1.11.1/man/zip_source_zip.man 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_source_zip.man 2024-10-31 23:27:33.000000000 +0100 @@ -96,7 +96,8 @@ is \-1, the whole file will be copied without decompressing it. .PP Supported flags are: -.br +.TP 14n +\fRZIP_FL_UNCHANGED\fR Try to get the original data without any changes that may have been made to \fIsrcarchive\fR @@ -150,6 +151,7 @@ Use \fBzip_source_zip_file\fR() or +\fBzip_source_zip_file_create\fR() instead. .SH "AUTHORS" Dieter Baron <\fidi...@nih.at\fR> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/zip_source_zip.mdoc new/libzip-1.11.2/man/zip_source_zip.mdoc --- old/libzip-1.11.1/man/zip_source_zip.mdoc 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/zip_source_zip.mdoc 2024-10-31 23:27:33.000000000 +0100 @@ -83,6 +83,7 @@ is \-1, the whole file will be copied without decompressing it. .Pp Supported flags are: +.Bl -tag -width Dv .It Dv ZIP_FL_UNCHANGED Try to get the original data without any changes that may have been made to @@ -134,7 +135,7 @@ Use .Fn zip_source_zip_file or -.F zip_source_zip_file_create +.Fn zip_source_zip_file_create instead. .Sh AUTHORS .An -nosplit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/ziptool.man new/libzip-1.11.2/man/ziptool.man --- old/libzip-1.11.1/man/ziptool.man 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/ziptool.man 2024-10-31 23:27:33.000000000 +0100 @@ -302,7 +302,9 @@ Print information about archive entry \fIindex\fR. .SS "Flags" -Some commands take flag arguments. Each character in the argument sets the corresponding flag. Use 0 or the empty string for no flags. +Some commands take flag arguments. +Each character in the argument sets the corresponding flag. +Use 0 or the empty string for no flags. .PP Supported flags are: .RS 6n diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/man/ziptool.mdoc new/libzip-1.11.2/man/ziptool.mdoc --- old/libzip-1.11.1/man/ziptool.mdoc 2024-09-19 13:38:15.000000000 +0200 +++ new/libzip-1.11.2/man/ziptool.mdoc 2024-10-31 23:27:33.000000000 +0100 @@ -265,7 +265,9 @@ .Ar index . .El .Ss Flags -Some commands take flag arguments. Each character in the argument sets the corresponding flag. Use 0 or the empty string for no flags. +Some commands take flag arguments. +Each character in the argument sets the corresponding flag. +Use 0 or the empty string for no flags. .Pp Supported flags are: .Bl -tag -width MMM -compact -offset indent diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzip-1.11.1/zipconf.h.in new/libzip-1.11.2/zipconf.h.in --- old/libzip-1.11.1/zipconf.h.in 1970-01-01 01:00:00.000000000 +0100 +++ new/libzip-1.11.2/zipconf.h.in 2024-10-31 23:27:33.000000000 +0100 @@ -0,0 +1,47 @@ +#ifndef _HAD_ZIPCONF_H +#define _HAD_ZIPCONF_H + +/* + zipconf.h -- platform specific include file + + This file was generated automatically by CMake + based on ../cmake-zipconf.h.in. + */ + +#define LIBZIP_VERSION "${libzip_VERSION}" +#define LIBZIP_VERSION_MAJOR ${libzip_VERSION_MAJOR} +#define LIBZIP_VERSION_MINOR ${libzip_VERSION_MINOR} +#define LIBZIP_VERSION_MICRO ${libzip_VERSION_PATCH} + +#cmakedefine ZIP_STATIC + +${ZIP_NULLABLE_DEFINES} + +${LIBZIP_TYPES_INCLUDE} + +typedef ${ZIP_INT8_T} zip_int8_t; +typedef ${ZIP_UINT8_T} zip_uint8_t; +typedef ${ZIP_INT16_T} zip_int16_t; +typedef ${ZIP_UINT16_T} zip_uint16_t; +typedef ${ZIP_INT32_T} zip_int32_t; +typedef ${ZIP_UINT32_T} zip_uint32_t; +typedef ${ZIP_INT64_T} zip_int64_t; +typedef ${ZIP_UINT64_T} zip_uint64_t; + +#define ZIP_INT8_MIN (-ZIP_INT8_MAX-1) +#define ZIP_INT8_MAX 0x7f +#define ZIP_UINT8_MAX 0xff + +#define ZIP_INT16_MIN (-ZIP_INT16_MAX-1) +#define ZIP_INT16_MAX 0x7fff +#define ZIP_UINT16_MAX 0xffff + +#define ZIP_INT32_MIN (-ZIP_INT32_MAX-1L) +#define ZIP_INT32_MAX 0x7fffffffL +#define ZIP_UINT32_MAX 0xffffffffLU + +#define ZIP_INT64_MIN (-ZIP_INT64_MAX-1LL) +#define ZIP_INT64_MAX 0x7fffffffffffffffLL +#define ZIP_UINT64_MAX 0xffffffffffffffffULL + +#endif /* zipconf.h */