@@ -29,11 +29,11 @@ use ostree_ext::ostree::MutableTree;
2929use ostree_ext:: { container as ostree_container, glib} ;
3030use ostree_ext:: { oci_spec, ostree} ;
3131
32- use bootc_internal_utils:: CommandRunExt ;
3332use crate :: containers_storage:: Mount ;
3433use crate :: cxxrsutil:: { CxxResult , FFIGObjectWrapper } ;
3534use crate :: isolation:: self_command;
3635use crate :: { RPMOSTREE_RPMDB_LOCATION , RPMOSTREE_SYSIMAGE_RPMDB } ;
36+ use bootc_internal_utils:: CommandRunExt ;
3737
3838const SYSROOT : & str = "sysroot" ;
3939const USR : & str = "usr" ;
@@ -374,7 +374,7 @@ impl BuildChunkedOCIOpts {
374374 } ;
375375 let manifest_data = manifest_data_tmpfile. as_ref ( ) . map ( |t| t. path ( ) ) ;
376376
377- let st = crate :: isolation:: self_command ( )
377+ crate :: isolation:: self_command ( )
378378 . args ( [
379379 "compose" ,
380380 "container-encapsulate" ,
@@ -397,10 +397,8 @@ impl BuildChunkedOCIOpts {
397397 manifest. as_os_str ( ) ,
398398 ]
399399 } ) )
400- . status ( ) ?;
401- if !st. success ( ) {
402- anyhow:: bail!( "Failed to run compose container-encapsulate: {st:?}" ) ;
403- }
400+ . run_inherited ( )
401+ . context ( "Invoking compose container-encapsulate" ) ?;
404402
405403 drop ( rootfs) ;
406404 // Ensure our tempdir is only dropped now
@@ -750,7 +748,7 @@ impl RootfsOpts {
750748 } ;
751749
752750 // Just build the root filesystem tree
753- let st = self_command ( )
751+ self_command ( )
754752 . args ( [
755753 "compose" ,
756754 "install" ,
@@ -777,10 +775,8 @@ impl RootfsOpts {
777775 // it won't be able to. We should lower the xattr stripping into
778776 // rpm-ostree ideally.
779777 . env ( "DRACUT_NO_XATTR" , "1" )
780- . status ( ) ?;
781- if !st. success ( ) {
782- anyhow:: bail!( "Executing compose install: {st:?}" ) ;
783- }
778+ . run_inherited ( )
779+ . context ( "Executing compose install" ) ?;
784780
785781 // Clear everything in the tempdir; at this point we may have hardlinks into
786782 // the pkgcache repo, which we don't need because we're producing a flat
@@ -1207,7 +1203,7 @@ pub(crate) fn compose_image(args: Vec<String>) -> CxxResult<()> {
12071203 compose_args_extra. extend ( [ "--source-root" , path. as_str ( ) ] ) ;
12081204 }
12091205
1210- let st = self_command ( )
1206+ self_command ( )
12111207 . args ( [
12121208 "compose" ,
12131209 "tree" ,
@@ -1226,10 +1222,7 @@ pub(crate) fn compose_image(args: Vec<String>) -> CxxResult<()> {
12261222 . args ( opt. lockfile_strict . then_some ( "--ex-lockfile-strict" ) )
12271223 . args ( compose_args_extra)
12281224 . arg ( opt. manifest . as_str ( ) )
1229- . status ( ) ?;
1230- if !st. success ( ) {
1231- return Err ( format ! ( "Failed to run compose tree: {st:?}" ) . into ( ) ) ;
1232- }
1225+ . run_inherited ( ) ?;
12331226
12341227 if !changed_path. exists ( ) {
12351228 return Ok ( ( ) ) ;
@@ -1265,7 +1258,7 @@ pub(crate) fn compose_image(args: Vec<String>) -> CxxResult<()> {
12651258 } )
12661259 . transpose ( ) ?;
12671260
1268- let st = self_command ( )
1261+ self_command ( )
12691262 . args ( [ "compose" , "container-encapsulate" ] )
12701263 . args ( label_args)
12711264 . args ( previous_arg)
@@ -1277,10 +1270,7 @@ pub(crate) fn compose_image(args: Vec<String>) -> CxxResult<()> {
12771270 commitid. as_str ( ) ,
12781271 tempdest. as_deref ( ) . unwrap_or ( target_imgref. as_str ( ) ) ,
12791272 ] )
1280- . status ( ) ?;
1281- if !st. success ( ) {
1282- return Err ( format ! ( "Failed to run compose container-encapsulate: {st:?}" ) . into ( ) ) ;
1283- }
1273+ . run_inherited ( ) ?;
12841274
12851275 if let Some ( tempdest) = tempdest {
12861276 let mut c = Command :: new ( "skopeo" ) ;
0 commit comments