File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -755,9 +755,19 @@ impl<'a> OmaRefresh<'a> {
755
755
756
756
let index_target_config = IndexTargetConfig :: new ( self . apt_config , & self . arch ) ;
757
757
758
- let archs_from_file = fs:: read_to_string ( "/var/lib/dpkg/arch" )
759
- . await
760
- . map ( |f| f. lines ( ) . map ( |x| x. to_string ( ) ) . collect :: < Vec < _ > > ( ) ) ;
758
+ let archs_from_file = fs:: read_to_string ( "/var/lib/dpkg/arch" ) . await ;
759
+
760
+ let archs_from_file = if let Ok ( file) = archs_from_file {
761
+ let res = file. lines ( ) . map ( |x| x. to_string ( ) ) . collect :: < Vec < _ > > ( ) ;
762
+
763
+ if res. is_empty ( ) {
764
+ None
765
+ } else {
766
+ Some ( res)
767
+ }
768
+ } else {
769
+ None
770
+ } ;
761
771
762
772
let mut flat_repo_no_release = vec ! [ ] ;
763
773
@@ -813,7 +823,7 @@ impl<'a> OmaRefresh<'a> {
813
823
814
824
let mut archs = if let Some ( archs) = ose. archs ( ) {
815
825
archs. iter ( ) . map ( |x| x. as_str ( ) ) . collect :: < Vec < _ > > ( )
816
- } else if let Ok ( ref f) = archs_from_file {
826
+ } else if let Some ( ref f) = archs_from_file {
817
827
f. iter ( ) . map ( |x| x. as_str ( ) ) . collect :: < Vec < _ > > ( )
818
828
} else {
819
829
vec ! [ self . arch. as_str( ) ]
You can’t perform that action at this time.
0 commit comments