summarylogtreecommitdiffstats
path: root/fvwm-themes.patch
blob: 19e1b2bae873d983feb41634b451c35ae44e0ab8 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff -up src/fvwm-themes-0.7.0/bin/fvwm-themes-config.in.orig src/fvwm-themes-0.7.0/bin/fvwm-themes-config.in
--- src/fvwm-themes-0.7.0/bin/fvwm-themes-config.in.orig	2003-10-20 08:45:50.000000000 -0600
+++ src/fvwm-themes-0.7.0/bin/fvwm-themes-config.in	2013-09-06 19:47:29.000000000 -0600
@@ -275,7 +275,7 @@ sub getExpandedRc ($) {
 	my $file = shift;
 	### should detect infinitive loops?
 	if (!-f $file) {
-		foreach (@searchPath) {
+		foreach (@searchPath, "$ROOT_PREFIX$ftDataDir") {
 			if (-f "$_/$file") { $file = "$_/$file"; last; }
 		}
 	}
@@ -311,7 +311,7 @@ sub searchThemeCfgIncludeFile ($$) {
 		unshift @subDirs, ".";
 	}
 	my $dir;
-	foreach $dir (@searchPath) {
+	foreach $dir (@searchPath, "$ROOT_PREFIX$ftDataDir") {
 		foreach (@subDirs) {
 			my $file = "$dir/$themesSubDir/$_/$file";
 			return $file if -f $file;
@@ -656,7 +656,7 @@ sub parseComponentName ($) {
 sub getThemeDir ($) {
 	my $theme = shift;
 	my $dir;
-	foreach $dir (@searchPath) {
+	foreach $dir (@searchPath, "$ROOT_PREFIX$ftDataDir") {
 		my $dir = "$dir/$themesSubDir/$theme";
 		return $dir if -d $dir;
 	}
@@ -966,6 +966,7 @@ sub new ($$;$$) {
 				$readFile = "$dir/$component";
 				$readFile .= ".d" if -d "$readFile.d" && !-e $readFile;
 				$readFile .= "/$mainDirFile" if -d $readFile;
+				$readFile =~ s{^$ROOT_PREFIX}{};
 			}
 			$cc->{'read-file'} = $readFile;
 		}
@@ -1444,6 +1445,7 @@ sub getOwnThemeSubMenusRc ($) {
 				}
 				my $readFile = $cc->{'read-file'};
 				$readFile =~ s:/[^/]+$:/$variants->[$index]->{'file'}:;
+				$readFile =~ s{^$ROOT_PREFIX}{};
 				if ($readFile ne $cc->{'read-file'}) {
 					$cc->{'read-file'} = $readFile;
 					$self->setModified();
@@ -2285,7 +2287,9 @@ Read @$rcFile2@
 	saveFile("$workDir/$rcFile", \$contents);
 
 	my $imagePath = "$workDir/$currentThemeSubDir/images:$workDir/images";
+	$imagePath =~ s{^$ROOT_PREFIX}{};
 	$imagePath .= ":$siteDir/images" if $workDir ne $siteDir;
+	$imagePath =~ s{:$ROOT_PREFIX}{:};
 	$imagePath .= ":$fvwmDefaultImagePath" if $fvwmDefaultImagePath;
 	$imagePath =~ s=(^|:)\Q$userDir\E(/|:|$)=$1\$FVWM_USERDIR$2=g;
 	$imagePath =~ s=(^|:)\Q$userHome\E(/|:|$)=$1\$HOME$2=g;
@@ -2402,7 +2406,7 @@ GetOptions(
 ) || wrongUsage();
 
 shift @searchPath if $site;
-$workDir = $searchPath[0];
+$workDir = "$ROOT_PREFIX$searchPath[0]";
 $siteDir = $searchPath[-1];
 
 if ($install) {