@@ -48,6 +48,7 @@ struct _RpmOstreeContext {
4848 RpmOstreeTreespec * spec ;
4949 HifContext * hifctx ;
5050 OstreeRepo * ostreerepo ;
51+ char * dummy_instroot_path ;
5152};
5253
5354G_DEFINE_TYPE (RpmOstreeContext , rpmostree_context , G_TYPE_OBJECT )
@@ -82,6 +83,11 @@ rpmostree_context_finalize (GObject *object)
8283 RpmOstreeContext * rctx = RPMOSTREE_CONTEXT (object );
8384
8485 g_clear_object (& rctx -> hifctx );
86+ if (rctx -> dummy_instroot_path )
87+ {
88+ (void ) glnx_shutil_rm_rf_at (AT_FDCWD , rctx -> dummy_instroot_path , NULL , NULL );
89+ g_free (rctx -> dummy_instroot_path );
90+ }
8591
8692 G_OBJECT_CLASS (rpmostree_context_parent_class )-> finalize (object );
8793}
@@ -450,7 +456,17 @@ rpmostree_context_setup (RpmOstreeContext *self,
450456 char * * enabled_repos = NULL ;
451457 char * * instlangs = NULL ;
452458
453- hif_context_set_install_root (self -> hifctx , installroot );
459+ if (installroot )
460+ hif_context_set_install_root (self -> hifctx , installroot );
461+ else
462+ {
463+ glnx_fd_close int dfd = -1 ; /* Auto close, we just use the path */
464+ if (!rpmostree_mkdtemp ("/tmp/rpmostree-dummy-instroot-XXXXXX" ,
465+ & self -> dummy_instroot_path ,
466+ & dfd , error ))
467+ goto out ;
468+ hif_context_set_install_root (self -> hifctx , self -> dummy_instroot_path );
469+ }
454470
455471 if (!hif_context_setup (self -> hifctx , cancellable , error ))
456472 goto out ;
@@ -1340,10 +1356,10 @@ rpmostree_context_assemble_commit (RpmOstreeContext *self,
13401356 set_rpm_macro_define ("_dbpath" , "/usr/share/rpm" );
13411357
13421358 /* Don't verify checksums here (we should have done this on ostree
1343- * import). Also, when we do run the transaction, only update the
1344- * rpmdb . Otherwise we unpacked with cpio .
1359+ * import). Also, avoid updating the database or anything by
1360+ * flagging it as a test . We'll do the database next .
13451361 */
1346- rpmtsSetVSFlags (ordering_ts , _RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS | RPMTRANS_FLAG_JUSTDB );
1362+ rpmtsSetVSFlags (ordering_ts , _RPMVSF_NOSIGNATURES | _RPMVSF_NODIGESTS | RPMTRANS_FLAG_TEST );
13471363
13481364 /* Tell librpm about each one so it can tsort them. What we really
13491365 * want is to do this from the rpm-md metadata so that we can fully
0 commit comments