File: 0002-Make-the-helpers.ld_preload_trick-multiarch-aware.patch

package info (click to toggle)
lua-apr 0.23.2.dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,020 kB
  • ctags: 1,075
  • sloc: ansic: 8,836; makefile: 157; sh: 20
file content (31 lines) | stat: -rw-r--r-- 1,387 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Enrico Tassi <gares@fettunta.org>
Date: Sat, 18 Jan 2014 10:38:11 +0100
Subject: Make the helpers.ld_preload_trick multiarch aware

---
 test/helpers.lua | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/helpers.lua b/test/helpers.lua
index edf4532..569f535 100644
--- a/test/helpers.lua
+++ b/test/helpers.lua
@@ -101,13 +101,16 @@ function helpers.ld_preload_trick(script) -- {{{1
   -- Include the libapr-1.so and libaprutil-1.so libraries in $LD_PRELOAD if
   -- they exist in the usual Debian location.
   local libs = apr.filepath_list_split(apr.env_get 'LD_PRELOAD' or '')
-  for _, libname in ipairs { '/usr/lib/libapr-1.so.0', '/usr/lib/libaprutil-1.so.0' } do
+  local multiarch = io.popen('dpkg-architecture -qDEB_HOST_MULTIARCH'):read('*l')
+  for _, libname in ipairs {
+	  '/usr/lib/'..multiarch..'/libapr-1.so.0',
+	  '/usr/lib/'..multiarch..'/libaprutil-1.so.0' } do
     if apr.stat(libname, 'type') == 'file' then table.insert(libs, libname) end
   end
   apr.env_set('LD_PRELOAD', apr.filepath_list_merge(libs))
 
   -- Now run the test in a child process where $LD_PRELOAD applies.
-  local child = assert(apr.proc_create 'lua')
+  local child = assert(apr.proc_create 'lua5.1')
   assert(child:cmdtype_set 'shellcmd/env')
   assert(child:exec { helpers.scriptpath(script) })
   local dead, reason, code = assert(child:wait(true))