44
55use anyhow:: { Context , Result } ;
66use camino:: Utf8PathBuf ;
7- use cap_std_ext:: rustix;
87use clap:: Parser ;
98use fn_error_context:: context;
109use ostree:: { gio, glib} ;
@@ -145,7 +144,7 @@ pub(crate) async fn ensure_self_unshared_mount_namespace() -> Result<()> {
145144 return Ok ( ( ) ) ;
146145 }
147146 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 ( ) ;
149148 if am_pid1 {
150149 tracing:: debug!( "We are pid 1" ) ;
151150 return Ok ( ( ) ) ;
@@ -237,7 +236,7 @@ pub(crate) fn require_root() -> Result<()> {
237236 if !uid. is_root ( ) {
238237 anyhow:: bail!( "This command requires root privileges" ) ;
239238 }
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 ) ? {
241240 anyhow:: bail!( "This command requires full root privileges (CAP_SYS_ADMIN)" ) ;
242241 }
243242 Ok ( ( ) )
@@ -263,10 +262,10 @@ async fn prepare_for_write() -> Result<()> {
263262async fn upgrade ( opts : UpgradeOpts ) -> Result < ( ) > {
264263 prepare_for_write ( ) . await ?;
265264 let sysroot = & get_locked_sysroot ( ) . await ?;
266- let repo = & sysroot. repo ( ) . unwrap ( ) ;
265+ let repo = & sysroot. repo ( ) ;
267266 let booted_deployment = & sysroot. require_booted_deployment ( ) ?;
268267 let status = crate :: status:: DeploymentStatus :: from_deployment ( booted_deployment, true ) ?;
269- let osname = booted_deployment. osname ( ) . unwrap ( ) ;
268+ let osname = booted_deployment. osname ( ) ;
270269 let origin = booted_deployment
271270 . origin ( )
272271 . ok_or_else ( || anyhow:: anyhow!( "Deployment is missing an origin" ) ) ?;
@@ -279,7 +278,7 @@ async fn upgrade(opts: UpgradeOpts) -> Result<()> {
279278 "Booted deployment contains local rpm-ostree modifications; cannot upgrade via bootc"
280279 ) ) ;
281280 }
282- let commit = booted_deployment. csum ( ) . unwrap ( ) ;
281+ let commit = booted_deployment. csum ( ) ;
283282 let state = ostree_container:: store:: query_image_commit ( repo, & commit) ?;
284283 let digest = state. manifest_digest . as_str ( ) ;
285284 let fetched = pull ( repo, & imgref, opts. quiet ) . await ?;
@@ -308,8 +307,8 @@ async fn switch(opts: SwitchOpts) -> Result<()> {
308307 let booted_deployment = & sysroot. require_booted_deployment ( ) ?;
309308 let ( origin, booted_image) = crate :: utils:: get_image_origin ( booted_deployment) ?;
310309 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 ( ) ;
313312
314313 let transport = ostree_container:: Transport :: try_from ( opts. transport . as_str ( ) ) ?;
315314 let imgref = ostree_container:: ImageReference {
0 commit comments