From nobody Fri Jun 14 01:46:00 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W0hvF23q1z5N4wK; Fri, 14 Jun 2024 01:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W0hvF0xNjz4ZYb; Fri, 14 Jun 2024 01:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718329561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z614ZPbuPNUylDc83YO/l94/a7yKbaDi8ZcVNhxehPk=; b=Hf3bxQkXO2rpJ8yGIxfdaiQ5EJY1jSaVeoTvrViiho5QxTt2PAZJFI2QUEvJm/7V4V+Lpl xpt3Jt1k9HT4VnPCQkIaJ2kB+vPkPABZQgJi/teXqqpwwRBTPXGOn6Xek6ZbIULFkwYne+ bFSkNITNaKl/P4h0SeieD39lic+LPsp3r0oeD71bA2h+XaqAL1PCdUIVLDLjGj9Q9GbBUU HcIvNOPPM9ibFJSQo7whioX2AXG6oXiC7JnhqEQRmGrLETdjsit+X+FhIePICNlu14DEGz jfIgBGjLQIJAuluKWVjXR+FfshneFLw+gaOyJld0ccCA7ltHXPX0ngtKlKFoLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718329561; a=rsa-sha256; cv=none; b=QSWOyQBXV5lRMQIbNaeiaIsA4FmjXLoK9bu8fZVuBXaGFdqAQ8Own+lFdTA7haHC53dFwD 5JIR1naTXedv+zN4f9UhBfaKwwIvVbS/cEyGdgsjSWSBuu8dTzQP4KSzERyLDT325W0xtX MJ3ML5RgAu08OJhXnZRp57+ogHTEqoZOzljsGm33mIowJMNWvOgV9bzMv0Gy9NyViWYyso dkEsfob5KTG9CNpK0L1y0zjMbHX2GphF0d1XaQytsG6+75sxzIMY9LxmwervUvbKZWx9Zx TqTwYDHIrabfJqq0gsl5LSLmQ4JtPDM4/VA6bLf79zkejdOpCU0+529DMPGP9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718329561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z614ZPbuPNUylDc83YO/l94/a7yKbaDi8ZcVNhxehPk=; b=t5XSJ9NRa3rC3EBQ1LfOhaMxIhHlsE/lVHWIs99UZkf0TBY/hSBzI2E/SAZmrdPmrEm3cI WtxzP7B+Wi+t/AkAsBhgmBhZnSypx75yKy/rM0qEA+A9V7ZfdosjZ3WgbC3KlPO2XV1qmX O34XSz3Qqf9j33TcdtkSnQY9TXeiixljPA/fDWslYYAVMAK0z58A/UFoujP+LyoTCTg4Ix P8NBjepzTFVBvV01nYhYTyqXp6sDHGpnMUGF9Ytk3JR39CHUtoBfhCBHvHeeDs+O92nHBM FGpkGGIcWO2Kz6lth37XA6nMFJUJ88YR2we058PVoOHwH2XjvLQJdkvZGFH6gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W0hvF0XMgz11lb; Fri, 14 Jun 2024 01:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45E1k0FH095903; Fri, 14 Jun 2024 01:46:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45E1k06Z095900; Fri, 14 Jun 2024 01:46:00 GMT (envelope-from git) Date: Fri, 14 Jun 2024 01:46:00 GMT Message-Id: <202406140146.45E1k06Z095900@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Jason E. Hale" Subject: git: e451100039f9 - main - sysutils/fusefs-rar2fs: Add libunrar 7.x compat List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhale X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e451100039f95983e1d88d4e85fbef8ed832d929 Auto-Submitted: auto-generated The branch main has been updated by jhale: URL: https://cgit.FreeBSD.org/ports/commit/?id=e451100039f95983e1d88d4e85fbef8ed832d929 commit e451100039f95983e1d88d4e85fbef8ed832d929 Author: Jason E. Hale AuthorDate: 2024-06-14 01:23:22 +0000 Commit: Jason E. Hale CommitDate: 2024-06-14 01:45:53 +0000 sysutils/fusefs-rar2fs: Add libunrar 7.x compat --- sysutils/fusefs-rar2fs/Makefile | 2 +- sysutils/fusefs-rar2fs/files/patch-src_dllext.cpp | 199 ++++++++++++++++++++++ 2 files changed, 200 insertions(+), 1 deletion(-) diff --git a/sysutils/fusefs-rar2fs/Makefile b/sysutils/fusefs-rar2fs/Makefile index 7d24b4dbd2d2..ca33d0e74a44 100644 --- a/sysutils/fusefs-rar2fs/Makefile +++ b/sysutils/fusefs-rar2fs/Makefile @@ -1,7 +1,7 @@ PORTNAME= rar2fs DISTVERSION= 1.29.5 DISTVERSIONPREFIX= v -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= sysutils PKGNAMEPREFIX= fusefs- diff --git a/sysutils/fusefs-rar2fs/files/patch-src_dllext.cpp b/sysutils/fusefs-rar2fs/files/patch-src_dllext.cpp new file mode 100644 index 000000000000..e3a8682f763a --- /dev/null +++ b/sysutils/fusefs-rar2fs/files/patch-src_dllext.cpp @@ -0,0 +1,199 @@ +Add compatibility with libunrar >= 7. Based upon upstream commits: + +https://github.com/hasse69/rar2fs/commit/d1d31f416269f4abb1262850b1fe645713a14fc4 +https://github.com/hasse69/rar2fs/commit/89d144d17bb23bd2ff143a3aac3593cbfc2dd3c1 + +--- src/dllext.cpp.orig 2021-05-02 06:17:04 UTC ++++ src/dllext.cpp +@@ -169,13 +169,21 @@ int PASCAL RARListArchiveEx(HANDLE hArcData, RARArchiv + } + else + { ++#if RARVER_MAJOR >= 7 ++ wcscpy(N->LinkTargetW,Arc.FileHead.RedirName.c_str()); ++#else + wcscpy(N->LinkTargetW,Arc.FileHead.RedirName); ++#endif + N->LinkTargetFlags |= LINK_T_UNICODE; // Make sure UNICODE is set + } + } + else if (Arc.FileHead.RedirType == FSREDIR_FILECOPY) + { ++#if RARVER_MAJOR >= 7 ++ wcscpy(N->LinkTargetW,Arc.FileHead.RedirName.c_str()); ++#else + wcscpy(N->LinkTargetW,Arc.FileHead.RedirName); ++#endif + N->LinkTargetFlags |= LINK_T_FILECOPY; + } + } +@@ -208,6 +216,13 @@ void PASCAL RARNextVolumeName(char *arch, bool oldstyl + { + #if RARVER_MAJOR < 5 + NextVolumeName(arch, NULL, 0, oldstylevolume); ++#elif RARVER_MAJOR >= 7 ++ wstring ArchiveW; ++ size_t len=strlen(arch); ++ ArchiveW.assign(arch,arch+len); ++ NextVolumeName(ArchiveW,oldstylevolume); ++ string NextArchive(ArchiveW.begin(),ArchiveW.end()); ++ strcpy(arch,NextArchive.c_str()); + #else + wchar NextName[NM]; + CharToWide(arch, NextName, ASIZE(NextName)); +@@ -221,6 +236,14 @@ void PASCAL RARVolNameToFirstName(char *arch, bool old + { + #if RARVER_MAJOR < 5 + VolNameToFirstName(arch, arch, !oldstylevolume); ++#elif RARVER_MAJOR >=7 ++ wstring ArcName; ++ size_t len=strlen(arch); ++ ArcName.assign(arch,arch+len); ++ VolNameToFirstName(ArcName, ArcName, !oldstylevolume); ++ string FirstName(ArcName.begin(),ArcName.end()); ++ strcpy(arch,FirstName.c_str()); ++ return; + #else + wchar ArcName[NM]; + CharToWide(arch, ArcName, ASIZE(ArcName)); +@@ -239,7 +262,6 @@ void PASCAL RARGetFileInfo(HANDLE hArcData, const char + void PASCAL RARGetFileInfo(HANDLE hArcData, const char *FileName, struct RARWcb *wcb) + { + #if RARVER_MAJOR > 4 +- char FileNameUtf[NM]; + DataSet *Data = (DataSet *)hArcData; + Archive& Arc = Data->Arc; + struct RARHeaderDataEx h; +@@ -248,8 +270,17 @@ void PASCAL RARGetFileInfo(HANDLE hArcData, const char + wcb->bytes = 0; + while (!RARReadHeaderEx(hArcData, &h)) + { ++#if RARVER_MAJOR >= 7 ++ size_t FileNameLen=Arc.FileHead.FileName.size()*sizeof(char32_t); ++ string FileNameUtf(FileNameLen,'\0'); ++ WideToUtf(Arc.FileHead.FileName.c_str(),&FileNameUtf[0],FileNameLen); ++ FileNameUtf.resize(strlen(FileNameUtf.c_str())); ++ if (!strcmp(FileNameUtf.c_str(), FileName)) ++#else ++ char FileNameUtf[NM]; + WideToUtf(Arc.FileHead.FileName,FileNameUtf,ASIZE(FileNameUtf)); + if (!strcmp(FileNameUtf, FileName)) ++#endif + { + wcb->bytes = ListFileHeader(wcb->data, Arc); + return; +@@ -368,7 +399,11 @@ static size_t ListFileHeader(wchar *wcs,Archive &Arc) + static size_t ListFileHeader(wchar *wcs,Archive &Arc) + { + FileHeader &hd=Arc.FileHead; ++#if RARVER_MAJOR >= 7 ++ wstring *Name=&hd.FileName; ++#else + wchar *Name=hd.FileName; ++#endif + RARFORMAT Format=Arc.Format; + + void *wcs_start = (void *)wcs; +@@ -433,25 +468,45 @@ static size_t ListFileHeader(wchar *wcs,Archive &Arc) + { + if (Format==RARFMT15) + { ++#if RARVER_MAJOR >= 7 ++ string LinkTargetA; ++#else + char LinkTargetA[NM]; ++#endif + if (Arc.FileHead.Encrypted) + { + // Link data are encrypted. We would need to ask for password + // and initialize decryption routine to display the link target. ++#if RARVER_MAJOR >= 7 ++ LinkTargetA="*<-?->"; ++#else + strncpyz(LinkTargetA,"*<-?->",ASIZE(LinkTargetA)); ++#endif + } + else + { + int DataSize=(int)Min((size_t)hd.PackSize,ASIZE(LinkTargetA)-1); ++#if RARVER_MAJOR >= 7 ++ Arc.Read(&LinkTargetA,DataSize); ++#else + Arc.Read(LinkTargetA,DataSize); ++#endif + LinkTargetA[DataSize > 0 ? DataSize : 0] = 0; + } ++#if RARVER_MAJOR >= 7 ++ wstring LinkTarget(LinkTargetA.begin(),LinkTargetA.end()); ++ wcs += msprintf(wcs, L"\n%12ls: %ls",St(MListTarget),LinkTarget.c_str()); ++ } ++ else ++ wcs += msprintf(wcs, L"\n%12ls: %ls",St(MListTarget),hd.RedirName.c_str()); ++#else + wchar LinkTarget[NM]; + CharToWide(LinkTargetA,LinkTarget,ASIZE(LinkTarget)); + wcs += msprintf(wcs, L"\n%12ls: %ls",St(MListTarget),LinkTarget); + } + else + wcs += msprintf(wcs, L"\n%12ls: %ls",St(MListTarget),hd.RedirName); ++#endif + } + + if (!hd.Dir) +@@ -487,11 +542,20 @@ static size_t ListFileHeader(wchar *wcs,Archive &Arc) + hd.FileHash.CRC32); + if (hd.FileHash.Type==HASH_BLAKE2) + { ++#if RARVER_MAJOR >= 7 ++ wstring BlakeStr; ++ BinToHex(hd.FileHash.Digest,BLAKE2_DIGEST_SIZE,BlakeStr); ++#else + wchar BlakeStr[BLAKE2_DIGEST_SIZE*2+1]; + BinToHex(hd.FileHash.Digest,BLAKE2_DIGEST_SIZE,NULL,BlakeStr,ASIZE(BlakeStr)); ++#endif + wcs += msprintf(wcs, L"\n%12ls: %ls", + hd.UseHashKey ? L"BLAKE2 MAC":hd.SplitAfter ? L"Pack-BLAKE2":L"BLAKE2", ++#if RARVER_MAJOR >= 7 ++ BlakeStr.c_str()); ++#else + BlakeStr); ++#endif + } + + const wchar *HostOS=L""; +@@ -529,7 +593,11 @@ static size_t ListFileHeader(wchar *wcs,Archive &Arc) + + if (hd.Version) + { ++#if RARVER_MAJOR >= 7 ++ uint Version=ParseVersionFileName(*Name,false); ++#else + uint Version=ParseVersionFileName(Name,false); ++#endif + if (Version!=0) + wcs += msprintf(wcs, L"\n%12ls: %u",St(MListFileVer),Version); + } +@@ -538,9 +606,17 @@ static size_t ListFileHeader(wchar *wcs,Archive &Arc) + { + wcs += msprintf(wcs, L"\n%12ls: ",L"Unix owner"); + if (*hd.UnixOwnerName!=0) ++#if RARVER_MAJOR >= 7 ++ wcs += msprintf(wcs, L"%ls:",GetWide(hd.UnixOwnerName).c_str()); ++#else + wcs += msprintf(wcs, L"%ls:",GetWide(hd.UnixOwnerName)); ++#endif + if (*hd.UnixGroupName!=0) ++#if RARVER_MAJOR >= 7 ++ wcs += msprintf(wcs, L"%ls",GetWide(hd.UnixGroupName).c_str()); ++#else + wcs += msprintf(wcs, L"%ls",GetWide(hd.UnixGroupName)); ++#endif + if ((*hd.UnixOwnerName!=0 || *hd.UnixGroupName!=0) && (hd.UnixOwnerNumeric || hd.UnixGroupNumeric)) + wcs += msprintf(wcs, L" "); + if (hd.UnixOwnerNumeric) +@@ -555,5 +631,3 @@ static size_t ListFileHeader(wchar *wcs,Archive &Arc) + } + + #endif +- +-