3 Commits

3 changed files with 82 additions and 15 deletions

View File

@@ -0,0 +1,56 @@
From e1b3bae57127178805415f5f3251145fbbfd04a3 Mon Sep 17 00:00:00 2001
From: Bastian Germann <bage@debian.org>
Date: Tue, 16 Apr 2024 20:30:37 +0000
Subject: [PATCH] Revert "Switch to faster CRC implementations in some
archives"
This reverts commit 2da64b6b62be7532fb28621164d5213fe4f37fe4 because the
faster CRC implementation calculates a wrong Gzip CRC on big endian machines.
---
XADCRCHandle.m | 2 +-
XADGzipParser.m | 2 +-
XADRARInputHandle.m | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/XADCRCHandle.m b/XADCRCHandle.m
index d927046..43ffff4 100644
--- a/XADCRCHandle.m
+++ b/XADCRCHandle.m
@@ -127,7 +127,7 @@ correctCRC:(uint32_t)correctcrc CRCTable:(const uint32_t *)crctable
- (int)streamAtMost:(int)num toBuffer:(void *)buffer
{
int actual=[parent readAtMost:num toBuffer:buffer];
- crc=XADCalculateCRCFast(crc,buffer,actual,XADCRCTable_sliced16_edb88320);
+ crc=XADCalculateCRC(crc,buffer,actual,XADCRCTable_edb88320);
return actual;
}
@end
diff --git a/XADGzipParser.m b/XADGzipParser.m
index 71c6e5b..dc16746 100644
--- a/XADGzipParser.m
+++ b/XADGzipParser.m
@@ -259,7 +259,7 @@ name:(NSString *)name propertiesToAdd:(NSMutableDictionary *)props
case DataState:
{
int actual=[currhandle readAtMost:num-bytesread toBuffer:&bytebuf[bytesread]];
- crc=XADCalculateCRCFast(crc,&bytebuf[bytesread],actual,XADCRCTable_sliced16_edb88320);
+ crc=XADCalculateCRC(crc,&bytebuf[bytesread],actual,XADCRCTable_edb88320);
bytesread+=actual;
diff --git a/XADRARInputHandle.m b/XADRARInputHandle.m
index 33ae966..11ca1d4 100644
--- a/XADRARInputHandle.m
+++ b/XADRARInputHandle.m
@@ -68,7 +68,7 @@
[parent readBytes:numbytes toBuffer:&bytebuf[total]];
- crc=XADCalculateCRCFast(crc,&bytebuf[total],numbytes,XADCRCTable_sliced16_edb88320);
+ crc=XADCalculateCRC(crc,&bytebuf[total],numbytes,XADCRCTable_edb88320);
total+=numbytes;
--
2.48.1

View File

@@ -1,3 +1,15 @@
-------------------------------------------------------------------
Thu Feb 20 10:15:43 UTC 2025 - Christophe Marin <christophe@krop.fr>
- Use %autosetup
-------------------------------------------------------------------
Fri Feb 7 11:47:46 UTC 2025 - Christophe Marin <christophe@krop.fr>
- Add patch to fix checksum calculation on big endian archs
(boo#1236917, gh#MacPaw/XADMaster#168)
* Revert-Switch-to-faster-CRC-implementations.patch
-------------------------------------------------------------------
Tue Oct 22 07:37:23 UTC 2024 - Joshua Smith <smolsheep@opensuse.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package unar
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,8 +24,9 @@ Summary: Multi-format unarchiver
License: LGPL-2.1-or-later
URL: https://unarchiver.c3.cx/commandline
Source0: https://github.com/MacPaw/XADMaster/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: %{name}.changes
Source2: https://github.com/MacPaw/universal-detector/archive/%{_dver}/universal-detector-%{_dver}.tar.gz
Source1: https://github.com/MacPaw/universal-detector/archive/%{_dver}/universal-detector-%{_dver}.tar.gz
# PATCH-FIX-UPSTREAM -- Fix wrong checksum on BE archs
Patch0: Revert-Switch-to-faster-CRC-implementations.patch
BuildRequires: gcc-c++
BuildRequires: gcc-objc
BuildRequires: gnustep-base-devel
@@ -46,31 +47,29 @@ well as disc images in ISO, BIN, MDF, NRG, CDI. It supports filenames
in foreign character sets.
%prep
%setup -q -T -c
tar xf %{SOURCE0}
mv XADMaster-%{version} %{name}
tar -xf %{SOURCE2}
mv universal-detector-%{_dver} UniversalDetector
%autosetup -p1 -a1 -n XADMaster-%{version}
# The code and Makefile.linux want to find UniversalDetector in the parent dir...
mv universal-detector-%{_dver} ../UniversalDetector
%build
export CFLAGS="%{optflags} -fno-strict-aliasing -Wno-int-conversion"
export CXXFLAGS="%{optflags}"
export OBJCFLAGS="$(gnustep-config --objc-flags)"
%make_build -C %{name} -f Makefile.linux
%make_build -f Makefile.linux
%install
install -d %{buildroot}%{_bindir}
install -m755 %{name}/lsar %{name}/unar -t %{buildroot}%{_bindir}
install -m755 lsar unar -t %{buildroot}%{_bindir}
install -d %{buildroot}%{_mandir}/man1
install -m644 %{name}/Extra/lsar.1 %{name}/Extra/unar.1 -t %{buildroot}%{_mandir}/man1
install -m644 Extra/lsar.1 Extra/unar.1 -t %{buildroot}%{_mandir}/man1
install -d %{buildroot}%{_datadir}/bash-completion/completions
install -m644 %{name}/Extra/lsar.bash_completion %{buildroot}%{_datadir}/bash-completion/completions/lsar
install -m644 %{name}/Extra/unar.bash_completion %{buildroot}%{_datadir}/bash-completion/completions/unar
install -m644 Extra/lsar.bash_completion %{buildroot}%{_datadir}/bash-completion/completions/lsar
install -m644 Extra/unar.bash_completion %{buildroot}%{_datadir}/bash-completion/completions/unar
%files
%license %{name}/LICENSE
%doc %{name}/README.md
%license LICENSE
%doc README.md
%{_bindir}/lsar
%{_bindir}/unar
%{_mandir}/man1/lsar.1%{?ext_man}