Sync from SUSE:ALP:Source:Standard:1.0 update-bootloader-rpm-macros revision 06cd7a2d375c43759e0731b9fa2112d1

This commit is contained in:
Adrian Schröter 2023-06-07 10:07:23 +02:00
commit a79aed3af5
4 changed files with 163 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

54
macros.update-bootloader Normal file
View File

@ -0,0 +1,54 @@
%update_bootloader_requires %{nil}
%update_bootloader_refresh_post() \
mkdir -p %{_rundir}/update-bootloader/ \
touch %{_rundir}/update-bootloader/refresh \
%nil
%update_bootloader_reinit_post() \
mkdir -p %{_rundir}/update-bootloader/ \
touch %{_rundir}/update-bootloader/reinit \
%nil
%update_bootloader_check_type_refresh_post() \
loader_type=`sed -n \\\
"/^[^#]*LOADER_TYPE=/{s@.*=\\(.*\\)@\\1@;s@^[\\"']@@;s@[\\"']\\\\$@@;p;q}" \\\
%{_sysconfdir}/sysconfig/bootloader \\\
2>/dev/null || :` \
for bl in %{?*}; do \
if test "x${bl}" = "x$loader_type" ; then \
mkdir -p %{_rundir}/update-bootloader/ \
touch %{_rundir}/update-bootloader/refresh \
break \
fi \
done \
%nil
%update_bootloader_check_type_reinit_post() \
loader_type=`sed -n \\\
"/^[^#]*LOADER_TYPE=/{s@.*=\\(.*\\)@\\1@;s@^[\\"']@@;s@[\\"']\\\\$@@;p;q}" \\\
%{_sysconfdir}/sysconfig/bootloader \\\
2>/dev/null || :` \
for bl in %{?*}; do \
if test "x${bl}" = "x$loader_type" ; then \
mkdir -p %{_rundir}/update-bootloader/ \
touch %{_rundir}/update-bootloader/reinit \
break \
fi \
done \
%nil
%update_bootloader_posttrans \
if test -x /sbin/update-bootloader; then \
if test -f %{_rundir}/update-bootloader/reinit; then \
rm -f -- %{_rundir}/update-bootloader/reinit %{_rundir}/update-bootloader/refresh \
if test -x %{_libexecdir}/grub2-instdev-fixup.pl; then \
%{_libexecdir}/grub2-instdev-fixup.pl || : \
fi \
/sbin/update-bootloader --reinit || : \
elif test -f %{_rundir}/update-bootloader/refresh; then \
rm -f %{_rundir}/update-bootloader/refresh \
/sbin/update-bootloader --refresh || : \
fi \
fi \
%nil

View File

@ -0,0 +1,39 @@
-------------------------------------------------------------------
Mon Aug 15 19:07:05 UTC 2022 - Dirk Müller <dmueller@suse.com>
- avoid bashisms in update-bootloader scriptlets (bsc#1195391)
-------------------------------------------------------------------
Tue Jul 13 06:16:06 UTC 2021 - Michael Chang <mchang@suse.com>
- Use grub2-instdev-fixup.pl if available for correting
/etc/default/grub_installdevice to use disk device if grub has been
installed on it
-------------------------------------------------------------------
Tue Jun 29 07:07:07 UTC 2021 - olaf@aepfle.de
- Make sure _rpmmacrodir is defined to restore compatibility with SLE12
-------------------------------------------------------------------
Thu Jun 24 09:33:46 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
- make perl-Bootloader optional. This avoids to pull in perl in
small systems that do not necessarily use perl-Bootloader
-------------------------------------------------------------------
Fri May 10 09:16:21 UTC 2019 - Dominique Leuenberger <dimstar@opensuse.org>
- Move RPM macros to %_rpmmacrodir.
-------------------------------------------------------------------
Thu Jan 19 10:14:01 UTC 2017 - jengelh@inai.de
- RPM group fixup
-------------------------------------------------------------------
Wed Dec 28 09:45:49 UTC 2016 - mchang@suse.com
- New package with rpm macros to support bootloader update in %posttrans to
improve the efficiency. (bsc#997317)

View File

@ -0,0 +1,47 @@
#
# spec file for package update-bootloader-rpm-macros
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if %{undefined _rpmmacrodir}
%define _rpmmacrodir %{_sysconfdir}/rpm
%endif
Name: update-bootloader-rpm-macros
Version: 0
Release: 0
Summary: RPM macros for update-bootloader
License: GPL-3.0-or-later
Group: Development/Tools/Building
URL: https://en.opensuse.org/openSUSE:Update_Bootloader_RPM_Macros
Source0: macros.update-bootloader
BuildArch: noarch
%description
This package provides rpm macros for bootloader update in rpm scripts
%prep
%build
%install
mkdir -p %{buildroot}%{_rpmmacrodir}
install -m644 %{SOURCE0} %{buildroot}%{_rpmmacrodir}
%files
%{_rpmmacrodir}/macros.update-bootloader
%changelog