update code

This commit is contained in:
zhuchunyi 2019-11-06 19:05:22 +08:00
parent a001a0397b
commit 4f0f5f255c
5 changed files with 21 additions and 78 deletions

View File

@ -1,28 +0,0 @@
From 8a6039df37353a3ef9208de0c4d63b611f549922 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 19 Oct 2017 12:46:53 -0400
Subject: [PATCH 1/2] *don't* use -f in dbxtool.service
Use -q to make it quiet but don't try to override it when we think it
won't work.
Related: rhbz#1489942
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/dbxtool.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dbxtool.service b/src/dbxtool.service
index fcfb6e6..1a2a829 100644
--- a/src/dbxtool.service
+++ b/src/dbxtool.service
@@ -7,4 +7,4 @@ WantedBy=multi-user.target
[Service]
RemainAfterExit=yes
-ExecStart=/usr/bin/dbxtool -a /usr/share/dbxtool/ -q -f
+ExecStart=/usr/bin/dbxtool -a /usr/share/dbxtool/ -q
--
2.14.2

View File

@ -1,36 +0,0 @@
From 946380463bb9a233381fc122a8374806d77b1778 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 23 Oct 2017 09:45:48 -0400
Subject: [PATCH 2/2] Make quiet exit on missing PK/KEK not return error
status.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/dbxtool.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/dbxtool.c b/src/dbxtool.c
index 717c991..b2cb587 100644
--- a/src/dbxtool.c
+++ b/src/dbxtool.c
@@ -541,13 +541,14 @@ check_pk_and_kek(bool force, bool quiet)
}
}
if (!all_found) {
- if (!quiet) {
+ if (quiet) {
+ if (!force)
+ exit(0);
+ } else {
if (!force)
errx(1, "Not attempting to apply updates.");
warnx("attempting to apply updates anyway.");
}
- if (!force)
- exit(1);
}
}
--
2.14.2

Binary file not shown.

Binary file not shown.

View File

@ -1,17 +1,15 @@
%global git_commit_hash 889594ffb104e3384fd91395f4f26b8b68fc38e1
Name: dbxtool Name: dbxtool
Version: 8 Version: 8
Release: 8 Release: 9
Summary: Tool for managing dbx updates installed on a machine. Summary: Tool for managing dbx updates installed on a machine.
License: GPLv2 License: GPLv2
URL: https://github.com/vathpela/dbxtool URL: https://github.com/vathpela/dbxtool-devel
#The file dbxtool-8.tar.bz2 is from fedora:https://kojipkgs.fedoraproject.org//packages/dbxtool/8/7.fc29/src/dbxtool-8-7.fc29.src.rpm. Source0: https://github.com/vathpela/%{name}-devel/archive/%{git_commit_hash}/%{name}-devel-889594f.tar.gz
Source0: https://github.com/vathpela/dbxtool/releases/download/dbxtool-%{version}/dbxtool-%{version}.tar.bz2
#Patch0,Patch1 and Patch2 are from fedora:https://kojipkgs.fedoraproject.org//packages/dbxtool/8/7.fc29/src/dbxtool-8-7.fc29.src.rpm.
Patch0: dbxtool-8-ccldflags.patch Patch0: dbxtool-8-ccldflags.patch
Patch1: 0001-don-t-use-f-in-dbxtool.service.patch
Patch2: 0002-Make-quiet-exit-on-missing-PK-KEK-not-return-error-s.patch
BuildRequires: gcc popt-devel efivar-devel >= 31-3 systemd BuildRequires: gcc popt-devel efivar-devel >= 35-1 systemd
Requires: efivar systemd Requires: efivar systemd
%description %description
@ -20,7 +18,7 @@ Tool for managing dbx updates installed on a machine.
%package_help %package_help
%prep %prep
%autosetup -n %{name}-%{version} -p1 %autosetup -n %{name}-devel-%{git_commit_hash} -p1
%build %build
%make_build CFLAGS="$RPM_OPT_FLAGS" CCLDFLAGS="%{__global_ldflags}" %make_build CFLAGS="$RPM_OPT_FLAGS" CCLDFLAGS="%{__global_ldflags}"
@ -28,24 +26,33 @@ Tool for managing dbx updates installed on a machine.
%install %install
%make_install %make_install
%check
%pre
%preun %preun
%systemd_preun dbxtool.service %systemd_preun dbxtool.service
%post %post
%systemd_post dbxtool.service %systemd_post dbxtool.service
%postun
%files %files
%{!?_licensedir:%global license %%doc} %{!?_licensedir:%global license %%doc}
%license COPYING %license COPYING
%exclude %{_docdir}/%{name}/COPYING %exclude %{_docdir}/%{name}/COPYING
%{_unitdir}/dbxtool.service %{_unitdir}/dbxtool.service
%{_bindir}/dbxtool %{_bindir}/%{name}
%dir %{_datadir}/dbxtool/ %dir %{_datadir}/%{name}/
%{_datadir}/dbxtool/*.bin %{_datadir}/%{name}/*.bin
%files help %files help
%doc %{_mandir}/man1/* %doc %{_mandir}/man1/*
%changelog %changelog
* Mon Sep 2 2019 openEuler Buildteam <buildteam@openeuler.org> - 8-8 * Mon Oct 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 8-9
- Package init - Package rebuild.
* Mon Sep 02 2019 openEuler Buildteam <buildteam@openeuler.org> - 8-8
- Package init.