[PATCH test/xts] Don't add local paths when the server is remote

Peter Harris pharris at opentext.com
Wed Aug 15 11:26:32 PDT 2012


XT_FONTPATH has to be a valid font path.

Also trim at least one remote path from XT_FONTPATH_GOOD, so it
isn't the same as XT_FONTPATH.

Signed-off-by: Peter Harris <pharris at opentext.com>
---

This works well in my setup. Is anyone relying on xtest font directories
being
in the same location on separate machines?

 xts5/bin/xts-config.in |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/xts5/bin/xts-config.in b/xts5/bin/xts-config.in
index 3d10c13..9e30b5f 100755
--- a/xts5/bin/xts-config.in
+++ b/xts5/bin/xts-config.in
@@ -97,6 +97,24 @@ BEGIN
 			$::vars{"XT_DISPLAYHOST"} = "";
 		}
 	}
+	else
+	{
+		# Not a local display; admin is responsible for placing
+		# xtest fonts on the font path before running xts-config.
+		$::vars{"XT_FONTPATH"} = $::vars{"XT_FONTPATH_GOOD"};
+		my @fp = split(/,/, $::vars{"XT_FONTPATH"});
+
+		# Remove xtest directory
+		my @fpg = grep(!/xtest/i, @fp);
+
+		# If xtest directory is not called "xtest", remove the
+		# last directory in the path (as it's less likely to
+		# be the path containing "default"/"cursor" than the
+		# first directory in the path).
+		pop @fpg if (scalar(@fp) == scalar(@fpg));
+
+		$::vars{"XT_FONTPATH_GOOD"} = join(',', @fpg);
+	}
  	if($::vars{"XT_SCREEN_COUNT"} > 1)
 	{
-- 
1.7.2.5

.



More information about the xorg-devel mailing list