On Sun, Apr 27, 2008 at 05:30:55PM -0400, James Vega wrote:
> Axel,
> 
> As suggested in a Debian bug report[0], I've attached a patch which

This time with the actual patch.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>
New patches:

[Store fish_history and fishd.HOSTNAME under XDG_CACHE_HOME instead of XDG_CONFIG_HOME
James Vega <[EMAIL PROTECTED]>**20080427212255] {
hunk ./doc_src/fishd.txt 20
-\c ~/.config/fish/fishd.HOSTNAME permanent storage location for universal
+\c ~/.cache/fish/fishd.HOSTNAME permanent storage location for universal
hunk ./doc_src/fishd.txt 24
-generally the case), manual modifications to ~/.fishd.HOSTNAME will be
-lost. Do NOT edit this file manually!
+generally the case), manual modifications to ~/.cache/fish/fishd.HOSTNAME
+will be lost. Do NOT edit this file manually!
hunk ./doc_src/index.hdr.in 1127
-The history is stored in the file '~/.config/fish/fish_history'. It is automatically
+The history is stored in the file '~/.cache/fish/fish_history'. It is automatically
hunk ./doc_src/index.hdr.in 1196
-the file .config/fish/fishd.HOSTNAME, where HOSTNAME is the name of your
+the file .cache/fish/fishd.HOSTNAME, where HOSTNAME is the name of your
hunk ./fishd.c 5
-variables from ~/.fishd, and takes care of communication between fish
-instances. When no clients are running, fishd will automatically shut
-down and save.
+variables from $XDG_CACHE_HOME/fishd.$HOSTNAME, and takes care of
+communication between fish instances. When no clients are running, fishd
+will automatically shut down and save.
hunk ./fishd.c 100
-   Small not about not editing ~/.fishd manually. Inserted at the top of all .fishd files.
+   Small note about not editing $XDG_CACHE_HOME/fishd.$HOSTNAME manually. Inserted at the top of all fishd.$HOSTNAME files.
hunk ./fishd.c 417
-   free'd. This is mostly the same code as path_get_config(), but had
+   free'd. This is mostly the same code as path_get_cache(), but had
hunk ./fishd.c 421
-static wchar_t *fishd_get_config()
+static wchar_t *fishd_get_cache()
hunk ./fishd.c 427
-	xdg_dir = fishd_env_get( L"XDG_CONFIG_HOME" );
+	xdg_dir = fishd_env_get( L"XDG_CACHE_HOME" );
hunk ./fishd.c 446
-			res = wcsdupcat( home, L"/.config/fish" );
+			res = wcsdupcat( home, L"/.cache/fish" );
hunk ./fishd.c 465
-		debug( 0, _(L"Unable to create a configuration directory for fish. Your personal settings will not be saved. Please set the $XDG_CONFIG_HOME variable to a directory where the current user has write access." ));
+		debug( 0, _(L"Unable to create a cache directory for fish. Please set the $XDG_CACHE_HOME variable to a directory where the current user has write access." ));
hunk ./fishd.c 477
-	wchar_t *wdir = fishd_get_config();
+	wchar_t *wdir = fishd_get_cache();
hunk ./history.c 472
-	path = path_get_config( context );
+	path = path_get_cache( context );
hunk ./path.c 311
+
+wchar_t *path_get_cache( void *context)
+{
+	wchar_t *xdg_dir, *home;
+	int done = 0;
+	wchar_t *res = 0;
+	
+	xdg_dir = env_get( L"XDG_CACHE_HOME" );
+	if( xdg_dir )
+	{
+		res = wcsdupcat( xdg_dir, L"/fish" );
+		if( !create_directory( res ) )
+		{
+			done = 1;
+		}
+		else
+		{
+			free( res );
+		}
+		
+	}
+	else
+	{		
+		home = env_get( L"HOME" );
+		if( home )
+		{
+			res = wcsdupcat( home, L"/.cache/fish" );
+			if( !create_directory( res ) )
+			{
+				done = 1;
+			}
+			else
+			{
+				free( res );
+			}
+		}
+	}
+	
+	if( done )
+	{
+		halloc_register_function( context, &free, res );
+		return res;
+	}
+	else
+	{
+		debug( 0, _(L"Unable to create a cache directory for fish. Please set the $XDG_CACHE_HOME variable to a directory where the current user has write access." ));
+		return 0;
+	}
+	
+}
hunk ./path.h 26
+/**
+   Returns the user cache directory for fish. If the directory
+   or one of it's parents doesn't exist, they are first created.
+
+   \param context the halloc context to use for memory allocations
+   \return 0 if the no configuration directory can be located or created, the directory path otherwise.
+*/
+wchar_t *path_get_cache( void *context);
+
}

