Accepting request 1094273 from openSUSE:Tools

- Filter dune language version in dune-package files

- Fix filtering compiled Python modules to handle Python >= 3.7

OBS-URL: https://build.opensuse.org/request/show/1094273
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/build-compare?expand=0&rev=126
This commit is contained in:
Dominique Leuenberger 2023-06-23 19:52:15 +00:00 committed by Git OBS Bridge
commit 1bb7c03d38
3 changed files with 34 additions and 2 deletions

View File

@ -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 <ol@infoserver.lv>
- Fix filtering compiled Python modules to handle Python >= 3.7
-------------------------------------------------------------------
Fri Apr 28 21:21:21 UTC 2023 - olaf@aepfle.de

View File

@ -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

View File

@ -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
}