1 |
caster 08/01/10 20:12:12 |
2 |
|
3 |
Modified: java-osgi.eclass |
4 |
Log: |
5 |
Fix relative path handling in _java-osgi_makejar, fixes bug #205234. |
6 |
|
7 |
Revision Changes Path |
8 |
1.2 eclass/java-osgi.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/java-osgi.eclass?rev=1.2&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/java-osgi.eclass?rev=1.2&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/java-osgi.eclass?r1=1.1&r2=1.2 |
13 |
|
14 |
Index: java-osgi.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/java-osgi.eclass,v |
17 |
retrieving revision 1.1 |
18 |
retrieving revision 1.2 |
19 |
diff -u -r1.1 -r1.2 |
20 |
--- java-osgi.eclass 9 Jan 2008 10:51:20 -0000 1.1 |
21 |
+++ java-osgi.eclass 10 Jan 2008 20:12:12 -0000 1.2 |
22 |
@@ -5,7 +5,7 @@ |
23 |
# |
24 |
# Licensed under the GNU General Public License, v2 |
25 |
# |
26 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-osgi.eclass,v 1.1 2008/01/09 10:51:20 elvanor Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-osgi.eclass,v 1.2 2008/01/10 20:12:12 caster Exp $ |
28 |
|
29 |
# ----------------------------------------------------------------------------- |
30 |
# @eclass-begin |
31 |
@@ -29,6 +29,18 @@ |
32 |
|
33 |
_OSGI_T="${T/%\//}" |
34 |
|
35 |
+# must get Diego to commit something like this to portability.eclass |
36 |
+_canonicalise() { |
37 |
+ if type -p realpath > /dev/null; then |
38 |
+ realpath "${@}" |
39 |
+ elif type -p readlink > /dev/null; then |
40 |
+ readlink -f "${@}" |
41 |
+ else |
42 |
+ # can't die, subshell |
43 |
+ eerror "No readlink nor realpath found, cannot canonicalise" |
44 |
+ fi |
45 |
+} |
46 |
+ |
47 |
# ----------------------------------------------------------------------------- |
48 |
# @ebuild-function _java-osgi_plugin |
49 |
# |
50 |
@@ -68,15 +80,15 @@ |
51 |
_java-osgi_makejar() { |
52 |
debug-print-function ${FUNCNAME} "$@" |
53 |
|
54 |
- (( ${#} < 4 )) && die "Four arguments are needed for java-osgi_dojar-fromfile()" |
55 |
+ (( ${#} < 4 )) && die "Four arguments are needed for _java-osgi_makejar()" |
56 |
|
57 |
- local absoluteJarPath="$(readlink -f ${1})" |
58 |
- local jarName="$(basename $1)" |
59 |
+ local absoluteJarPath="$(_canonicalise ${1})" |
60 |
+ local jarName="$(basename ${1})" |
61 |
|
62 |
mkdir "${_OSGI_T}/tmp_jar" || die "Unable to create directory ${_OSGI_T}/tmp_jar" |
63 |
[[ -d "${_OSGI_T}/osgi" ]] || mkdir "${_OSGI_T}/osgi" || die "Unable to create directory ${_OSGI_T}/osgi" |
64 |
|
65 |
- cd "${_OSGI_T}/tmp_jar" && jar xf "${1}" && cd - > /dev/null \ |
66 |
+ cd "${_OSGI_T}/tmp_jar" && jar xf "${absoluteJarPath}" && cd - > /dev/null \ |
67 |
|| die "Unable to uncompress correctly the original jar" |
68 |
|
69 |
cat > "${_OSGI_T}/tmp_jar/META-INF/MANIFEST.MF" <<-EOF |
70 |
@@ -178,7 +190,7 @@ |
71 |
|
72 |
((${#} < 4)) && die "Four arguments are needed for _java-osgi_makejar-fromfile()" |
73 |
|
74 |
- local absoluteJarPath="$(readlink -f ${1})" |
75 |
+ local absoluteJarPath="$(_canonicalise ${1})" |
76 |
local jarName="$(basename ${1})" |
77 |
|
78 |
mkdir "${_OSGI_T}/tmp_jar" || die "Unable to create directory ${_OSGI_T}/tmp_jar" |
79 |
|
80 |
|
81 |
|
82 |
-- |
83 |
gentoo-commits@l.g.o mailing list |