File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ use lang::LANGUAGE_LOADER;
32
32
use oma_console:: OmaLayer ;
33
33
use oma_console:: print:: { OmaColorFormat , termbg} ;
34
34
use oma_console:: writer:: { MessageType , Writer , writeln_inner} ;
35
+ use oma_pm:: apt:: AptConfig ;
35
36
use oma_utils:: OsRelease ;
36
37
use oma_utils:: dbus:: { create_dbus_connection, get_another_oma_status} ;
37
38
use reqwest:: Client ;
@@ -210,6 +211,8 @@ fn main() {
210
211
}
211
212
}
212
213
214
+ init_apt_config ( & oma) ;
215
+
213
216
let code = match try_main ( oma, config, matches) {
214
217
Ok ( exit_code) => {
215
218
unlock_oma ( ) . ok ( ) ;
@@ -233,6 +236,17 @@ fn main() {
233
236
exit ( code) ;
234
237
}
235
238
239
+ fn init_apt_config ( oma : & OhManagerAilurus ) {
240
+ let apt_config = AptConfig :: new ( ) ;
241
+ apt_config. set ( "Dir" , & oma. global . sysroot . to_string_lossy ( ) ) ;
242
+
243
+ for kv in & oma. global . apt_options {
244
+ let ( k, v) = kv. split_once ( '=' ) . unwrap_or ( ( kv. as_str ( ) , "" ) ) ;
245
+ debug ! ( "Set apt option: {k}={v}" ) ;
246
+ apt_config. set ( k, v) ;
247
+ }
248
+ }
249
+
236
250
fn parse_args ( ) -> ( ArgMatches , OhManagerAilurus ) {
237
251
let matches = match OhManagerAilurus :: command ( ) . try_get_matches ( ) {
238
252
Ok ( m) => m,
You can’t perform that action at this time.
0 commit comments