Skip to content

Commit

Permalink
Prepend target directory in $XDG_CACHE_HOME
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaran committed May 14, 2015
1 parent 813fced commit 49b23c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Xsession.d/25unburden-home-dir-xdg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

if unburden_it; then
if [ -z "$XDG_CACHE_HOME" ]; then
XDG_CACHE_HOME="$(echo "$FILELAYOUT" | sed -e "s/%u/$USER/;s/%s/cache/")"
XDG_CACHE_HOME="$TARGETDIR/$(echo "$FILELAYOUT" | sed -e "s/%u/$USER/;s/%s/cache/")"
export XDG_CACHE_HOME
fi
fi
3 changes: 2 additions & 1 deletion t/xsession-d-xdg.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ my ($cmd, $wanted, $output, $stderr);
# Set a debug environment
$ENV{PATH} = "$BINDIR:/bin"; # /bin needed for sed
$ENV{UNBURDEN_BASENAME} = $t->BASENAME;
$ENV{TARGETDIR} = '.';
delete $ENV{XDG_CACHE_HOME};

$t->setup_test_environment_without_target('');
Expand All @@ -41,7 +42,7 @@ $t->eq_or_diff_stdout("$XSESSIOND/$RPSCRIPT\n", "run-parts STDOUT");

$t->call_cmd("/bin/sh -c '. $XSESSIOND/$RPSCRIPT; echo \$XDG_CACHE_HOME'");
$t->eq_or_diff_stderr('', "Xsession.d STDERR is empty");
$t->eq_or_diff_stdout($t->TARGET."/cache\n", "XDG_CACHE_HOME is set");
$t->eq_or_diff_stdout($ENV{TARGETDIR}.'/'.$t->TARGET."/cache\n", "XDG_CACHE_HOME is set");

ok( write_file($t->HOME.'/.'.$t->BASENAME, "UNBURDEN_HOME=no\n"), "Configure Xsession.d script to NOT run unburden-home-dir" );

Expand Down

0 comments on commit 49b23c6

Please sign in to comment.