Context:

[Fix dumb error causing fish not to compile... 
[EMAIL PROTECTED] 
[Fix bug causing flood of error messages in terminal when trying to highlight an invalid command, reported by Denilson F. de Sa.
[EMAIL PROTECTED] 
[Add quilt completions, written by Stefano Sabatini.
[EMAIL PROTECTED] 
[Make string handling a bit more solid be making sure sb_printf returns a null terminated string even on failiure.
[EMAIL PROTECTED] 
[Add completions for various user and group adding commands. Skip addgroup, since manual page was actually for adduser, most switches weren't applicable and I was too lazy to guess which ones.
[EMAIL PROTECTED] 
[Add completions for m4
[EMAIL PROTECTED] 
[Add completions for badblocks
[EMAIL PROTECTED] 
[Add completions for Battle of Wesnoth
[EMAIL PROTECTED] 
[Improve documentaion for bind builtin, clarify how to specify key sequences.
[EMAIL PROTECTED] 
[Add simple git completions by Diggory Hardy
[EMAIL PROTECTED] 
[Fix spelling in docs and add a help page for the funced builtin. These changes where suggested by Emanuele Rusconi.
[EMAIL PROTECTED] 
[Search for command-not-found in PATH on startup, since older implementations place it there
[EMAIL PROTECTED] 
[In prompt_pwd, if a directory name starts with a dot, include first two characters. This patch was written by Denilson F. de Sá
[EMAIL PROTECTED] 
[Remove useless stray argument in function call
[EMAIL PROTECTED] 
[Correct completions for the function builtin
[EMAIL PROTECTED] 
[Add more documentation on events
[EMAIL PROTECTED] 
[Fix minor bug, PWD was incorrectly set on startup
[EMAIL PROTECTED] 
[Drop vim feature of only completing text and gzip files
[EMAIL PROTECTED] 
[Improve code comment
[EMAIL PROTECTED] 
[Add an extra input validation check
[EMAIL PROTECTED] 
[Improve error messages on failed execve calls a bit more
[EMAIL PROTECTED] 
[Oops. Made a minor but important typo in previous cleanup patch. :-(
[EMAIL PROTECTED] 
[Drop minor typo, add a few code comments
[EMAIL PROTECTED] 
[Add support for the Ubuntu 'command-no-found' handler, which suggests a package to install in order to get a command.
[EMAIL PROTECTED] 
[Handle case insensitive completions of variables better
[EMAIL PROTECTED] 
[The max size of the string buffer was too small. Push it up a bit.
[EMAIL PROTECTED] 
[Add canse insensitive tilde completion
[EMAIL PROTECTED] 
[Fixed various spelling errors.
James Vega <[EMAIL PROTECTED]>**20080113200151] 
[Improve Doxygen documentation generation a bit
[EMAIL PROTECTED] 
[Make sure fish_indent handles io erros
[EMAIL PROTECTED] 
[Add lots of new code comments.
[EMAIL PROTECTED] 
[TAG 1.23.0
[EMAIL PROTECTED] 
Patch bundle hash:
8030ddde5d5df3c7092cc622923af13e92ee06f1

Attachment: signature.asc
Description: Digital signature

Reply via email to