@@ -64,7 +64,7 @@ pub struct InstallCommand {
64
64
default_value = "https://registry.pgtrunk.io"
65
65
) ]
66
66
registry : String ,
67
- /// The PostgreSQL version for which this extension should be installed. Experimental for versions other than Postgres 15.
67
+ /// The PostgreSQL version for which this extension should be installed.
68
68
#[ clap( long, action) ]
69
69
pg_version : Option < u8 > ,
70
70
/// Skip dependency resolution.
@@ -73,6 +73,12 @@ pub struct InstallCommand {
73
73
/// Installs required system dependencies for the extension
74
74
#[ clap( long = "deps" , action) ]
75
75
install_system_dependencies : bool ,
76
+ /// Installation location for architecture-independent support files.
77
+ #[ clap( long = "sharedir" , action) ]
78
+ sharedir : Option < PathBuf > ,
79
+ /// Installation location for dynamically loadable modules.
80
+ #[ clap( long = "pkglibdir" , action) ]
81
+ pkglibdir : Option < PathBuf > ,
76
82
}
77
83
78
84
impl InstallCommand {
@@ -155,9 +161,14 @@ impl SubCommand for InstallCommand {
155
161
async fn execute ( & self , _task : Task ) -> Result < ( ) > {
156
162
let pg_config = self . pgconfig ( ) ?;
157
163
158
- let package_lib_dir = pg_config. pkglibdir ( ) ?;
159
-
160
- let sharedir = pg_config. sharedir ( ) ?;
164
+ let package_lib_dir = match & self . pkglibdir {
165
+ Some ( p) => p. clone ( ) ,
166
+ None => pg_config. pkglibdir ( ) ?,
167
+ } ;
168
+ let sharedir = match & self . sharedir {
169
+ Some ( p) => p. clone ( ) ,
170
+ None => pg_config. sharedir ( ) ?,
171
+ } ;
161
172
162
173
if !package_lib_dir. exists ( ) && !package_lib_dir. is_dir ( ) {
163
174
println ! (
@@ -348,8 +359,8 @@ async fn fetch_archive_legacy(registry: &str, name: &str, version: &str) -> Resu
348
359
}
349
360
}
350
361
351
- async fn fetch_archive_from_registry < ' a > (
352
- name : Name < ' a > ,
362
+ async fn fetch_archive_from_registry (
363
+ name : Name < ' _ > ,
353
364
version : & str ,
354
365
registry : & str ,
355
366
postgres_version : u8 ,
@@ -675,7 +686,7 @@ async fn install_trunk_archive(
675
686
for package_manager in operating_system. package_managers ( ) {
676
687
if let Some ( packages_to_install) = system_deps. get ( package_manager. as_str ( ) ) {
677
688
for package in packages_to_install {
678
- let installation_command = package_manager. install ( & package) ;
689
+ let installation_command = package_manager. install ( package) ;
679
690
680
691
let status = mockcmd:: Command :: new ( "sh" )
681
692
. arg ( "-c" )
0 commit comments