mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Clean up installation directory choices for extensions.
Arrange for the control files to be in $SHAREDIR/extension not $SHAREDIR/contrib, since we're generally trying to deprecate the term "contrib" and this is a once-in-many-moons opportunity to get rid of it in install paths. Fix PGXS to install the $EXTENSION file into that directory no matter what MODULEDIR is set to; a nondefault MODULEDIR should only affect the script and secondary extension files. Fix the control file directory parameter to be interpreted relative to $SHAREDIR, to avoid a surprising disconnect between how you specify that and what you set MODULEDIR to. Per discussion with David Wheeler.
This commit is contained in:
@ -278,7 +278,7 @@ get_extension_control_directory(void)
|
||||
|
||||
get_share_path(my_exec_path, sharepath);
|
||||
result = (char *) palloc(MAXPGPATH);
|
||||
snprintf(result, MAXPGPATH, "%s/contrib", sharepath);
|
||||
snprintf(result, MAXPGPATH, "%s/extension", sharepath);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -291,7 +291,7 @@ get_extension_control_filename(const char *extname)
|
||||
|
||||
get_share_path(my_exec_path, sharepath);
|
||||
result = (char *) palloc(MAXPGPATH);
|
||||
snprintf(result, MAXPGPATH, "%s/contrib/%s.control",
|
||||
snprintf(result, MAXPGPATH, "%s/extension/%s.control",
|
||||
sharepath, extname);
|
||||
|
||||
return result;
|
||||
@ -305,7 +305,7 @@ get_extension_script_directory(ExtensionControlFile *control)
|
||||
|
||||
/*
|
||||
* The directory parameter can be omitted, absolute, or relative to the
|
||||
* control-file directory.
|
||||
* installation's share directory.
|
||||
*/
|
||||
if (!control->directory)
|
||||
return get_extension_control_directory();
|
||||
@ -315,8 +315,7 @@ get_extension_script_directory(ExtensionControlFile *control)
|
||||
|
||||
get_share_path(my_exec_path, sharepath);
|
||||
result = (char *) palloc(MAXPGPATH);
|
||||
snprintf(result, MAXPGPATH, "%s/contrib/%s",
|
||||
sharepath, control->directory);
|
||||
snprintf(result, MAXPGPATH, "%s/%s", sharepath, control->directory);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user