File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ impl Client {
242
242
pub fn new_state ( & self , selections : & [ Selection ] , summary : impl ToString ) -> Result < Option < State > , Error > {
243
243
let old_state = self . installation . active_state ;
244
244
245
- let fstree = self . blit_root ( selections. iter ( ) . map ( |s| & s. package ) , old_state . map ( state :: Id :: next ) ) ?;
245
+ let fstree = self . blit_root ( selections. iter ( ) . map ( |s| & s. package ) ) ?;
246
246
247
247
match & self . scope {
248
248
Scope :: Stateful => {
@@ -519,7 +519,6 @@ impl Client {
519
519
fn blit_root < ' a > (
520
520
& self ,
521
521
packages : impl IntoIterator < Item = & ' a package:: Id > ,
522
- state_id : Option < state:: Id > ,
523
522
) -> Result < vfs:: tree:: Tree < PendingFile > , Error > {
524
523
let progress = ProgressBar :: new ( 1 ) . with_style (
525
524
ProgressStyle :: with_template ( "\n |{bar:20.red/blue}| {pos}/{len} {msg}" )
@@ -688,7 +687,14 @@ BUG_REPORT_URL="https://github.com/serpent-os""#,
688
687
tx = state_id. unwrap_or_default( )
689
688
) ;
690
689
691
- fs:: write ( root. join ( "usr" ) . join ( "lib" ) . join ( "os-release" ) , os_release) ?;
690
+ // It's possible this doesn't exist if
691
+ // we remove all packages (=
692
+ let dir = root. join ( "usr" ) . join ( "lib" ) ;
693
+ if !dir. exists ( ) {
694
+ fs:: create_dir ( & dir) ?;
695
+ }
696
+
697
+ fs:: write ( dir. join ( "os-release" ) , os_release) ?;
692
698
693
699
Ok ( ( ) )
694
700
}
You can’t perform that action at this time.
0 commit comments