From 72dd6943b9260934a36d4cc0c8a7fde721e64f3871dce1fa66334f7a176537e5 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Sat, 17 Jun 2023 13:25:50 +0000 Subject: [PATCH] - Filter dune language version in dune-package files - Fix filtering compiled Python modules to handle Python >= 3.7 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=304 --- build-compare.changes | 10 ++++++++++ build-compare.spec | 2 +- pkg-diff.sh | 24 +++++++++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 9bfd2c7..077306c 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Sat Jun 17 17:17:17 UTC 2023 - olaf@aepfle.de + +- Filter dune language version in dune-package files + +------------------------------------------------------------------- +Wed May 3 17:32:18 UTC 2023 - Oleg Girko + +- Fix filtering compiled Python modules to handle Python >= 3.7 + ------------------------------------------------------------------- Fri Apr 28 21:21:21 UTC 2023 - olaf@aepfle.de diff --git a/build-compare.spec b/build-compare.spec index 1c3887d..388cce0 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -17,7 +17,7 @@ Name: build-compare -Version: 20230428T221133.82ffb27 +Version: 20230617T171717.50241a8 Release: 0 Summary: Build Result Compare Script License: GPL-2.0-or-later diff --git a/pkg-diff.sh b/pkg-diff.sh index d954183..a58182b 100644 --- a/pkg-diff.sh +++ b/pkg-diff.sh @@ -64,7 +64,26 @@ filter_xenefi() { } filter_pyc() { - perl -e "open fh, '+<', '$f'; seek fh, 4, SEEK_SET; print fh '0000';" + perl -e ' + my $ts_off = 4; + my $f = shift; + open fh, "+<", $f; + my $data; + die "Unexpected EOF while reading $f" if read(fh, $data, 2) < 2; + my $magic1 = unpack "v", $data; + die "Unexpected EOF while reading $f" if read(fh, $data, 2) < 2; + my $magic2 = unpack "v", $data; + die "File $f is not a compiled Python module" if $magic2 != 0x0a0d; + if ($magic1 >= 3392 && $magic1 < 20000) { + $ts_off += 4; + die "Unexpected EOF while reading $f" if read(fh, $data, 4) < 4; + my $flags = unpack "V", $data; + $ts_off += 8 if $flags & 0x1; + } + seek fh, $ts_off, SEEK_SET; + print fh "0000"; + close fh; + ' "$f" } filter_dvi() { @@ -645,6 +664,9 @@ normalize_file() sed -i 's/^127.0.0.1[[:blank:]].*/127.0.0.1 hst/' "old/$file" sed -i 's/^127.0.0.1[[:blank:]].*/127.0.0.1 hst/' "new/$file" ;; + */dune-package) + sed -i '1s@^(lang dune [^)]\+)@(lang dune 0.0)@' "old/$file" "new/$file" + ;; esac }