1 |
commit: ac489776e5c17f2e6a91b0ee7603caa7ad797a4e |
2 |
Author: Maciej Mrozowski <reavertm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 30 06:05:30 2017 +0000 |
4 |
Commit: Maciej Mrozowski <reavertm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 30 06:05:45 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac489776 |
7 |
|
8 |
dev-libs/libmspack: Fix tests, bug #635776 |
9 |
|
10 |
Package-Manager: Portage-2.3.8, Repoman-2.3.4 |
11 |
|
12 |
.../files/libmspack-0.6_alpha-fix-tests.patch | 96 ++++++++++++++++++++++ |
13 |
dev-libs/libmspack/libmspack-0.6_alpha.ebuild | 4 + |
14 |
2 files changed, 100 insertions(+) |
15 |
|
16 |
diff --git a/dev-libs/libmspack/files/libmspack-0.6_alpha-fix-tests.patch b/dev-libs/libmspack/files/libmspack-0.6_alpha-fix-tests.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..2f010d87a37 |
19 |
--- /dev/null |
20 |
+++ b/dev-libs/libmspack/files/libmspack-0.6_alpha-fix-tests.patch |
21 |
@@ -0,0 +1,96 @@ |
22 |
+From deb65056f436a4ce06946c4dde270f533e3cab4d Mon Sep 17 00:00:00 2001 |
23 |
+From: Stuart Caie <kyzer@××××××××××××××.uk> |
24 |
+Date: Mon, 16 Oct 2017 13:59:05 +0100 |
25 |
+Subject: [PATCH] Fix cabd_test.c test and msdecompile_md5 script |
26 |
+ |
27 |
+--- |
28 |
+ libmspack/ChangeLog | 10 +++++++++ |
29 |
+ libmspack/test/cabd_test.c | 3 ++- |
30 |
+ libmspack/test/msdecompile_md5 | 47 +++++++++++++++++++++--------------------- |
31 |
+ 3 files changed, 36 insertions(+), 24 deletions(-) |
32 |
+ |
33 |
+diff --git a/libmspack/ChangeLog b/libmspack/ChangeLog |
34 |
+index 6861b19..4aef85f 100644 |
35 |
+--- a/libmspack/ChangeLog |
36 |
++++ b/libmspack/ChangeLog |
37 |
+@@ -1,3 +1,13 @@ |
38 |
++2017-10-16 Stuart Caie <kyzer@××××××××××××××.uk> |
39 |
++ |
40 |
++ * test/cabd_test.c: update the short string tests to expect not only |
41 |
++ MSPACK_ERR_DATAFORMAT but also MSPACK_ERR_READ, because of the recent |
42 |
++ change to cabd_read_string(). Thanks to maitreyee43 for spotting this. |
43 |
++ |
44 |
++ * test/msdecompile_md5: update the setup instructions for this script, |
45 |
++ and also change the script so it works with current Wine. Again, thanks |
46 |
++ to maitreyee43 for trying to use it and finding it not working. |
47 |
++ |
48 |
+ 2017-08-13 Stuart Caie <kyzer@××××××××××××××.uk> |
49 |
+ |
50 |
+ * src/chmextract.c: support MinGW one-arg mkdir(). Thanks to AntumDeluge |
51 |
+diff --git a/libmspack/test/cabd_test.c b/libmspack/test/cabd_test.c |
52 |
+index 5e8851c..abed65c 100644 |
53 |
+--- a/libmspack/test/cabd_test.c |
54 |
++++ b/libmspack/test/cabd_test.c |
55 |
+@@ -186,7 +186,8 @@ void cabd_open_test_05() { |
56 |
+ for (i = 0; i < (sizeof(str_files)/sizeof(char *)); i++) { |
57 |
+ cab = cabd->open(cabd, str_files[i]); |
58 |
+ TEST(cab == NULL); |
59 |
+- TEST(cabd->last_error(cabd) == MSPACK_ERR_DATAFORMAT); |
60 |
++ TEST(cabd->last_error(cabd) == MSPACK_ERR_DATAFORMAT || |
61 |
++ cabd->last_error(cabd) == MSPACK_ERR_READ); |
62 |
+ } |
63 |
+ |
64 |
+ /* lack of data blocks should NOT be a problem for merely reading */ |
65 |
+diff --git a/libmspack/test/msdecompile_md5 b/libmspack/test/msdecompile_md5 |
66 |
+index a1d3b4b..9efbfac 100755 |
67 |
+--- a/libmspack/test/msdecompile_md5 |
68 |
++++ b/libmspack/test/msdecompile_md5 |
69 |
+@@ -1,24 +1,25 @@ |
70 |
+-#!/usr/bin/perl -w |
71 |
+-# put hh.exe, hhctrl.ocx and itss.dll into this directory |
72 |
+-# for this script to work. You can get them by downloading |
73 |
+-# the HTML Help Workshop from Microsoft and then doing: |
74 |
+-# $ cabextract -F 'hh*' htmlhelp.exe |
75 |
+-# $ cabextract -F itircl.dll hhupd.exe |
76 |
+-# $ cabextract -F itss.dll hhupd.exe |
77 |
+-# $ cp -a itircl.dll ~/.wine/drive_c/windows/system32/ |
78 |
+-# $ cp -a itss.dll ~/.wine/drive_c/windows/system32/ |
79 |
+-# $ wine regsvr32 /s 'C:\WINDOWS\SYSTEM32\itircl.dll' |
80 |
+-# $ wine regsvr32 /s 'C:\WINDOWS\SYSTEM32\itss.dll' |
81 |
++#!/bin/sh |
82 |
++# This script needs the following setup to work: |
83 |
++# - hh.exe and hhctrl.ocx copied to Wine's system32 |
84 |
++# - itss.dll and itircl.dll installed as Wine DLLs |
85 |
++# |
86 |
++# Download the HTML Help Workshop (htmlhelp.exe) from Microsoft: |
87 |
++# |
88 |
++# https://msdn.microsoft.com/en-us/library/windows/desktop/ms669985(v=vs.85).aspx |
89 |
++# |
90 |
++# and then run these commands: |
91 |
++# |
92 |
++# cabextract htmlhelp.exe -F hhupd.exe |
93 |
++# cabextract hhupd.exe -F hh.exe |
94 |
++# cabextract hhupd.exe -F hhctrl.ocx |
95 |
++# cabextract hhupd.exe -F itircl.dll |
96 |
++# cabextract hhupd.exe -F itss.dll |
97 |
++# mv hh.exe hhctrl.ocx itircl.dll itss.dll ~/.wine/drive_c/windows/system32/ |
98 |
++# wine regsvr32 /s 'c:\windows\system32\itircl.dll' |
99 |
++# wine regsvr32 /s 'c:\windows\system32\itss.dll' |
100 |
+ |
101 |
+-use strict; |
102 |
+-use File::Temp qw(tempdir); |
103 |
+- |
104 |
+-die "Usage: $0 <file.chm>\n" unless @ARGV == 1; |
105 |
+-my $hh = $0; $hh =~ s{[^/]+$}{hh.exe}; |
106 |
+-my $dir = tempdir("./.tempXXXX", CLEANUP => 1); |
107 |
+- |
108 |
+-$ENV{LANG} = 'C'; |
109 |
+-$ENV{WINEDLLOVERRIDES}='hhctrl.ocx,itss=n'; |
110 |
+-print "*** $ARGV[0]\n"; |
111 |
+-system("wine $hh -decompile $dir $ARGV[0] 1>&2 && " . |
112 |
+- "cd $dir && find * -type f -print0 | xargs -0 md5sum"); |
113 |
++dir=`mktemp -d` |
114 |
++echo "*** $1" |
115 |
++LANG=C WINEDLLOVERRIDES='hhctrl.ocx=n' wine hh -decompile $dir "$1" |
116 |
++cd $dir && find * -type f -exec md5sum {} + |
117 |
++rm -rf $dir |
118 |
|
119 |
diff --git a/dev-libs/libmspack/libmspack-0.6_alpha.ebuild b/dev-libs/libmspack/libmspack-0.6_alpha.ebuild |
120 |
index b8c96e78ed0..6a40351178f 100644 |
121 |
--- a/dev-libs/libmspack/libmspack-0.6_alpha.ebuild |
122 |
+++ b/dev-libs/libmspack/libmspack-0.6_alpha.ebuild |
123 |
@@ -20,6 +20,10 @@ IUSE="debug doc static-libs" |
124 |
DEPEND="" |
125 |
RDEPEND="" |
126 |
|
127 |
+PATCHES=( |
128 |
+ "${FILESDIR}/${P}-fix-tests.patch" |
129 |
+) |
130 |
+ |
131 |
S="${WORKDIR}/${MY_P}" |
132 |
|
133 |
multilib_src_configure() { |