Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
9d8142e92f
!26 Fix install-gmo target to recompile gmo files only if needed
From: @cao-fei8 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-01-06 09:51:02 +00:00
cao-fei8
7f61253c68 Fix install-gmo target to recompile gmo files only if needed
Signed-off-by: cao-fei8 <caofei@xfusion.com>
2023-01-06 17:27:19 +08:00
openeuler-ci-bot
f785e28e5b
!22 fix incorrect total message in check-embedded mode
From: @cao-fei8 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-01-06 07:13:54 +00:00
cao-fei8
91d6d2bcf7 fix incorrect total message in check-embedded mode
Signed-off-by: cao-fei8 <caofei@xfusion.com>
2023-01-06 14:55:33 +08:00
openeuler-ci-bot
49478f87c1
!17 [sync] PR-16: 添加sw架构
From: @openeuler-sync-bot 
Reviewed-by: @gitee-cmd 
Signed-off-by: @gitee-cmd
2022-12-19 03:04:14 +00:00
wuzx
16feab6326
update rhash.spec.
Signed-off-by: wuzx <471319475@qq.com>
2022-12-08 08:57:47 +00:00
wuzx
c82d18cddd
update rhash.spec.
Signed-off-by: wuzx <471319475@qq.com>
2022-11-25 07:42:28 +00:00
wzx
5e233df07a Add sw64 architecture
Signed-off-by: wzx <wuzx1226@qq.com>
(cherry picked from commit 7dee9c4be21b9c69b7f3c47debb9e01c6365c7cc)
2022-11-08 14:39:24 +08:00
openeuler-ci-bot
ddbf825f40
!15 Fix bug with hash options in check mode
From: @zhangruifang2020 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2022-10-25 08:44:24 +00:00
zhangruifang2020
0af74ce409 Fix bug with hash options in check mode 2022-10-21 15:46:49 +08:00
5 changed files with 157 additions and 2 deletions

View File

@ -0,0 +1,41 @@
From 9e4eeb1268149b24b7fbe0fc0fe91e3a266e6261 Mon Sep 17 00:00:00 2001
From: Aleksey <rhash.admin@gmail.com>
Date: Sun, 31 Oct 2021 02:49:04 +0300
Subject: [PATCH] Fix install-gmo target to recompile gmo files only if needed
---
Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 6031e43..c127379 100644
--- a/Makefile
+++ b/Makefile
@@ -293,7 +293,7 @@ clean-bindings:
clean-local:
rm -f *.o $(RHASH_SHARED) $(RHASH_STATIC)
- rm -f po/*.gmo po/*.po~
+ rm -f po/*.gmo po/*.po~ po/compile-gmo.tag
distclean: clean-local
rm -f config.log config.mak $(SPECFILE) $(LIBRHASH_PC)
@@ -309,11 +309,14 @@ update-po:
msgmerge -U $$f po/rhash.pot; \
done
-compile-gmo:
+po/compile-gmo.tag: $(I18N_FILES)
for f in $(I18N_FILES); do \
g=`basename $$f .po`; \
msgfmt -o po/$$g.gmo $$f; \
done
+ touch $@
+
+compile-gmo: po/compile-gmo.tag
install-gmo: compile-gmo
for f in $(I18N_FILES); do \
--
2.33.0

View File

@ -0,0 +1,25 @@
From 5796c94b1eba4fb7407868555e630b409340b78e Mon Sep 17 00:00:00 2001
From: Aleksey <rhash.admin@gmail.com>
Date: Sat, 11 Sep 2021 21:23:34 +0300
Subject: [PATCH] fix incorrect total message in check-embedded mode
---
hash_check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hash_check.c b/hash_check.c
index 0c0ed84..0ed88ce 100644
--- a/hash_check.c
+++ b/hash_check.c
@@ -1147,7 +1147,7 @@ static int check_embedded_crc32(file_t* file)
log_error_file_t(&rhash_data.out_file);
res = -2;
} else if (!rhash_data.stop_flags) {
- if (res >= 0)
+ if (res == 0)
rhash_data.ok++;
else if (res == -1 && errno == ENOENT)
rhash_data.miss++;
--
2.33.0

View File

@ -0,0 +1,26 @@
From 79a1a0b3d267893c40ac31192b20e20969a3a79c Mon Sep 17 00:00:00 2001
From: Aleksey <rhash.admin@gmail.com>
Date: Sun, 12 Dec 2021 16:27:55 +0300
Subject: [PATCH] Fix bug with hash options in --check mode
---
hash_check.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/hash_check.c b/hash_check.c
index 4cffdc6..4d44d0d 100644
--- a/hash_check.c
+++ b/hash_check.c
@@ -1262,7 +1262,8 @@ static void set_parser_flags_by_file_extension(struct hash_parser_ext* parser)
struct file_ext ext;
if (!extract_uppercase_file_ext(&ext, parser->hash_file))
return;
- parser->expected_hash_mask = bsd_hash_name_to_id(ext.buffer, ext.length);
+ if (!parser->expected_hash_mask)
+ parser->expected_hash_mask = bsd_hash_name_to_id(ext.buffer, ext.length);
if (ext.length == 3 && memcmp(ext.buffer, "SFV", 3) == 0)
parser->is_sfv = 1;
}
--
2.27.0

39
RHash-1.4.2-sw.patch Executable file
View File

@ -0,0 +1,39 @@
diff -Naur RHash-1.4.2.org/configure RHash-1.4.2.sw/configure
--- RHash-1.4.2.org/configure 2022-02-25 19:11:47.060000000 +0000
+++ RHash-1.4.2.sw/configure 2022-02-25 19:19:40.480000000 +0000
@@ -402,6 +402,7 @@
ia64) HOST_ARCH=ia64 ;;
macppc|ppc*|Power*) HOST_ARCH=ppc ;;
alpha) HOST_ARCH=alpha ;;
+ sw_64) HOST_ARCH=sw_64 ;;
sun4*|sparc*) HOST_ARCH=sparc ;;
parisc*|hppa*|9000*) HOST_ARCH=hppa ;;
aarch64*) HOST_ARCH=aarch64 ;;
diff -Naur RHash-1.4.2.org/librhash/byte_order.h RHash-1.4.2.sw/librhash/byte_order.h
--- RHash-1.4.2.org/librhash/byte_order.h 2022-02-25 19:11:47.060000000 +0000
+++ RHash-1.4.2.sw/librhash/byte_order.h 2022-02-25 19:18:16.820000000 +0000
@@ -60,7 +60,7 @@
/* try detecting endianness by CPU */
#ifdef RHASH_BYTE_ORDER
#elif defined(CPU_IA32) || defined(CPU_X64) || defined(__ia64) || defined(__ia64__) || \
- defined(__alpha__) || defined(_M_ALPHA) || defined(vax) || defined(MIPSEL) || \
+ defined(__alpha__) || defined(_M_ALPHA) || defined(__sw_64__) || defined(_M_SW_64) || defined(vax) || defined(MIPSEL) || \
defined(_ARM_) || defined(__arm__)
# define RHASH_BYTE_ORDER RHASH_BYTE_ORDER_LE
#elif defined(__sparc) || defined(__sparc__) || defined(sparc) || \
diff -Naur RHash-1.4.2.org/librhash/test_hashes.h RHash-1.4.2.sw/librhash/test_hashes.h
--- RHash-1.4.2.org/librhash/test_hashes.h 2022-02-25 19:11:47.070000000 +0000
+++ RHash-1.4.2.sw/librhash/test_hashes.h 2022-02-25 19:19:15.490000000 +0000
@@ -89,6 +89,12 @@
#ifdef __ia64__
" __ia64__"
#endif
+#ifdef __sw_64__
+ " __sw_64__"
+#endif
+#ifdef _M_SW_64
+ " _M_SW_64"
+#endif
#ifdef __alpha__
" __alpha__"
#endif

