4
4
5
5
use anyhow:: { Context , Result } ;
6
6
use camino:: Utf8PathBuf ;
7
- use cap_std_ext:: rustix;
8
7
use clap:: Parser ;
9
8
use fn_error_context:: context;
10
9
use ostree:: { gio, glib} ;
@@ -145,7 +144,7 @@ pub(crate) async fn ensure_self_unshared_mount_namespace() -> Result<()> {
145
144
return Ok ( ( ) ) ;
146
145
}
147
146
if std:: env:: var_os ( recurse_env) . is_some ( ) {
148
- let am_pid1 = cap_std_ext :: rustix:: process:: getpid ( ) . is_init ( ) ;
147
+ let am_pid1 = rustix:: process:: getpid ( ) . is_init ( ) ;
149
148
if am_pid1 {
150
149
tracing:: debug!( "We are pid 1" ) ;
151
150
return Ok ( ( ) ) ;
@@ -237,7 +236,7 @@ pub(crate) fn require_root() -> Result<()> {
237
236
if !uid. is_root ( ) {
238
237
anyhow:: bail!( "This command requires root privileges" ) ;
239
238
}
240
- if !rustix:: thread:: is_in_capability_bounding_set ( rustix:: thread:: Capability :: SystemAdmin ) ? {
239
+ if !rustix:: thread:: capability_is_in_bounding_set ( rustix:: thread:: Capability :: SystemAdmin ) ? {
241
240
anyhow:: bail!( "This command requires full root privileges (CAP_SYS_ADMIN)" ) ;
242
241
}
243
242
Ok ( ( ) )
@@ -263,10 +262,10 @@ async fn prepare_for_write() -> Result<()> {
263
262
async fn upgrade ( opts : UpgradeOpts ) -> Result < ( ) > {
264
263
prepare_for_write ( ) . await ?;
265
264
let sysroot = & get_locked_sysroot ( ) . await ?;
266
- let repo = & sysroot. repo ( ) . unwrap ( ) ;
265
+ let repo = & sysroot. repo ( ) ;
267
266
let booted_deployment = & sysroot. require_booted_deployment ( ) ?;
268
267
let status = crate :: status:: DeploymentStatus :: from_deployment ( booted_deployment, true ) ?;
269
- let osname = booted_deployment. osname ( ) . unwrap ( ) ;
268
+ let osname = booted_deployment. osname ( ) ;
270
269
let origin = booted_deployment
271
270
. origin ( )
272
271
. ok_or_else ( || anyhow:: anyhow!( "Deployment is missing an origin" ) ) ?;
@@ -279,7 +278,7 @@ async fn upgrade(opts: UpgradeOpts) -> Result<()> {
279
278
"Booted deployment contains local rpm-ostree modifications; cannot upgrade via bootc"
280
279
) ) ;
281
280
}
282
- let commit = booted_deployment. csum ( ) . unwrap ( ) ;
281
+ let commit = booted_deployment. csum ( ) ;
283
282
let state = ostree_container:: store:: query_image_commit ( repo, & commit) ?;
284
283
let digest = state. manifest_digest . as_str ( ) ;
285
284
let fetched = pull ( repo, & imgref, opts. quiet ) . await ?;
@@ -308,8 +307,8 @@ async fn switch(opts: SwitchOpts) -> Result<()> {
308
307
let booted_deployment = & sysroot. require_booted_deployment ( ) ?;
309
308
let ( origin, booted_image) = crate :: utils:: get_image_origin ( booted_deployment) ?;
310
309
let booted_refspec = origin. optional_string ( "origin" , "refspec" ) ?;
311
- let osname = booted_deployment. osname ( ) . unwrap ( ) ;
312
- let repo = & sysroot. repo ( ) . unwrap ( ) ;
310
+ let osname = booted_deployment. osname ( ) ;
311
+ let repo = & sysroot. repo ( ) ;
313
312
314
313
let transport = ostree_container:: Transport :: try_from ( opts. transport . as_str ( ) ) ?;
315
314
let imgref = ostree_container:: ImageReference {
0 commit comments