summaryrefslogtreecommitdiff
path: root/debian/patches/libjava-fixed-symlinks.diff
blob: f463729719f12df64d12866b88ee7237825aafef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# DP: Remove unneed '..' elements from symlinks in JAVA_HOME

--- a/src/libjava/Makefile.am
+++ b/src/libjava/Makefile.am
@@ -831,7 +831,7 @@
 	$(mkinstalldirs) $(DESTDIR)$(SDK_INCLUDE_DIR)/$(OS)
 	relative() { \
 	  $(PERL) -e 'use File::Spec; \
-	    print File::Spec->abs2rel($$ARGV[0], $$ARGV[1])' $$1 $$2; \
+	    print File::Spec->abs2rel($$ARGV[0], $$ARGV[1])' $$1 $$2 | sed -r 's,(bin|lib)[^/]*/\.\./,,'; \
 	}; \
 	RELATIVE=$$(relative $(DESTDIR)$(bindir) $(DESTDIR)$(SDK_BIN_DIR)); \
 	ln -sf $$RELATIVE/`echo gij | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \
--- a/src/libjava/Makefile.in
+++ b/src/libjava/Makefile.in
@@ -12460,7 +12460,7 @@
 @CREATE_JAVA_HOME_TRUE@	$(mkinstalldirs) $(DESTDIR)$(SDK_INCLUDE_DIR)/$(OS)
 @CREATE_JAVA_HOME_TRUE@	relative() { \
 @CREATE_JAVA_HOME_TRUE@	  $(PERL) -e 'use File::Spec; \
-@CREATE_JAVA_HOME_TRUE@	    print File::Spec->abs2rel($$ARGV[0], $$ARGV[1])' $$1 $$2; \
+@CREATE_JAVA_HOME_TRUE@	    print File::Spec->abs2rel($$ARGV[0], $$ARGV[1])' $$1 $$2 | sed -r 's,(bin|lib)[^/]*/\.\./,,'; \
 @CREATE_JAVA_HOME_TRUE@	}; \
 @CREATE_JAVA_HOME_TRUE@	RELATIVE=$$(relative $(DESTDIR)$(bindir) $(DESTDIR)$(SDK_BIN_DIR)); \
 @CREATE_JAVA_HOME_TRUE@	ln -sf $$RELATIVE/`echo gij | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'` \