View File

@ -1,11 +1,17 @@
Name: rhash
Version: 1.4.2
Release: 1
Release: 5
Summary: Great utility for computing hash sums
License: MIT
URL: https://github.com/rhash/RHash
Source0: https://github.com/rhash/RHash/archive/v%{version}/rhash-%{version}.tar.gz
#References: https://github.com/rhash/RHash/commit/79a1a0b3d267893c40ac31192b20e20969a3a79c
Patch0: Fix-bug-with-hash-options-in-check-mode.patch
Patch1: RHash-1.4.2-sw.patch
Patch2: 0001-fix-incorrect-total-message-in-check-embedded-mode.patch
Patch3: 0001-Fix-install-gmo-target-to-recompile-gmo-files-only-i.patch
BuildRequires: gcc
%description
@ -30,7 +36,13 @@ Summary: Documentation for rhash
Documentation for rhash
%prep
%autosetup -n RHash-%{version}
%setup -n RHash-%{version}
%patch0 -p1
%ifarch sw_64
%patch1 -p1
%endif
%patch2 -p1
%patch3 -p1
sed -i -e '/^INSTALL_SHARED/s/644/755/' librhash/Makefile
%build
@ -63,6 +75,18 @@ make test-shared
%{_mandir}/man1/*.1*
%changelog
* Fri Jan 6 2023 caofei <caofei@xfusion.com> - 1.4.2-5
- Fix install-gmo target to recompile gmo files only if needed
* Fri Jan 6 2023 caofei<caofei@xfusion.com> - 1.4.2-4
- fix incorrect total message in check-embedded mode
* Tue Oct 25 2022 wuzx<wuzx1226@qq.com> - 1.4.2-3
- Add sw64 architecture
* Fri Oct 21 2022 zhangruifang <zhangruifang1@h-partners.com> - 1.4.2-2
- Fix bug with hash options in check mode
* Tue Nov 30 2021 zoulin <zoulin13@huawei.com> - 1.4.2-1
- Upgrade to 1.4.2