Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/elfix:elfix-0.8.x commit in: tests/paxmodule/, tests/revdeppaxtest/
Date: Mon, 20 May 2013 20:02:55
Message-Id: 1369080042.130711ec3d255b8649daf79e74f26b49c153327c.blueness@gentoo
1 commit: 130711ec3d255b8649daf79e74f26b49c153327c
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 20 15:18:03 2013 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Mon May 20 20:00:42 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=130711ec
7
8 tests/{paxmodule,revdeppaxtest}: make path resolutions more robust
9
10 ---
11 tests/paxmodule/paxmodtest.sh | 30 +++++++++++++++---------------
12 tests/revdeppaxtest/revdeptest.sh | 34 ++++++++++++++++------------------
13 2 files changed, 31 insertions(+), 33 deletions(-)
14
15 diff --git a/tests/paxmodule/paxmodtest.sh b/tests/paxmodule/paxmodtest.sh
16 index fb0b280..8e831bf 100755
17 --- a/tests/paxmodule/paxmodtest.sh
18 +++ b/tests/paxmodule/paxmodtest.sh
19 @@ -26,28 +26,28 @@ verbose=${1-0}
20 shift
21
22 TESTFILE="$(pwd)/dummy"
23 -PAXCTLNG="../../src/paxctl-ng"
24 -PYPAXCTL="../../scripts/pypaxctl"
25 +PAXCTLNG="$(pwd)/../../src/paxctl-ng"
26 +PYPAXCTL="$(pwd)/../../scripts/pypaxctl"
27
28 unamem=$(uname -m)
29 pythonversion=$(python --version 2>&1)
30 pythonversion=$(echo ${pythonversion} | awk '{ print $2 }')
31 pythonversion=${pythonversion%\.*}
32 -PYTHONPATH="../../scripts/build/lib.linux-${unamem}-${pythonversion}"
33 +export PYTHONPATH="$(pwd)/../../scripts/build/lib.linux-${unamem}-${pythonversion}"
34 +
35 +#NOTE: the last -D or -U wins as it does for gcc $CFLAGS
36 +for f in $@; do
37 + [ $f = "-UXTPAX" ] && unset XTPAX
38 + [ $f = "-DXTPAX" ] && XTPAX=1
39 + [ $f = "-UPTPAX" ] && unset PTPAX
40 + [ $f = "-DPTPAX" ] && PTPAX=1
41 +done
42 +export XTPAX
43 +export PTPAX
44
45 -if [ ! -d ${PYTHONPATH} ]; then
46 +if [ -d ${PYTHONPATH} ]; then
47 + rm -rf ${PYTHONPATH}
48 echo " (Re)building pax module"
49 -
50 - #NOTE: the last -D or -U wins as it does for gcc $CFLAGS
51 - for f in $@; do
52 - [ $f = "-UXTPAX" ] && unset XTPAX
53 - [ $f = "-DXTPAX" ] && XTPAX=1
54 - [ $f = "-UPTPAX" ] && unset PTPAX
55 - [ $f = "-DPTPAX" ] && PTPAX=1
56 - done
57 - export XTPAX
58 - export PTPAX
59 -
60 ( cd ../../scripts; exec ./setup.py build ) >/dev/null
61 fi
62
63
64 diff --git a/tests/revdeppaxtest/revdeptest.sh b/tests/revdeppaxtest/revdeptest.sh
65 index 84e67b6..e8380e8 100755
66 --- a/tests/revdeppaxtest/revdeptest.sh
67 +++ b/tests/revdeppaxtest/revdeptest.sh
68 @@ -33,8 +33,8 @@ if [ "$ID" != 0 ]; then
69 exit 1
70 fi
71
72 -PAXCTLNG="../../src/paxctl-ng"
73 -REVDEPPAX="../../scripts/revdep-pax"
74 +PAXCTLNG="$(pwd)/../../src/paxctl-ng"
75 +REVDEPPAX="$(pwd)/../../scripts/revdep-pax"
76
77 LIBSPATH="$(pwd)/.libs"
78 BINARY="revdepbin"
79 @@ -65,23 +65,21 @@ unamem=$(uname -m)
80 pythonversion=$(python --version 2>&1)
81 pythonversion=$(echo ${pythonversion} | awk '{ print $2 }')
82 pythonversion=${pythonversion%\.*}
83 -PYTHONPATH="../../scripts/build/lib.linux-${unamem}-${pythonversion}"
84 -
85 -# Assume the pax.so module is built if the path exists
86 -# otherwise build it ourselves!
87 -if [ ! -d ${PYTHONPATH} ]; then
88 - echo " (Re)building pax module"
89 -
90 - #NOTE: the last -D or -U wins as it does for gcc $CFLAGS
91 - for f in $@; do
92 - [ $f = "-UXTPAX" ] && unset XTPAX
93 - [ $f = "-DXTPAX" ] && XTPAX=1
94 - [ $f = "-UPTPAX" ] && unset PTPAX
95 - [ $f = "-DPTPAX" ] && PTPAX=1
96 - done
97 - export XTPAX
98 - export PTPAX
99 +export PYTHONPATH="$(pwd)/../../scripts/build/lib.linux-${unamem}-${pythonversion}"
100 +
101 +#NOTE: the last -D or -U wins as it does for gcc $CFLAGS
102 +for f in $@; do
103 + [ $f = "-UXTPAX" ] && unset XTPAX
104 + [ $f = "-DXTPAX" ] && XTPAX=1
105 + [ $f = "-UPTPAX" ] && unset PTPAX
106 + [ $f = "-DPTPAX" ] && PTPAX=1
107 +done
108 +export XTPAX
109 +export PTPAX
110
111 +if [ -d ${PYTHONPATH} ]; then
112 + rm -rf ${PYTHONPATH}
113 + echo " (Re)building pax module"
114 ( cd ../../scripts; exec ./setup.py build ) >/dev/null
115 fi