[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32287] trunk/blender/source/blender/ blenlib/intern/path_util.c: changes to path searching

Campbell Barton ideasman42 at gmail.com
Sun Oct 3 23:13:52 CEST 2010


Revision: 32287
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32287
Author:   campbellbarton
Date:     2010-10-03 23:13:52 +0200 (Sun, 03 Oct 2010)

Log Message:
-----------
changes to path searching
- don't search CWD/foldername anymore, only CWD/2.54/foldername, since this is the new default build systems use.
- local source paths (./release/scripts) are now treated as system path, otherwise when this is used you cant test ~/.blender/2.54/scripts at the same time.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/path_util.c

Modified: trunk/blender/source/blender/blenlib/intern/path_util.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/path_util.c	2010-10-03 21:10:59 UTC (rev 32286)
+++ trunk/blender/source/blender/blenlib/intern/path_util.c	2010-10-03 21:13:52 UTC (rev 32287)
@@ -838,7 +838,6 @@
 	extern char bprogname[]; /* argv[0] from creator.c */
 	char bprogdir[FILE_MAX];
 	char relfolder[FILE_MAX];
-	char cwd[FILE_MAX];
 	
 #ifdef PATH_DEBUG2
 	printf("get_path_local...\n");
@@ -853,19 +852,7 @@
 	/* use argv[0] (bprogname) to get the path to the executable */
 	BLI_split_dirfile(bprogname, bprogdir, NULL);
 	
-	/* try EXECUTABLE_DIR/folder_name */
-	if(test_path(targetpath, bprogdir, "", relfolder))
-		return 1;
-	
-	/* try CWD/release/folder_name */
-	if(test_path(targetpath, BLI_getwdN(cwd), "release", relfolder))
-		return 1;
-	
-	/* try EXECUTABLE_DIR/release/folder_name */
-	if(test_path(targetpath, bprogdir, "release", relfolder))
-		return 1;
-	
-	/* try EXECUTABLE_DIR/2.5/folder_name - new default directory for local blender installed files */
+	/* try EXECUTABLE_DIR/2.5x/folder_name - new default directory for local blender installed files */
 	if(test_path(targetpath, bprogdir, blender_version_decimal(), relfolder))
 		return 1;
 
@@ -914,6 +901,34 @@
 	char system_path[FILE_MAX];
 	const char *system_base_path;
 
+
+	/* first allow developer only overrides to the system path
+	 * these are only used when running blender from source */
+	extern char bprogname[]; /* argv[0] from creator.c */
+	char cwd[FILE_MAX];
+	char relfolder[FILE_MAX];
+	char bprogdir[FILE_MAX];
+
+	/* use argv[0] (bprogname) to get the path to the executable */
+	BLI_split_dirfile(bprogname, bprogdir, NULL);
+
+	if (subfolder_name) {
+		BLI_join_dirfile(relfolder, folder_name, subfolder_name);
+	} else {
+		BLI_strncpy(relfolder, folder_name, FILE_MAX);
+	}
+
+	/* try CWD/release/folder_name */
+	if(test_path(targetpath, BLI_getwdN(cwd), "release", relfolder))
+		return 1;
+	
+	/* try EXECUTABLE_DIR/release/folder_name */
+	if(test_path(targetpath, bprogdir, "release", relfolder))
+		return 1;
+	/* end developer overrides */
+
+
+
 	system_path[0] = '\0';
 
 	if (test_env_path(system_path, envvar)) {





More information about the Bf-blender-cvs mailing list