!25 rust/treefile: Fix has_modules_enable check

From: @chenmaodong 
Reviewed-by: @wanglmb 
Signed-off-by: @wanglmb
This commit is contained in:
openeuler-ci-bot 2022-12-29 10:59:31 +00:00 committed by Gitee
commit 6be416e2c3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From 0b2f5f0533def11cf38c6b86b7ee6b10aa28123c Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Thu, 21 Apr 2022 13:06:20 -0400
Subject: [PATCH] rust/treefile: Fix has_modules_enable() check
We need to check that the set is actually non-empty.
---
rust/src/treefile.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/src/treefile.rs b/rust/src/treefile.rs
index dfc8fbc0..884e33f7 100644
--- a/rust/src/treefile.rs
+++ b/rust/src/treefile.rs
@@ -863,7 +863,7 @@ impl Treefile {
self.parsed
.modules
.as_ref()
- .map(|m| m.enable.is_some())
+ .map(|m| m.enable.as_ref().map(|e| !e.is_empty()).unwrap_or_default())
.unwrap_or_default()
}
--
2.21.0

View File

@ -4,12 +4,13 @@
Name: rpm-ostree
Version: 2022.8
Release: 3
Release: 4
Summary: Hybrid image/package system
License: Apache-2.0 or MIT and GPL-2.0-or-later and LGPL-2.0-or-later
URL: https://github.com/coreos/rpm-ostree
Source0: https://github.com/coreos/rpm-ostree/releases/download/v2022.8/%{name}-%{version}.tar.xz
Patch0: fix-compose-err.patch
Patch1: backport-0001-rust-treefile-Fix-has_modules_enable-check.patch
%if %{with rust}
%if !%{defined rust_arches}
@ -114,6 +115,9 @@ install -pm 0644 src/daemon/org.projectatomic.rpmostree1.conf %{buildroot}/etc/d
%{_mandir}/man*/*
%changelog
* Thu Dec 29 2022 chenmaodong <chenmaodong@xfusion.com> - 2022.8-4
- Fix has_modules_enable() check
* Mon Oct 10 2022 fushanqing <fushanqing@kylinos.cn> - 2022.8-3
- add fix-compose-err.patch