зеркало из https://github.com/microsoft/vcpkg.git
[libmagic] Update to version 5.45. (#34763)
* [libmagic] Update to version 5.45. * Update patches. * Update version database.
This commit is contained in:
Родитель
a069d6dcb8
Коммит
f17f0bffde
|
@ -31,13 +31,13 @@ index 299ac0c..2c365a6 100644
|
|||
#define PATHSEP ':'
|
||||
@@ -103,7 +103,7 @@
|
||||
|
||||
#define private static
|
||||
#define file_private static
|
||||
|
||||
-#if HAVE_VISIBILITY && !defined(WIN32)
|
||||
+#if HAVE_VISIBILITY && !defined(_WIN32)
|
||||
#define public __attribute__ ((__visibility__("default")))
|
||||
#ifndef protected
|
||||
#define protected __attribute__ ((__visibility__("hidden")))
|
||||
#define file_public __attribute__ ((__visibility__("default")))
|
||||
#ifndef file_protected
|
||||
#define file_protected __attribute__ ((__visibility__("hidden")))
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
|
|
|
@ -11,14 +11,15 @@ diff --git a/src/file.h b/src/file.h
|
|||
index 0332506..4aa9f60 100644
|
||||
--- a/src/file.h
|
||||
+++ b/src/file.h
|
||||
@@ -88,6 +88,7 @@
|
||||
@@ -88,7 +88,8 @@
|
||||
/* Do this here and now, because struct stat gets re-defined on solaris */
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
+#include <dirent.h>
|
||||
|
||||
#define ENABLE_CONDITIONALS
|
||||
|
||||
#include <locale.h>
|
||||
#if defined(HAVE_XLOCALE_H)
|
||||
#include <xlocale.h>
|
||||
#endif
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ index 3ab52d1..fc48d84 100644
|
|||
--- a/src/pread.c
|
||||
+++ b/src/pread.c
|
||||
@@ -3,7 +3,9 @@
|
||||
FILE_RCSID("@(#)$File: pread.c,v 1.2 2013/04/02 16:23:07 christos Exp $")
|
||||
FILE_RCSID("@(#)$File: pread.c,v 1.5 2022/09/24 20:30:13 christos Exp $")
|
||||
#endif /* lint */
|
||||
#include <fcntl.h>
|
||||
+#ifdef HAVE_UNISTD_H
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
From 6d10bef865b69764f6e0ddd2b0f6a84e484cdb37 Mon Sep 17 00:00:00 2001
|
||||
From: Long Nguyen <nguyen.long.908132@gmail.com>
|
||||
Date: Sun, 9 May 2021 13:25:14 +0700
|
||||
Subject: [PATCH 09/14] No fcntl in magic.c
|
||||
|
||||
---
|
||||
src/magic.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/magic.c b/src/magic.c
|
||||
index e9aeafa..382bd96 100644
|
||||
--- a/src/magic.c
|
||||
+++ b/src/magic.c
|
||||
@@ -462,7 +462,7 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd)
|
||||
rv = 0;
|
||||
goto done;
|
||||
}
|
||||
-#if O_CLOEXEC == 0
|
||||
+#if O_CLOEXEC == 0 && !defined(_WIN32)
|
||||
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
}
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
|
@ -17,7 +17,7 @@ index 5204f20..7244841 100644
|
|||
#undef HAVE_MAJOR
|
||||
-#ifdef S_IFLNK
|
||||
+#if S_IFLNK != 0
|
||||
private int
|
||||
file_private int
|
||||
bad_link(struct magic_set *ms, int err, char *buf)
|
||||
{
|
||||
@@ -108,7 +108,7 @@ file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
|
||||
|
|
|
@ -11,21 +11,19 @@ diff --git a/src/funcs.c b/src/funcs.c
|
|||
index b926625..b585486 100644
|
||||
--- a/src/funcs.c
|
||||
+++ b/src/funcs.c
|
||||
@@ -809,6 +809,7 @@ file_print_guid(char *str, size_t len, const uint64_t *guid)
|
||||
g->data4[6], g->data4[7]);
|
||||
@@ -888,5 +888,6 @@
|
||||
}
|
||||
|
||||
+#ifndef _WIN32
|
||||
protected int
|
||||
file_protected int
|
||||
file_pipe_closexec(int *fds)
|
||||
{
|
||||
@@ -827,6 +828,7 @@ protected int
|
||||
file_clear_closexec(int fd) {
|
||||
return fcntl(fd, F_SETFD, 0);
|
||||
@@ -914,5 +915,6 @@
|
||||
#endif
|
||||
}
|
||||
+#endif
|
||||
|
||||
protected char *
|
||||
file_protected char *
|
||||
file_strtrim(char *str)
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
From fa0e11f36bb0e322250e1e488ced9f2bf166874f Mon Sep 17 00:00:00 2001
|
||||
From: Long Nguyen <nguyen.long.908132@gmail.com>
|
||||
Date: Fri, 14 May 2021 18:11:39 +0700
|
||||
Subject: [PATCH 14/14] Define POSIX macros if missing
|
||||
|
||||
---
|
||||
src/file.h | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/src/file.h b/src/file.h
|
||||
index ccfe0da..98cd37b 100644
|
||||
--- a/src/file.h
|
||||
+++ b/src/file.h
|
||||
@@ -100,6 +100,21 @@
|
||||
#include <stdarg.h>
|
||||
#include <dirent.h>
|
||||
|
||||
+#if !defined(S_IFBLK)
|
||||
+#define S_IFBLK 0
|
||||
+#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
|
||||
+#endif
|
||||
+
|
||||
+#if !defined(S_IFLNK)
|
||||
+#define S_IFLNK 0
|
||||
+#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
|
||||
+#endif
|
||||
+
|
||||
+#if !defined(S_IFSOCK)
|
||||
+#define S_IFSOCK 0
|
||||
+#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
|
||||
+#endif
|
||||
+
|
||||
#define ENABLE_CONDITIONALS
|
||||
|
||||
#ifndef MAGIC
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
|
@ -7,20 +7,20 @@ diff --git a/src/compress.c b/src/compress.c
|
|||
index 33ce2bc..f172eda 100644
|
||||
--- a/src/compress.c
|
||||
+++ b/src/compress.c
|
||||
@@ -378,7 +378,7 @@
|
||||
@@ -407,7 +407,7 @@
|
||||
sread(int fd, void *buf, size_t n, int canbepipe __attribute__((__unused__)))
|
||||
{
|
||||
ssize_t rv;
|
||||
-#ifdef FIONREAD
|
||||
-#if defined(FIONREAD) && !defined(__MINGW32__)
|
||||
+#if defined(FIONREAD) && !defined(__MINGW32__) && !defined(WIN32)
|
||||
int t = 0;
|
||||
#endif
|
||||
size_t rn = n;
|
||||
@@ -386,7 +386,7 @@
|
||||
@@ -418,7 +418,7 @@
|
||||
if (fd == STDIN_FILENO)
|
||||
goto nocheck;
|
||||
|
||||
-#ifdef FIONREAD
|
||||
-#if defined(FIONREAD) && !defined(__MINGW32__)
|
||||
+#if defined(FIONREAD) && !defined(__MINGW32__) && !defined(WIN32)
|
||||
if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1 || t == 0)) {
|
||||
#ifdef FD_ZERO
|
||||
|
|
|
@ -2,13 +2,13 @@ diff --git a/src/fsmagic.c b/src/fsmagic.c
|
|||
index 7244841..2c553c1 100644
|
||||
--- a/src/fsmagic.c
|
||||
+++ b/src/fsmagic.c
|
||||
@@ -66,7 +66,7 @@ FILE_RCSID("@(#)$File: fsmagic.c,v 1.81 2019/07/16 13:30:32 christos Exp $")
|
||||
@@ -66,7 +66,7 @@ # define major(dev) (((dev) >> 8) & 0xff)
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
#undef HAVE_MAJOR
|
||||
-#if S_IFLNK != 0
|
||||
+#if S_IFLNK != 0 && ! defined(_WIN32)
|
||||
private int
|
||||
file_private int
|
||||
bad_link(struct magic_set *ms, int err, char *buf)
|
||||
{
|
||||
@@ -108,7 +108,7 @@ file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
|
||||
|
|
|
@ -8,12 +8,10 @@ if(VCPKG_TARGET_IS_WINDOWS)
|
|||
"0006-Remove-Wrap-POSIX-headers.patch"
|
||||
"0007-Substitute-unistd-macros-for-MSVC.patch"
|
||||
"0008-Add-FILENO-defines.patch"
|
||||
"0009-No-fcntl-in-magic.c.patch"
|
||||
"0010-Properly-check-for-the-presence-of-bitmasks.patch"
|
||||
"0011-Remove-pipe-related-functions-in-funcs.c.patch"
|
||||
"0012-Convert-MSYS2-paths-to-Windows-paths.patch"
|
||||
"0013-Check-for-backslash-in-argv-0-on-Windows.patch"
|
||||
"0014-Define-POSIX-macros-if-missing.patch"
|
||||
"0015-MSYS2-Remove-ioctl-call.patch"
|
||||
"0016-Fix-file_famagic-function.patch"
|
||||
)
|
||||
|
@ -22,8 +20,8 @@ endif()
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO file/file
|
||||
REF FILE5_40
|
||||
SHA512 d76bfe5326e1b40368e055c2e049a24b4ffdbd727371f4f3aa1dd3f53787d16b88550b3cc71ecf02151e2fb3e567eb2598e4707badab8c391eb71113c2dcc319
|
||||
REF FILE5_45
|
||||
SHA512 fdd4c5d13d5ea1d25686c76d8ebc3252c54040c4871e3f0f623c4548b3841795d4e36050292a9453eedf0fbf932573890e9d6ac9fa63ccf577215598ae84b9ea
|
||||
HEAD_REF master
|
||||
PATCHES ${PATCHES}
|
||||
)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"name": "libmagic",
|
||||
"version": "5.40",
|
||||
"port-version": 3,
|
||||
"version": "5.45",
|
||||
"description": "This library can be used to classify files according to magic number tests.",
|
||||
"homepage": "https://github.com/file/file",
|
||||
"dependencies": [
|
||||
|
|
|
@ -4421,8 +4421,8 @@
|
|||
"port-version": 13
|
||||
},
|
||||
"libmagic": {
|
||||
"baseline": "5.40",
|
||||
"port-version": 3
|
||||
"baseline": "5.45",
|
||||
"port-version": 0
|
||||
},
|
||||
"libmariadb": {
|
||||
"baseline": "3.3.1",
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "30ebcd2ff5522b8c72ba5a5cadd840df34350382",
|
||||
"version": "5.45",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "2bb05dd744d7eb83ad0a8d887ef589aaea37f6b3",
|
||||
"version": "5.40",
|
||||
|
|
Загрузка…
Ссылка в новой задаче