commit e67f45a25aebca642e39cde5975a6da795517257 Author: Adrian Schröter Date: Wed Jun 7 10:07:23 2023 +0200 Sync from SUSE:ALP:Source:Standard:1.0 update-bootloader-rpm-macros revision 06cd7a2d375c43759e0731b9fa2112d1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fecc750 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/macros.update-bootloader b/macros.update-bootloader new file mode 100644 index 0000000..77966de --- /dev/null +++ b/macros.update-bootloader @@ -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 diff --git a/update-bootloader-rpm-macros.changes b/update-bootloader-rpm-macros.changes new file mode 100644 index 0000000..d054a48 --- /dev/null +++ b/update-bootloader-rpm-macros.changes @@ -0,0 +1,39 @@ +------------------------------------------------------------------- +Mon Aug 15 19:07:05 UTC 2022 - Dirk Müller + +- avoid bashisms in update-bootloader scriptlets (bsc#1195391) + +------------------------------------------------------------------- +Tue Jul 13 06:16:06 UTC 2021 - Michael Chang + +- 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 + +- 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 + +- 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) + diff --git a/update-bootloader-rpm-macros.spec b/update-bootloader-rpm-macros.spec new file mode 100644 index 0000000..6f4d0c5 --- /dev/null +++ b/update-bootloader-rpm-macros.spec @@ -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