diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-01-11 23:45:17 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-01-11 23:45:17 +0000 |
commit | 7051f2e58b6bbc371b2c94cead2715bf06310adb (patch) | |
tree | d8eb7cbcdfa3883fcdb1cb004774e17be52600b0 /sys-apps/file | |
parent | 3b4acc0bc0b77136b371d8a3119066f80f221efe (diff) |
gentoo auto-resync : 11:01:2023 - 23:45:17
Diffstat (limited to 'sys-apps/file')
-rw-r--r-- | sys-apps/file/Manifest | 2 | ||||
-rw-r--r-- | sys-apps/file/file-5.44-r2.ebuild | 171 | ||||
-rw-r--r-- | sys-apps/file/files/file-5.44-decompress-empty.patch | 126 |
3 files changed, 299 insertions, 0 deletions
diff --git a/sys-apps/file/Manifest b/sys-apps/file/Manifest index 69cfe8840bec..7ee583333470 100644 --- a/sys-apps/file/Manifest +++ b/sys-apps/file/Manifest @@ -1,6 +1,7 @@ AUX file-5.43-configure-clang16.patch 473 BLAKE2B 4f98016638a5afb5e7dd8c1085077d562a65811585971f5c5dd3c36b1848754900e2c41779c55b69b65c8ca07533f379623e230f7cd9cecd00318619572f1e24 SHA512 96627055e6a970fbad2f8a3c8d6ad5b326e89fceab081187e012c3a363975bb3d2368320653093121ef132fa80e4c9576278e3d58aee4b5a4afc26aa88ecd5c7 AUX file-5.43-portage-sandbox.patch 640 BLAKE2B d0442694866d6d0dfa203f686309de3f79a9f3047cbb20b8ea2d9042293c437cbd6b04f02a6c779df9b6331a7c9cee4fc460b2e4ed0c29563fce981f33d69ec3 SHA512 10a8d059a62d3d4f58a255c8204f9f72660babb16e76d9de9946cb1c91130e56c9733f1fcf30396c40bc9906055a123b47ea55d38a54f3473e8b2c69a2f91ef3 AUX file-5.43-seccomp-fstatat64-musl.patch 565 BLAKE2B 31c42ae9857958e70dc459afc6c2cf1a297c0d29048908e54bd9ea5e15b85608a6fa76795d89716d3c5293a131e986fb83398f4a6eb560a72d794a448387fe2c SHA512 d53ed79b84a7b499c92b5d57ef4b482750a96dbeca904d480b44017e757fee8f404703485513d9da823c7aace7c1b51c64be4402afd6aca0ff9e4ece6ccfcb53 +AUX file-5.44-decompress-empty.patch 4065 BLAKE2B 4eea6b2cee04861a595d543e01940bd0fbfabf91a33d30ad40de1e84a3d49b456587839ebebde5aaea1a45e0ce9d7ef4aed4462062476e9bb9ebd536f84afe91 SHA512 852da270c653a2663fa7baa1a805dbd272190364d9fbe2c4ac599ee659b7f1ebbcfa27cbec46476b9055f95ff2decd67caaa4fcac3a19c24c385519ef95429eb AUX file-5.44-limits-solaris.patch 443 BLAKE2B d7481f0669b48d6c1a94e50706b6523636adba4e789d8f5a43fe231d26cbe89b8faded72470059cce7064d011eb5587ae4d5ef34c83c0463f04dd322d09aa5a4 SHA512 d96e84db2e87ca616d2d0eea58e188847f5bd98fcb843d1b875786e3f23faf515d199b2ccf5d4cc22834153a889439b7754091f80d5588f7cbd343d218a442c4 AUX file-5.44-seccomp-utimes.patch 587 BLAKE2B c1d2a8861034e9de0d4b1d0440935bd1ce25b789de0ac7f573378a1ef5d409f4c879deb0fd8dc89c48674d5af795cf8b99f7da870c9e5d54cec7a2d400b803f5 SHA512 e41b80f2e858ecc3e100b128d41c2d2e948a334f87523ae5d0c3b50916c678f37d6f26948d0b51a1bbdea9b0ab2683a3955004df2736d1240dcf80ee14390d9f DIST file-5.43.tar.gz 1162786 BLAKE2B aaaf32c5054fb83e912af6656e5e67947f45576ec3711c7cba5531ed780e142a448580e0db41a828c8a3c5d2f1bf0c8ed49bc9688499caaae4a08baa16b3610c SHA512 9d02f4e7a69d90468d6bd35df5ec240ddee8c2408b7df3e73427d7f18736baf77db0638a1fe8283f4e6abd1d5ad653890ed3a5a0d48bb52d4023ca4070ecdf06 @@ -9,5 +10,6 @@ DIST file-5.44.tar.gz 1186437 BLAKE2B a90ccae738a95315d75a0aaee7bbff3624425cc926 DIST file-5.44.tar.gz.asc 195 BLAKE2B a0905d42fec0fa052d75fb5b267c6ae223176451c0f1d3346006d4b760c3d858f2dcda5f0a30c6aa4b09b5afee427b75bc4debd5033d978f39dc1da01d3e1bd1 SHA512 1a4dc39283f4859581441aa35b3ed72b323c4e05ca0960d17126d1b9ec18465c695c0545e24f09f8437a60ab52e582be67b6cbbc656bbb676de00148c3644d23 EBUILD file-5.43-r2.ebuild 3748 BLAKE2B 8a3bf79b24f0e7adb88254c67efffd6c4d811b2dbbe95067861ca0c750ce3f4eaf48d996cf9d903196da0889796051c55d79443132b0ff4ef3337342f730b5e1 SHA512 e3cad781107a0db9d3125584c48ffb70aa22ca211691aba621d342f61878bb6b1460aede609e51d2f80bfd866dac5d9f1e57fca1c5bfd03c83e7063307ffb519 EBUILD file-5.44-r1.ebuild 3977 BLAKE2B 3f59ebb6fe4aa4d30c634ed3605df50e9353a764314a3199a402637ef05f726799da80e51dae5743d7aae04aaf7b41218edbd172216166ce58340bc7081ea97e SHA512 f73860f67289d5193d08874d4c6552e4f4a56145bab1cbb78224c81a4cfed4ed7a2a517e334673e54b07674b77b9abce977b60d54e2582f291266c984c55a6ad +EBUILD file-5.44-r2.ebuild 4036 BLAKE2B a6be85526dec13066b4da445da1c088a500d7882ae05879e091ebe6c32262800443654792f9ba001880c53e47ca381b5a894b61f608475c7b0e95cb0a80ec48f SHA512 77da1f7eda9cf69b7b637fec1db361fc4b81c137f883a38e22a0bae2091303da793955c567a242d156533f998b666099985ffa774589fc72abf367d544be6eaf EBUILD file-9999.ebuild 3855 BLAKE2B 29dc182f37fe2d0195eee8df904472447b97f97db750a46d686badb2795736035661ec2a398e36b416c27880df4caadddd283fddf2762a17ce1e94faca4faf49 SHA512 a271f686925d2b3be69e08f58a84be9ab742a19c0dc5f8d86413aae646aedbcc27fe51c0e8451ca92633d268bed1e529e52aa227e1c77b520f60048cc7dcd60c MISC metadata.xml 565 BLAKE2B 737512e354fedb4483608b04c594a486c0d8a0f70d23d306c59c78dedb0c8116f80ff558926444b9d9b9ef15805b3826163523b5644c88f01a330be1b8c9a76f SHA512 f240bf9e064c6e6f5b63e3265dfe3adf5b1d2c2b5b2456b79ea7451580150271ccb4097d33967de57ba767fecbdbea51fb62ccb683fcc5e1cca101be660ffd19 diff --git a/sys-apps/file/file-5.44-r2.ebuild b/sys-apps/file/file-5.44-r2.ebuild new file mode 100644 index 000000000000..fd89f18309c4 --- /dev/null +++ b/sys-apps/file/file-5.44-r2.ebuild @@ -0,0 +1,171 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +DISTUTILS_OPTIONAL=1 +PYTHON_COMPAT=( python3_{8..11} ) + +inherit distutils-r1 libtool toolchain-funcs multilib-minimal + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/glensc/file.git" + inherit autotools git-r3 +else + VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/file.asc + inherit verify-sig + SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz" + SRC_URI+=" verify-sig? ( ftp://ftp.astron.com/pub/file/${P}.tar.gz.asc )" + + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + + BDEPEND="verify-sig? ( sec-keys/openpgp-keys-file )" +fi + +DESCRIPTION="Identify a file's format by scanning binary data for patterns" +HOMEPAGE="https://www.darwinsys.com/file/" + +LICENSE="BSD-2" +SLOT="0" +IUSE="bzip2 lzip lzma python seccomp static-libs zlib zstd" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +DEPEND=" + bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] ) + lzip? ( app-arch/lzlib ) + lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] ) + python? ( + ${PYTHON_DEPS} + dev-python/setuptools[${PYTHON_USEDEP}] + ) + zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] ) + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] ) +" +RDEPEND="${DEPEND} + python? ( !dev-python/python-magic ) + seccomp? ( sys-libs/libseccomp[${MULTILIB_USEDEP}] )" +BDEPEND+=" + python? ( + ${PYTHON_DEPS} + ${DISTUTILS_DEPS} + )" + +PATCHES=( + "${FILESDIR}/file-5.43-seccomp-fstatat64-musl.patch" #789336, not upstream yet + "${FILESDIR}/file-5.43-portage-sandbox.patch" #889046 + "${FILESDIR}/file-5.44-limits-solaris.patch" # applied upstream + "${FILESDIR}/file-5.44-seccomp-utimes.patch" # upstream + "${FILESDIR}/file-5.44-decompress-empty.patch" # upstream +) + +src_prepare() { + default + + if [[ ${PV} == 9999 ]] ; then + eautoreconf + else + elibtoolize + fi + + # Don't let python README kill main README, bug ##60043 + mv python/README.md python/README.python.md || die + + # bug #662090 + sed 's@README.md@README.python.md@' -i python/setup.py || die +} + +multilib_src_configure() { + local myeconfargs=( + --enable-fsect-man5 + $(use_enable bzip2 bzlib) + $(multilib_native_use_enable lzip lzlib) + $(use_enable lzma xzlib) + $(use_enable seccomp libseccomp) + $(use_enable static-libs static) + $(use_enable zlib) + $(use_enable zstd zstdlib) + ) + + econf "${myeconfargs[@]}" +} + +build_src_configure() { + local myeconfargs=( + --disable-shared + --disable-libseccomp + --disable-bzlib + --disable-xzlib + --disable-zlib + ) + + econf_build "${myeconfargs[@]}" +} + +need_build_file() { + # When cross-compiling, we need to build up our own file + # because people often don't keep matching host/target + # file versions, bug #362941 + tc-is-cross-compiler && ! has_version -b "~${CATEGORY}/${P}" +} + +src_configure() { + local ECONF_SOURCE="${S}" + + if need_build_file ; then + mkdir -p "${WORKDIR}"/build || die + cd "${WORKDIR}"/build || die + build_src_configure + fi + + multilib-minimal_src_configure +} + +multilib_src_compile() { + if multilib_is_native_abi ; then + emake + else + # bug #586444 + emake -C src magic.h + emake -C src libmagic.la + fi +} + +src_compile() { + if need_build_file ; then + # bug #586444 + emake -C "${WORKDIR}"/build/src magic.h + emake -C "${WORKDIR}"/build/src file + local -x PATH="${WORKDIR}/build/src:${PATH}" + fi + + multilib-minimal_src_compile + + if use python ; then + cd python || die + distutils-r1_src_compile + fi +} + +multilib_src_install() { + if multilib_is_native_abi ; then + default + else + emake -C src install-{nodist_includeHEADERS,libLTLIBRARIES} DESTDIR="${D}" + fi +} + +multilib_src_install_all() { + dodoc ChangeLog MAINT # README + + # Required for `file -C` + insinto /usr/share/misc/magic + doins -r magic/Magdir/* + + if use python ; then + cd python || die + distutils-r1_src_install + fi + + find "${ED}" -type f -name "*.la" -delete || die +} diff --git a/sys-apps/file/files/file-5.44-decompress-empty.patch b/sys-apps/file/files/file-5.44-decompress-empty.patch new file mode 100644 index 000000000000..21dcfa4c94c5 --- /dev/null +++ b/sys-apps/file/files/file-5.44-decompress-empty.patch @@ -0,0 +1,126 @@ +https://bugs.astron.com/view.php?id=415 +https://github.com/file/file/commit/1dd21dd360472d7b830825df8e40a06cdc1cbbcf + +From 1dd21dd360472d7b830825df8e40a06cdc1cbbcf Mon Sep 17 00:00:00 2001 +From: Christos Zoulas <christos@zoulas.com> +Date: Sun, 8 Jan 2023 18:09:16 +0000 +Subject: [PATCH] fix decompression always returning empty. + +--- a/src/compress.c ++++ b/src/compress.c +@@ -609,6 +609,7 @@ uncompresszlib(const unsigned char *old, unsigned char **newch, + int rc; + z_stream z; + ++ DPRINTF("builtin zlib decompression\n"); + z.next_in = CCAST(Bytef *, old); + z.avail_in = CAST(uint32_t, *n); + z.next_out = *newch; +@@ -650,6 +651,7 @@ uncompressbzlib(const unsigned char *old, unsigned char **newch, + int rc; + bz_stream bz; + ++ DPRINTF("builtin bzlib decompression\n"); + memset(&bz, 0, sizeof(bz)); + rc = BZ2_bzDecompressInit(&bz, 0, 0); + if (rc != BZ_OK) +@@ -690,6 +692,7 @@ uncompressxzlib(const unsigned char *old, unsigned char **newch, + int rc; + lzma_stream xz; + ++ DPRINTF("builtin xzlib decompression\n"); + memset(&xz, 0, sizeof(xz)); + rc = lzma_auto_decoder(&xz, UINT64_MAX, 0); + if (rc != LZMA_OK) +@@ -729,6 +732,7 @@ uncompresszstd(const unsigned char *old, unsigned char **newch, + ZSTD_inBuffer in; + ZSTD_outBuffer out; + ++ DPRINTF("builtin zstd decompression\n"); + if ((zstd = ZSTD_createDStream()) == NULL) { + return makeerror(newch, n, "No ZSTD decompression stream, %s", + strerror(errno)); +@@ -777,6 +781,7 @@ uncompresslzlib(const unsigned char *old, unsigned char **newch, + + bufp = *newch; + ++ DPRINTF("builtin lzlib decompression\n"); + dec = LZ_decompress_open(); + if (!dec) { + return makeerror(newch, n, "unable to allocate LZ_Decoder"); +@@ -833,11 +838,13 @@ makeerror(unsigned char **buf, size_t *len, const char *fmt, ...) + va_list ap; + int rv; + ++ DPRINTF("Makeerror %s\n", fmt); + free(*buf); + va_start(ap, fmt); + rv = vasprintf(&msg, fmt, ap); + va_end(ap); + if (rv < 0) { ++ DPRINTF("Makeerror failed"); + *buf = NULL; + *len = 0; + return NODATA; +@@ -1048,7 +1055,7 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, int nofork, + pid_t pid; + pid_t writepid = -1; + size_t i; +- ssize_t r; ++ ssize_t r, re; + char *const *args; + #ifdef HAVE_POSIX_SPAWNP + posix_spawn_file_actions_t fa; +@@ -1103,6 +1110,7 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, int nofork, + + handledesc(&fa, fd, fdp); + ++ DPRINTF("Executing %s\n", compr[method].argv[0]); + status = posix_spawnp(&pid, compr[method].argv[0], &fa, NULL, + args, NULL); + +@@ -1128,6 +1136,7 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, int nofork, + * do not modify fdp[i][j]. + */ + handledesc(NULL, fd, fdp); ++ DPRINTF("Executing %s\n", compr[method].argv[0]); + + (void)execvp(compr[method].argv[0], args); + dprintf(STDERR_FILENO, "exec `%s' failed, %s", +@@ -1146,6 +1155,7 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, int nofork, + if (writepid == (pid_t)-1) { + rv = makeerror(newch, n, "Write to child failed, %s", + strerror(errno)); ++ DPRINTF("Write to child failed\n"); + goto err; + } + closefd(fdp[STDIN_FILENO], 1); +@@ -1153,6 +1163,7 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, int nofork, + + rv = OKDATA; + r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0); ++ DPRINTF("read got %zd\n", r); + if (r < 0) { + rv = ERRDATA; + DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0], +@@ -1165,15 +1176,17 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, int nofork, + * errors, otherwise we risk the child blocking and never + * exiting. + */ ++ DPRINTF("Closing stdout for bytes_max\n"); + closefd(fdp[STDOUT_FILENO], 0); + goto ok; + } +- if ((r = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0) { ++ if ((re = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0) { ++ DPRINTF("Got stuff from stderr %s\n", *newch); + rv = ERRDATA; + r = filter_error(*newch, r); + goto ok; + } +- if (r == 0) ++ if (re == 0) + goto ok; + rv = makeerror(newch, n, "Read stderr failed, %s", + strerror(errno)); + |